Merge branch 'develop' into sidv/eslintCleanup

* develop:
  chore: Add lodash-eslint rule
  chore: Add lodash-eslint rule
  feat: Spellcheck docs when building
  fix: Enable extending lintstagedrc.
  fix: lintstagedrc `lint:jison`
This commit is contained in:
Sidharth Vinod 2022-11-23 20:52:36 +05:30
commit a4fec411bd
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
8 changed files with 235 additions and 41 deletions

View File

@ -1,28 +0,0 @@
name: Documentation Checks
on:
push:
branches:
- develop
paths:
- 'packages/mermaid/src/docs/**/*'
pull_request:
branches:
- develop
paths:
- 'packages/mermaid/src/docs/**/*'
jobs:
spellcheck:
name: 'Docs: Spellcheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Check out the code
- uses: actions/setup-node@v3
name: Setup node
with:
node-version: '18'
- run: npm install -g cspell
name: Install cSpell
- run: cspell --config ./cSpell.json "packages/mermaid/src/docs/**/*.md" --no-progress
name: Run cSpell

View File

@ -1,4 +0,0 @@
{
"!(docs/**/*)*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"],
"cSpell.json": ["ts-node-esm scripts/fixCSpell.ts"]
}

5
.lintstagedrc.mjs Normal file
View File

@ -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'],
};

View File

@ -13,6 +13,7 @@
"bbox",
"bilkent",
"bisheng",
"braintree",
"brolin",
"brotli",
"classdef",
@ -34,6 +35,7 @@
"gantt",
"gitea",
"gitgraph",
"globby",
"graphlib",
"grav",
"greywolf",
@ -41,11 +43,13 @@
"jaoude",
"jison",
"kaufmann",
"khroma",
"klemm",
"klink",
"knsv",
"knut",
"laganeckas",
"lintstagedrc",
"lucida",
"matthieu",
"mdbook",
@ -75,6 +79,7 @@
"treemap",
"ts-nocheck",
"tuleap",
"unist",
"verdana",
"viewports",
"vinod",

View File

@ -1,6 +0,0 @@
{
"src/docs/**": ["pnpm --filter mermaid run docs:build --git"],
"src/docs.mts": ["pnpm --filter mermaid run docs:build --git"],
"src/(defaultConfig|config|mermaidAPI).ts": ["pnpm --filter mermaid run docs:build --git"],
"*.jison": ["pnpm run lint:jison"]
}

View File

@ -0,0 +1,7 @@
import baseConfig from '../../.lintstagedrc.mjs';
export default {
...baseConfig,
'src/docs/**': ['pnpm --filter mermaid run docs:build --git'],
'src/docs.mts': ['pnpm --filter mermaid run docs:build --git'],
'src/(defaultConfig|config|mermaidAPI).ts': ['pnpm --filter mermaid run docs:build --git'],
};

View File

@ -1,7 +1,7 @@
{
"name": "mermaid",
"version": "9.2.2",
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"main": "./dist/mermaid.min.js",
"module": "./dist/mermaid.core.mjs",
"types": "./dist/mermaid.d.ts",
@ -26,12 +26,13 @@
"scripts": {
"clean": "rimraf dist",
"docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup",
"docs:build": "rimraf ../../docs && pnpm docs:code && ts-node-esm src/docs.mts",
"docs:verify": "pnpm docs:code && ts-node-esm src/docs.mts --verify",
"docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts",
"docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.mts --verify",
"docs:pre:vitepress": "rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.mts --vitepress",
"docs:build:vitepress": "pnpm docs:pre:vitepress && vitepress build src/vitepress",
"docs:dev": "pnpm docs:pre:vitepress && concurrently \"vitepress dev src/vitepress\" \"ts-node-esm src/docs.mts --watch --vitepress\"",
"docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress",
"docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"",
"release": "pnpm build",
"prepublishOnly": "pnpm -w run build"
},
@ -79,6 +80,7 @@
"chokidar": "^3.5.3",
"concurrently": "^7.5.0",
"coveralls": "^3.1.1",
"cspell": "^6.14.3",
"globby": "^13.1.2",
"identity-obj-proxy": "^3.0.0",
"jison": "^0.4.18",

213
pnpm-lock.yaml generated
View File

@ -254,6 +254,9 @@ importers:
coveralls:
specifier: ^3.1.1
version: 3.1.1
cspell:
specifier: ^6.14.3
version: 6.14.3
globby:
specifier: ^13.1.2
version: 13.1.2
@ -1373,21 +1376,84 @@ packages:
'@cspell/dict-vue': 3.0.0
dev: true
/@cspell/cspell-bundled-dicts/6.14.3:
resolution: {integrity: sha512-bgPBduoDi1jkrcLkmAwRG1c6F1iprF2yfBgEDT19dRG1kYuq/fLGNOcSmEp4CbApn8m0MmxsrhEp8O0Q9owQRQ==}
engines: {node: '>=14'}
dependencies:
'@cspell/dict-ada': 4.0.0
'@cspell/dict-aws': 3.0.0
'@cspell/dict-bash': 4.1.0
'@cspell/dict-companies': 3.0.3
'@cspell/dict-cpp': 4.0.0
'@cspell/dict-cryptocurrencies': 3.0.1
'@cspell/dict-csharp': 4.0.1
'@cspell/dict-css': 4.0.0
'@cspell/dict-dart': 2.0.0
'@cspell/dict-django': 4.0.0
'@cspell/dict-docker': 1.1.3
'@cspell/dict-dotnet': 4.0.0
'@cspell/dict-elixir': 4.0.0
'@cspell/dict-en-gb': 1.1.33
'@cspell/dict-en_us': 4.1.0
'@cspell/dict-filetypes': 3.0.0
'@cspell/dict-fonts': 3.0.0
'@cspell/dict-fullstack': 3.0.0
'@cspell/dict-git': 2.0.0
'@cspell/dict-golang': 5.0.0
'@cspell/dict-haskell': 4.0.0
'@cspell/dict-html': 4.0.1
'@cspell/dict-html-symbol-entities': 4.0.0
'@cspell/dict-java': 5.0.2
'@cspell/dict-latex': 3.0.0
'@cspell/dict-lorem-ipsum': 3.0.0
'@cspell/dict-lua': 3.0.0
'@cspell/dict-node': 4.0.1
'@cspell/dict-npm': 4.0.1
'@cspell/dict-php': 3.0.3
'@cspell/dict-powershell': 3.0.0
'@cspell/dict-public-licenses': 2.0.0
'@cspell/dict-python': 4.0.0
'@cspell/dict-r': 2.0.0
'@cspell/dict-ruby': 3.0.0
'@cspell/dict-rust': 3.0.0
'@cspell/dict-scala': 3.0.0
'@cspell/dict-software-terms': 3.0.5
'@cspell/dict-sql': 2.0.0
'@cspell/dict-swift': 2.0.0
'@cspell/dict-typescript': 3.0.1
'@cspell/dict-vue': 3.0.0
dev: true
/@cspell/cspell-pipe/6.14.2:
resolution: {integrity: sha512-9H7Z/jy2tGpMW9T/JOk8T3bqvQoHJIz1wddktA5Lq8fnMqlDhM9le2uykhVlLpemLhWpDS2fNzLJ3sHiaPgHBA==}
engines: {node: '>=14'}
dev: true
/@cspell/cspell-pipe/6.14.3:
resolution: {integrity: sha512-/mLZxJOK3/UFpnR4jrImKY5W4cn5XWjvQPXnFCEzpU0tAAF6GboJgWl30TegqFJjLVCKTNRMOtT1r6kgvb66zw==}
engines: {node: '>=14'}
dev: true
/@cspell/cspell-service-bus/6.14.2:
resolution: {integrity: sha512-IOK4MqwDNS2y29eZjdpHrCQ0ouTWZCS2e3EOmlvY+yUpT7e1AX8pVOaar4jLnXg03evAjrFrrmfmhFI6poO6Hg==}
engines: {node: '>=14'}
dev: true
/@cspell/cspell-service-bus/6.14.3:
resolution: {integrity: sha512-89OWGBzhorhiWcFqFTeHl9Y6WTdd5MGC2XNNCVZLM3VTYaFx4DVkiyxWdkE7gHjYxvNdGSH54/fE18TqLc//dQ==}
engines: {node: '>=14'}
dev: true
/@cspell/cspell-types/6.14.2:
resolution: {integrity: sha512-/EZYVglm6+2GlnkFTzuLuQFr7vrttkhG+ZsNO9EDcFYB5N7O2ndNSkTQFxGi8FS8R3RS5CHyS5X6hANnolzvfQ==}
engines: {node: '>=14'}
dev: true
/@cspell/cspell-types/6.14.3:
resolution: {integrity: sha512-u4Hun0vOQVkk3tJ6VzPjHVmv2dq0D6jYqX8pWLKWRwo38rdoIkdWseN359sWCz96tDM8g5rpSFdmecbWLU7BYg==}
engines: {node: '>=14'}
dev: true
/@cspell/dict-ada/4.0.0:
resolution: {integrity: sha512-M0n4ZYmpLOXbDD07Qb/Ekk0K5pX2C+mCuJ2ZxPgbTq9HGlrN43PmqrGJHWcgtVHE3fd1D4VxS85QcQP6r1Y+KQ==}
dev: true
@ -1570,6 +1636,11 @@ packages:
engines: {node: '>=14.6'}
dev: true
/@cspell/strong-weak-map/6.14.3:
resolution: {integrity: sha512-/FTvcywuwfFTMEpRabL8+rqB/ezSjvMp6todO0SwL/agYQmRIuTvTYLh0Ikq430oVnjo7LDgztW0tHq38UlFLw==}
engines: {node: '>=14.6'}
dev: true
/@cspotcode/source-map-support/0.8.1:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
@ -4141,6 +4212,11 @@ packages:
engines: {node: ^12.20.0 || >=14}
dev: true
/commander/9.4.1:
resolution: {integrity: sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==}
engines: {node: ^12.20.0 || >=14}
dev: true
/comment-json/4.2.3:
resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==}
engines: {node: '>= 6'}
@ -4349,6 +4425,17 @@ packages:
yaml: 1.10.2
dev: true
/cosmiconfig/7.1.0:
resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==}
engines: {node: '>=10'}
dependencies:
'@types/parse-json': 4.0.0
import-fresh: 3.3.0
parse-json: 5.2.0
path-type: 4.0.0
yaml: 1.10.2
dev: true
/coveralls/3.1.1:
resolution: {integrity: sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww==}
engines: {node: '>=6'}
@ -4401,6 +4488,26 @@ packages:
gensequence: 4.0.2
dev: true
/cspell-dictionary/6.14.3:
resolution: {integrity: sha512-yIqJEZZj36j1CmmjAiuQOYZM6T62Ih7k35DhAU1hYVARUEEnFN/Uz72UkDj2SAmURVn2On+bAmZ5zCx0JZzf2g==}
engines: {node: '>=14'}
dependencies:
'@cspell/cspell-pipe': 6.14.3
'@cspell/cspell-types': 6.14.3
cspell-trie-lib: 6.14.3
fast-equals: 4.0.3
gensequence: 4.0.2
dev: true
/cspell-gitignore/6.14.3:
resolution: {integrity: sha512-CZTGxx3msF6p1Z0xgLe5LXXvve7DooSuRMBMdGn230usce1nKoxpPoPxgs+zXeCpi+FanykKnoZkdRvjolMpOA==}
engines: {node: '>=14'}
hasBin: true
dependencies:
cspell-glob: 6.14.3
find-up: 5.0.0
dev: true
/cspell-glob/6.14.2:
resolution: {integrity: sha512-a9o3lBccEcH2676RGge2YqEORovm+II++D53P6hOW/23ltDe1J509MSY6CJdYdPk/VssOExas6akJ6FbKSCBgw==}
engines: {node: '>=14'}
@ -4408,6 +4515,13 @@ packages:
micromatch: 4.0.5
dev: true
/cspell-glob/6.14.3:
resolution: {integrity: sha512-ISwCK8GqM/dnvtaxA17w1MPmMzFLOqdTz+JWIcR4at47T9qd8bNB0X0P4eqyuqgsbKkWbfnSlsYlEjRHTi4a7A==}
engines: {node: '>=14'}
dependencies:
micromatch: 4.0.5
dev: true
/cspell-grammar/6.14.2:
resolution: {integrity: sha512-Q9+gwp1U/qnECTqxa7WBMPn6sgBfXPIM68jXg8RgNMAuy1CE+m1eTCM9FBNFNpNKJWjaZPvANLOW5/EStN2A/A==}
engines: {node: '>=14'}
@ -4417,6 +4531,15 @@ packages:
'@cspell/cspell-types': 6.14.2
dev: true
/cspell-grammar/6.14.3:
resolution: {integrity: sha512-Nz8tYUmstyKcFlXbxdw4N8NsQ2ZY/5ztNfouokk47LKaTAS0LyWlLSkZUxN016fMY2h+C+3dI+jaut2H/rtNew==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@cspell/cspell-pipe': 6.14.3
'@cspell/cspell-types': 6.14.3
dev: true
/cspell-io/6.14.2:
resolution: {integrity: sha512-QyQ0BBfDvF6B37SlSsmlzRnaGqiIHt7c5NsCNKf3ZfioTWkNI/fiabvSkpNGBAkELP6BPBxjsG+TaS+swZp+Kg==}
engines: {node: '>=14'}
@ -4427,6 +4550,16 @@ packages:
- encoding
dev: true
/cspell-io/6.14.3:
resolution: {integrity: sha512-EbH+qopgWIzr9SZCGDsF4AWYgucN4QzYeAgyXjTbV9RnNIGKOKovMe3vN9nxjOZyPKv2TvmgU+uMXDM61iObRw==}
engines: {node: '>=14'}
dependencies:
'@cspell/cspell-service-bus': 6.14.3
node-fetch: 2.6.7
transitivePeerDependencies:
- encoding
dev: true
/cspell-lib/6.14.2:
resolution: {integrity: sha512-QNsmWix0oFi1CjzFfNG1xAJVl1OC+6kiWvq0A1S8VD3LJhJVvBqSv1vudpL1oS7H2/2yxk9PUC/MajGLi5i5MQ==}
engines: {node: '>=14.6'}
@ -4457,6 +4590,36 @@ packages:
- encoding
dev: true
/cspell-lib/6.14.3:
resolution: {integrity: sha512-RJT5Tbe0UCMCtqDWRujjxq9u23sc2XylIpDP7MnpLx8wLVgFv2WPzESYNRGZqceqZYwBAPnpqS9h2ANxXSi8UQ==}
engines: {node: '>=14.6'}
dependencies:
'@cspell/cspell-bundled-dicts': 6.14.3
'@cspell/cspell-pipe': 6.14.3
'@cspell/cspell-types': 6.14.3
'@cspell/strong-weak-map': 6.14.3
clear-module: 4.1.2
comment-json: 4.2.3
configstore: 5.0.1
cosmiconfig: 7.1.0
cspell-dictionary: 6.14.3
cspell-glob: 6.14.3
cspell-grammar: 6.14.3
cspell-io: 6.14.3
cspell-trie-lib: 6.14.3
fast-equals: 4.0.3
find-up: 5.0.0
fs-extra: 10.1.0
gensequence: 4.0.2
import-fresh: 3.3.0
resolve-from: 5.0.0
resolve-global: 1.0.0
vscode-languageserver-textdocument: 1.0.7
vscode-uri: 3.0.6
transitivePeerDependencies:
- encoding
dev: true
/cspell-trie-lib/6.14.2:
resolution: {integrity: sha512-+aTRwFUzBPFbJ8zlDwzB1ew/gP7L6kddoXjmqCNeFx9B5DiwN1KPFRo+uBx21JOkoavnviGU//DpyWSU9Cittw==}
engines: {node: '>=14'}
@ -4467,6 +4630,40 @@ packages:
gensequence: 4.0.2
dev: true
/cspell-trie-lib/6.14.3:
resolution: {integrity: sha512-WVa5gbD9glsZ4c60qPD5RTwojKc5ooxw/Gn+HC9CBdWv5rE1AmM1V3yVWhYx2ZMbJufboBrzmSjJB9qdmUl3oA==}
engines: {node: '>=14'}
dependencies:
'@cspell/cspell-pipe': 6.14.3
'@cspell/cspell-types': 6.14.3
fs-extra: 10.1.0
gensequence: 4.0.2
dev: true
/cspell/6.14.3:
resolution: {integrity: sha512-DimVpUiw2iOSvO1daOTtOWjmryVZdFnPmjPhyhWZUqakOEgE2MgoBuk3cFzXqb8GsGXHQh5PqiWr1rqIkQ99qA==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@cspell/cspell-pipe': 6.14.3
chalk: 4.1.2
commander: 9.4.1
cspell-gitignore: 6.14.3
cspell-glob: 6.14.3
cspell-lib: 6.14.3
fast-json-stable-stringify: 2.1.0
file-entry-cache: 6.0.1
fs-extra: 10.1.0
get-stdin: 8.0.0
glob: 8.0.3
imurmurhash: 0.1.4
semver: 7.3.8
strip-ansi: 6.0.1
vscode-uri: 3.0.6
transitivePeerDependencies:
- encoding
dev: true
/css-tree/1.0.0-alpha.39:
resolution: {integrity: sha512-7UvkEYgBAHRG9Nt980lYxjsTrCyHFN53ky3wVsDkiMdVqylqRt+Zc+jm5qw7/qyOvN2dHSYtX0e4MbCCExSvnA==}
engines: {node: '>=8.0.0'}
@ -6288,6 +6485,11 @@ packages:
engines: {node: '>=0.12.0'}
dev: true
/get-stdin/8.0.0:
resolution: {integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==}
engines: {node: '>=10'}
dev: true
/get-stream/4.1.0:
resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==}
engines: {node: '>=6'}
@ -6374,6 +6576,17 @@ packages:
path-is-absolute: 1.0.1
dev: true
/glob/8.0.3:
resolution: {integrity: sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==}
engines: {node: '>=12'}
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 5.1.0
once: 1.4.0
dev: true
/global-dirs/0.1.1:
resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==}
engines: {node: '>=4'}