From 710d19e73ebf0ddea9f9b9cf2f8e34f2ed479f79 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Wed, 28 Sep 2022 15:32:16 +0200 Subject: [PATCH 1/5] Add browser support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This significantly changes how tests are run. Because we need to run tests in the browser, Playwright is used for testing. The tests now use the Playwright snapshot feature. For every input fixture a markdown and HTML snapshot are made both using the Node.js and the browser API. To run tests in the browser, esbuild is used to serve a bundled version of the browser API. This is then dynamically imported and called inside a Playwright browser page. Unlike the Node.js implementation, the browser implementation doesn’t support any options. Launch options are irrelevant in the browser. Mermaid configuration is global in the browser. SVG Minification is probably unneeded when used in the browser, so SVGO isn’t included. Closes #8 --- .c8rc.json | 1 + .eslintrc.yaml | 5 + .gitignore | 1 + .prettierignore | 3 +- README.md | 7 + browser.ts | 38 ++ index.ts | 42 +- package-lock.json | 607 ++++++++---------- package.json | 19 +- playwright.config.ts | 24 + test.ts | 104 --- {__fixtures__ => test/fixtures}/dark/input.md | 0 .../fixtures}/dark/options.json | 0 .../fixtures}/flowchart/input.md | 0 .../fixtures}/fontawesome/input.md | 0 .../fixtures}/forest/input.md | 0 .../fixtures}/forest/options.json | 0 .../fixtures}/gantt/input.md | 0 .../fixtures}/multiple/input.md | 0 .../fixtures}/neutral/input.md | 0 .../fixtures}/neutral/options.json | 0 .../fixtures}/no-mermaid/input.md | 0 .../fixtures}/sequence/input.md | 0 .../fixtures}/simple/input.md | 0 test/runInBrowser.ts | 22 + test/test.ts | 108 ++++ test/test.ts-snapshots/dark-browser.html | 2 + test/test.ts-snapshots/dark-browser.md | 3 + test/test.ts-snapshots/dark-node.html | 91 +++ .../test.ts-snapshots/dark-node.md | 2 +- test/test.ts-snapshots/flowchart-browser.html | 2 + test/test.ts-snapshots/flowchart-browser.md | 3 + .../test.ts-snapshots/flowchart-node.html | 3 +- .../test.ts-snapshots/flowchart-node.md | 2 +- .../fontawesome-browser.html | 4 + test/test.ts-snapshots/fontawesome-browser.md | 7 + test/test.ts-snapshots/fontawesome-node.html | 84 +++ .../test.ts-snapshots/fontawesome-node.md | 2 +- test/test.ts-snapshots/forest-browser.html | 2 + test/test.ts-snapshots/forest-browser.md | 3 + test/test.ts-snapshots/forest-node.html | 91 +++ .../test.ts-snapshots/forest-node.md | 2 +- test/test.ts-snapshots/gantt-browser.html | 2 + test/test.ts-snapshots/gantt-browser.md | 3 + test/test.ts-snapshots/gantt-node.html | 73 +++ .../test.ts-snapshots/gantt-node.md | 4 +- test/test.ts-snapshots/multiple-browser.html | 9 + test/test.ts-snapshots/multiple-browser.md | 17 + test/test.ts-snapshots/multiple-node.html | 322 ++++++++++ .../test.ts-snapshots/multiple-node.md | 38 +- test/test.ts-snapshots/neutral-browser.html | 2 + test/test.ts-snapshots/neutral-browser.md | 3 + test/test.ts-snapshots/neutral-node.html | 91 +++ .../test.ts-snapshots/neutral-node.md | 2 +- .../test.ts-snapshots/no-mermaid-browser.html | 3 + .../test.ts-snapshots/no-mermaid-browser.md | 0 test/test.ts-snapshots/no-mermaid-node.html | 3 + test/test.ts-snapshots/no-mermaid-node.md | 5 + test/test.ts-snapshots/sequence-browser.html | 2 + test/test.ts-snapshots/sequence-browser.md | 3 + test/test.ts-snapshots/sequence-node.html | 74 +++ .../test.ts-snapshots/sequence-node.md | 12 +- test/test.ts-snapshots/simple-browser.html | 4 + test/test.ts-snapshots/simple-browser.md | 7 + test/test.ts-snapshots/simple-node.html | 93 +++ .../test.ts-snapshots/simple-node.md | 2 +- 66 files changed, 1559 insertions(+), 499 deletions(-) create mode 100644 browser.ts create mode 100644 playwright.config.ts delete mode 100644 test.ts rename {__fixtures__ => test/fixtures}/dark/input.md (100%) rename {__fixtures__ => test/fixtures}/dark/options.json (100%) rename {__fixtures__ => test/fixtures}/flowchart/input.md (100%) rename {__fixtures__ => test/fixtures}/fontawesome/input.md (100%) rename {__fixtures__ => test/fixtures}/forest/input.md (100%) rename {__fixtures__ => test/fixtures}/forest/options.json (100%) rename {__fixtures__ => test/fixtures}/gantt/input.md (100%) rename {__fixtures__ => test/fixtures}/multiple/input.md (100%) rename {__fixtures__ => test/fixtures}/neutral/input.md (100%) rename {__fixtures__ => test/fixtures}/neutral/options.json (100%) rename {__fixtures__ => test/fixtures}/no-mermaid/input.md (100%) rename {__fixtures__ => test/fixtures}/sequence/input.md (100%) rename {__fixtures__ => test/fixtures}/simple/input.md (100%) create mode 100644 test/runInBrowser.ts create mode 100644 test/test.ts create mode 100644 test/test.ts-snapshots/dark-browser.html create mode 100644 test/test.ts-snapshots/dark-browser.md create mode 100644 test/test.ts-snapshots/dark-node.html rename __fixtures__/dark/output.md => test/test.ts-snapshots/dark-node.md (95%) create mode 100644 test/test.ts-snapshots/flowchart-browser.html create mode 100644 test/test.ts-snapshots/flowchart-browser.md rename __snapshots__/rehype.html => test/test.ts-snapshots/flowchart-node.html (94%) rename __fixtures__/flowchart/output.md => test/test.ts-snapshots/flowchart-node.md (95%) create mode 100644 test/test.ts-snapshots/fontawesome-browser.html create mode 100644 test/test.ts-snapshots/fontawesome-browser.md create mode 100644 test/test.ts-snapshots/fontawesome-node.html rename __fixtures__/fontawesome/output.md => test/test.ts-snapshots/fontawesome-node.md (94%) create mode 100644 test/test.ts-snapshots/forest-browser.html create mode 100644 test/test.ts-snapshots/forest-browser.md create mode 100644 test/test.ts-snapshots/forest-node.html rename __fixtures__/forest/output.md => test/test.ts-snapshots/forest-node.md (95%) create mode 100644 test/test.ts-snapshots/gantt-browser.html create mode 100644 test/test.ts-snapshots/gantt-browser.md create mode 100644 test/test.ts-snapshots/gantt-node.html rename __fixtures__/gantt/output.md => test/test.ts-snapshots/gantt-node.md (96%) create mode 100644 test/test.ts-snapshots/multiple-browser.html create mode 100644 test/test.ts-snapshots/multiple-browser.md create mode 100644 test/test.ts-snapshots/multiple-node.html rename __fixtures__/multiple/output.md => test/test.ts-snapshots/multiple-node.md (94%) create mode 100644 test/test.ts-snapshots/neutral-browser.html create mode 100644 test/test.ts-snapshots/neutral-browser.md create mode 100644 test/test.ts-snapshots/neutral-node.html rename __fixtures__/neutral/output.md => test/test.ts-snapshots/neutral-node.md (95%) create mode 100644 test/test.ts-snapshots/no-mermaid-browser.html rename __fixtures__/no-mermaid/output.md => test/test.ts-snapshots/no-mermaid-browser.md (100%) create mode 100644 test/test.ts-snapshots/no-mermaid-node.html create mode 100644 test/test.ts-snapshots/no-mermaid-node.md create mode 100644 test/test.ts-snapshots/sequence-browser.html create mode 100644 test/test.ts-snapshots/sequence-browser.md create mode 100644 test/test.ts-snapshots/sequence-node.html rename __fixtures__/sequence/output.md => test/test.ts-snapshots/sequence-node.md (94%) create mode 100644 test/test.ts-snapshots/simple-browser.html create mode 100644 test/test.ts-snapshots/simple-browser.md create mode 100644 test/test.ts-snapshots/simple-node.html rename __fixtures__/simple/output.md => test/test.ts-snapshots/simple-node.md (95%) diff --git a/.c8rc.json b/.c8rc.json index 51d1e5e..0fc1f54 100644 --- a/.c8rc.json +++ b/.c8rc.json @@ -1,4 +1,5 @@ { "100": true, + "include": ["index.ts"], "reporter": ["html", "lcov", "text"] } diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 0f9d5c7..79fc355 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -1,2 +1,7 @@ extends: - remcohaszing +rules: + no-param-reassign: off + '@typescript-eslint/consistent-type-imports': + - error + - prefer: type-imports diff --git a/.gitignore b/.gitignore index 9047223..f773d47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ coverage/ dist/ node_modules/ +test-results/ *.d.ts *.js *.log diff --git a/.prettierignore b/.prettierignore index af2766f..14f0c47 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ -__fixtures__/*/output.md -__snapshots__/ +**/*-snapshots/* coverage/ dist/ diff --git a/README.md b/README.md index f6b32cc..87ec006 100644 --- a/README.md +++ b/README.md @@ -48,15 +48,22 @@ console.log(value); These options are passed to [`puppeteer.launch()`](https://pptr.dev/#?product=Puppeteer&show=api-puppeteerlaunchoptions). +- **Note**: This options is required in Node.js. In the browser this option is unused. + #### `svgo` These options are passed to the [SVGO](https://github.com/svg/svgo) constructor. Set to `null` to disable minifying using SVGO completely. +**Note**: This options is only supported in Node.js. In the browser this option is unused. + #### `mermaidOptions` The [mermaid options](https://mermaid-js.github.io/mermaid/#/Setup) to use. +**Note**: This options is only supported in Node.js. In the browser this option is unused. If you +this in a browser, call `mermaid.initialize()` manually. + ## License [MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing) diff --git a/browser.ts b/browser.ts new file mode 100644 index 0000000..856db9f --- /dev/null +++ b/browser.ts @@ -0,0 +1,38 @@ +import { fromParse5 } from 'hast-util-from-parse5'; +import { type Code, type Parent, type Root } from 'mdast'; +import mermaid from 'mermaid'; +import { parseFragment } from 'parse5'; +import { type Plugin } from 'unified'; +import { visit } from 'unist-util-visit'; + +// eslint-disable-next-line jsdoc/require-jsdoc +function transformer(ast: Root): void { + const instances: [string, number, Parent][] = []; + + visit(ast, { type: 'code', lang: 'mermaid' }, (node: Code, index, parent: Parent) => { + instances.push([node.value, index, parent]); + }); + + // Nothing to do. No need to start puppeteer in this case. + if (!instances.length) { + return; + } + + const results = instances.map(([code], index) => + // @ts-expect-error The mermaid types are wrong. + mermaid.render(`remark-mermaid-${index}`, code), + ); + + for (const [i, [, index, parent]] of instances.entries()) { + const value = results[i]; + parent.children.splice(index, 1, { + type: 'paragraph', + children: [{ type: 'html', value }], + data: { hChildren: [fromParse5(parseFragment(value))] }, + }); + } +} + +const remarkMermaid: Plugin<[], Root> = () => transformer; + +export default remarkMermaid; diff --git a/index.ts b/index.ts index f908aad..dc34c68 100644 --- a/index.ts +++ b/index.ts @@ -1,12 +1,12 @@ import { createRequire } from 'module'; import { fromParse5 } from 'hast-util-from-parse5'; -import { Code, Parent, Root } from 'mdast'; -import { Mermaid } from 'mermaid'; +import { type Code, type Parent, type Root } from 'mdast'; +import { type Mermaid } from 'mermaid'; import { parseFragment } from 'parse5'; -import puppeteer, { Browser, Page, PuppeteerLaunchOptions } from 'puppeteer-core'; -import { optimize, OptimizedSvg, OptimizeOptions } from 'svgo'; -import { Plugin } from 'unified'; +import puppeteer, { type Browser, type Page, type PuppeteerLaunchOptions } from 'puppeteer-core'; +import { optimize, type OptimizedSvg, type OptimizeOptions } from 'svgo'; +import { type Plugin } from 'unified'; import { visit } from 'unist-util-visit'; const mermaidScript = { @@ -76,7 +76,9 @@ export const defaultSVGOOptions: OptimizeOptions = { export interface RemarkMermaidOptions { /** - * Launc options to pass to puppeteer. + * Launch options to pass to puppeteer. + * + * **Note**: This options is required in Node.js. In the browser this option is unused. */ launchOptions: PuppeteerLaunchOptions; @@ -85,12 +87,17 @@ export interface RemarkMermaidOptions { * * Set to `null` explicitly to disable this. * + * **Note**: This options is only supported in Node.js. In the browser this option is unused. + * * @default defaultSVGOOptions */ svgo?: OptimizeOptions | null; /** * The mermaid options to use. + * + * **Note**: This options is only supported in Node.js. In the browser this option is unused. If + * you this in a browser, call `mermaid.initialize()` manually. */ mermaidOptions?: Parameters[0]; } @@ -98,11 +105,13 @@ export interface RemarkMermaidOptions { /** * @param options Options that may be used to tweak the output. */ -const remarkMermaid: Plugin<[RemarkMermaidOptions], Root> = ({ - launchOptions, - mermaidOptions = {}, - svgo = defaultSVGOOptions, -}) => { +const remarkMermaid: Plugin<[RemarkMermaidOptions?], Root> = (options) => { + if (!options?.launchOptions?.executablePath) { + throw new Error('The option `launchOptions.executablePath` is required when using Node.js'); + } + + const { launchOptions, mermaidOptions, svgo = defaultSVGOOptions } = options; + let browserPromise: Promise | undefined; let count = 0; @@ -135,14 +144,17 @@ const remarkMermaid: Plugin<[RemarkMermaidOptions], Root> = ({ results = await page.evaluate( // We can’t calculate coverage on this function, as it’s run by Chrome, not Node. /* c8 ignore start */ - (codes, initOptions) => - codes.map((code) => { - const id = 'a'; + (codes, initOptions) => { + if (initOptions) { mermaid.initialize(initOptions); + } + return codes.map((code) => { + const id = 'a'; const div = document.createElement('div'); div.innerHTML = mermaid.render(id, code); return div.innerHTML; - }), + }); + }, /* C8 ignore stop */ instances.map((instance) => instance[0]), mermaidOptions, diff --git a/package-lock.json b/package-lock.json index 7fa17e6..958d787 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@types/mdast": "^3.0.0", + "@types/mermaid": "^9.0.0", "@types/svgo": "^2.0.0", "hast-util-from-parse5": "^7.0.0", "mermaid": "^9.0.0", @@ -20,22 +21,20 @@ "unist-util-visit": "^4.0.0" }, "devDependencies": { - "@types/mermaid": "^8.0.0", + "@playwright/test": "^1.0.0", "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "c8": "^7.0.0", + "esbuild": "^0.15.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^6.0.0", "prettier": "^2.0.0", - "puppeteer": "^17.0.0", "rehype-stringify": "^9.0.0", "remark": "^14.0.0", "remark-rehype": "^10.0.0", "sinon": "^14.0.0", - "tsx": "^3.0.0", - "typescript": "^4.0.0", - "uvu": "^0.5.0" + "typescript": "^4.0.0" }, "engines": { "node": ">=14" @@ -55,9 +54,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.19.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", + "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", "dev": true, "peer": true, "engines": { @@ -183,40 +182,26 @@ "node": "^14 || ^16 || ^17 || ^18" } }, - "node_modules/@esbuild-kit/cjs-loader": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.3.3.tgz", - "integrity": "sha512-Rt4O1mXlPEDVxvjsHLgbtHVdUXYK9C1/6ThpQnt7FaXIjUOsI6qhHYMgALhNnlIMZffag44lXd6Dqgx3xALbpQ==", - "dev": true, - "dependencies": { - "@esbuild-kit/core-utils": "^2.1.0", - "get-tsconfig": "^4.1.0" - } - }, - "node_modules/@esbuild-kit/core-utils": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-2.3.0.tgz", - "integrity": "sha512-JL73zt/LN/qqziHuod4/bM2xBNNofDZu1cbwT6KIn6B11lA4cgDXkoSHOfNCbZMZOnh0Aqf0vW/gNQC+Z18hKQ==", - "dev": true, - "dependencies": { - "esbuild": "~0.15.4", - "source-map-support": "^0.5.21" - } - }, - "node_modules/@esbuild-kit/esm-loader": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.4.2.tgz", - "integrity": "sha512-N9dPKAj8WOx6djVnStgILWXip4fjDcBk9L7azO0/uQDpu8Ee0eaL78mkN4Acid9BzvNAKWwdYXFJZnsVahNEew==", + "node_modules/@esbuild/android-arm": { + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.9.tgz", + "integrity": "sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@esbuild-kit/core-utils": "^2.1.0", - "get-tsconfig": "^4.1.0" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.6.tgz", - "integrity": "sha512-hqmVU2mUjH6J2ZivHphJ/Pdse2ZD+uGCHK0uvsiLDk/JnSedEVj77CiVUnbMKuU4tih1TZZL8tG9DExQg/GZsw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.9.tgz", + "integrity": "sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==", "cpu": [ "loong64" ], @@ -230,9 +215,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.1.tgz", - "integrity": "sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.2.tgz", + "integrity": "sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -253,9 +238,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", - "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.5.tgz", + "integrity": "sha512-XVVDtp+dVvRxMoxSiSfasYaG02VEe1qH5cKgMQJWhol6HwzbcqoCMJi8dAGoYAO57jhUyhI6cWuRiTcRaDaYug==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -364,6 +349,22 @@ "node": ">= 8" } }, + "node_modules/@playwright/test": { + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.26.1.tgz", + "integrity": "sha512-bNxyZASVt2adSZ9gbD7NCydzcb5JaI0OR9hc7s+nmPeH604gwp0zp17NNpwXY4c8nvuBGQQ9oGDx72LE+cUWvw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "playwright-core": "1.26.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -451,17 +452,10 @@ "@types/unist": "*" } }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "dev": true - }, "node_modules/@types/mermaid": { - "version": "8.2.9", - "resolved": "https://registry.npmjs.org/@types/mermaid/-/mermaid-8.2.9.tgz", - "integrity": "sha512-f1i8fNoVFVJXedk+R7GcEk4KoOWzWAU3CzFqlVw1qWKktfsataBERezCz1pOdKy8Ec02ZdPQXGM7NU2lPHABYQ==", - "dev": true + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mermaid/-/mermaid-9.1.0.tgz", + "integrity": "sha512-rc8QqhveKAY7PouzY/p8ljS+eBSNCv7o79L97RSub/Ic2SQ34ph1Ng3s8wFLWVjvaEt6RLOWtSCsgYWd95NY8A==" }, "node_modules/@types/ms": { "version": "0.7.31", @@ -470,9 +464,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.7.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.14.tgz", - "integrity": "sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==" + "version": "18.7.23", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz", + "integrity": "sha512-DWNcCHolDq0ZKGizjx2DZjR/PqsYwAcYUJmfMWqtVU2MBMG5Mo+xFZrhGId5r/O5HOuMPyQEcM6KUBp5lBZZBg==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -524,16 +518,15 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.0.tgz", - "integrity": "sha512-X3In41twSDnYRES7hO2xna4ZC02SY05UN9sGW//eL1P5k4CKfvddsdC2hOq0O3+WU1wkCPQkiTY9mzSnXKkA0w==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.38.1.tgz", + "integrity": "sha512-ky7EFzPhqz3XlhS7vPOoMDaQnQMn+9o5ICR9CPr/6bw8HrFkzhMSxuA3gRfiJVvs7geYrSeawGJjZoZQKCOglQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.36.0", - "@typescript-eslint/type-utils": "5.36.0", - "@typescript-eslint/utils": "5.36.0", + "@typescript-eslint/scope-manager": "5.38.1", + "@typescript-eslint/type-utils": "5.38.1", + "@typescript-eslint/utils": "5.38.1", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", "regexpp": "^3.2.0", "semver": "^7.3.7", @@ -557,15 +550,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.36.0.tgz", - "integrity": "sha512-dlBZj7EGB44XML8KTng4QM0tvjI8swDh8MdpE5NX5iHWgWEfIuqSfSE+GPeCrCdj7m4tQLuevytd57jNDXJ2ZA==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.38.1.tgz", + "integrity": "sha512-LDqxZBVFFQnQRz9rUZJhLmox+Ep5kdUmLatLQnCRR6523YV+XhRjfYzStQ4MheFA8kMAfUlclHSbu+RKdRwQKw==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.36.0", - "@typescript-eslint/types": "5.36.0", - "@typescript-eslint/typescript-estree": "5.36.0", + "@typescript-eslint/scope-manager": "5.38.1", + "@typescript-eslint/types": "5.38.1", + "@typescript-eslint/typescript-estree": "5.38.1", "debug": "^4.3.4" }, "engines": { @@ -585,13 +578,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.36.0.tgz", - "integrity": "sha512-PZUC9sz0uCzRiuzbkh6BTec7FqgwXW03isumFVkuPw/Ug/6nbAqPUZaRy4w99WCOUuJTjhn3tMjsM94NtEj64g==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.38.1.tgz", + "integrity": "sha512-BfRDq5RidVU3RbqApKmS7RFMtkyWMM50qWnDAkKgQiezRtLKsoyRKIvz1Ok5ilRWeD9IuHvaidaLxvGx/2eqTQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.36.0", - "@typescript-eslint/visitor-keys": "5.36.0" + "@typescript-eslint/types": "5.38.1", + "@typescript-eslint/visitor-keys": "5.38.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -602,13 +595,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.36.0.tgz", - "integrity": "sha512-W/E3yJFqRYsjPljJ2gy0YkoqLJyViWs2DC6xHkXcWyhkIbCDdaVnl7mPLeQphVI+dXtY05EcXFzWLXhq8Mm/lQ==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.38.1.tgz", + "integrity": "sha512-UU3j43TM66gYtzo15ivK2ZFoDFKKP0k03MItzLdq0zV92CeGCXRfXlfQX5ILdd4/DSpHkSjIgLLLh1NtkOJOAw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.36.0", - "@typescript-eslint/utils": "5.36.0", + "@typescript-eslint/typescript-estree": "5.38.1", + "@typescript-eslint/utils": "5.38.1", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -629,9 +622,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.36.0.tgz", - "integrity": "sha512-3JJuLL1r3ljRpFdRPeOtgi14Vmpx+2JcR6gryeORmW3gPBY7R1jNYoq4yBN1L//ONZjMlbJ7SCIwugOStucYiQ==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.38.1.tgz", + "integrity": "sha512-QTW1iHq1Tffp9lNfbfPm4WJabbvpyaehQ0SrvVK2yfV79SytD9XDVxqiPvdrv2LK7DGSFo91TB2FgWanbJAZXg==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -642,13 +635,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.0.tgz", - "integrity": "sha512-EW9wxi76delg/FS9+WV+fkPdwygYzRrzEucdqFVWXMQWPOjFy39mmNNEmxuO2jZHXzSQTXzhxiU1oH60AbIw9A==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.38.1.tgz", + "integrity": "sha512-99b5e/Enoe8fKMLdSuwrfH/C0EIbpUWmeEKHmQlGZb8msY33qn1KlkFww0z26o5Omx7EVjzVDCWEfrfCDHfE7g==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.36.0", - "@typescript-eslint/visitor-keys": "5.36.0", + "@typescript-eslint/types": "5.38.1", + "@typescript-eslint/visitor-keys": "5.38.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -669,15 +662,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.36.0.tgz", - "integrity": "sha512-wAlNhXXYvAAUBbRmoJDywF/j2fhGLBP4gnreFvYvFbtlsmhMJ4qCKVh/Z8OP4SgGR3xbciX2nmG639JX0uw1OQ==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.38.1.tgz", + "integrity": "sha512-oIuUiVxPBsndrN81oP8tXnFa/+EcZ03qLqPDfSZ5xIJVm7A9V0rlkQwwBOAGtrdN70ZKDlKv+l1BeT4eSFxwXA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.36.0", - "@typescript-eslint/types": "5.36.0", - "@typescript-eslint/typescript-estree": "5.36.0", + "@typescript-eslint/scope-manager": "5.38.1", + "@typescript-eslint/types": "5.38.1", + "@typescript-eslint/typescript-estree": "5.38.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -693,12 +686,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.0.tgz", - "integrity": "sha512-pdqSJwGKueOrpjYIex0T39xarDt1dn4p7XJ+6FqBWugNQwXlNGC5h62qayAIYZ/RPPtD+ButDWmpXT1eGtiaYg==", + "version": "5.38.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.38.1.tgz", + "integrity": "sha512-bSHr1rRxXt54+j2n4k54p4fj8AHJ49VDWtjpImOpzQj4qjAiOpPni+V1Tyajh19Api1i844F757cur8wH3YvOA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.36.0", + "@typescript-eslint/types": "5.38.1", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -935,12 +928,6 @@ "node": "*" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", @@ -1088,9 +1075,9 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" }, "node_modules/ci-info": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", - "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz", + "integrity": "sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug==", "dev": true, "peer": true }, @@ -2031,9 +2018,9 @@ } }, "node_modules/devtools-protocol": { - "version": "0.0.1019158", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1019158.tgz", - "integrity": "sha512-wvq+KscQ7/6spEV7czhnZc9RM/woz1AY+/Vpd8/h2HFMwJSdTliu7f/yr1A6vDdJfKICZsShqsYpEQbdhg8AFQ==" + "version": "0.0.1036444", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1036444.tgz", + "integrity": "sha512-0y4f/T8H9lsESV9kKP1HDUXgHxCdniFeJh6Erq+FbdOEvp/Ydp9t8kcAAM5gOd17pMrTDlFWntoHtzzeTUWKNw==" }, "node_modules/diff": { "version": "5.1.0", @@ -2115,9 +2102,9 @@ } }, "node_modules/dompurify": { - "version": "2.3.10", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.10.tgz", - "integrity": "sha512-o7Fg/AgC7p/XpKjf/+RC3Ok6k4St5F7Q6q6+Nnm3p2zGWioAY6dh0CbbuwOhH2UcSzKsdniE/YnE2/92JcsA+g==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.0.tgz", + "integrity": "sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA==" }, "node_modules/domutils": { "version": "2.8.0", @@ -2147,9 +2134,9 @@ } }, "node_modules/entities": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.1.tgz", - "integrity": "sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", + "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", "engines": { "node": ">=0.12" }, @@ -2168,9 +2155,9 @@ } }, "node_modules/es-abstract": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", - "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.3.tgz", + "integrity": "sha512-AyrnaKVpMzljIdwjzrj+LxGmj8ik2LckwXacHqrJJ/jxz6dDDBcZ7I7nlHM0FvEW8MfbWJwOd+yT2XzYW49Frw==", "dev": true, "peer": true, "dependencies": { @@ -2178,22 +2165,23 @@ "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.1.1", + "get-intrinsic": "^1.1.3", "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "is-callable": "^1.2.6", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.2", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", "string.prototype.trimend": "^1.0.5", "string.prototype.trimstart": "^1.0.5", "unbox-primitive": "^1.0.2" @@ -2234,9 +2222,9 @@ } }, "node_modules/esbuild": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.6.tgz", - "integrity": "sha512-sgLOv3l4xklvXzzczhRwKRotyrfyZ2i1fCS6PTOLPd9wevDPArGU8HFtHrHCOcsMwTjLjzGm15gvC8uxVzQf+w==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.9.tgz", + "integrity": "sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==", "dev": true, "hasInstallScript": true, "bin": { @@ -2246,33 +2234,34 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/linux-loong64": "0.15.6", - "esbuild-android-64": "0.15.6", - "esbuild-android-arm64": "0.15.6", - "esbuild-darwin-64": "0.15.6", - "esbuild-darwin-arm64": "0.15.6", - "esbuild-freebsd-64": "0.15.6", - "esbuild-freebsd-arm64": "0.15.6", - "esbuild-linux-32": "0.15.6", - "esbuild-linux-64": "0.15.6", - "esbuild-linux-arm": "0.15.6", - "esbuild-linux-arm64": "0.15.6", - "esbuild-linux-mips64le": "0.15.6", - "esbuild-linux-ppc64le": "0.15.6", - "esbuild-linux-riscv64": "0.15.6", - "esbuild-linux-s390x": "0.15.6", - "esbuild-netbsd-64": "0.15.6", - "esbuild-openbsd-64": "0.15.6", - "esbuild-sunos-64": "0.15.6", - "esbuild-windows-32": "0.15.6", - "esbuild-windows-64": "0.15.6", - "esbuild-windows-arm64": "0.15.6" + "@esbuild/android-arm": "0.15.9", + "@esbuild/linux-loong64": "0.15.9", + "esbuild-android-64": "0.15.9", + "esbuild-android-arm64": "0.15.9", + "esbuild-darwin-64": "0.15.9", + "esbuild-darwin-arm64": "0.15.9", + "esbuild-freebsd-64": "0.15.9", + "esbuild-freebsd-arm64": "0.15.9", + "esbuild-linux-32": "0.15.9", + "esbuild-linux-64": "0.15.9", + "esbuild-linux-arm": "0.15.9", + "esbuild-linux-arm64": "0.15.9", + "esbuild-linux-mips64le": "0.15.9", + "esbuild-linux-ppc64le": "0.15.9", + "esbuild-linux-riscv64": "0.15.9", + "esbuild-linux-s390x": "0.15.9", + "esbuild-netbsd-64": "0.15.9", + "esbuild-openbsd-64": "0.15.9", + "esbuild-sunos-64": "0.15.9", + "esbuild-windows-32": "0.15.9", + "esbuild-windows-64": "0.15.9", + "esbuild-windows-arm64": "0.15.9" } }, "node_modules/esbuild-android-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.6.tgz", - "integrity": "sha512-Z1CHSgB1crVQi2LKSBwSkpaGtaloVz0ZIYcRMsvHc3uSXcR/x5/bv9wcZspvH/25lIGTaViosciS/NS09ERmVA==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.9.tgz", + "integrity": "sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==", "cpu": [ "x64" ], @@ -2286,9 +2275,9 @@ } }, "node_modules/esbuild-android-arm64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.6.tgz", - "integrity": "sha512-mvM+gqNxqKm2pCa3dnjdRzl7gIowuc4ga7P7c3yHzs58Im8v/Lfk1ixSgQ2USgIywT48QWaACRa3F4MG7djpSw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.9.tgz", + "integrity": "sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==", "cpu": [ "arm64" ], @@ -2302,9 +2291,9 @@ } }, "node_modules/esbuild-darwin-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.6.tgz", - "integrity": "sha512-BsfVt3usScAfGlXJiGtGamwVEOTM8AiYiw1zqDWhGv6BncLXCnTg1As+90mxWewdTZKq3iIy8s9g8CKkrrAXVw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.9.tgz", + "integrity": "sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==", "cpu": [ "x64" ], @@ -2318,9 +2307,9 @@ } }, "node_modules/esbuild-darwin-arm64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.6.tgz", - "integrity": "sha512-CnrAeJaEpPakUobhqO4wVSA4Zm6TPaI5UY4EsI62j9mTrjIyQPXA1n4Ju6Iu5TVZRnEqV6q8blodgYJ6CJuwCA==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.9.tgz", + "integrity": "sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==", "cpu": [ "arm64" ], @@ -2334,9 +2323,9 @@ } }, "node_modules/esbuild-freebsd-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.6.tgz", - "integrity": "sha512-+qFdmqi+jkAsxsNJkaWVrnxEUUI50nu6c3MBVarv3RCDCbz7ZS1a4ZrdkwEYFnKcVWu6UUE0Kkb1SQ1yGEG6sg==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.9.tgz", + "integrity": "sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==", "cpu": [ "x64" ], @@ -2350,9 +2339,9 @@ } }, "node_modules/esbuild-freebsd-arm64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.6.tgz", - "integrity": "sha512-KtQkQOhnNciXm2yrTYZMD3MOm2zBiiwFSU+dkwNbcfDumzzUprr1x70ClTdGuZwieBS1BM/k0KajRQX7r504Xw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.9.tgz", + "integrity": "sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==", "cpu": [ "arm64" ], @@ -2366,9 +2355,9 @@ } }, "node_modules/esbuild-linux-32": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.6.tgz", - "integrity": "sha512-IAkDNz3TpxwISTGVdQijwyHBZrbFgLlRi5YXcvaEHtgbmayLSDcJmH5nV1MFgo/x2QdKcHBkOYHdjhKxUAcPwg==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.9.tgz", + "integrity": "sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==", "cpu": [ "ia32" ], @@ -2382,9 +2371,9 @@ } }, "node_modules/esbuild-linux-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.6.tgz", - "integrity": "sha512-gQPksyrEYfA4LJwyfTQWAZaVZCx4wpaLrSzo2+Xc9QLC+i/sMWmX31jBjrn4nLJCd79KvwCinto36QC7BEIU/A==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.9.tgz", + "integrity": "sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==", "cpu": [ "x64" ], @@ -2398,9 +2387,9 @@ } }, "node_modules/esbuild-linux-arm": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.6.tgz", - "integrity": "sha512-xZ0Bq2aivsthDjA/ytQZzxrxIZbG0ATJYMJxNeOIBc1zUjpbVpzBKgllOZMsTSXMHFHGrow6TnCcgwqY0+oEoQ==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.9.tgz", + "integrity": "sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==", "cpu": [ "arm" ], @@ -2414,9 +2403,9 @@ } }, "node_modules/esbuild-linux-arm64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.6.tgz", - "integrity": "sha512-aovDkclFa6C9EdZVBuOXxqZx83fuoq8097xZKhEPSygwuy4Lxs8J4anHG7kojAsR+31lfUuxzOo2tHxv7EiNHA==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.9.tgz", + "integrity": "sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==", "cpu": [ "arm64" ], @@ -2430,9 +2419,9 @@ } }, "node_modules/esbuild-linux-mips64le": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.6.tgz", - "integrity": "sha512-wVpW8wkWOGizsCqCwOR/G3SHwhaecpGy3fic9BF1r7vq4djLjUcA8KunDaBCjJ6TgLQFhJ98RjDuyEf8AGjAvw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.9.tgz", + "integrity": "sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==", "cpu": [ "mips64el" ], @@ -2446,9 +2435,9 @@ } }, "node_modules/esbuild-linux-ppc64le": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.6.tgz", - "integrity": "sha512-z6w6gsPH/Y77uchocluDC8tkCg9rfkcPTePzZKNr879bF4tu7j9t255wuNOCE396IYEGxY7y8u2HJ9i7kjCLVw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.9.tgz", + "integrity": "sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==", "cpu": [ "ppc64" ], @@ -2462,9 +2451,9 @@ } }, "node_modules/esbuild-linux-riscv64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.6.tgz", - "integrity": "sha512-pfK/3MJcmbfU399TnXW5RTPS1S+ID6ra+CVj9TFZ2s0q9Ja1F5A1VirUUvViPkjiw+Kq3zveyn6U09Wg1zJXrw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.9.tgz", + "integrity": "sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==", "cpu": [ "riscv64" ], @@ -2478,9 +2467,9 @@ } }, "node_modules/esbuild-linux-s390x": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.6.tgz", - "integrity": "sha512-OZeeDu32liefcwAE63FhVqM4heWTC8E3MglOC7SK0KYocDdY/6jyApw0UDkDHlcEK9mW6alX/SH9r3PDjcCo/Q==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.9.tgz", + "integrity": "sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==", "cpu": [ "s390x" ], @@ -2494,9 +2483,9 @@ } }, "node_modules/esbuild-netbsd-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.6.tgz", - "integrity": "sha512-kaxw61wcHMyiEsSsi5ut1YYs/hvTC2QkxJwyRvC2Cnsz3lfMLEu8zAjpBKWh9aU/N0O/gsRap4wTur5GRuSvBA==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.9.tgz", + "integrity": "sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==", "cpu": [ "x64" ], @@ -2510,9 +2499,9 @@ } }, "node_modules/esbuild-openbsd-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.6.tgz", - "integrity": "sha512-CuoY60alzYfIZapUHqFXqXbj88bbRJu8Fp9okCSHRX2zWIcGz4BXAHXiG7dlCye5nFVrY72psesLuWdusyf2qw==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.9.tgz", + "integrity": "sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==", "cpu": [ "x64" ], @@ -2526,9 +2515,9 @@ } }, "node_modules/esbuild-sunos-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.6.tgz", - "integrity": "sha512-1ceefLdPWcd1nW/ZLruPEYxeUEAVX0YHbG7w+BB4aYgfknaLGotI/ZvPWUZpzhC8l1EybrVlz++lm3E6ODIJOg==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.9.tgz", + "integrity": "sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==", "cpu": [ "x64" ], @@ -2542,9 +2531,9 @@ } }, "node_modules/esbuild-windows-32": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.6.tgz", - "integrity": "sha512-pBqdOsKqCD5LRYiwF29PJRDJZi7/Wgkz46u3d17MRFmrLFcAZDke3nbdDa1c8YgY78RiemudfCeAemN8EBlIpA==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.9.tgz", + "integrity": "sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==", "cpu": [ "ia32" ], @@ -2558,9 +2547,9 @@ } }, "node_modules/esbuild-windows-64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.6.tgz", - "integrity": "sha512-KpPOh4aTOo//g9Pk2oVAzXMpc9Sz9n5A9sZTmWqDSXCiiachfFhbuFlsKBGATYCVitXfmBIJ4nNYYWSOdz4hQg==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.9.tgz", + "integrity": "sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==", "cpu": [ "x64" ], @@ -2574,9 +2563,9 @@ } }, "node_modules/esbuild-windows-arm64": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.6.tgz", - "integrity": "sha512-DB3G2x9OvFEa00jV+OkDBYpufq5x/K7a6VW6E2iM896DG4ZnAvJKQksOsCPiM1DUaa+DrijXAQ/ZOcKAqf/3Hg==", + "version": "0.15.9", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.9.tgz", + "integrity": "sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==", "cpu": [ "arm64" ], @@ -2611,13 +2600,13 @@ } }, "node_modules/eslint": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.0.tgz", - "integrity": "sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA==", + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.24.0.tgz", + "integrity": "sha512-dWFaPhGhTAiPcCgm3f6LI2MBWbogMnTJzFBbhXVRQDJPkr9pGZvVjlVfXd+vyDcWPA2Ic9L2AXPIQM0+vk/cSQ==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.3.1", - "@humanwhocodes/config-array": "^0.10.4", + "@eslint/eslintrc": "^1.3.2", + "@humanwhocodes/config-array": "^0.10.5", "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "@humanwhocodes/module-importer": "^1.0.1", "ajv": "^6.10.0", @@ -2635,7 +2624,6 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.15.0", "globby": "^11.1.0", @@ -2644,6 +2632,7 @@ "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -2942,9 +2931,9 @@ } }, "node_modules/eslint-plugin-n": { - "version": "15.2.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.5.tgz", - "integrity": "sha512-8+BYsqiyZfpu6NXmdLOXVUfk8IocpCjpd8nMRRH0A9ulrcemhb2VI9RSJMEy5udx++A/YcVPD11zT8hpFq368g==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.3.0.tgz", + "integrity": "sha512-IyzPnEWHypCWasDpxeJnim60jhlumbmq0pubL6IOcnk8u2y53s5QfT8JnXy7skjHJ44yWHRb11PLtDHuu1kg/Q==", "dev": true, "peer": true, "dependencies": { @@ -3223,9 +3212,9 @@ "peer": true }, "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3361,20 +3350,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3401,12 +3376,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", @@ -3427,9 +3396,9 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", - "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", + "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", "dev": true, "peer": true, "dependencies": { @@ -3472,15 +3441,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-tsconfig": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.2.0.tgz", - "integrity": "sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -3976,9 +3936,9 @@ } }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "peer": true, "engines": { @@ -4241,6 +4201,12 @@ "node": ">=8" } }, + "node_modules/js-sdsl": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.4.tgz", + "integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==", + "dev": true + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4454,16 +4420,14 @@ } }, "node_modules/mdast-util-to-hast": { - "version": "12.2.1", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.2.1.tgz", - "integrity": "sha512-dyindR2P7qOqXO1hQirZeGtVbiX7xlNQbw7gGaAwN4A1dh4+X8xU/JyYmRoyB8Fu1uPXzp7mlL5QwW7k+knvgA==", + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.2.3.tgz", + "integrity": "sha512-AN1LP/bYd8GxSljYiu76/kL14Dfi4SJNBbn4XDyzJzZIndVk0vBE4iQhvR1vfhYRK+4XEgmeteDCJriDAhvABg==", "dev": true, "dependencies": { "@types/hast": "^2.0.0", "@types/mdast": "^3.0.0", - "@types/mdurl": "^1.0.0", "mdast-util-definitions": "^5.0.0", - "mdurl": "^1.0.0", "micromark-util-sanitize-uri": "^1.0.0", "trim-lines": "^3.0.0", "unist-builder": "^3.0.0", @@ -4521,12 +4485,6 @@ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==" }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4537,15 +4495,15 @@ } }, "node_modules/mermaid": { - "version": "9.1.6", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-9.1.6.tgz", - "integrity": "sha512-oBuQk7s55wQgEgH/AK0GYY8U0kBqOIGK9QlJL+VYxh+1kZQtU9tNwoy0gWCfBJDaFIRdfpc/fm9PagaIXg6XFQ==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-9.1.7.tgz", + "integrity": "sha512-MRVHXy5FLjnUQUG7YS3UN9jEN6FXCJbFCXVGJQjVIbiR6Vhw0j/6pLIjqsiah9xoHmQU6DEaKOvB3S1g/1nBPA==", "dependencies": { "@braintree/sanitize-url": "^6.0.0", "d3": "^7.0.0", "dagre": "^0.8.5", "dagre-d3": "^0.6.4", - "dompurify": "2.3.10", + "dompurify": "2.4.0", "graphlib": "^2.1.8", "khroma": "^2.0.0", "moment-mini": "2.24.0", @@ -5298,11 +5256,11 @@ } }, "node_modules/parse5": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz", - "integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz", + "integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==", "dependencies": { - "entities": "^4.3.0" + "entities": "^4.4.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -5381,6 +5339,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/playwright-core": { + "version": "1.26.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.26.1.tgz", + "integrity": "sha512-hzFchhhxnEiPc4qVPs9q2ZR+5eKNifY2hQDHtg1HnTTUuphYCBP8ZRb2si+B1TR7BHirgXaPi48LIye5SgrLAA==", + "dev": true, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -5468,37 +5438,14 @@ "node": ">=6" } }, - "node_modules/puppeteer": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-17.0.0.tgz", - "integrity": "sha512-T2rdzlPxnPezF218kywFP3O+0YI5/8Kl8riNUicGb+KuMyDTrqRjhSOSDp6coQ1T4QYPBARTFp4EMBepMOzAQA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "cross-fetch": "3.1.5", - "debug": "4.3.4", - "devtools-protocol": "0.0.1019158", - "extract-zip": "2.0.1", - "https-proxy-agent": "5.0.1", - "progress": "2.0.3", - "proxy-from-env": "1.1.0", - "rimraf": "3.0.2", - "tar-fs": "2.1.1", - "unbzip2-stream": "1.4.3", - "ws": "8.8.1" - }, - "engines": { - "node": ">=14.1.0" - } - }, "node_modules/puppeteer-core": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-17.0.0.tgz", - "integrity": "sha512-uPXO+9ERGm5qEudVTUOgret+WTcvb8l6W6ZIX+ZEW295hcRQqRy8kQqT0f/89KJzGrC4cn9Kui5m+azYjEM2DA==", + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-17.1.3.tgz", + "integrity": "sha512-gm3d5fTVEc+h7jVtT3Y1k8OL1awaOzln44UfsJhUJKH/tyO/wn/zOxyAHTQt9aX/yo37IS0dfisU3i3P8qvZnw==", "dependencies": { "cross-fetch": "3.1.5", "debug": "4.3.4", - "devtools-protocol": "0.0.1019158", + "devtools-protocol": "0.0.1036444", "extract-zip": "2.0.1", "https-proxy-agent": "5.0.1", "progress": "2.0.3", @@ -5988,6 +5935,21 @@ "regexp-tree": "~0.1.1" } }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -6085,16 +6047,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/space-separated-tokens": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.1.tgz", @@ -6270,9 +6222,9 @@ } }, "node_modules/stylis": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.1.tgz", - "integrity": "sha512-lVrM/bNdhVX2OgBFNa2YJ9Lxj7kPzylieHd3TNjuGE0Re9JB7joL5VUKOVH1kdNNJTgGPpT8hmwIAPLaSyEVFQ==" + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.2.tgz", + "integrity": "sha512-Nn2CCrG2ZaFziDxaZPN43CXqn+j7tcdjPFCkRBkFue8QYXC2HdEwnw5TCBo4yQZ2WxKYeSi0fdoOrtEqgDrXbA==" }, "node_modules/supports-color": { "version": "7.2.0", @@ -6440,23 +6392,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tsx": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.9.0.tgz", - "integrity": "sha512-ofxsE+qjqCYYq4UBt5khglvb+ESgxef1YpuNcdQI92kvcAT2tZVrnSK3g4bRXTUhLmKHcC5q8vIZA47os/stng==", - "dev": true, - "dependencies": { - "@esbuild-kit/cjs-loader": "^2.3.3", - "@esbuild-kit/core-utils": "^2.1.0", - "@esbuild-kit/esm-loader": "^2.4.2" - }, - "bin": { - "tsx": "dist/cli.js" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -6491,9 +6426,9 @@ } }, "node_modules/typescript": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", - "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", + "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -6690,9 +6625,9 @@ } }, "node_modules/vfile": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.4.tgz", - "integrity": "sha512-KI+7cnst03KbEyN1+JE504zF5bJBZa+J+CrevLeyIMq0aPU681I2rQ5p4PlnQ6exFtWiUrg26QUdFMnAKR6PIw==", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.5.tgz", + "integrity": "sha512-U1ho2ga33eZ8y8pkbQLH54uKqGhFJ6GYIHnnG5AhRpAh3OWjkrRHKa/KogbmQn8We+c0KVV3rTOgR9V/WowbXQ==", "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", diff --git a/package.json b/package.json index 128ec44..654a6fc 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,21 @@ "name": "remark-mermaidjs", "version": "3.0.0", "description": "A remark plugin to render mermaid diagrams using puppeteer", - "exports": "./index.js", + "exports": { + "browser": "./browser.js", + "types": "./index.d.ts", + "default": "./index.js" + }, "type": "module", "files": [ + "browser.js", "index.d.ts", "index.html", "index.js" ], "scripts": { "prepack": "tsc --noEmit false", - "start": "tsx watch test.ts", - "test": "c8 tsx test.ts" + "test": "c8 playwright test" }, "author": "Remco Haszing ", "license": "MIT", @@ -38,6 +42,7 @@ }, "dependencies": { "@types/mdast": "^3.0.0", + "@types/mermaid": "^9.0.0", "@types/svgo": "^2.0.0", "hast-util-from-parse5": "^7.0.0", "mermaid": "^9.0.0", @@ -48,21 +53,19 @@ "unist-util-visit": "^4.0.0" }, "devDependencies": { - "@types/mermaid": "^8.0.0", + "@playwright/test": "^1.0.0", "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "c8": "^7.0.0", + "esbuild": "^0.15.0", "eslint": "^8.0.0", "eslint-config-remcohaszing": "^6.0.0", "prettier": "^2.0.0", - "puppeteer": "^17.0.0", "rehype-stringify": "^9.0.0", "remark": "^14.0.0", "remark-rehype": "^10.0.0", "sinon": "^14.0.0", - "tsx": "^3.0.0", - "typescript": "^4.0.0", - "uvu": "^0.5.0" + "typescript": "^4.0.0" } } diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..870ec4d --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,24 @@ +import { type PlaywrightTestConfig } from '@playwright/test'; +import { serve } from 'esbuild'; + +const { port } = await serve( + { servedir: 'test' }, + { + bundle: true, + entryPoints: ['./test/runInBrowser.ts'], + format: 'esm', + platform: 'browser', + }, +); + +const config: PlaywrightTestConfig = { + testMatch: /test\/test\.ts$/, + metadata: {}, + webServer: { + command: '', + port, + reuseExistingServer: true, + }, +}; + +export default config; diff --git a/test.ts b/test.ts deleted file mode 100644 index 1e87895..0000000 --- a/test.ts +++ /dev/null @@ -1,104 +0,0 @@ -import { readdir, readFile, writeFile } from 'fs/promises'; -import process from 'process'; - -import { executablePath } from 'puppeteer'; -import puppeteer from 'puppeteer-core'; -import rehypeStringify from 'rehype-stringify'; -import { remark } from 'remark'; -import remarkRehype from 'remark-rehype'; -import sinon from 'sinon'; -import { test } from 'uvu'; -import * as assert from 'uvu/assert'; - -import remarkMermaid, { defaultSVGOOptions, RemarkMermaidOptions } from './index.js'; - -const fixtures = new URL('__fixtures__/', import.meta.url); -const launchOptions = { - executablePath: executablePath(), -}; - -test.after.each(() => { - sinon.restore(); -}); - -for (const name of await readdir(fixtures)) { - test(name, async () => { - const fixture = new URL(`${name}/`, fixtures); - const actual = await readFile(new URL('input.md', fixture)); - const expectedPath = new URL('output.md', fixture); - const expected = await readFile(new URL('output.md', fixture), 'utf8'); - let options: RemarkMermaidOptions = { - svgo: defaultSVGOOptions, - launchOptions, - }; - try { - options = JSON.parse(await readFile(new URL('options.json', fixture), 'utf8')); - options.launchOptions = launchOptions; - } catch { - // This test case uses default options. - } - const { value } = await remark().use(remarkMermaid, options).process(actual); - if (process.argv.includes('write') && value !== expected) { - await writeFile(expectedPath, value); - } - assert.is(value, expected); - }); -} - -const markdown = ` -\`\`\`mermaid -graph TD; - A-->B; -\`\`\` -`; - -test('should not launch the browser if no graphs are defined', async () => { - const processor = remark().use(remarkMermaid, { launchOptions }); - const launch = sinon.spy(puppeteer, 'launch'); - await processor.process('```js\n```'); - sinon.assert.notCalled(launch); -}); - -test('should share the browser for concurrent calls', async () => { - const processor = remark().use(remarkMermaid, { launchOptions }); - const launch = sinon.spy(puppeteer, 'launch'); - await Promise.all( - Array.from({ length: 3 }) - .fill(markdown) - .map((content) => processor.process(content)), - ); - sinon.assert.calledOnce(launch); -}); - -test('should close the browser if no more files are being processed', async () => { - const processor = remark().use(remarkMermaid, { launchOptions }); - const launch = sinon.spy(puppeteer, 'launch'); - for (const content of Array.from({ length: 3 }).fill(markdown)) { - await processor.process(content); - } - sinon.assert.calledThrice(launch); -}); - -test('should output a remark-rehype compatible ast', async () => { - const processor = remark() - .use(remarkMermaid, { launchOptions }) - .use(remarkRehype) - .use(rehypeStringify); - const { value } = await processor.process(` -\`\`\`mermaid -graph TD; - A-->B; - A-->C; - B-->D; - C-->D; -\`\`\` -`); - const expectedPath = new URL('__snapshots__/rehype.html', import.meta.url); - const expected = await readFile(expectedPath, 'utf8'); - if (process.argv.includes('write') && value !== expected) { - await writeFile(expectedPath, value); - } - assert.is(value, expected); -}); - -test.run(); diff --git a/__fixtures__/dark/input.md b/test/fixtures/dark/input.md similarity index 100% rename from __fixtures__/dark/input.md rename to test/fixtures/dark/input.md diff --git a/__fixtures__/dark/options.json b/test/fixtures/dark/options.json similarity index 100% rename from __fixtures__/dark/options.json rename to test/fixtures/dark/options.json diff --git a/__fixtures__/flowchart/input.md b/test/fixtures/flowchart/input.md similarity index 100% rename from __fixtures__/flowchart/input.md rename to test/fixtures/flowchart/input.md diff --git a/__fixtures__/fontawesome/input.md b/test/fixtures/fontawesome/input.md similarity index 100% rename from __fixtures__/fontawesome/input.md rename to test/fixtures/fontawesome/input.md diff --git a/__fixtures__/forest/input.md b/test/fixtures/forest/input.md similarity index 100% rename from __fixtures__/forest/input.md rename to test/fixtures/forest/input.md diff --git a/__fixtures__/forest/options.json b/test/fixtures/forest/options.json similarity index 100% rename from __fixtures__/forest/options.json rename to test/fixtures/forest/options.json diff --git a/__fixtures__/gantt/input.md b/test/fixtures/gantt/input.md similarity index 100% rename from __fixtures__/gantt/input.md rename to test/fixtures/gantt/input.md diff --git a/__fixtures__/multiple/input.md b/test/fixtures/multiple/input.md similarity index 100% rename from __fixtures__/multiple/input.md rename to test/fixtures/multiple/input.md diff --git a/__fixtures__/neutral/input.md b/test/fixtures/neutral/input.md similarity index 100% rename from __fixtures__/neutral/input.md rename to test/fixtures/neutral/input.md diff --git a/__fixtures__/neutral/options.json b/test/fixtures/neutral/options.json similarity index 100% rename from __fixtures__/neutral/options.json rename to test/fixtures/neutral/options.json diff --git a/__fixtures__/no-mermaid/input.md b/test/fixtures/no-mermaid/input.md similarity index 100% rename from __fixtures__/no-mermaid/input.md rename to test/fixtures/no-mermaid/input.md diff --git a/__fixtures__/sequence/input.md b/test/fixtures/sequence/input.md similarity index 100% rename from __fixtures__/sequence/input.md rename to test/fixtures/sequence/input.md diff --git a/__fixtures__/simple/input.md b/test/fixtures/simple/input.md similarity index 100% rename from __fixtures__/simple/input.md rename to test/fixtures/simple/input.md diff --git a/test/runInBrowser.ts b/test/runInBrowser.ts new file mode 100644 index 0000000..6eccd74 --- /dev/null +++ b/test/runInBrowser.ts @@ -0,0 +1,22 @@ +import rehypeStringify from 'rehype-stringify'; +import { remark } from 'remark'; +import remarkRehype from 'remark-rehype'; + +import remarkMermaid from '../browser.js'; + +/** + * Process a fixture using remark and remark-mermaidjs. + * + * This function is run in the browser. + * + * @param name The name of the fixture to process. + * @returns A tuple of the file processed to both markdown and HTML. + */ +export async function processFixture(name: string): Promise<[string, string]> { + const response = await fetch(`fixtures/${name}/input.md`); + const original = await response.text(); + const processor = remark().use(remarkMermaid); + const asMarkdown = processor.processSync(original); + const asHTML = processor().use(remarkRehype).use(rehypeStringify).processSync(original); + return [asMarkdown.value as string, asHTML.value as string]; +} diff --git a/test/test.ts b/test/test.ts new file mode 100644 index 0000000..7f602cc --- /dev/null +++ b/test/test.ts @@ -0,0 +1,108 @@ +import { readdir, readFile } from 'fs/promises'; + +import { chromium, expect, test } from '@playwright/test'; +import puppeteer from 'puppeteer-core'; +import rehypeStringify from 'rehype-stringify'; +import { remark } from 'remark'; +import remarkRehype from 'remark-rehype'; +import sinon from 'sinon'; + +import remarkMermaid, { defaultSVGOOptions, type RemarkMermaidOptions } from '../index.js'; + +const fixtures = new URL('fixtures/', import.meta.url); +const fixtureNames = await readdir(fixtures); +const launchOptions = { + executablePath: chromium.executablePath(), +}; +const markdown = ` +\`\`\`mermaid +graph TD; +A-->B; +\`\`\` +`; + +test.describe.parallel('browser', () => { + for (const name of fixtureNames) { + test(name, async ({ page }, testInfo) => { + testInfo.snapshotSuffix = 'browser'; + await page.goto('/'); + + const result = await page.evaluate(async (fixtureName) => { + const { processFixture } = await import('./runInBrowser.js'); + + return processFixture(fixtureName); + }, name); + + expect(result[0]).toMatchSnapshot({ name: `${name}.md` }); + expect(result[1]).toMatchSnapshot({ name: `${name}.html` }); + }); + } +}); + +test.describe.parallel('node', () => { + for (const name of fixtureNames) { + // eslint-disable-next-line no-empty-pattern + test(name, async ({}, testInfo) => { + testInfo.snapshotSuffix = 'node'; + const fixture = new URL(`${name}/`, fixtures); + const original = await readFile(new URL('input.md', fixture)); + let options: RemarkMermaidOptions = { + svgo: defaultSVGOOptions, + launchOptions, + }; + try { + options = JSON.parse(await readFile(new URL('options.json', fixture), 'utf8')); + options.launchOptions = launchOptions; + } catch { + // This test case uses default options. + } + const processor = remark().use(remarkMermaid, options); + const asMarkdown = await processor.process(original); + const asHTML = await processor().use(remarkRehype).use(rehypeStringify).process(original); + expect(asMarkdown.value).toMatchSnapshot({ name: `${name}.md` }); + expect(asHTML.value).toMatchSnapshot({ name: `${name}.html` }); + }); + } +}); + +test.describe.serial('node', () => { + test.afterEach(() => { + sinon.restore(); + }); + + test('it should not launch the browser if no graphs are defined', async () => { + const processor = remark().use(remarkMermaid, { launchOptions }); + const launch = sinon.spy(puppeteer, 'launch'); + await processor.process('```js\n```'); + sinon.assert.notCalled(launch); + }); + + test('it should share the browser for concurrent calls', async () => { + const processor = remark().use(remarkMermaid, { launchOptions }); + const launch = sinon.spy(puppeteer, 'launch'); + await Promise.all( + Array.from({ length: 3 }) + .fill(markdown) + .map((content) => processor.process(content)), + ); + sinon.assert.calledOnce(launch); + }); + + test('it should close the browser if no more files are being processed', async () => { + const processor = remark().use(remarkMermaid, { launchOptions }); + const launch = sinon.spy(puppeteer, 'launch'); + for (const content of Array.from({ length: 3 }).fill(markdown)) { + await processor.process(content); + } + sinon.assert.calledThrice(launch); + }); + + test('it should throw an error if no executablePath is given', () => { + expect(() => remark().use(remarkMermaid).processSync('')).toThrowError( + 'The option `launchOptions.executablePath` is required when using Node.js', + ); + expect(() => remark().use(remarkMermaid, { launchOptions: {} }).processSync('')).toThrowError( + 'The option `launchOptions.executablePath` is required when using Node.js', + ); + }); +}); diff --git a/test/test.ts-snapshots/dark-browser.html b/test/test.ts-snapshots/dark-browser.html new file mode 100644 index 0000000..eb60148 --- /dev/null +++ b/test/test.ts-snapshots/dark-browser.html @@ -0,0 +1,2 @@ +

An example of a flowchart

+

A
B
C
D

\ No newline at end of file diff --git a/test/test.ts-snapshots/dark-browser.md b/test/test.ts-snapshots/dark-browser.md new file mode 100644 index 0000000..b39a06a --- /dev/null +++ b/test/test.ts-snapshots/dark-browser.md @@ -0,0 +1,3 @@ +# An example of a flowchart + +
A
B
C
D
diff --git a/test/test.ts-snapshots/dark-node.html b/test/test.ts-snapshots/dark-node.html new file mode 100644 index 0000000..87d4e30 --- /dev/null +++ b/test/test.ts-snapshots/dark-node.html @@ -0,0 +1,91 @@ +

An example of a flowchart

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ A +
+
+
+ + + +
+ B +
+
+
+ + + +
+ C +
+
+
+ + + +
+ D +
+
+
+
+

\ No newline at end of file diff --git a/__fixtures__/dark/output.md b/test/test.ts-snapshots/dark-node.md similarity index 95% rename from __fixtures__/dark/output.md rename to test/test.ts-snapshots/dark-node.md index d8b3e34..65f8bd1 100644 --- a/__fixtures__/dark/output.md +++ b/test/test.ts-snapshots/dark-node.md @@ -1,6 +1,6 @@ # An example of a flowchart - + diff --git a/test/test.ts-snapshots/flowchart-browser.html b/test/test.ts-snapshots/flowchart-browser.html new file mode 100644 index 0000000..eb60148 --- /dev/null +++ b/test/test.ts-snapshots/flowchart-browser.html @@ -0,0 +1,2 @@ +

An example of a flowchart

+

A
B
C
D

\ No newline at end of file diff --git a/test/test.ts-snapshots/flowchart-browser.md b/test/test.ts-snapshots/flowchart-browser.md new file mode 100644 index 0000000..b39a06a --- /dev/null +++ b/test/test.ts-snapshots/flowchart-browser.md @@ -0,0 +1,3 @@ +# An example of a flowchart + +
A
B
C
D
diff --git a/__snapshots__/rehype.html b/test/test.ts-snapshots/flowchart-node.html similarity index 94% rename from __snapshots__/rehype.html rename to test/test.ts-snapshots/flowchart-node.html index ae87d19..6c52a32 100644 --- a/__snapshots__/rehype.html +++ b/test/test.ts-snapshots/flowchart-node.html @@ -1,4 +1,5 @@ -

+

An example of a flowchart

+

diff --git a/__fixtures__/flowchart/output.md b/test/test.ts-snapshots/flowchart-node.md similarity index 95% rename from __fixtures__/flowchart/output.md rename to test/test.ts-snapshots/flowchart-node.md index 26b9d81..e626d4d 100644 --- a/__fixtures__/flowchart/output.md +++ b/test/test.ts-snapshots/flowchart-node.md @@ -1,6 +1,6 @@ # An example of a flowchart - + diff --git a/test/test.ts-snapshots/fontawesome-browser.html b/test/test.ts-snapshots/fontawesome-browser.html new file mode 100644 index 0000000..91814f0 --- /dev/null +++ b/test/test.ts-snapshots/fontawesome-browser.html @@ -0,0 +1,4 @@ +

Basic support for fontawesome

+

It is possible to add icons from fontawesome.

+

The icons are acessed via the syntax fa:#icon class name#.

+

for peace
forbidden
A perhaps?

\ No newline at end of file diff --git a/test/test.ts-snapshots/fontawesome-browser.md b/test/test.ts-snapshots/fontawesome-browser.md new file mode 100644 index 0000000..24f26fc --- /dev/null +++ b/test/test.ts-snapshots/fontawesome-browser.md @@ -0,0 +1,7 @@ +# Basic support for fontawesome + +It is possible to add icons from fontawesome. + +The icons are acessed via the syntax `fa:#icon class name#`. + +
for peace
forbidden
A perhaps?
diff --git a/test/test.ts-snapshots/fontawesome-node.html b/test/test.ts-snapshots/fontawesome-node.html new file mode 100644 index 0000000..c07f60c --- /dev/null +++ b/test/test.ts-snapshots/fontawesome-node.html @@ -0,0 +1,84 @@ +

Basic support for fontawesome

+

It is possible to add icons from fontawesome.

+

The icons are acessed via the syntax fa:#icon class name#.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ + for peace +
+ + + + + +
+ + forbidden +
+
+
+ + + +
+ +
+
+
+ + + +
+ A + + perhaps? +
+
+
+ +

\ No newline at end of file diff --git a/__fixtures__/fontawesome/output.md b/test/test.ts-snapshots/fontawesome-node.md similarity index 94% rename from __fixtures__/fontawesome/output.md rename to test/test.ts-snapshots/fontawesome-node.md index 0658cf8..caffa3b 100644 --- a/__fixtures__/fontawesome/output.md +++ b/test/test.ts-snapshots/fontawesome-node.md @@ -4,7 +4,7 @@ It is possible to add icons from fontawesome. The icons are acessed via the syntax `fa:#icon class name#`. - + diff --git a/test/test.ts-snapshots/forest-browser.html b/test/test.ts-snapshots/forest-browser.html new file mode 100644 index 0000000..eb60148 --- /dev/null +++ b/test/test.ts-snapshots/forest-browser.html @@ -0,0 +1,2 @@ +

An example of a flowchart

+

A
B
C
D

\ No newline at end of file diff --git a/test/test.ts-snapshots/forest-browser.md b/test/test.ts-snapshots/forest-browser.md new file mode 100644 index 0000000..b39a06a --- /dev/null +++ b/test/test.ts-snapshots/forest-browser.md @@ -0,0 +1,3 @@ +# An example of a flowchart + +
A
B
C
D
diff --git a/test/test.ts-snapshots/forest-node.html b/test/test.ts-snapshots/forest-node.html new file mode 100644 index 0000000..fb47b09 --- /dev/null +++ b/test/test.ts-snapshots/forest-node.html @@ -0,0 +1,91 @@ +

An example of a flowchart

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ A +
+
+
+ + + +
+ B +
+
+
+ + + +
+ C +
+
+
+ + + +
+ D +
+
+
+
+

\ No newline at end of file diff --git a/__fixtures__/forest/output.md b/test/test.ts-snapshots/forest-node.md similarity index 95% rename from __fixtures__/forest/output.md rename to test/test.ts-snapshots/forest-node.md index ce3f33b..b9a1849 100644 --- a/__fixtures__/forest/output.md +++ b/test/test.ts-snapshots/forest-node.md @@ -1,6 +1,6 @@ # An example of a flowchart - + diff --git a/test/test.ts-snapshots/gantt-browser.html b/test/test.ts-snapshots/gantt-browser.html new file mode 100644 index 0000000..9cc1ad9 --- /dev/null +++ b/test/test.ts-snapshots/gantt-browser.html @@ -0,0 +1,2 @@ +

An example of a gantt diagram

+

Adding GANTT diagram functionality to mermaid2014-01-072014-01-092014-01-112014-01-132014-01-152014-01-172014-01-192014-01-21Completed task Completed task in the critical line Implement parser and jison Active task Create tests for parser Future task Future task in critical line Future task2 Create tests for renderer Add to mermaid A sectionCritical tasksAdding GANTT diagram functionality to mermaid

\ No newline at end of file diff --git a/test/test.ts-snapshots/gantt-browser.md b/test/test.ts-snapshots/gantt-browser.md new file mode 100644 index 0000000..dd90810 --- /dev/null +++ b/test/test.ts-snapshots/gantt-browser.md @@ -0,0 +1,3 @@ +# An example of a gantt diagram + +Adding GANTT diagram functionality to mermaid2014-01-072014-01-092014-01-112014-01-132014-01-152014-01-172014-01-192014-01-21Completed task Completed task in the critical line Implement parser and jison Active task Create tests for parser Future task Future task in critical line Future task2 Create tests for renderer Add to mermaid A sectionCritical tasksAdding GANTT diagram functionality to mermaid diff --git a/test/test.ts-snapshots/gantt-node.html b/test/test.ts-snapshots/gantt-node.html new file mode 100644 index 0000000..e7dcf53 --- /dev/null +++ b/test/test.ts-snapshots/gantt-node.html @@ -0,0 +1,73 @@ +

An example of a gantt diagram

+

+ + + + + 2014-01-07 + + + + 2014-01-09 + + + + 2014-01-11 + + + + 2014-01-13 + + + + 2014-01-15 + + + + 2014-01-17 + + + + 2014-01-19 + + + + 2014-01-21 + + + + + + + + + + + + + + + + + + + + + + + Completed task + Completed task in the critical line + Implement parser and jison + Active task + Create tests for parser + Future task + Future task in critical line + Future task2 + Create tests for renderer + Add to mermaid + A section + Critical tasks + + Adding GANTT diagram functionality to mermaid + +

\ No newline at end of file diff --git a/__fixtures__/gantt/output.md b/test/test.ts-snapshots/gantt-node.md similarity index 96% rename from __fixtures__/gantt/output.md rename to test/test.ts-snapshots/gantt-node.md index 97a71ca..9fbce5d 100644 --- a/__fixtures__/gantt/output.md +++ b/test/test.ts-snapshots/gantt-node.md @@ -1,6 +1,6 @@ # An example of a gantt diagram - + @@ -68,6 +68,6 @@ Add to mermaid A section Critical tasks - + Adding GANTT diagram functionality to mermaid diff --git a/test/test.ts-snapshots/multiple-browser.html b/test/test.ts-snapshots/multiple-browser.html new file mode 100644 index 0000000..4246aa1 --- /dev/null +++ b/test/test.ts-snapshots/multiple-browser.html @@ -0,0 +1,9 @@ +

Demos

+

Basic sequence diagram

+

AliceBobJohnBob thinks a longlong time, so longthat the text doesnot fit on a row.Hello Bob, how are you?How about you John?I am good thanks!I am good thanks!Checking with John...Yes... John, how are you?AliceBobJohn

+

Basic flowchart

+

Link text
Square Rect
Circle
Round Rect
Rhombus

+

Loops, alt and opt

+

AliceBobalt[is sick][is well]opt[Extra response]loop[Daily query]Hello Bob, how are you?Not so good :(Feeling fresh like a daisyThanks for askingAliceBob

+

Message to self in loop

+

AliceBobJohnloop[Healthcheck]Rational thoughtsprevail...Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!AliceBobJohn

\ No newline at end of file diff --git a/test/test.ts-snapshots/multiple-browser.md b/test/test.ts-snapshots/multiple-browser.md new file mode 100644 index 0000000..6a1e563 --- /dev/null +++ b/test/test.ts-snapshots/multiple-browser.md @@ -0,0 +1,17 @@ +# Demos + +## Basic sequence diagram + +AliceBobJohnBob thinks a longlong time, so longthat the text doesnot fit on a row.Hello Bob, how are you?How about you John?I am good thanks!I am good thanks!Checking with John...Yes... John, how are you?AliceBobJohn + +## Basic flowchart + +
Link text
Square Rect
Circle
Round Rect
Rhombus
+ +## Loops, alt and opt + +AliceBobalt[is sick][is well]opt[Extra response]loop[Daily query]Hello Bob, how are you?Not so good :(Feeling fresh like a daisyThanks for askingAliceBob + +## Message to self in loop + +AliceBobJohnloop[Healthcheck]Rational thoughtsprevail...Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!AliceBobJohn diff --git a/test/test.ts-snapshots/multiple-node.html b/test/test.ts-snapshots/multiple-node.html new file mode 100644 index 0000000..8f88bc7 --- /dev/null +++ b/test/test.ts-snapshots/multiple-node.html @@ -0,0 +1,322 @@ +

Demos

+

Basic sequence diagram

+

+ + + + + + + + + + + + + + + + + + Alice + + + Bob + + + John + + + + + + + + + + + + + + + + + + + + + + Bob thinks a long + long time, so long + that the text does + not fit on a row. + Hello Bob, how are you? + + How about you John? + + I am good thanks! + + I am good thanks! + + Checking with John... + + Yes... John, how are you? + + + Alice + + Bob + + John + +

+

Basic flowchart

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Link text + +
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ Square Rect +
+
+
+ + + +
+ Circle +
+
+
+ + + +
+ Round Rect +
+
+
+ + + +
+ Rhombus +
+
+
+
+

+

Loops, alt and opt

+

+ + + + + + + + + + + + + + + + + + Alice + + + Bob + + + + + + + + + + + + + + + + + + + + + + + + + + + alt + [is sick] + [is well] + + + + + + opt + [Extra response] + + + + + + loop + [Daily query] + Hello Bob, how are you? + + Not so good :( + + Feeling fresh like a daisy + + Thanks for asking + + + Alice + + Bob + +

+

Message to self in loop

+

+ + + + + + + + + + + + + + + + + + Alice + + + Bob + + + John + + + + + + + + + + + + + + + + + + + + + + + + + + loop + [Healthcheck] + + Rational thoughts + prevail... + Hello John, how are you? + + Fight against hypochondria + + Great! + + How about you? + + Jolly good! + + + Alice + + Bob + + John + +

\ No newline at end of file diff --git a/__fixtures__/multiple/output.md b/test/test.ts-snapshots/multiple-node.md similarity index 94% rename from __fixtures__/multiple/output.md rename to test/test.ts-snapshots/multiple-node.md index cdbc296..cdee372 100644 --- a/__fixtures__/multiple/output.md +++ b/test/test.ts-snapshots/multiple-node.md @@ -2,7 +2,7 @@ ## Basic sequence diagram - + @@ -52,17 +52,17 @@ long time, so long that the text does not fit on a row. - Hello Bob, how are you? + Hello Bob, how are you? - How about you John? + How about you John? - I am good thanks! + I am good thanks! - I am good thanks! + I am good thanks! - Checking with John... + Checking with John... - Yes... John, how are you? + Yes... John, how are you? Alice @@ -75,7 +75,7 @@ ## Basic flowchart - + @@ -173,7 +173,7 @@ ## Loops, alt and opt - + @@ -238,13 +238,13 @@ loop [Daily query] - Hello Bob, how are you? + Hello Bob, how are you? - Not so good :( + Not so good :( - Feeling fresh like a daisy + Feeling fresh like a daisy - Thanks for asking + Thanks for asking Alice @@ -255,7 +255,7 @@ ## Message to self in loop - + @@ -310,15 +310,15 @@ Rational thoughts prevail... - Hello John, how are you? + Hello John, how are you? - Fight against hypochondria + Fight against hypochondria - Great! + Great! - How about you? + How about you? - Jolly good! + Jolly good! Alice diff --git a/test/test.ts-snapshots/neutral-browser.html b/test/test.ts-snapshots/neutral-browser.html new file mode 100644 index 0000000..eb60148 --- /dev/null +++ b/test/test.ts-snapshots/neutral-browser.html @@ -0,0 +1,2 @@ +

An example of a flowchart

+

A
B
C
D

\ No newline at end of file diff --git a/test/test.ts-snapshots/neutral-browser.md b/test/test.ts-snapshots/neutral-browser.md new file mode 100644 index 0000000..b39a06a --- /dev/null +++ b/test/test.ts-snapshots/neutral-browser.md @@ -0,0 +1,3 @@ +# An example of a flowchart + +
A
B
C
D
diff --git a/test/test.ts-snapshots/neutral-node.html b/test/test.ts-snapshots/neutral-node.html new file mode 100644 index 0000000..bd3a454 --- /dev/null +++ b/test/test.ts-snapshots/neutral-node.html @@ -0,0 +1,91 @@ +

An example of a flowchart

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ A +
+
+
+ + + +
+ B +
+
+
+ + + +
+ C +
+
+
+ + + +
+ D +
+
+
+
+

\ No newline at end of file diff --git a/__fixtures__/neutral/output.md b/test/test.ts-snapshots/neutral-node.md similarity index 95% rename from __fixtures__/neutral/output.md rename to test/test.ts-snapshots/neutral-node.md index 4182eb7..6436d2f 100644 --- a/__fixtures__/neutral/output.md +++ b/test/test.ts-snapshots/neutral-node.md @@ -1,6 +1,6 @@ # An example of a flowchart - + diff --git a/test/test.ts-snapshots/no-mermaid-browser.html b/test/test.ts-snapshots/no-mermaid-browser.html new file mode 100644 index 0000000..893842f --- /dev/null +++ b/test/test.ts-snapshots/no-mermaid-browser.html @@ -0,0 +1,3 @@ +

No medmaid

+
console.log('This is a JavaScript code block');
+
\ No newline at end of file diff --git a/__fixtures__/no-mermaid/output.md b/test/test.ts-snapshots/no-mermaid-browser.md similarity index 100% rename from __fixtures__/no-mermaid/output.md rename to test/test.ts-snapshots/no-mermaid-browser.md diff --git a/test/test.ts-snapshots/no-mermaid-node.html b/test/test.ts-snapshots/no-mermaid-node.html new file mode 100644 index 0000000..893842f --- /dev/null +++ b/test/test.ts-snapshots/no-mermaid-node.html @@ -0,0 +1,3 @@ +

No medmaid

+
console.log('This is a JavaScript code block');
+
\ No newline at end of file diff --git a/test/test.ts-snapshots/no-mermaid-node.md b/test/test.ts-snapshots/no-mermaid-node.md new file mode 100644 index 0000000..fca3f7f --- /dev/null +++ b/test/test.ts-snapshots/no-mermaid-node.md @@ -0,0 +1,5 @@ +# No medmaid + +```js +console.log('This is a JavaScript code block'); +``` diff --git a/test/test.ts-snapshots/sequence-browser.html b/test/test.ts-snapshots/sequence-browser.html new file mode 100644 index 0000000..315ea12 --- /dev/null +++ b/test/test.ts-snapshots/sequence-browser.html @@ -0,0 +1,2 @@ +

An example of a sequence diagram

+

AliceBobJohnloop[Healthcheck]Rational thoughts prevail...Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!AliceBobJohn

\ No newline at end of file diff --git a/test/test.ts-snapshots/sequence-browser.md b/test/test.ts-snapshots/sequence-browser.md new file mode 100644 index 0000000..3fb5e34 --- /dev/null +++ b/test/test.ts-snapshots/sequence-browser.md @@ -0,0 +1,3 @@ +# An example of a sequence diagram + +AliceBobJohnloop[Healthcheck]Rational thoughts prevail...Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!AliceBobJohn diff --git a/test/test.ts-snapshots/sequence-node.html b/test/test.ts-snapshots/sequence-node.html new file mode 100644 index 0000000..306fd3c --- /dev/null +++ b/test/test.ts-snapshots/sequence-node.html @@ -0,0 +1,74 @@ +

An example of a sequence diagram

+

+ + + + + + + + + + + + + + + + + + Alice + + + Bob + + + John + + + + + + + + + + + + + + + + + + + + + + + + + + loop + [Healthcheck] + + Rational thoughts + prevail... + Hello John, how are you? + + Fight against hypochondria + + Great! + + How about you? + + Jolly good! + + + Alice + + Bob + + John + +

\ No newline at end of file diff --git a/__fixtures__/sequence/output.md b/test/test.ts-snapshots/sequence-node.md similarity index 94% rename from __fixtures__/sequence/output.md rename to test/test.ts-snapshots/sequence-node.md index 2c98d0a..b89256d 100644 --- a/__fixtures__/sequence/output.md +++ b/test/test.ts-snapshots/sequence-node.md @@ -1,6 +1,6 @@ # An example of a sequence diagram - + @@ -55,15 +55,15 @@ Rational thoughts prevail... - Hello John, how are you? + Hello John, how are you? - Fight against hypochondria + Fight against hypochondria - Great! + Great! - How about you? + How about you? - Jolly good! + Jolly good! Alice diff --git a/test/test.ts-snapshots/simple-browser.html b/test/test.ts-snapshots/simple-browser.html new file mode 100644 index 0000000..f57c955 --- /dev/null +++ b/test/test.ts-snapshots/simple-browser.html @@ -0,0 +1,4 @@ +

Simple

+

This is a simple mermaid diagram.

+

A
B
C
D

+

It is rendered above.

\ No newline at end of file diff --git a/test/test.ts-snapshots/simple-browser.md b/test/test.ts-snapshots/simple-browser.md new file mode 100644 index 0000000..8322b05 --- /dev/null +++ b/test/test.ts-snapshots/simple-browser.md @@ -0,0 +1,7 @@ +# Simple + +This is a simple mermaid diagram. + +
A
B
C
D
+ +It is rendered above. diff --git a/test/test.ts-snapshots/simple-node.html b/test/test.ts-snapshots/simple-node.html new file mode 100644 index 0000000..79e35c8 --- /dev/null +++ b/test/test.ts-snapshots/simple-node.html @@ -0,0 +1,93 @@ +

Simple

+

This is a simple mermaid diagram.

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + +
+ A +
+
+
+ + + +
+ B +
+
+
+ + + +
+ C +
+
+
+ + + +
+ D +
+
+
+
+

+

It is rendered above.

\ No newline at end of file diff --git a/__fixtures__/simple/output.md b/test/test.ts-snapshots/simple-node.md similarity index 95% rename from __fixtures__/simple/output.md rename to test/test.ts-snapshots/simple-node.md index 56caa02..6f0a088 100644 --- a/__fixtures__/simple/output.md +++ b/test/test.ts-snapshots/simple-node.md @@ -2,7 +2,7 @@ This is a simple mermaid diagram. - + From a252a6afc2c93d9153e8af1e4b0e7e4c4fc6a311 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Thu, 29 Sep 2022 10:02:13 +0200 Subject: [PATCH 2/5] Use hast-util-from-dom in the browser --- browser.ts | 7 ++++--- package-lock.json | 14 ++++++++++++++ package.json | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/browser.ts b/browser.ts index 856db9f..b7aadd0 100644 --- a/browser.ts +++ b/browser.ts @@ -1,7 +1,6 @@ -import { fromParse5 } from 'hast-util-from-parse5'; +import { fromDom } from 'hast-util-from-dom'; import { type Code, type Parent, type Root } from 'mdast'; import mermaid from 'mermaid'; -import { parseFragment } from 'parse5'; import { type Plugin } from 'unified'; import { visit } from 'unist-util-visit'; @@ -23,12 +22,14 @@ function transformer(ast: Root): void { mermaid.render(`remark-mermaid-${index}`, code), ); + const wrapper = document.createElement('div'); for (const [i, [, index, parent]] of instances.entries()) { const value = results[i]; + wrapper.innerHTML = value; parent.children.splice(index, 1, { type: 'paragraph', children: [{ type: 'html', value }], - data: { hChildren: [fromParse5(parseFragment(value))] }, + data: { hChildren: [fromDom(wrapper.firstChild!)] }, }); } } diff --git a/package-lock.json b/package-lock.json index 958d787..1fe4ddd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@types/mdast": "^3.0.0", "@types/mermaid": "^9.0.0", "@types/svgo": "^2.0.0", + "hast-util-from-dom": "^4.0.0", "hast-util-from-parse5": "^7.0.0", "mermaid": "^9.0.0", "parse5": "^7.0.0", @@ -3595,6 +3596,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hast-util-from-dom": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hast-util-from-dom/-/hast-util-from-dom-4.1.0.tgz", + "integrity": "sha512-0EMIYQVIhRfiC1LVdTsvM4yTY0rM/v63wwoYmOYV02mIOASYeQrfQekG4Jhge2kOAMaNFbvppUma47rbeWWE5Q==", + "dependencies": { + "hastscript": "^7.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-from-parse5": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-7.1.0.tgz", diff --git a/package.json b/package.json index 654a6fc..7c57797 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@types/mdast": "^3.0.0", "@types/mermaid": "^9.0.0", "@types/svgo": "^2.0.0", + "hast-util-from-dom": "^4.0.0", "hast-util-from-parse5": "^7.0.0", "mermaid": "^9.0.0", "parse5": "^7.0.0", From 9365b0a473bf8102ea7e7bf9a7cea4d1b1d2f2bf Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Thu, 29 Sep 2022 10:16:22 +0200 Subject: [PATCH 3/5] Run playwright install in GitHub actions --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0150ad..fa34384 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,7 @@ jobs: - run: npm --global install npm@8 if: ${{ matrix.node-version == 14 }} - run: npm ci + - run: npx playwright install - run: npm test - uses: codecov/codecov-action@v3 if: ${{ matrix.node-version == 18 }} From ef608d2e3ed20152e35dc3149b858f31b57e0d34 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Thu, 29 Sep 2022 12:26:00 +0200 Subject: [PATCH 4/5] Add missing verb in documentation --- README.md | 2 +- index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87ec006..7fc048a 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ disable minifying using SVGO completely. The [mermaid options](https://mermaid-js.github.io/mermaid/#/Setup) to use. **Note**: This options is only supported in Node.js. In the browser this option is unused. If you -this in a browser, call `mermaid.initialize()` manually. +use this in a browser, call `mermaid.initialize()` manually. ## License diff --git a/index.ts b/index.ts index dc34c68..faa3ce3 100644 --- a/index.ts +++ b/index.ts @@ -97,7 +97,7 @@ export interface RemarkMermaidOptions { * The mermaid options to use. * * **Note**: This options is only supported in Node.js. In the browser this option is unused. If - * you this in a browser, call `mermaid.initialize()` manually. + * you use this in a browser, call `mermaid.initialize()` manually. */ mermaidOptions?: Parameters[0]; } From e1a698c8e9322746610db1888a9fec78de320672 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Sun, 2 Oct 2022 12:59:19 +0200 Subject: [PATCH 5/5] Cache playwright browser between runs --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa34384..038f4ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,10 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm --global install npm@8 if: ${{ matrix.node-version == 14 }} + - uses: actions/cache@v3 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npx playwright install - run: npm test