Skip to content

Commit

Permalink
Merge pull request #3911 from mermaid-js/release/9.3.0
Browse files Browse the repository at this point in the history
Release/9.3.0
  • Loading branch information
knsv committed Dec 15, 2022
2 parents e2a0c43 + 774512d commit 5735efa
Show file tree
Hide file tree
Showing 454 changed files with 13,051 additions and 33,886 deletions.
87 changes: 74 additions & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsdoc/recommended",
"plugin:json/recommended",
"plugin:markdown/recommended",
"plugin:@cspell/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "html", "jest", "jsdoc", "json"],
"plugins": [
"@typescript-eslint",
"no-only-tests",
"html",
"jest",
"jsdoc",
"json",
"@cspell",
"lodash",
"unicorn"
],
"rules": {
"curly": "error",
"no-console": "error",
"no-prototype-builtins": "off",
"no-unused-vars": "off",
"jsdoc/check-indentation": "off",
"jsdoc/check-alignment": "off",
"jsdoc/check-line-alignment": "off",
"jsdoc/multiline-blocks": "off",
"jsdoc/newline-after-description": "off",
"jsdoc/tag-lines": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-description": "off",
"cypress/no-async-tests": "off",
"@typescript-eslint/ban-ts-comment": [
"error",
Expand All @@ -48,7 +49,44 @@
}
],
"json/*": ["error", "allowComments"],
"no-empty": ["error", { "allowEmptyCatch": true }]
"@cspell/spellchecker": [
"error",
{
"checkIdentifiers": false,
"checkStrings": false,
"checkStringTemplates": false
}
],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-only-tests/no-only-tests": "error",
"lodash/import-scope": ["error", "method"],
"unicorn/better-regex": "error",
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-array-push-push": "error",
"unicorn/no-for-loop": "error",
"unicorn/no-instanceof-array": "error",
"unicorn/no-typeof-undefined": "error",
"unicorn/no-unnecessary-await": "error",
"unicorn/no-unsafe-regex": "warn",
"unicorn/no-useless-promise-resolve-reject": "error",
"unicorn/prefer-array-find": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/prefer-array-index-of": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-default-parameters": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-negative-index": "error",
"unicorn/prefer-object-from-entries": "error",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/prefer-string-trim-start-end": "error",
"unicorn/string-content": "error",
"unicorn/prefer-spread": "error",
"unicorn/no-lonely-if": "error"
},
"overrides": [
{
Expand All @@ -57,6 +95,29 @@
"no-console": "off"
}
},
{
"files": ["*.{js,jsx,mjs,cjs}"],
"extends": ["plugin:jsdoc/recommended"],
"rules": {
"jsdoc/check-indentation": "off",
"jsdoc/check-alignment": "off",
"jsdoc/check-line-alignment": "off",
"jsdoc/multiline-blocks": "off",
"jsdoc/newline-after-description": "off",
"jsdoc/tag-lines": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-description": "off"
}
},
{
"files": ["*.{ts,tsx}"],
"plugins": ["tsdoc"],
"rules": {
"tsdoc/syntax": "error"
}
},
{
"files": ["*.spec.{ts,js}", "cypress/**", "demos/**", "**/docs/**"],
"rules": {
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ contact_links:
- name: GitHub Discussions
url: https://github.com/mermaid-js/mermaid/discussions
about: Ask the Community questions or share your own graphs in our discussions.
- name: Security Vulnerability
url: https://github.com/mermaid-js/.github/blob/main/SECURITY.md
about: Report security issues confidentially.
- name: Slack
url: https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE
about: Join our Community on Slack for Help and a casual chat.
Expand Down
18 changes: 0 additions & 18 deletions .github/dependabot.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/docs.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/link-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This Link Checker is run on all documentation files once per week.

# references:
# - https://github.com/lycheeverse/lychee-action
# - https://github.com/lycheeverse/lychee

name: Link Checker

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 8 * * 5'

jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
# lychee only uses the GITHUB_TOKEN to avoid rate-limiting
contents: read
steps:
- uses: actions/checkout@v3

- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Link Checker
uses: lycheeverse/lychee-action@v1.5.4
with:
args: --verbose --no-progress --cache --max-cache-age 1d packages/mermaid/src/docs/**/*.md README.md README.zh-CN.md
fail: true
jobSummary: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
17 changes: 16 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ready_for_review

permissions:
contents: read
contents: write

jobs:
lint:
Expand Down Expand Up @@ -39,4 +39,19 @@ jobs:
run: pnpm run lint

- name: Verify Docs
id: verifyDocs
working-directory: ./packages/mermaid
continue-on-error: ${{ github.event_name == 'push' }}
run: pnpm run docs:verify

- name: Rebuild Docs
if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
working-directory: ./packages/mermaid
run: pnpm run docs:build

- name: Commit changes
uses: EndBug/add-and-commit@v9
if: ${{ steps.verifyDocs.outcome == 'failure' && github.event_name == 'push' }}
with:
message: 'Update docs'
add: 'docs/*'
62 changes: 62 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy Vitepress docs to Pages

on:
# Runs on pushes targeting the default branch
push:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: 18

- name: Install Packages
run: pnpm install --frozen-lockfile

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Run Build
run: pnpm --filter mermaid run docs:build:vitepress

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: packages/mermaid/src/vitepress/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cypress/snapshots/
.eslintcache
.tsbuildinfo
tsconfig.tsbuildinfo
knsv*.html

knsv*.html
local*.html
stats/
6 changes: 0 additions & 6 deletions .lintstagedrc.json

This file was deleted.

5 changes: 5 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'!(docs/**/*)*.{ts,js,json,html,md,mts}': ['eslint --fix', 'prettier --write'],
'cSpell.json': ['ts-node-esm scripts/fixCSpell.ts'],
'**/*.jison': ['pnpm -w run lint:jison'],
};
13 changes: 13 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These links are ignored by our link checker https://github.com/lycheeverse/lychee
# The file allows you to list multiple regular expressions for exclusion (one pattern per line).

# Network error: Forbidden
https://codepen.io

# Network error: The certificate was not trusted
https://mkdocs.org/
https://osawards.com/javascript/#nominees
https://osawards.com/javascript/2019

# Don't check files that are generated during the build via `pnpm docs:code`
packages/mermaid/src/docs/config/setup/*
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
auto-install-peers=true
strict-peer-dependencies=false
use-inline-specifiers-lockfile-format=true
use-inline-specifiers-lockfile-format=true
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ cypress/platform/xss3.html
.cache
coverage
# Autogenerated by PNPM
pnpm-lock.yaml
pnpm-lock.yaml
stats
Loading

0 comments on commit 5735efa

Please sign in to comment.