Skip to content

Commit

Permalink
Merge branch 'develop' into pr/rhysd/4359
Browse files Browse the repository at this point in the history
* develop: (595 commits)
  chore: Fix unit tests
  chore(deps): update all patch dependencies
  chore: Update docs
  Update docs
  New Mermaid Live Editor for Confluence Cloud (mermaid-js#4814)
  Update link to Discourse theme component (mermaid-js#4811)
  Update flowchart.md (mermaid-js#4810)
  chore: remove unneeded `CommomDB`
  chore: Update docs
  "CSS" instead of "css" in flowchart.md (mermaid-js#4797)
  Update CONTRIBUTING.md
  Update CONTRIBUTING.md
  fix: typos (mermaid-js#4801)
  chore: Align with convention
  fix: Add support for `~test Array~string~`
  chore: Add JSDoc to apply in sequenceDB
  refactor: Tidy up direction handling
  chore: Fix flowchart arrow
  chore: Add test to verify activate
  chore: Update tests snapshot
  ...
  • Loading branch information
sidharthv96 committed Sep 6, 2023
2 parents 8d48f8d + abcf2a2 commit c3b86b6
Show file tree
Hide file tree
Showing 326 changed files with 15,309 additions and 8,281 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Expand Up @@ -38,12 +38,17 @@ module.exports = {
'lodash',
'unicorn',
],
ignorePatterns: [
// this file is automatically generated by `pnpm run --filter mermaid types:build-config`
'packages/mermaid/src/config.type.ts',
],
rules: {
curly: 'error',
'no-console': 'error',
'no-prototype-builtins': 'off',
'no-unused-vars': 'off',
'cypress/no-async-tests': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/ban-ts-comment': [
Expand Down Expand Up @@ -123,6 +128,14 @@ module.exports = {
files: ['*.{ts,tsx}'],
plugins: ['tsdoc'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'TSEnumDeclaration',
message:
'Prefer using TypeScript union types over TypeScript enum, since TypeScript enums have a bunch of issues, see https://dev.to/dvddpl/whats-the-problem-with-typescript-enums-2okj',
},
],
'tsdoc/syntax': 'error',
},
},
Expand Down
11 changes: 10 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Expand Up @@ -53,8 +53,17 @@ body:
Please fill out the info below.
Note that you only need to fill out the relevant section
value: |-
- Mermaid version:
- Mermaid version:
- Browser and Version: [Chrome, Edge, Firefox]
- type: textarea
attributes:
label: Suggested Solutions
description: >
If applicable, suggest solutions that could resolve the bug.
It would help maintainers/contributors to not waste time looking for the solution. Even pointing the line causing the bug would be great!
placeholder: |-
- Variable `parser` in file <filepath> is not initialised ...
- Add a new type for ...
- type: textarea
attributes:
label: Additional Context
Expand Down
11 changes: 11 additions & 0 deletions codecov.yaml → .github/codecov.yaml
@@ -1,6 +1,17 @@
codecov:
branch: develop

comment:
layout: 'reach, diff, flags, files'
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: yes # [yes :: must have a head report to post]

coverage:
status:
project:
off
# Turing off for now as code coverage isn't stable and causes unnecessary build failures.
# default:
# threshold: 2%
44 changes: 44 additions & 0 deletions .github/lychee.toml
@@ -0,0 +1,44 @@
############################# Display #############################

# Verbose program output
# Accepts log level: "error", "warn", "info", "debug", "trace"
verbose = "debug"

# Don't show interactive progress bar while checking links.
no_progress = true

############################# Cache ###############################

# Enable link caching. This can be helpful to avoid checking the same links on
# multiple runs.
cache = true

# Discard all cached requests older than this duration.
max_cache_age = "1d"

############################# Requests ############################

# Comma-separated list of accepted status codes for valid links.
accept = [200, 429]

############################# Exclusions ##########################

# Exclude URLs and mail addresses from checking (supports regex).
exclude = [
# Network error: Forbidden
"https://codepen.io",

# Timeout error, maybe Twitter has anti-bot defenses against GitHub's CI servers?
"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 slack invite
"https://join.slack.com/"
]

# Exclude all private IPs from checking.
# Equivalent to setting `exclude_private`, `exclude_link_local`, and
# `exclude_loopback` to true.
exclude_all_private = true
7 changes: 4 additions & 3 deletions .github/pr-labeler.yml
@@ -1,3 +1,4 @@
'Type: Bug / Error': 'bug/*'
'Type: Enhancement': 'feature/*'
'Type: Other': 'other/*'
'Type: Bug / Error': ['bug/*', fix/*]
'Type: Enhancement': ['feature/*', 'feat/*']
'Type: Other': ['other/*', 'chore/*', 'test/*', 'refactor/*']
'Area: Documentation': ['docs/*']
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Expand Up @@ -13,6 +13,6 @@ Describe the way your implementation works or what design decisions you made if
Make sure you

- [ ] :book: have read the [contribution guidelines](https://github.com/mermaid-js/mermaid/blob/develop/CONTRIBUTING.md)
- [ ] :computer: have added unit/e2e tests (if appropriate)
- [ ] :notebook: have added documentation (if appropriate)
- [ ] :computer: have added necessary unit/e2e tests.
- [ ] :notebook: have added documentation. Make sure [`MERMAID_RELEASE_VERSION`](https://github.com/mermaid-js/mermaid/blob/develop/packages/mermaid/src/docs/community/development.md#3-update-documentation) is used for all new features.
- [ ] :bookmark: targeted `develop` branch
15 changes: 14 additions & 1 deletion .github/release-drafter.yml
@@ -1,14 +1,27 @@
name-template: '$NEXT_PATCH_VERSION'
tag-template: '$NEXT_PATCH_VERSION'
categories:
- title: '🚨 **Breaking Changes**'
labels:
- 'Breaking Change'
- title: '🚀 Features'
labels:
- 'Type: Enhancement'
- 'feature' # deprecated, new PRs shouldn't have this
- title: '🐛 Bug Fixes'
labels:
- 'Type: Bug / Error'
- 'fix' # deprecated, new PRs shouldn't have this
- title: '🧰 Maintenance'
label: 'Type: Other'
labels:
- 'Type: Other'
- 'chore' # deprecated, new PRs shouldn't have this
- title: '⚡️ Performance'
labels:
- 'Type: Performance'
- title: '📚 Documentation'
labels:
- 'Area: Documentation'
change-template: '- $TITLE (#$NUMBER) @$AUTHOR'
sort-by: title
sort-direction: ascending
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build-docs.yml
@@ -1,14 +1,18 @@
name: Build Vitepress docs

on:
push:
branches:
- master
- release/*
pull_request:
merge_group:

permissions:
contents: read

jobs:
# Build job
build:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -25,5 +29,9 @@ jobs:
- name: Install Packages
run: pnpm install --frozen-lockfile

- name: Verify release verion
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release')) }}
run: pnpm --filter mermaid run docs:verify-version

- name: Run Build
run: pnpm --filter mermaid run docs:build:vitepress
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Expand Up @@ -2,6 +2,7 @@ name: Build

on:
push: {}
merge_group:
pull_request:
types:
- opened
Expand All @@ -12,7 +13,7 @@ permissions:
contents: read

jobs:
build:
build-mermaid:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-readme-in-sync.yml
Expand Up @@ -14,7 +14,7 @@ permissions:
contents: read

jobs:
check:
check-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/checks.yml
@@ -1,15 +1,16 @@
on:
push: {}
push:
merge_group:
pull_request:
types:
- opened
- synchronize
- ready_for_review

name: Static analysis
name: Static analysis on Test files

jobs:
test:
check-tests:
runs-on: ubuntu-latest
name: check tests
if: github.repository_owner == 'mermaid-js'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-applitools.yml
Expand Up @@ -19,7 +19,7 @@ env:
USE_APPLI: ${{ secrets.APPLITOOLS_API_KEY && 'true' || '' }}

jobs:
test:
e2e-applitools:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/e2e.yml
@@ -1,12 +1,15 @@
name: E2E

on: [push, pull_request]
on:
push:
pull_request:
merge_group:

permissions:
contents: read

jobs:
build:
e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -42,15 +45,18 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
VITEST_COVERAGE: true
CYPRESS_COMMIT: ${{ github.sha }}
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
if: steps.cypress.conclusion == 'success'
# Run step only pushes to develop and pull_requests
if: ${{ steps.cypress.conclusion == 'success' && (github.event_name == 'pull_request' || github.ref == 'refs/heads/develop')}}
with:
files: coverage/cypress/lcov.info
flags: e2e
name: mermaid-codecov
fail_ci_if_error: true
fail_ci_if_error: false
verbose: true
token: 6845cc80-77ee-4e17-85a1-026cd95e0766
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/link-checker.yml
Expand Up @@ -20,7 +20,7 @@ on:
- cron: '30 8 * * *'

jobs:
linkChecker:
link-checker:
runs-on: ubuntu-latest
permissions:
# lychee only uses the GITHUB_TOKEN to avoid rate-limiting
Expand All @@ -39,10 +39,7 @@ jobs:
uses: lycheeverse/lychee-action@v1.8.0
with:
args: >-
--verbose
--no-progress
--cache
--max-cache-age 1d
--config .github/lychee.toml
packages/mermaid/src/docs/**/*.md
README.md
README.zh-CN.md
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/lint.yml
@@ -1,7 +1,8 @@
name: Lint

on:
push: {}
push:
merge_group:
pull_request:
types:
- opened
Expand Down Expand Up @@ -52,6 +53,33 @@ jobs:
exit 1
fi
- name: Verify `./src/config.type.ts` is in sync with `./src/schemas/config.schema.yaml`
shell: bash
run: |
if ! pnpm run --filter mermaid types:verify-config; then
ERROR_MESSAGE='Running `pnpm run --filter mermaid types:verify-config` failed.'
ERROR_MESSAGE+=' This should be fixed by running'
ERROR_MESSAGE+=' `pnpm run --filter mermaid types:build-config`'
ERROR_MESSAGE+=' on your local machine.'
echo "::error title=Lint failure::${ERROR_MESSAGE}"
# make sure to return an error exitcode so that GitHub actions shows a red-cross
exit 1
fi
- name: Verify no circular dependencies
working-directory: ./packages/mermaid
shell: bash
run: |
if ! pnpm run --filter mermaid checkCircle; then
ERROR_MESSAGE='Circular dependency detected.'
ERROR_MESSAGE+=' This should be fixed by removing the circular dependency.'
ERROR_MESSAGE+=' Run `pnpm run --filter mermaid checkCircle` on your local machine'
ERROR_MESSAGE+=' to see the circular dependency.'
echo "::error title=Lint failure::${ERROR_MESSAGE}"
# make sure to return an error exitcode so that GitHub actions shows a red-cross
exit 1
fi
- name: Verify Docs
id: verifyDocs
working-directory: ./packages/mermaid
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/pr-labeler-config-validator.yml
@@ -1,11 +1,15 @@
name: Validate PR Labeler Configuration
on:
push: {}
push:
paths:
- .github/workflows/pr-labeler-config-validator.yml
- .github/workflows/pr-labeler.yml
- .github/pr-labeler.yml
pull_request:
types:
- opened
- synchronize
- ready_for_review
paths:
- .github/workflows/pr-labeler-config-validator.yml
- .github/workflows/pr-labeler.yml
- .github/pr-labeler.yml

jobs:
pr-labeler:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-docs.yml
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
# Build job
build:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -48,11 +48,11 @@ jobs:
path: packages/mermaid/src/vitepress/.vitepress/dist

# Deployment job
deploy:
deploy-docs:
environment:
name: github-pages
runs-on: ubuntu-latest
needs: build
needs: build-docs
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit c3b86b6

Please sign in to comment.