3.3 KiB
Warning
THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
Please edit the corresponding file in /packages/mermaid/src/docs/community/setup.md.
Initial Setup
Initial setup consists of 3 main steps:
flowchart LR
source --> requirements --> setup
source[Get the source code]
requirements[Install the requirements]
setup[Install packages]
Get the Source Code
In GitHub, you first fork a repository when you are going to make changes and submit pull requests.
Then you clone a copy to your local development machine (e.g. where you code) to make a copy with all the files to work with.
Fork mermaid to start contributing to the main project and its documentation, or search for other repositories.
Here is a GitHub document that gives an overview of the process.
git clone git@github.com/your-fork/mermaid
Once you have cloned the repository onto your development machine, change into the mermaid
project folder (the top level directory of the mermaid project repository)
cd mermaid
Install Requirements
We support development within Docker environment along with host setup. You may choose it up to your preferences.
Host
These are the tools we use for working with the code and documentation:
- volta to manage node versions.
- Node.js.
volta install node
- pnpm package manager.
volta install pnpm
- npx the packaged executor in npm. This is needed to install pnpm.
Docker
Install Docker. And that is pretty much all you need.
Optionally, to run GUI (Cypress) within Docker you will also need an X11 server installed. You might already have it installed, so check this by running:
echo $DISPLAY
If the $DISPLAY
variable is not empty, then an X11 server is running. Otherwise you may need to install one.
Install packages
Host
Run npx pnpm install
. You will need npx
for this because volta
doesn't support it yet.
npx pnpm install # npx is required for first install
Docker
For development using Docker there is a self-documented run
bash script, which provides convenient aliases for docker compose
commands.
Make sure that ./run
script is executable:
chmod +x run
💡 Tip To get detailed help simply type
./run
or./run help
.It also has short Development quick start guide embedded.
./run pnpm install # Install packages
Verify Everything Works
This step is optional, but it helps to make sure that everything in development branch was OK before you started making any changes.
You can run the test
script to verify that pnpm is working and that the repository has been cloned correctly:
Host
pnpm test
Docker
./run pnpm test
The test
script and others are in the top-level package.json
file.
All tests should run successfully without any errors or failures. (You might see lint or formatting warnings; those are ok during this step.)