Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release docs #4493

Merged
merged 75 commits into from Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
47b695c
reorganize, start adding text
weedySeaDragon Oct 18, 2022
95120c3
added main TOC headings
weedySeaDragon Nov 3, 2022
135893f
copy working draft to vdocs/community/development.md
weedySeaDragon Nov 4, 2022
dabda9d
CONTRIBUTING.md is note (with link) to development.md on doc site
weedySeaDragon Nov 4, 2022
5eee767
add TBD/comments in 'Contribute to Documentation....' section
weedySeaDragon Nov 4, 2022
e022404
delete vdocs dir; it not longer exists
weedySeaDragon Nov 4, 2022
16d1610
clarify section headings; add TODO
weedySeaDragon Nov 14, 2022
548ae5b
sidebar: add sub-entries for Development/contribution
weedySeaDragon Nov 14, 2022
535a1fc
add mermaid diagram
weedySeaDragon Nov 15, 2022
950832e
Minor wording changes to Tech Reqs/Setup
weedySeaDragon Nov 15, 2022
6b8f60e
nav menu: contributing now points to src/doc about contributing
weedySeaDragon Nov 15, 2022
9c0b81c
sidebar menu: remove sub-sub sections since sub menus cannot be colla…
weedySeaDragon Nov 15, 2022
3bdcfd9
add TODO - PRs should start with... (fix|bug|feat|...)
weedySeaDragon Nov 15, 2022
449cbdf
make TODOs bold, ital so they're obv
weedySeaDragon Nov 18, 2022
acebcbf
/doc files changed
weedySeaDragon Nov 18, 2022
a867400
(minor) fix formatting; add "upvoting" to cSpell.json
weedySeaDragon Nov 18, 2022
3fbc26d
Merge remote-tracking branch 'MERMAID/develop' into docs/3682-develop…
weedySeaDragon Nov 18, 2022
bd8f620
updates based on sidharthv96's review
weedySeaDragon Nov 18, 2022
71d2175
questions? search in... capitalize Search, + closed issues
weedySeaDragon Nov 18, 2022
0333bc1
spelling: description; .. help us keep release notes organized
weedySeaDragon Nov 18, 2022
fee63d8
update related /docs file
weedySeaDragon Nov 19, 2022
bd5b5cd
Merge remote-tracking branch 'origin/docs/3682-developer-contributing…
weedySeaDragon Nov 19, 2022
ee0f872
Merge develop cSpell.json
weedySeaDragon Nov 25, 2022
3eb2bb9
Merge develop into HEAD; install; lint:fix
weedySeaDragon Nov 25, 2022
b15eacf
remove references to old sidebar.md file
weedySeaDragon Nov 27, 2022
3c49fb2
(minor) force link check again (too many network calls before)
weedySeaDragon Nov 27, 2022
6807f19
fix links
weedySeaDragon Nov 28, 2022
75fa259
simplify pnpm cypress command example
weedySeaDragon Nov 28, 2022
a497909
fix pnpm dev command example
weedySeaDragon Nov 28, 2022
df10951
Add hint on "flowchart" and "graph" (and some more styling)
koppor Apr 30, 2023
5c8b739
Update docs
koppor Apr 30, 2023
9a080bb
Merge branch 'release/10.2.3' into develop
knsv Jun 8, 2023
768e012
Correct timeline spelling
adamazing Jun 9, 2023
6e657e5
Fix link to Tutorials from n00b-overview page
Spiderpig86 Jun 9, 2023
071f490
Run build
Spiderpig86 Jun 9, 2023
19fab1f
Update tutorial link
Spiderpig86 Jun 9, 2023
779acb1
Merge pull request #4472 from Spiderpig86/patch-1
sidharthv96 Jun 10, 2023
c76cb93
Run docs:build
adamazing Jun 10, 2023
d32d935
Fix Directives Documentation
adamazing Jun 10, 2023
2abb954
Merge pull request #4475 from adamazing/fix-directives-documentation
sidharthv96 Jun 12, 2023
a754f7b
Update all patch dependencies
renovate[bot] Jun 12, 2023
b651be7
Merge pull request #4482 from mermaid-js/renovate/patch-all-patch
sidharthv96 Jun 12, 2023
355b471
Merge branch 'develop' into patch-1
koppor Jun 12, 2023
26d0e5c
Rename "info" to "note"
koppor Jun 12, 2023
ea138ef
Rename info to note
koppor Jun 12, 2023
bdd3ed4
Update docs
koppor Jun 12, 2023
190d796
Merge pull request #4096 from koppor/patch-1
sidharthv96 Jun 12, 2023
4a20047
Merge pull request #4467 from adamazing/patch-1
sidharthv96 Jun 12, 2023
64558ff
strawman extension and mime type docs
bollwyvl Jun 12, 2023
a7b75d7
Update docs
bollwyvl Jun 12, 2023
af13f34
Ignore bundlephobia
sidharthv96 Jun 12, 2023
cdea0ea
Support for development in Docker
nirname Jun 10, 2023
616d445
Rerun
nirname Jun 12, 2023
245c4f8
Update coveralls
sidharthv96 Jun 13, 2023
40199e2
Disable coveralls
sidharthv96 Jun 13, 2023
e2a32e5
Update integrations.md per review
bollwyvl Jun 13, 2023
3e20a42
Update docs
bollwyvl Jun 13, 2023
921bbd1
Move filetype Recommendations to the top
sidharthv96 Jun 13, 2023
56a9625
Merge pull request #4485 from bollwyvl/gh-3098-document-extension-and…
sidharthv96 Jun 13, 2023
1a6fd69
Merge branch 'develop' into pr/weedySeaDragon/3814
sidharthv96 Jun 15, 2023
5b4efba
ignore .pnpm-store
sidharthv96 Jun 15, 2023
ecec4d9
Update development.md
sidharthv96 Jun 15, 2023
8426716
Merge pull request #4478 from nirname/feature/docker-development-support
sidharthv96 Jun 15, 2023
186de33
Remove duplication from Contributing.md
sidharthv96 Jun 15, 2023
08c1071
Ignore localhost links
sidharthv96 Jun 15, 2023
307aa6f
Merge branch 'develop' into pr/weedySeaDragon/3814
sidharthv96 Jun 15, 2023
66116ef
Add docker
sidharthv96 Jun 15, 2023
beb3a22
Merge pull request #3814 from weedySeaDragon/docs/3682-developer-cont…
sidharthv96 Jun 15, 2023
c73d493
Ignore localhost
sidharthv96 Jun 15, 2023
d4a473b
Revert patch changes
sidharthv96 Jun 15, 2023
7cd62bd
Revert patch changes
sidharthv96 Jun 15, 2023
cae612d
Merge branch 'master' into develop
sidharthv96 Jun 15, 2023
609530b
Fix lycheeignore
sidharthv96 Jun 15, 2023
415e73b
Fix lycheeignore
sidharthv96 Jun 15, 2023
3662869
Ignore slack link
sidharthv96 Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Expand Up @@ -41,11 +41,9 @@ jobs:
run: |
pnpm exec vitest run ./packages/mermaid/src/diagrams/gantt/ganttDb.spec.ts

- name: Upload Coverage to Coveralls
# it feels a bit weird to use @master, but that's what the docs use
# (coveralls also doesn't publish a @v1 we can use)
# https://github.com/marketplace/actions/coveralls-github-action
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: unit
# Coveralls is throwing 500. Disabled for now.
# - name: Upload Coverage to Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: unit
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,8 +3,10 @@
node_modules/
coverage/
.idea/
.pnpm-store/

dist
v8-compile-cache-0

yarn-error.log
.npmrc
Expand Down Expand Up @@ -39,3 +41,4 @@ stats/

**/user-avatars/*
**/contributor-names.json
.pnpm-store
6 changes: 6 additions & 0 deletions .lycheeignore
Expand Up @@ -9,3 +9,9 @@ https://twitter.com/mermaidjs_

# Don't check files that are generated during the build via `pnpm docs:code`
packages/mermaid/src/docs/config/setup/*

# Ignore localhost
http://localhost:3333/

# Ignore slack invite
https://join.slack.com/
177 changes: 34 additions & 143 deletions CONTRIBUTING.md
@@ -1,14 +1,10 @@
# Contributing

So you want to help? That's great!
Please read in detail about how to contribute documentation and code on the [Mermaid documentation site.](https://mermaid-js.github.io/mermaid/#/development)

![Happy people jumping with excitement](https://media.giphy.com/media/BlVnrxJgTGsUw/giphy.gif)
---

Here are a few things to know to get you started on the right path.

Below link will help you making a copy of the repository in your local system.

https://docs.github.com/en/get-started/quickstart/fork-a-repo
# Mermaid contribution cheat-sheet

## Requirements

Expand All @@ -18,163 +14,58 @@ https://docs.github.com/en/get-started/quickstart/fork-a-repo

## 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:

```bash
git clone git@github.com:mermaid-js/mermaid.git
cd mermaid
# npx is required for first install as volta support for pnpm is not added yet.
npx pnpm install
pnpm test
```

## Committing code

We make all changes via pull requests. As we have many pull requests from developers new to mermaid, the current approach is to have _knsv, Knut Sveidqvist_ as a main reviewer of changes and merging pull requests. More precisely like this:

- Large changes reviewed by knsv or other developer asked to review by knsv
- Smaller low-risk changes like dependencies, documentation, etc. can be merged by active collaborators
- Documentation (updates to the `package/mermaid/src/docs` folder is also allowed via direct commits)

To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text.

One example:

`feature/945_state_diagrams`

Another:

`bug/123_nasty_bug_branch`

## Committing documentation

Less strict here, it is OK to commit directly in the `develop` branch if you are a collaborator.

The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax).
Install required packages:

### Documentation source files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)

The source files for the project documentation are located in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory. This is where you should make changes.
The files under `/packages/mermaid/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory.

After editing files in the [`/packages/mermaid/src/docs`](packages/mermaid/src/docs) directory, be sure to run `pnpm install` and `pnpm run --filter mermaid docs:build` locally to build the `/docs` directory.

```mermaid
flowchart LR
classDef default fill:#fff,color:black,stroke:black

source["files in /packages/mermaid/src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"]

```

You can use `note`, `tip`, `warning` and `danger` in triple backticks to add a note, tip, warning or danger box.
Do not use vitepress specific markdown syntax `::: warning` as it will not be processed correctly.

````
```note
Note content
```

```tip
Tip content
```

```warning
Warning content
```

```danger
Danger content
```bash
# npx is required for first install as volta support for pnpm is not added yet.
npx pnpm install
pnpm test
```

````

**_DO NOT CHANGE FILES IN `/docs`_**

### The official documentation site
### Docker

**[The mermaid documentation site](https://mermaid-js.github.io/mermaid/) is powered by [Vitepress](https://vitepress.vuejs.org/), a simple documentation site generator.**
If you are using docker and docker-compose, you have self-documented `run` bash script, which is a convenient alias for docker-compose commands:

If you want to preview the whole documentation site on your machine:

```sh
cd packages/mermaid
pnpm i
pnpm docs:dev
```bash
./run install # npx pnpm install
./run test # pnpm test
```

You can now build and serve the documentation site:
## Testing

```sh
pnpm docs:serve
```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
```

## Branching

Going forward we will use a git flow inspired approach to branching. So development is done in develop, to do the development in the develop.

Once development is done we branch a release branch from develop for testing.

Once the release happens we merge the release branch to master and kill the release branch.

This means... **branch off your pull request from develop**

## Content of a pull request
## Branch name format:

A new feature has been born. Great! But without the steps below it might just ... fade away ...

### **Add unit tests for the parsing part**

This is important so that, if someone else does a change to the grammar that does not know about this great feature, gets notified early on when that change breaks the parser. Another important aspect is that without proper parsing tests refactoring is pretty much impossible.

### **Add e2e tests**

This tests the rendering and visual appearance of the diagram. This ensures that the rendering of that feature in the e2e will be reviewed in the release process going forward. Less chance that it breaks!

To start working with the e2e tests, run `pnpm run dev` to start the dev server, after that start cypress by running `pnpm exec cypress open` in the mermaid folder.

The rendering tests are very straightforward to create. There is a function imgSnapshotTest. This function takes a diagram in text form, the mermaid options and renders that diagram in cypress.

When running in ci it will take a snapshot of the rendered diagram and compare it with the snapshot from last build and flag for review it if it differs.

This is what a rendering test looks like:

```javascript
it('should render forks and joins', () => {
imgSnapshotTest(
`
stateDiagram
state fork_state <<fork>>
[*] --> fork_state
fork_state --> State2
fork_state --> State3

state join_state <<join>>
State2 --> join_state
State3 --> join_state
join_state --> State4
State4 --> [*]
`,
{ logLevel: 0 }
);
cy.get('svg');
});
```text
[feature | bug | chore | docs]/[issue number]_[short description using dashes ('-') or underscores ('_') instead of spaces]
```

### **Add documentation for it**

Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature?

The source files for documentation are in `/packages/mermaid/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated.
eg: `feature/2945_state-diagram-new-arrow-florbs`, `bug/1123_fix_random_ugly_red_text`

#### Adding to or changing the documentation organization
## Documentation

If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `mermaid/src/docs/.vitepress/config.js`.
Documentation is necessary for all non bugfix/refactoring changes.

When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/
Only make changes to files are in [`/packages/mermaid/src/docs`](packages/mermaid/src/docs)

## Last words

Don't get daunted if it is hard in the beginning. We have a great community with only encouraging words. So if you get stuck, ask for help and hints in the slack forum. If you want to show off something good, show it off there.
**_DO NOT CHANGE FILES IN `/docs`_**

[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)

![A superhero wishing you good luck](https://media.giphy.com/media/l49JHz7kJvl6MCj3G/giphy.gif)
1 change: 1 addition & 0 deletions cSpell.json
Expand Up @@ -129,6 +129,7 @@
"ugge",
"unist",
"unocss",
"upvoting",
"valign",
"verdana",
"viewports",
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,9 @@
version: '3.9'
services:
mermaid:
image: node:18.16.0-alpine3.18
stdin_open: true
tty: true
working_dir: /mermaid
volumes:
- ./:/mermaid