2019-10-11 08:10:54 +02:00
# Contributing
2023-06-15 08:34:37 +02:00
Please read in detail about how to contribute documentation and code on the [Mermaid documentation site. ](https://mermaid-js.github.io/mermaid/#/development )
2023-06-15 06:19:26 +02:00
---
2023-06-15 08:34:37 +02:00
# Mermaid contribution cheat-sheet
2022-10-09 21:55:59 +02:00
2022-10-10 14:07:59 +02:00
## Requirements
- [volta ](https://volta.sh/ ) to manage node versions.
- [Node.js ](https://nodejs.org/en/ ). `volta install node`
- [pnpm ](https://pnpm.io/ ) package manager. `volta install pnpm`
2022-06-26 12:37:14 +02:00
## Development Installation
2022-09-04 21:30:47 +02:00
2023-06-11 00:15:31 +02:00
If you don't have direct access to push to mermaid repositories, make a fork first. Then clone. Or clone directly from mermaid-js:
2022-06-26 12:37:14 +02:00
```bash
git clone git@github.com:mermaid-js/mermaid.git
cd mermaid
2023-06-11 00:15:31 +02:00
```
Install required packages:
```bash
2022-10-11 08:18:52 +02:00
# npx is required for first install as volta support for pnpm is not added yet.
npx pnpm install
2022-09-29 20:40:16 +02:00
pnpm test
2022-06-26 12:37:14 +02:00
```
2023-06-15 08:38:30 +02:00
### Docker
2023-06-11 00:15:31 +02:00
If you are using docker and docker-compose, you have self-documented `run` bash script, which is a convenient alias for docker-compose commands:
```bash
./run install # npx pnpm install
./run test # pnpm test
```
2023-06-15 08:34:37 +02:00
## Testing
2022-09-06 01:54:31 +02:00
2023-06-15 08:34:37 +02:00
```bash
# Run unit test
pnpm test
# Run unit test in watch mode
pnpm test:watch
# Run E2E test
pnpm e2e
# Debug E2E tests
pnpm dev
pnpm cypress:open # in another terminal
2022-09-06 01:54:31 +02:00
```
2023-06-15 08:34:37 +02:00
## Branch name format:
2023-02-16 13:30:41 +01:00
2023-06-15 08:34:37 +02:00
```text
[feature | bug | chore | docs]/[issue number]_[short description using dashes ('-') or underscores ('_') instead of spaces]
2023-02-16 13:30:41 +01:00
```
2023-06-15 08:34:37 +02:00
eg: `feature/2945_state-diagram-new-arrow-florbs` , `bug/1123_fix_random_ugly_red_text`
2023-02-16 13:30:41 +01:00
2023-06-15 08:34:37 +02:00
## Documentation
2023-02-16 13:30:41 +01:00
2023-06-15 08:34:37 +02:00
Documentation is necessary for all non bugfix/refactoring changes.
2023-02-16 13:30:41 +01:00
2023-06-15 08:34:37 +02:00
Only make changes to files are in [`/packages/mermaid/src/docs` ](packages/mermaid/src/docs )
2023-02-16 13:30:41 +01:00
2022-09-06 01:54:31 +02:00
**_DO NOT CHANGE FILES IN `/docs` _**
2019-10-11 08:10:54 +02:00
[Join our slack community if you want closer contact! ](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE )