mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 21:09:50 +02:00
Merge branch 'develop' into sidv/runTimeDiff
* develop: (280 commits) chore: Remove unused imports in block Fix spelling Update docs Lychee ignore chrome webstore Update link chore(deps): update all patch dependencies build(docs): vendor CSS dependencies chore(deps): update all minor dependencies Ran lint:fix Fix chrome webstore url causing 404 build(deps): update `langium` to `v3` and apply the required changes Resolves E2E testing issues and issue #5343 Fix spelling Fix community integrations Fix docs docs: Fix config Update all minor dependencies Amend docs to document gitgraph parallel commits Fix lint Use Yarn Add COREPACK_ENABLE_STRICT ...
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
# Fail on errors
|
||||
set -euxo pipefail
|
||||
export COREPACK_ENABLE_STRICT='0'
|
||||
|
||||
# Increase heap size
|
||||
export NODE_OPTIONS="--max_old_space_size=4096"
|
||||
@@ -10,6 +11,7 @@ pushd packages/mermaid
|
||||
# Append commit hash to version
|
||||
jq ".version = .version + \"+${COMMIT_REF:0:7}\"" package.json > package.tmp.json
|
||||
mv package.tmp.json package.json
|
||||
yarn link
|
||||
popd
|
||||
|
||||
pnpm run -r clean
|
||||
@@ -24,11 +26,11 @@ cd mermaid-live-editor
|
||||
|
||||
# We have to use npm instead of yarn because it causes trouble in netlify
|
||||
# Install dependencies
|
||||
npm install
|
||||
yarn install
|
||||
|
||||
# Link local mermaid to live editor
|
||||
npm link ../packages/mermaid
|
||||
yarn link mermaid
|
||||
|
||||
# Force Build the site
|
||||
npm run build -- --force
|
||||
yarn run build -- --force
|
||||
|
||||
|
@@ -5,20 +5,31 @@
|
||||
* (i.e. the root of the Mermaid project).
|
||||
*/
|
||||
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import prettier from 'prettier';
|
||||
import { readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
const filepath = './cSpell.json';
|
||||
const cSpell: { words: string[] } = JSON.parse(readFileSync(filepath, 'utf8'));
|
||||
const cSpellDictionaryDir = './.cspell';
|
||||
|
||||
cSpell.words = [...new Set(cSpell.words.map((word) => word.toLowerCase()))];
|
||||
cSpell.words.sort((a, b) => a.localeCompare(b));
|
||||
function sortWordsInFile(filepath: string) {
|
||||
const words = readFileSync(filepath, 'utf8')
|
||||
.split('\n')
|
||||
.map((word) => word.trim())
|
||||
.filter((word) => word);
|
||||
words.sort((a, b) => a.localeCompare(b));
|
||||
|
||||
const prettierConfig = prettier.resolveConfig.sync(filepath) ?? {};
|
||||
writeFileSync(
|
||||
filepath,
|
||||
prettier.format(JSON.stringify(cSpell), {
|
||||
...prettierConfig,
|
||||
filepath,
|
||||
})
|
||||
);
|
||||
writeFileSync(filepath, words.join('\n') + '\n', 'utf8');
|
||||
}
|
||||
|
||||
function findDictionaries() {
|
||||
const files = readdirSync(cSpellDictionaryDir, { withFileTypes: true })
|
||||
.filter((dir) => dir.isFile())
|
||||
.filter((dir) => dir.name.endsWith('.txt'));
|
||||
return files.map((file) => join(cSpellDictionaryDir, file.name));
|
||||
}
|
||||
|
||||
function main() {
|
||||
const files = findDictionaries();
|
||||
files.forEach(sortWordsInFile);
|
||||
}
|
||||
|
||||
main();
|
||||
|
Reference in New Issue
Block a user