mermaid/CONTRIBUTING.md
Sidharth Vinod aa34b99203
Merge remote-tracking branch 'origin/release/10.3.1'
* origin/release/10.3.1: (85 commits)
  Version update and adjusted error diagram
  Fix for broker error diagram related #4178
  Adding new flowchart tests related to issue #2139
  Fix for interim issue with classes in state diagrams
  use default export in `error` diagram
  create `ParserDefinition` type
  standardized `error` diagram'
  #2139 Applying user defined classes properly when calculating shape width
  style: format packages/mermaid/src/config.type.ts
  build(types): use prettier conf on config.types.ts
  Syntax Update CONTRIBUTING.md
  docs: Correct detectType filename
  chore: Minor cleanups
  chore: remove comment
  chore: Remove comments, cleanup
  fix!(deps): fix zenuml style leakage. update @zenuml/core to ^3.0.6 to fix the style leakage.
  Update selectSvgElement.ts
  create `Group` type
  Add specialChars in textNoTagsToken, alphaNumToken
  Return Unicode Text to idStringToken definition
  ...
2023-08-12 17:04:06 +05:30

2.2 KiB

Contributing

Please read in detail about how to contribute documentation and code on the Mermaid documentation site.


Mermaid contribution cheat-sheet

Requirements

  • volta to manage node versions.
  • Node.js. volta install node
  • pnpm package manager. volta install pnpm

Development Installation

If you don't have direct access to push to mermaid repositories, make a fork first. Then clone. Or clone directly from mermaid-js:

git clone git@github.com:mermaid-js/mermaid.git
cd mermaid

Install required packages:

# npx is required for first install as volta support for pnpm is not added yet.
npx pnpm install
pnpm test # run unit tests
pnpm dev # starts a dev server

Open http://localhost:9000 in your browser after starting the dev server. You can also duplicate the example.html file in demos/dev, rename it and add your own mermaid code to it. That will be served at http://localhost:9000/dev/your-file-name.html.

Docker

If you are using docker and docker-compose, you have self-documented run bash script, which is a convenient alias for docker-compose commands:

./run install # npx pnpm install
./run test # pnpm test

Testing

# 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

Branch name format:

   [feature | bug | chore | docs]/[issue number]_[short description using dashes ('-') or underscores ('_') instead of spaces]

eg: feature/2945_state-diagram-new-arrow-florbs, bug/1123_fix_random_ugly_red_text

Documentation

Documentation is necessary for all non bugfix/refactoring changes.

Only make changes to files that are in /packages/mermaid/src/docs

DO NOT CHANGE FILES IN /docs

Join our slack community if you want closer contact!