mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 02:27:05 +02:00
Merge branch 'next' into sidv/runCodeCov
* next: remove duplicate `@types/d3-scale` dev dependency chore: Move liveReload code into script. Fix minify undefined chore: Fix minify Fix import chore: Fix outfile names chore: Add analyzer comment chore: Split chunks into folders chore: Split chunks into folders chore: Add defaultOptions to server chore: Split chunks into folders chore: IIFE to cSpell chore: Minor comments chore: Replace Date.now with console.time chore: Build at start chore: Add build times to live reload chore: Add live-reload chore: Remove @vitest/coverage-c8 chore: Add esbuild (Breaking change) mermaid.min.js and mermaid.js will now be IIFE instead of UMD.
This commit is contained in:
@@ -5,20 +5,24 @@
|
||||
* (i.e. the root of the Mermaid project).
|
||||
*/
|
||||
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import { readFile, writeFile } from 'node:fs/promises';
|
||||
import prettier from 'prettier';
|
||||
|
||||
const filepath = './cSpell.json';
|
||||
const cSpell: { words: string[] } = JSON.parse(readFileSync(filepath, 'utf8'));
|
||||
const main = async () => {
|
||||
const filepath = './cSpell.json';
|
||||
const cSpell: { words: string[] } = JSON.parse(await readFile(filepath, 'utf8'));
|
||||
|
||||
cSpell.words = [...new Set(cSpell.words.map((word) => word.toLowerCase()))];
|
||||
cSpell.words.sort((a, b) => a.localeCompare(b));
|
||||
cSpell.words = [...new Set(cSpell.words.map((word) => word.toLowerCase()))];
|
||||
cSpell.words.sort((a, b) => a.localeCompare(b));
|
||||
|
||||
const prettierConfig = prettier.resolveConfig.sync(filepath) ?? {};
|
||||
writeFileSync(
|
||||
filepath,
|
||||
prettier.format(JSON.stringify(cSpell), {
|
||||
...prettierConfig,
|
||||
const prettierConfig = (await prettier.resolveConfig(filepath)) ?? {};
|
||||
await writeFile(
|
||||
filepath,
|
||||
})
|
||||
);
|
||||
await prettier.format(JSON.stringify(cSpell), {
|
||||
...prettierConfig,
|
||||
filepath,
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
void main();
|
||||
|
Reference in New Issue
Block a user