From 0c85e8ee53725f0371c2fe0952c011846e971c1b Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 18:27:58 -0700 Subject: [PATCH 01/56] eslint (mostly use double quotes) --- src/docs.mts | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 76594c4bf4..9e3b9ddefd 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,26 +1,26 @@ -import { remark } from 'remark'; -import type { Code, Root } from 'mdast'; -import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; +import { remark } from "remark"; +import type { Code, Root } from "mdast"; +import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs"; // @ts-ignore -import flatmap from 'unist-util-flatmap'; -import { globby } from 'globby'; -import { join, dirname } from 'path'; -import { exec } from 'child_process'; -import prettier from 'prettier'; +import flatmap from "unist-util-flatmap"; +import { globby } from "globby"; +import { join, dirname } from "path"; +import { exec } from "child_process"; +import prettier from "prettier"; -const verify = process.argv.includes('--verify'); -const git = process.argv.includes('--git'); +const verify = process.argv.includes("--verify"); +const git = process.argv.includes("--git"); let fileChanged = false; // Possible Improvement: combine with lint-staged to only copy files that have changed const prepareOutFile = (file: string): string => { - const outFile = join('docs', file.replace('src/docs/', '')); + const outFile = join("docs", file.replace("src/docs/", "")); mkdirSync(dirname(outFile), { recursive: true }); return outFile; }; const verifyAndCopy = (file: string, content?: string) => { const outFile = prepareOutFile(file); - const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from('#NEW FILE#'); + const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from("#NEW FILE#"); const newBuffer = content ? Buffer.from(content) : readFileSync(file); if (existingBuffer.equals(newBuffer)) { // Files are same, skip. @@ -34,16 +34,16 @@ const verifyAndCopy = (file: string, content?: string) => { }; const transform = (file: string) => { - const doc = readFileSync(file, 'utf8'); + const doc = readFileSync(file, "utf8"); const ast: Root = remark.parse(doc); const out = flatmap(ast, (c: Code) => { - if (c.type !== 'code' || !c.lang?.startsWith('mermaid')) { + if (c.type !== "code" || !c.lang?.startsWith("mermaid")) { return [c]; } - if (c.lang === 'mermaid' || c.lang === 'mmd') { - c.lang = 'mermaid-example'; + if (c.lang === "mermaid" || c.lang === "mmd") { + c.lang = "mermaid-example"; } - return [c, Object.assign({}, c, { lang: 'mermaid' })]; + return [c, Object.assign({}, c, { lang: "mermaid" })]; }); const transformed = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.\n${remark.stringify( @@ -52,20 +52,20 @@ const transform = (file: string) => { verifyAndCopy( file, prettier.format(transformed, { - parser: 'markdown', + parser: "markdown", useTabs: false, tabWidth: 2, - endOfLine: 'auto', + endOfLine: "auto", printWidth: 100, - singleQuote: true, + singleQuote: true }) ); }; (async () => { - const mdFiles = await globby(['./src/docs/**/*.md'], { dot: true }); + const mdFiles = await globby(["./src/docs/**/*.md"], { dot: true }); mdFiles.forEach(transform); - const nonMDFiles = await globby(['src/docs/**', '!**/*.md'], { dot: true }); + const nonMDFiles = await globby(["src/docs/**", "!**/*.md"], { dot: true }); nonMDFiles.forEach((file) => { verifyAndCopy(file); }); @@ -77,8 +77,8 @@ const transform = (file: string) => { process.exit(1); } if (git) { - console.log('Adding changes in docs folder to git'); - exec('git add docs'); + console.log("Adding changes in docs folder to git"); + exec("git add docs"); } } })(); From 703b7eb91d38d0248d2bccfe7d1b753355326a45 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 18:33:17 -0700 Subject: [PATCH 02/56] rename vars so intent is clearer, add doc, use constants --- src/docs.mts | 55 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 9e3b9ddefd..fe38cf52e1 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -6,18 +6,41 @@ import flatmap from "unist-util-flatmap"; import { globby } from "globby"; import { join, dirname } from "path"; import { exec } from "child_process"; +// @ts-ignore import prettier from "prettier"; -const verify = process.argv.includes("--verify"); +const SOURCE_DOCS_DIR = 'src/docs/'; +const FINAL_DOCS_DIR = 'docs/'; +const AUTOGENERATED_TEXT = + "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs."; + +const verifyOnly = process.argv.includes("--verify"); const git = process.argv.includes("--git"); -let fileChanged = false; -// Possible Improvement: combine with lint-staged to only copy files that have changed + +let filesWereChanged = false; + + +/** + * Given a source file name and path, return the documentation destination full path and file name + * Create the destination path if it does not already exist. + * Possible Improvement: combine with lint-staged to only copy files that have changed + * + * @param file {string} name of the file (including full path) + * @returns {string} name of the file with the path changed from src/docs to docs + */ const prepareOutFile = (file: string): string => { - const outFile = join("docs", file.replace("src/docs/", "")); + const outFile = join(FINAL_DOCS_DIR, file.replace(SOURCE_DOCS_DIR, "")); mkdirSync(dirname(outFile), { recursive: true }); return outFile; }; +/** + * Verify that a file was changed and (potentially) write the new contents out to the file. Log a message to the console + * If the file was not changed, do nothing. (No message is logged to the console.) + * + * @param file {string} name of the file that will be verified + * @param content {string} new contents for the file + */ const verifyAndCopy = (file: string, content?: string) => { const outFile = prepareOutFile(file); const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from("#NEW FILE#"); @@ -27,12 +50,22 @@ const verifyAndCopy = (file: string, content?: string) => { return; } console.log(`File changed: ${outFile}`); - fileChanged = true; - if (!verify) { + filesWereChanged = true; + if (!verifyOnly) { writeFileSync(outFile, newBuffer); } }; +/** + * Transform a markdown file and write the transformed file to the directory for published documentation + * 1. add a `mermaid-example` block before every `mermaid` or `mmd` block + * On the docsify site (one place where the documentation is published), this will show the code used for the mermaid diagram + * 2. add the text that says the file is automatically generated + * 3. use prettier to format the file + * Verify that the file has been changed and write out the changes + * + * @param file {string} name of the file that will be verified + */ const transform = (file: string) => { const doc = readFileSync(file, "utf8"); const ast: Root = remark.parse(doc); @@ -46,9 +79,9 @@ const transform = (file: string) => { return [c, Object.assign({}, c, { lang: "mermaid" })]; }); - const transformed = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs.\n${remark.stringify( - out - )}`; + // Add the AUTOGENERATED_TEXT to the start of the file + const transformed = `${AUTOGENERATED_TEXT}\n${remark.stringify(out)}`; + verifyAndCopy( file, prettier.format(transformed, { @@ -69,8 +102,8 @@ const transform = (file: string) => { nonMDFiles.forEach((file) => { verifyAndCopy(file); }); - if (fileChanged) { - if (verify) { + if (filesWereChanged) { + if (verifyOnly) { console.log( "Changes detected in files in `docs`. Please run `yarn docs:build` after making changes to 'src/docs' to update the `docs` folder." ); From d38f0e9e03794b01bd6ee652e36d98b78478aeeb Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 18:36:17 -0700 Subject: [PATCH 03/56] adjust console log message if only verifying, if copied actually happened --- src/docs.mts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/docs.mts b/src/docs.mts index fe38cf52e1..4ed1f7feb0 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -49,11 +49,18 @@ const verifyAndCopy = (file: string, content?: string) => { // Files are same, skip. return; } - console.log(`File changed: ${outFile}`); + let changeMsg = 'changed'; + if (verifyOnly) { + changeMsg = 'to be changed'; + } + let logMsg = ` File ${changeMsg}: ${outFile}` + filesWereChanged = true; if (!verifyOnly) { writeFileSync(outFile, newBuffer); + logMsg += ' ...and copied to /docs' } + console.log(logMsg); }; /** From 6554a41f6dfd054d6540b4e101e25e4b7213780a Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 18:39:36 -0700 Subject: [PATCH 04/56] transform HTML (insert comment); add console msgs and clarify; add file doc --- src/docs.mts | 71 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 4ed1f7feb0..d211e0fbff 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,6 +1,24 @@ +/** + * @overview Process and potentially transform documentation source files into files suitable for publishing. + * Copy files from the source directory (/src/docs) to the directory used for the final, published documentation (/docs). + * The list of files changed (transformed) and copied to /docs are logged to the console. + * If a file in /src/docs has the same contents in /docs, nothing is done (it is not copied to /docs). + * + * @example docs + * @example docs --verify + * If the --verify option is used, no files will be copied to /docs, but the list of files to be changed is still shown on the console. + * A message to the console will show that this command should be run without the --verify flag so that the 'docs' folder is be updated. + * Note that the command will return an exit code (1), which will show that it failed. + * @example docs --git + * If the --git option is used, the command `git add docs` will be run + * + */ + import { remark } from "remark"; import type { Code, Root } from "mdast"; import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs"; +import { JSDOM } from "jsdom"; + // @ts-ignore import flatmap from "unist-util-flatmap"; import { globby } from "globby"; @@ -63,6 +81,10 @@ const verifyAndCopy = (file: string, content?: string) => { console.log(logMsg); }; +const readSyncedUTF8file = (file: string): string => { + return readFileSync(file, "utf8"); +} + /** * Transform a markdown file and write the transformed file to the directory for published documentation * 1. add a `mermaid-example` block before every `mermaid` or `mmd` block @@ -73,8 +95,8 @@ const verifyAndCopy = (file: string, content?: string) => { * * @param file {string} name of the file that will be verified */ -const transform = (file: string) => { - const doc = readFileSync(file, "utf8"); +const transformMarkdown = (file: string) => { + const doc = readSyncedUTF8file(file); const ast: Root = remark.parse(doc); const out = flatmap(ast, (c: Code) => { if (c.type !== "code" || !c.lang?.startsWith("mermaid")) { @@ -102,17 +124,54 @@ const transform = (file: string) => { ); }; +/** + * Transform a HTML file and write the transformed file to the directory for published documentation + * - add the text that says the file is automatically generated + * Verify that the file has been changed and write out the changes + * + * @param filename {string} name of the HTML file to transform + */ +const transformHtml = (filename: string) => { + + /** + * Insert the '...auto generated...' comment into an HTML file after the element + * + * @param fname {string} file name that should have the comment inserted + * @returns {string} the contents of the file with the comment inserted + */ + function insertAutoGeneratedComment(fname: string): string { + const fileContents = readSyncedUTF8file(fname); + const jsdom = new JSDOM(fileContents); + const htmlDoc = jsdom.window.document; + const autoGeneratedComment = jsdom.window.document.createComment(AUTOGENERATED_TEXT); + + let rootElement = htmlDoc.documentElement; + rootElement.prepend(autoGeneratedComment); + return jsdom.serialize(); + } + + let transformedHTML = insertAutoGeneratedComment(filename); + verifyAndCopy(filename, transformedHTML); +}; + (async () => { + console.log("Transforming markdown files..."); const mdFiles = await globby(["./src/docs/**/*.md"], { dot: true }); - mdFiles.forEach(transform); - const nonMDFiles = await globby(["src/docs/**", "!**/*.md"], { dot: true }); - nonMDFiles.forEach((file) => { + mdFiles.forEach(transformMarkdown); + + console.log("Transforming html files..."); + const htmlFiles = await globby(["./src/docs/**/*.html"], { dot: true }); + htmlFiles.forEach(transformHtml); + + console.log("Transforming all other files..."); + const otherFiles = await globby(["src/docs/**", "!**/*.md", "!**/*.html"], { dot: true }); + otherFiles.forEach((file) => { verifyAndCopy(file); }); if (filesWereChanged) { if (verifyOnly) { console.log( - "Changes detected in files in `docs`. Please run `yarn docs:build` after making changes to 'src/docs' to update the `docs` folder." + "Changes detected in files in `src/docs`. Please run `yarn docs:build` after making changes to 'src/docs' to update the `docs` folder." ); process.exit(1); } From 0832b24d66d07b9f71160ad29edae60026cd35e8 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 23:43:57 -0700 Subject: [PATCH 05/56] use single quotes; use const instead of let (2); use const instead of function --- src/docs.mts | 78 +++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index d211e0fbff..ad9ab1bf07 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -14,30 +14,29 @@ * */ -import { remark } from "remark"; -import type { Code, Root } from "mdast"; -import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs"; -import { JSDOM } from "jsdom"; +import { remark } from 'remark'; +import type { Code, Root } from 'mdast'; +import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; +import { JSDOM } from 'jsdom'; // @ts-ignore -import flatmap from "unist-util-flatmap"; -import { globby } from "globby"; -import { join, dirname } from "path"; -import { exec } from "child_process"; +import flatmap from 'unist-util-flatmap'; +import { globby } from 'globby'; +import { join, dirname } from 'path'; +import { exec } from 'child_process'; // @ts-ignore -import prettier from "prettier"; +import prettier from 'prettier'; const SOURCE_DOCS_DIR = 'src/docs/'; const FINAL_DOCS_DIR = 'docs/'; const AUTOGENERATED_TEXT = - "# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs."; + '# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs.'; -const verifyOnly = process.argv.includes("--verify"); -const git = process.argv.includes("--git"); +const verifyOnly = process.argv.includes('--verify'); +const git = process.argv.includes('--git'); let filesWereChanged = false; - /** * Given a source file name and path, return the documentation destination full path and file name * Create the destination path if it does not already exist. @@ -47,7 +46,7 @@ let filesWereChanged = false; * @returns {string} name of the file with the path changed from src/docs to docs */ const prepareOutFile = (file: string): string => { - const outFile = join(FINAL_DOCS_DIR, file.replace(SOURCE_DOCS_DIR, "")); + const outFile = join(FINAL_DOCS_DIR, file.replace(SOURCE_DOCS_DIR, '')); mkdirSync(dirname(outFile), { recursive: true }); return outFile; }; @@ -61,7 +60,7 @@ const prepareOutFile = (file: string): string => { */ const verifyAndCopy = (file: string, content?: string) => { const outFile = prepareOutFile(file); - const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from("#NEW FILE#"); + const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from('#NEW FILE#'); const newBuffer = content ? Buffer.from(content) : readFileSync(file); if (existingBuffer.equals(newBuffer)) { // Files are same, skip. @@ -71,19 +70,19 @@ const verifyAndCopy = (file: string, content?: string) => { if (verifyOnly) { changeMsg = 'to be changed'; } - let logMsg = ` File ${changeMsg}: ${outFile}` + let logMsg = ` File ${changeMsg}: ${outFile}`; filesWereChanged = true; if (!verifyOnly) { writeFileSync(outFile, newBuffer); - logMsg += ' ...and copied to /docs' + logMsg += ' ...and copied to /docs'; } console.log(logMsg); }; const readSyncedUTF8file = (file: string): string => { - return readFileSync(file, "utf8"); -} + return readFileSync(file, 'utf8'); +}; /** * Transform a markdown file and write the transformed file to the directory for published documentation @@ -99,13 +98,13 @@ const transformMarkdown = (file: string) => { const doc = readSyncedUTF8file(file); const ast: Root = remark.parse(doc); const out = flatmap(ast, (c: Code) => { - if (c.type !== "code" || !c.lang?.startsWith("mermaid")) { + if (c.type !== 'code' || !c.lang?.startsWith('mermaid')) { return [c]; } - if (c.lang === "mermaid" || c.lang === "mmd") { - c.lang = "mermaid-example"; + if (c.lang === 'mermaid' || c.lang === 'mmd') { + c.lang = 'mermaid-example'; } - return [c, Object.assign({}, c, { lang: "mermaid" })]; + return [c, Object.assign({}, c, { lang: 'mermaid' })]; }); // Add the AUTOGENERATED_TEXT to the start of the file @@ -114,12 +113,12 @@ const transformMarkdown = (file: string) => { verifyAndCopy( file, prettier.format(transformed, { - parser: "markdown", + parser: 'markdown', useTabs: false, tabWidth: 2, - endOfLine: "auto", + endOfLine: 'auto', printWidth: 100, - singleQuote: true + singleQuote: true, }) ); }; @@ -132,39 +131,38 @@ const transformMarkdown = (file: string) => { * @param filename {string} name of the HTML file to transform */ const transformHtml = (filename: string) => { - /** * Insert the '...auto generated...' comment into an HTML file after the element * - * @param fname {string} file name that should have the comment inserted + * @param fileName {string} file name that should have the comment inserted * @returns {string} the contents of the file with the comment inserted */ - function insertAutoGeneratedComment(fname: string): string { - const fileContents = readSyncedUTF8file(fname); + const insertAutoGeneratedComment = (fileName: string): string => { + const fileContents = readSyncedUTF8file(fileName); const jsdom = new JSDOM(fileContents); const htmlDoc = jsdom.window.document; const autoGeneratedComment = jsdom.window.document.createComment(AUTOGENERATED_TEXT); - let rootElement = htmlDoc.documentElement; + const rootElement = htmlDoc.documentElement; rootElement.prepend(autoGeneratedComment); return jsdom.serialize(); } - let transformedHTML = insertAutoGeneratedComment(filename); + const transformedHTML = insertAutoGeneratedComment(filename); verifyAndCopy(filename, transformedHTML); }; (async () => { - console.log("Transforming markdown files..."); - const mdFiles = await globby(["./src/docs/**/*.md"], { dot: true }); + console.log('Transforming markdown files...'); + const mdFiles = await globby(['./src/docs/**/*.md'], { dot: true }); mdFiles.forEach(transformMarkdown); - console.log("Transforming html files..."); - const htmlFiles = await globby(["./src/docs/**/*.html"], { dot: true }); + console.log('Transforming html files...'); + const htmlFiles = await globby(['./src/docs/**/*.html'], { dot: true }); htmlFiles.forEach(transformHtml); - console.log("Transforming all other files..."); - const otherFiles = await globby(["src/docs/**", "!**/*.md", "!**/*.html"], { dot: true }); + console.log('Transforming all other files...'); + const otherFiles = await globby(['src/docs/**', '!**/*.md', '!**/*.html'], { dot: true }); otherFiles.forEach((file) => { verifyAndCopy(file); }); @@ -176,8 +174,8 @@ const transformHtml = (filename: string) => { process.exit(1); } if (git) { - console.log("Adding changes in docs folder to git"); - exec("git add docs"); + console.log('Adding changes in docs folder to git'); + exec('git add docs'); } } })(); From 1a0fe0abf6ac06c38be700aafadce88e9394b5c9 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 08:19:34 -0700 Subject: [PATCH 06/56] (comments only) reword main docblock; clarify other comments; grammar etc. fixes --- src/docs.mts | 57 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index ad9ab1bf07..b090fdd8c7 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,17 +1,25 @@ /** - * @overview Process and potentially transform documentation source files into files suitable for publishing. - * Copy files from the source directory (/src/docs) to the directory used for the final, published documentation (/docs). - * The list of files changed (transformed) and copied to /docs are logged to the console. - * If a file in /src/docs has the same contents in /docs, nothing is done (it is not copied to /docs). + * @file Transform documentation source files into files suitable for publishing and optionally copy + * the transformed files from the source directory to the directory used for the final, published + * documentation directory. The list of files transformed and copied to final documentation + * directory are logged to the console. If a file in the source directory has the same contents in + * the final directory, nothing is done (the final directory is up-to-date). + * @example + * docs + * Run with no option flags * - * @example docs - * @example docs --verify - * If the --verify option is used, no files will be copied to /docs, but the list of files to be changed is still shown on the console. - * A message to the console will show that this command should be run without the --verify flag so that the 'docs' folder is be updated. - * Note that the command will return an exit code (1), which will show that it failed. - * @example docs --git - * If the --git option is used, the command `git add docs` will be run + * @example + * docs --verify + * If the --verify option is used, it only _verifies_ that the final directory has been updated with the transformed files in the source directory. + * No files will be copied to the final documentation directory, but the list of files to be changed is shown on the console. + * If the final documentation directory does not have the transformed files from source directory + * - a message to the console will show that this command should be run without the --verify flag so that the final directory is updated, and + * - it will return a fail exit code (1) * + * @example + * docs --git + * If the --git option is used, the command `git add docs` will be run after all transformations (and/or verifications) have completed successfully + * If not files were transformed, the git command is not run. */ import { remark } from 'remark'; @@ -39,11 +47,12 @@ let filesWereChanged = false; /** * Given a source file name and path, return the documentation destination full path and file name - * Create the destination path if it does not already exist. - * Possible Improvement: combine with lint-staged to only copy files that have changed + * Create the destination path if it does not already exist. Possible Improvement: combine with + * lint-staged to only copy files that have changed * - * @param file {string} name of the file (including full path) - * @returns {string} name of the file with the path changed from src/docs to docs + * @param {string} file - Name of the file (including full path) + * @returns {string} Name of the file with the path changed from the source directory to final + * documentation directory */ const prepareOutFile = (file: string): string => { const outFile = join(FINAL_DOCS_DIR, file.replace(SOURCE_DOCS_DIR, '')); @@ -86,11 +95,10 @@ const readSyncedUTF8file = (file: string): string => { /** * Transform a markdown file and write the transformed file to the directory for published documentation - * 1. add a `mermaid-example` block before every `mermaid` or `mmd` block - * On the docsify site (one place where the documentation is published), this will show the code used for the mermaid diagram - * 2. add the text that says the file is automatically generated - * 3. use prettier to format the file - * Verify that the file has been changed and write out the changes + * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one + * place where the documentation is published), this will show the code used for the mermaid diagram + * 2. Add the text that says the file is automatically generated + * 3. Use prettier to format the file Verify that the file has been changed and write out the changes * * @param file {string} name of the file that will be verified */ @@ -124,9 +132,9 @@ const transformMarkdown = (file: string) => { }; /** - * Transform a HTML file and write the transformed file to the directory for published documentation - * - add the text that says the file is automatically generated - * Verify that the file has been changed and write out the changes + * Transform an HTML file and write the transformed file to the directory for published documentation + * - Add the text that says the file is automatically generated Verify that the file has been changed + * and write out the changes * * @param filename {string} name of the HTML file to transform */ @@ -135,7 +143,7 @@ const transformHtml = (filename: string) => { * Insert the '...auto generated...' comment into an HTML file after the element * * @param fileName {string} file name that should have the comment inserted - * @returns {string} the contents of the file with the comment inserted + * @returns {string} The contents of the file with the comment inserted */ const insertAutoGeneratedComment = (fileName: string): string => { const fileContents = readSyncedUTF8file(fileName); @@ -152,6 +160,7 @@ const transformHtml = (filename: string) => { verifyAndCopy(filename, transformedHTML); }; +/** Main method (entry point) */ (async () => { console.log('Transforming markdown files...'); const mdFiles = await globby(['./src/docs/**/*.md'], { dot: true }); From a878edfb9b230970902c3a38ee5702b7f5a24dad Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 08:32:52 -0700 Subject: [PATCH 07/56] add and use constants; DRY glob patterns in main --- src/docs.mts | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index b090fdd8c7..7f1fe9d506 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -38,12 +38,19 @@ import prettier from 'prettier'; const SOURCE_DOCS_DIR = 'src/docs/'; const FINAL_DOCS_DIR = 'docs/'; const AUTOGENERATED_TEXT = - '# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs.'; + '# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in ${SOURCE_DOCS_DIR}.'; + +const LOGMSG_TRANSFORMED = 'transformed'; +const LOGMSG_TO_BE_TRANSFORMED = 'to be transformed'; +const LOGMSG_COPIED = ' ...and copied to ${FINAL_DOCS_DIR}'; + +const WARN_DOCSDIR_DOESNT_MATCH = + "Changed files were transformed in `${SOURCE_DOCS_DIR}` but do not match the files in `${FINAL_DOCS_DIR}`. Please run `yarn docs:build` after making changes to '${SOURCE_DOCS_DIR}' to update the `${FINAL_DOCS_DIR}` directory with the transformed files."; const verifyOnly = process.argv.includes('--verify'); const git = process.argv.includes('--git'); -let filesWereChanged = false; +let filesWereTransformed = false; /** * Given a source file name and path, return the documentation destination full path and file name @@ -162,28 +169,33 @@ const transformHtml = (filename: string) => { /** Main method (entry point) */ (async () => { + const sourceDirGlob = join(__dirname, SOURCE_DOCS_DIR, '**'); + const includeFilesStartingWithDot = true; + console.log('Transforming markdown files...'); - const mdFiles = await globby(['./src/docs/**/*.md'], { dot: true }); + const mdFiles = await globby([join(sourceDirGlob, '*.md')], { dot: includeFilesStartingWithDot }); mdFiles.forEach(transformMarkdown); console.log('Transforming html files...'); - const htmlFiles = await globby(['./src/docs/**/*.html'], { dot: true }); + const htmlFiles = await globby([join(sourceDirGlob, '*.html')], { + dot: includeFilesStartingWithDot, + }); htmlFiles.forEach(transformHtml); console.log('Transforming all other files...'); - const otherFiles = await globby(['src/docs/**', '!**/*.md', '!**/*.html'], { dot: true }); + const otherFiles = await globby([sourceDirGlob, '!**/*.md', '!**/*.html'], { + dot: includeFilesStartingWithDot, + }); otherFiles.forEach((file) => { verifyAndCopy(file); }); if (filesWereChanged) { if (verifyOnly) { - console.log( - "Changes detected in files in `src/docs`. Please run `yarn docs:build` after making changes to 'src/docs' to update the `docs` folder." - ); + console.log(WARN_DOCSDIR_DOESNT_MATCH); process.exit(1); } if (git) { - console.log('Adding changes in docs folder to git'); + console.log('Adding changes in ${FINAL_DOCS_DIR} folder to git'); exec('git add docs'); } } From 411d641aa25dc203627ebfbc8a1c560984354890 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 08:35:51 -0700 Subject: [PATCH 08/56] simplfy method to copy transformation to /docs; extract logging Extract the logging so that it if later we want to turn it on/off with a --verbose flag --- src/docs.mts | 65 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 7f1fe9d506..e04296424f 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -68,32 +68,50 @@ const prepareOutFile = (file: string): string => { }; /** - * Verify that a file was changed and (potentially) write the new contents out to the file. Log a message to the console - * If the file was not changed, do nothing. (No message is logged to the console.) + * Log messages to the console showing if the transformed file copied to the final documentation + * directory or still needs to be copied. * - * @param file {string} name of the file that will be verified - * @param content {string} new contents for the file + * @param {string} filename Name of the file that was transformed + * @param {boolean} wasCopied Whether or not the file was copied + */ +const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { + let changeMsg: string; + let logMsg: string; + changeMsg = wasCopied ? LOGMSG_TRANSFORMED : LOGMSG_TO_BE_TRANSFORMED; + logMsg = ` File ${changeMsg}: ${filename}`; + if (wasCopied) { + logMsg += LOGMSG_COPIED; + } + console.log(logMsg); +}; + +/** + * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the + * transformed contents to the final documentation directory if the doCopy flag is true. Log + * messages to the console. + * + * @param {string} file Name of the file that will be verified + * @param {string} [transformedContent] New contents for the file + * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final + * documentation directory. Default is `false` */ -const verifyAndCopy = (file: string, content?: string) => { +const copyTransformedContents = ( + file: string, + transformedContent?: string, + doCopy: boolean = false +) => { const outFile = prepareOutFile(file); const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from('#NEW FILE#'); - const newBuffer = content ? Buffer.from(content) : readFileSync(file); + const newBuffer = transformedContent ? Buffer.from(transformedContent) : readFileSync(file); if (existingBuffer.equals(newBuffer)) { - // Files are same, skip. - return; - } - let changeMsg = 'changed'; - if (verifyOnly) { - changeMsg = 'to be changed'; + return; // Files are same, skip. } - let logMsg = ` File ${changeMsg}: ${outFile}`; - filesWereChanged = true; - if (!verifyOnly) { + filesWereTransformed = true; + if (doCopy) { writeFileSync(outFile, newBuffer); - logMsg += ' ...and copied to /docs'; } - console.log(logMsg); + logWasOrShouldBeTransformed(outFile, doCopy); }; const readSyncedUTF8file = (file: string): string => { @@ -102,6 +120,7 @@ const readSyncedUTF8file = (file: string): string => { /** * Transform a markdown file and write the transformed file to the directory for published documentation + * * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one * place where the documentation is published), this will show the code used for the mermaid diagram * 2. Add the text that says the file is automatically generated @@ -125,7 +144,7 @@ const transformMarkdown = (file: string) => { // Add the AUTOGENERATED_TEXT to the start of the file const transformed = `${AUTOGENERATED_TEXT}\n${remark.stringify(out)}`; - verifyAndCopy( + copyTransformedContents( file, prettier.format(transformed, { parser: 'markdown', @@ -140,6 +159,7 @@ const transformMarkdown = (file: string) => { /** * Transform an HTML file and write the transformed file to the directory for published documentation + * * - Add the text that says the file is automatically generated Verify that the file has been changed * and write out the changes * @@ -161,10 +181,10 @@ const transformHtml = (filename: string) => { const rootElement = htmlDoc.documentElement; rootElement.prepend(autoGeneratedComment); return jsdom.serialize(); - } + }; const transformedHTML = insertAutoGeneratedComment(filename); - verifyAndCopy(filename, transformedHTML); + copyTransformedContents(filename, transformedHTML); }; /** Main method (entry point) */ @@ -187,9 +207,10 @@ const transformHtml = (filename: string) => { dot: includeFilesStartingWithDot, }); otherFiles.forEach((file) => { - verifyAndCopy(file); + copyTransformedContents(file); }); - if (filesWereChanged) { + + if (filesWereTransformed) { if (verifyOnly) { console.log(WARN_DOCSDIR_DOESNT_MATCH); process.exit(1); From c6ce5a80fa3ddcda81bd617355607124cbc1ec68 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 11:00:59 -0700 Subject: [PATCH 09/56] fix: pass in doCopy param --- src/docs.mts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index e04296424f..088e004b02 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -111,7 +111,7 @@ const copyTransformedContents = ( if (doCopy) { writeFileSync(outFile, newBuffer); } - logWasOrShouldBeTransformed(outFile, doCopy); + logWasOrShouldBeTransformed(fileInFinalDocDir, doCopy); }; const readSyncedUTF8file = (file: string): string => { @@ -153,7 +153,8 @@ const transformMarkdown = (file: string) => { endOfLine: 'auto', printWidth: 100, singleQuote: true, - }) + }), + !verifyOnly ); }; From d0074356e9ed9e37e35c2d5963f33c3994cadd23 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 11:01:50 -0700 Subject: [PATCH 10/56] fix: cannot use __dirname with .mts and latest Node --- src/docs.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs.mts b/src/docs.mts index 088e004b02..2baa87f017 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -190,7 +190,7 @@ const transformHtml = (filename: string) => { /** Main method (entry point) */ (async () => { - const sourceDirGlob = join(__dirname, SOURCE_DOCS_DIR, '**'); + const sourceDirGlob = join('.', SOURCE_DOCS_DIR, '**'); const includeFilesStartingWithDot = true; console.log('Transforming markdown files...'); From 73abcd869ca324798fe068ffefe0f67ec5b7658f Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 11:02:22 -0700 Subject: [PATCH 11/56] fix: also check other files --- src/docs.mts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 2baa87f017..877f7a022c 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -207,8 +207,9 @@ const transformHtml = (filename: string) => { const otherFiles = await globby([sourceDirGlob, '!**/*.md', '!**/*.html'], { dot: includeFilesStartingWithDot, }); - otherFiles.forEach((file) => { - copyTransformedContents(file); + otherFiles.forEach((file: string) => { + const transformedContents = readSyncedUTF8file(file); // no transformation is done; just get the contents + copyTransformedContents(file, transformedContents, !verifyOnly); }); if (filesWereTransformed) { From 7fe8f260fc1edd5b5ba616d557442329d6cd76c4 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 11:03:22 -0700 Subject: [PATCH 12/56] minor cleanup, clarify var names, add @todos --- src/docs.mts | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 877f7a022c..738e4c9c94 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -20,13 +20,18 @@ * docs --git * If the --git option is used, the command `git add docs` will be run after all transformations (and/or verifications) have completed successfully * If not files were transformed, the git command is not run. + * + * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to + * get their absolute paths. Ensures that the location of those 2 directories is not dependent on + * where this file resides. + * + * @todo Write a test file for this. (Will need to be able to deal with globby. Jest has trouble with it. */ import { remark } from 'remark'; import type { Code, Root } from 'mdast'; import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; import { JSDOM } from 'jsdom'; - // @ts-ignore import flatmap from 'unist-util-flatmap'; import { globby } from 'globby'; @@ -35,36 +40,35 @@ import { exec } from 'child_process'; // @ts-ignore import prettier from 'prettier'; -const SOURCE_DOCS_DIR = 'src/docs/'; -const FINAL_DOCS_DIR = 'docs/'; -const AUTOGENERATED_TEXT = - '# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in ${SOURCE_DOCS_DIR}.'; +const SOURCE_DOCS_DIR = 'src/docs'; +const FINAL_DOCS_DIR = 'docs'; + +const AUTOGENERATED_TEXT = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in ${SOURCE_DOCS_DIR}.`; const LOGMSG_TRANSFORMED = 'transformed'; const LOGMSG_TO_BE_TRANSFORMED = 'to be transformed'; -const LOGMSG_COPIED = ' ...and copied to ${FINAL_DOCS_DIR}'; +const LOGMSG_COPIED = ` ...and copied to ${FINAL_DOCS_DIR}`; -const WARN_DOCSDIR_DOESNT_MATCH = - "Changed files were transformed in `${SOURCE_DOCS_DIR}` but do not match the files in `${FINAL_DOCS_DIR}`. Please run `yarn docs:build` after making changes to '${SOURCE_DOCS_DIR}' to update the `${FINAL_DOCS_DIR}` directory with the transformed files."; +const WARN_DOCSDIR_DOESNT_MATCH = `Changed files were transformed in ${SOURCE_DOCS_DIR} but do not match the files in ${FINAL_DOCS_DIR}. Please run yarn docs:build after making changes to ${SOURCE_DOCS_DIR} to update the ${FINAL_DOCS_DIR} directory with the transformed files.`; -const verifyOnly = process.argv.includes('--verify'); -const git = process.argv.includes('--git'); +const verifyOnly: boolean = process.argv.includes('--verify'); +const git: boolean = process.argv.includes('--git'); let filesWereTransformed = false; /** * Given a source file name and path, return the documentation destination full path and file name - * Create the destination path if it does not already exist. Possible Improvement: combine with - * lint-staged to only copy files that have changed + * Create the destination path if it does not already exist. * * @param {string} file - Name of the file (including full path) * @returns {string} Name of the file with the path changed from the source directory to final * documentation directory + * @todo Possible Improvement: combine with lint-staged to only copy files that have changed */ -const prepareOutFile = (file: string): string => { - const outFile = join(FINAL_DOCS_DIR, file.replace(SOURCE_DOCS_DIR, '')); - mkdirSync(dirname(outFile), { recursive: true }); - return outFile; +const changeToFinalDocDir = (file: string): string => { + const newDir = file.replace(SOURCE_DOCS_DIR, FINAL_DOCS_DIR); + mkdirSync(dirname(newDir), { recursive: true }); + return newDir; }; /** @@ -100,8 +104,10 @@ const copyTransformedContents = ( transformedContent?: string, doCopy: boolean = false ) => { - const outFile = prepareOutFile(file); - const existingBuffer = existsSync(outFile) ? readFileSync(outFile) : Buffer.from('#NEW FILE#'); + const fileInFinalDocDir = changeToFinalDocDir(file); + const existingBuffer = existsSync(fileInFinalDocDir) + ? readFileSync(fileInFinalDocDir) + : Buffer.from('#NEW FILE#'); const newBuffer = transformedContent ? Buffer.from(transformedContent) : readFileSync(file); if (existingBuffer.equals(newBuffer)) { return; // Files are same, skip. @@ -109,7 +115,7 @@ const copyTransformedContents = ( filesWereTransformed = true; if (doCopy) { - writeFileSync(outFile, newBuffer); + writeFileSync(fileInFinalDocDir, newBuffer); } logWasOrShouldBeTransformed(fileInFinalDocDir, doCopy); }; @@ -185,7 +191,7 @@ const transformHtml = (filename: string) => { }; const transformedHTML = insertAutoGeneratedComment(filename); - copyTransformedContents(filename, transformedHTML); + copyTransformedContents(filename, transformedHTML, !verifyOnly); }; /** Main method (entry point) */ From d18624bbe97f26696c8399a959c5210b049b6bfb Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 16:54:31 -0700 Subject: [PATCH 13/56] change references from /docs to /src/docs; rework doc section in CONTRIBUTING --- CONTRIBUTING.md | 34 +++++++++++++++++++++++++++------- docs/development.md | 14 +++++++------- docs/mindmap.md | 10 +++++----- src/docs/development.md | 14 +++++++------- src/docs/mindmap.md | 10 +++++----- 5 files changed, 51 insertions(+), 31 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb7f3bf5aa..1d65e93f2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,8 +20,8 @@ yarn test We make all changes via pull requests. As we have many pull requests from developers new to mermaid, the current approach is to have _knsv, Knut Sveidqvist_ as a main reviewer of changes and merging pull requests. More precisely like this: - Large changes reviewed by knsv or other developer asked to review by knsv -- Smaller low-risk changes like dependencies, documentation etc can be merged by active collaborators -- documentation (updates to the docs folder is also allowed via direct commits) +- Smaller low-risk changes like dependencies, documentation, etc. can be merged by active collaborators +- Documentation (updates to the `src/docs` folder is also allowed via direct commits) To commit code, create a branch, let it start with the type like feature or bug followed by the issue number for reference and some describing text. @@ -37,12 +37,28 @@ Another: Less strict here, it is OK to commit directly in the `develop` branch if you are a collaborator. -The documentation is located in the `docs` directory and published using GitHub Pages. -The documentation site is powered by [Docsify](https://docsify.js.org), a simple documentation site generator. +The documentation is written in **Markdown**. For more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax). -The documentation is written in Markdown, for more information about Markdown [see the GitHub Markdown help page](https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax). +### Documentation source files are in /src/docs -If you want to preview the documentation site on your machine, you need to install `docsify-cli`: +The source files for the project documentation are located in the `/src/docs` directory. This is where you should make changes. +The files under `/src/docs` are processed to generate the published documentation, and the resulting files are put into the `/docs` directory. + +```mermaid +flowchart LR + classDef default fill:#fff,color:black,stroke:black + + source["files in /src/docs\n(changes should be done here)"] -- automatic processing\nto generate the final documentation--> published["files in /docs\ndisplayed on the official documentation site"] + +``` + +**_DO NOT CHANGE FILES IN `/docs`_** + +### The official documentation site + +**[The mermaid documentation site](https://mermaid-js.github.io/mermaid/) is powered by [Docsify](https://docsify.js.org), a simple documentation site generator.** + +If you want to preview the whole documentation site on your machine, you need to install `docsify-cli`: ```sh $ npm i docsify-cli -g @@ -121,7 +137,11 @@ it('should render forks and joins', () => { Finally, if it is not in the documentation, no one will know about it and then **no one will use it**. Wouldn't that be sad? With all the effort that was put into the feature? -The docs are located in the docs folder and are ofc written in markdown. Just pick the right section and start typing. If you want to add to the structure as in adding a new section and new file you do that via the \_navbar.md. +The source files for documentation are in `/src/docs` and are written in markdown. Just pick the right section and start typing. See the [Committing Documentation](#committing-documentation) section for more about how the documentation is generated. + +#### Adding to or changing the documentation organization + +If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `src/docs/_sidebar.md`. The changes in master is reflected in https://mermaid-js.github.io/mermaid/ once released the updates are committed to https://mermaid-js.github.io/#/ diff --git a/docs/development.md b/docs/development.md index d5cbe891e0..365f639d7e 100644 --- a/docs/development.md +++ b/docs/development.md @@ -8,7 +8,7 @@ So you want to help? That's great! Here are a few things to get you started on the right path. -**The Docs Structure is dictated by [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)** +**The Docs Structure is dictated by [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)** **Note: Commits and Pull Requests should be directed to the develop branch.** @@ -46,9 +46,9 @@ Start with the type, such as **feature** or **bug**, followed by the issue numbe If it is not in the documentation, it's like it never happened. Wouldn't that be sad? With all the effort that was put into the feature? -The docs are located in the `src/docs` folder and are written in Markdown. Just pick the right section and start typing. If you want to propose changes to the structure of the documentation, such as adding a new section or a new file you do that via the **[sidebar](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)**. +The docs are located in the `src/docs` folder and are written in Markdown. Just pick the right section and start typing. If you want to propose changes to the structure of the documentation, such as adding a new section or a new file you do that via the **[sidebar](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)**. -> **All the documents displayed in the github.io page are listed in [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)**. +> **All the documents displayed in the GitHub.io page are listed in [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)**. The contents of are based on the docs from the `master` branch. Updates committed to the `master` branch are reflected in the [Mermaid Docs](https://mermaid-js.github.io/mermaid/) once released. @@ -60,7 +60,7 @@ The documentation is located in the `src/docs` directory and organized according The `docs` folder will be automatically generated when committing to `src/docs` and should not be edited manually. -We encourage contributions to the documentation at [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs). We publish documentation using GitHub Pages with [Docsify](https://www.youtube.com/watch?v=TV88lp7egMw&t=3s) +We encourage contributions to the documentation at [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs). We publish documentation using GitHub Pages with [Docsify](https://www.youtube.com/watch?v=TV88lp7egMw&t=3s) ### Add Unit Tests for Parsing @@ -73,7 +73,7 @@ This tests the rendering and visual appearance of the diagrams. This ensures tha To start working with the e2e tests: 1. Run `yarn dev` to start the dev server -2. Start **Cypress** by running `cypress open` in the **mermaid** folder.\ +2. Start **Cypress** by running `cypress open` in the **mermaid** folder. (Make sure you have path to Cypress in order, the binary is located in `node_modules/.bin`). The rendering tests are very straightforward to create. There is a function `imgSnapshotTest`, which takes a diagram in text form and the mermaid options, and it renders that diagram in Cypress. @@ -114,7 +114,7 @@ Markdown is used to format the text, for more information about Markdown [see th To edit Docs on your computer: -1. Find the Markdown file (.md) to edit in the [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs) directory in the `develop` branch. +1. Find the Markdown file (.md) to edit in the [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs) directory in the `develop` branch. 2. Create a fork of the develop branch. 3. Make changes or add new documentation. 4. Commit changes to your fork and push it to GitHub. @@ -123,7 +123,7 @@ To edit Docs on your computer: To edit Docs on GitHub: 1. Login to [GitHub.com](https://www.github.com). -2. Navigate to [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs). +2. Navigate to [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs). 3. To edit a file, click the pencil icon at the top-right of the file contents panel. 4. Describe what you changed in the **Propose file change** section, located at the bottom of the page. 5. Submit your changes by clicking the button **Propose file change** at the bottom (by automatic creation of a fork and a new branch). diff --git a/docs/mindmap.md b/docs/mindmap.md index f9d732463f..6ab954f5b6 100644 --- a/docs/mindmap.md +++ b/docs/mindmap.md @@ -2,7 +2,7 @@ # Mindmap -**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/mindmap.md) +**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/docs/mindmap.md) > Mindmap: This is an experimental diagram for now. The syntax and properties can change in future releases. The syntax is stabel except for the icon integration which is the experimental part. @@ -64,7 +64,7 @@ In the following example you can see how there are 3 dufferent levels. One with B C -In summary is is a simple text outline where there are one node at the root level called `Root` which has one child `A`. A in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. +In summary is a simple text outline where there are one node at the root level called `Root` which has one child `A`. `A` in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. ```mermaid-example mindmap @@ -168,7 +168,7 @@ More shapes will be added, beginning with the shapes available in flowcharts. ## icons -As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parethesis like in the following example where icons for material design and fontwaresome 4. is displayed. The intention is that this approach should be used for all diagrams supporting icons. **Expermental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change. +As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parenthesis like in the following example where icons for material design and fontawesome 4 are displayed. The intention is that this approach should be used for all diagrams supporting icons. **Experimental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change. ```mermaid-example mindmap @@ -190,7 +190,7 @@ mindmap ## Classes -Again the syntax for adding classes is similar to flowcharts and you can add classes using a tripple colon following a numver of css classes separated by space. In the following example one of the nodes has two custom classes attached urgent turning the background red and the text whiet and large increasing the font size: +Again the syntax for adding classes is similar to flowcharts. You can add classes using a triple colon following a number of css classes separated by space. In the following example one of the nodes has two custom classes attached urgent turning the background red and the text white and large increasing the font size: ```mermaid-example mindmap @@ -222,7 +222,7 @@ The actual indentation does not really matter only compared with the previous ro B C -This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a highter indentation nor does ot haver the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as sieblings. +This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. ```mermaid-example mindmap diff --git a/src/docs/development.md b/src/docs/development.md index 96da46c11f..95e5fe4174 100644 --- a/src/docs/development.md +++ b/src/docs/development.md @@ -6,7 +6,7 @@ So you want to help? That's great! Here are a few things to get you started on the right path. -**The Docs Structure is dictated by [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)** +**The Docs Structure is dictated by [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)** **Note: Commits and Pull Requests should be directed to the develop branch.** @@ -44,9 +44,9 @@ Start with the type, such as **feature** or **bug**, followed by the issue numbe If it is not in the documentation, it's like it never happened. Wouldn't that be sad? With all the effort that was put into the feature? -The docs are located in the `src/docs` folder and are written in Markdown. Just pick the right section and start typing. If you want to propose changes to the structure of the documentation, such as adding a new section or a new file you do that via the **[sidebar](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)**. +The docs are located in the `src/docs` folder and are written in Markdown. Just pick the right section and start typing. If you want to propose changes to the structure of the documentation, such as adding a new section or a new file you do that via the **[sidebar](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)**. -> **All the documents displayed in the github.io page are listed in [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/docs/_sidebar.md)**. +> **All the documents displayed in the GitHub.io page are listed in [sidebar.md](https://github.com/mermaid-js/mermaid/edit/develop/src/docs/_sidebar.md)**. The contents of [https://mermaid-js.github.io/mermaid/](https://mermaid-js.github.io/mermaid/) are based on the docs from the `master` branch. Updates committed to the `master` branch are reflected in the [Mermaid Docs](https://mermaid-js.github.io/mermaid/) once released. @@ -58,7 +58,7 @@ The documentation is located in the `src/docs` directory and organized according The `docs` folder will be automatically generated when committing to `src/docs` and should not be edited manually. -We encourage contributions to the documentation at [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs). We publish documentation using GitHub Pages with [Docsify](https://www.youtube.com/watch?v=TV88lp7egMw&t=3s) +We encourage contributions to the documentation at [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs). We publish documentation using GitHub Pages with [Docsify](https://www.youtube.com/watch?v=TV88lp7egMw&t=3s) ### Add Unit Tests for Parsing @@ -71,7 +71,7 @@ This tests the rendering and visual appearance of the diagrams. This ensures tha To start working with the e2e tests: 1. Run `yarn dev` to start the dev server -2. Start **Cypress** by running `cypress open` in the **mermaid** folder. +2. Start **Cypress** by running `cypress open` in the **mermaid** folder. (Make sure you have path to Cypress in order, the binary is located in `node_modules/.bin`). The rendering tests are very straightforward to create. There is a function `imgSnapshotTest`, which takes a diagram in text form and the mermaid options, and it renders that diagram in Cypress. @@ -112,7 +112,7 @@ Markdown is used to format the text, for more information about Markdown [see th To edit Docs on your computer: -1. Find the Markdown file (.md) to edit in the [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs) directory in the `develop` branch. +1. Find the Markdown file (.md) to edit in the [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs) directory in the `develop` branch. 2. Create a fork of the develop branch. 3. Make changes or add new documentation. 4. Commit changes to your fork and push it to GitHub. @@ -121,7 +121,7 @@ To edit Docs on your computer: To edit Docs on GitHub: 1. Login to [GitHub.com](https://www.github.com). -2. Navigate to [mermaid-js/mermaid/docs](https://github.com/mermaid-js/mermaid/tree/develop/docs). +2. Navigate to [mermaid-js/mermaid/src/docs](https://github.com/mermaid-js/mermaid/tree/develop/src/docs). 3. To edit a file, click the pencil icon at the top-right of the file contents panel. 4. Describe what you changed in the **Propose file change** section, located at the bottom of the page. 5. Submit your changes by clicking the button **Propose file change** at the bottom (by automatic creation of a fork and a new branch). diff --git a/src/docs/mindmap.md b/src/docs/mindmap.md index 1418085149..d7f1b48171 100644 --- a/src/docs/mindmap.md +++ b/src/docs/mindmap.md @@ -1,6 +1,6 @@ # Mindmap -**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/mindmap.md) +**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/docs/mindmap.md) > Mindmap: This is an experimental diagram for now. The syntax and properties can change in future releases. The syntax is stabel except for the icon integration which is the experimental part. @@ -43,7 +43,7 @@ mindmap C ``` -In summary is is a simple text outline where there are one node at the root level called `Root` which has one child `A`. A in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. +In summary is a simple text outline where there are one node at the root level called `Root` which has one child `A`. `A` in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. ```mermaid mindmap @@ -109,7 +109,7 @@ More shapes will be added, beginning with the shapes available in flowcharts. ## icons -As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parethesis like in the following example where icons for material design and fontwaresome 4. is displayed. The intention is that this approach should be used for all diagrams supporting icons. **Expermental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change. +As with flowcharts you can add icons to your nodes but with an updated syntax. The styling for the font based icons are added during the integration so that they are available for the web page. _This is not something a diagram author can do but has to be done with the site administrator or the integrator_. Once the icon fonts are in place you add them to the mind map nodes using the `::icon()` syntax. You place the classes for the icon within the parenthesis like in the following example where icons for material design and fontawesome 4 are displayed. The intention is that this approach should be used for all diagrams supporting icons. **Experimental feature:** This wider scope is also the reason Mindmaps are experimental as this syntax and approach could change. ```mermaid-example mindmap @@ -122,7 +122,7 @@ mindmap ## Classes -Again the syntax for adding classes is similar to flowcharts and you can add classes using a tripple colon following a numver of css classes separated by space. In the following example one of the nodes has two custom classes attached urgent turning the background red and the text whiet and large increasing the font size: +Again the syntax for adding classes is similar to flowcharts. You can add classes using a triple colon following a number of css classes separated by space. In the following example one of the nodes has two custom classes attached urgent turning the background red and the text white and large increasing the font size: ```mermaid-example mindmap @@ -147,7 +147,7 @@ mindmap C ``` -This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a highter indentation nor does ot haver the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as sieblings. +This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. ```mermaid mindmap From be28160a4a9386246e487c6ba8c0c7170450b460 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Mon, 5 Sep 2022 17:01:03 -0700 Subject: [PATCH 14/56] unmangle sentence about doc changes committed and showing up on docsify site --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d65e93f2a..1d55fe3b35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,7 +143,8 @@ The source files for documentation are in `/src/docs` and are written in markdow If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `src/docs/_sidebar.md`. -The changes in master is reflected in https://mermaid-js.github.io/mermaid/ once released the updates are committed to https://mermaid-js.github.io/#/ + +When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/ ## Last words From e690da638dc6467e93db5687aa0413d3eaeaea3d Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 06:40:26 -0700 Subject: [PATCH 15/56] (formatting) prettier fix --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d55fe3b35..8171aeca99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,7 +143,6 @@ The source files for documentation are in `/src/docs` and are written in markdow If you want to add a new section or change the organization (structure), then you need to make sure to **change the side navigation** in `src/docs/_sidebar.md`. - When changes are committed and then released, they become part of the `master` branch and become part of the published documentation on https://mermaid-js.github.io/mermaid/ ## Last words From 5f81e3d5ed4123a562651bd66831365c6648e56a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 7 Sep 2022 20:51:46 +0530 Subject: [PATCH 16/56] chore: Run postbuild with prepare As postbuild was not running with prepare, PR that updated `documentation` package was green, although it should've failed. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cacde6635f..163e509bd0 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "build": "concurrently \"yarn build:dev\" \"yarn build:prod\"", "docs:build": "ts-node-esm src/docs.mts", "docs:verify": "ts-node-esm src/docs.mts --verify", - "postbuild": "documentation build src/mermaidAPI.ts src/config.ts src/defaultConfig.ts --shallow -f md --markdown-toc false > src/docs/Setup.md; yarn docs:build", + "postbuild": "documentation build src/mermaidAPI.ts src/config.ts src/defaultConfig.ts --shallow -f md --markdown-toc false > src/docs/Setup.md && prettier --write src/docs/Setup.md && yarn docs:build", "build:watch": "yarn build:dev --watch", "release": "yarn build", - "lint": "eslint --cache --ignore-path .gitignore .; prettier --check .", - "lint:fix": "eslint --fix --ignore-path .gitignore .; prettier --write .", + "lint": "eslint --cache --ignore-path .gitignore . && prettier --check .", + "lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write .", "e2e:depr": "yarn lint && jest e2e --config e2e/jest.config.js", "cypress": "cypress run", "cypress:open": "cypress open", @@ -43,7 +43,7 @@ "test": "yarn lint && jest src/.*", "test:watch": "jest --watch src", "prepublishOnly": "yarn build && yarn test", - "prepare": "concurrently \"husky install\" \"yarn build:prod\"", + "prepare": "concurrently \"husky install\" \"yarn build:prod\" \"yarn postbuild\"", "pre-commit": "lint-staged" }, "repository": { From a800cb6fe62aa5fb7781cd8f40721acb4ea8d641 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 7 Sep 2022 20:54:19 +0530 Subject: [PATCH 17/56] Update prettier --- package.json | 4 ++-- yarn.lock | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 163e509bd0..a791f05747 100644 --- a/package.json +++ b/package.json @@ -115,8 +115,8 @@ "lint-staged": "^13.0.0", "moment": "^2.23.0", "path-browserify": "^1.0.1", - "prettier": "^2.3.2", - "prettier-plugin-jsdoc": "^0.3.30", + "prettier": "^2.7.1", + "prettier-plugin-jsdoc": "^0.4.2", "remark": "^14.0.2", "start-server-and-test": "^1.12.6", "terser-webpack-plugin": "^5.3.6", diff --git a/yarn.lock b/yarn.lock index 2834342cac..58c3d2818f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9873,16 +9873,16 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prettier-plugin-jsdoc@^0.3.30: - version "0.3.38" - resolved "https://registry.yarnpkg.com/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-0.3.38.tgz#b8adbe9efc1dc11f3cc5ff0b07e0233a0fdf533d" - integrity sha512-h81ZV/nFk5gr3fzWMWzWoz/M/8FneAZxscT7DVSy+5jMIuWYnBFZfSswVKYZyTaZ5r6+6k4hpFTDWhRp85C1tg== +prettier-plugin-jsdoc@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/prettier-plugin-jsdoc/-/prettier-plugin-jsdoc-0.4.2.tgz#c5668fc622ed10b87d988279476f96af96b058b7" + integrity sha512-w2jnAQm3z0GAG0bhzVJeehzDtrhGMSxJjit5ApCc2oxWfc7+jmLAkbtdOXaSpfwZz3IWkk+PiQPeRrLNpbM+Mw== dependencies: binary-searching "^2.0.5" comment-parser "^1.3.1" mdast-util-from-markdown "^1.2.0" -prettier@^2.3.2: +prettier@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== From 6376c9ae43420aa5a6c95a66ceac776e9496fe88 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 14:15:09 -0700 Subject: [PATCH 18/56] switch order of params so the last one can be omitted --- src/docs.mts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 738e4c9c94..cf5f54ae91 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -100,9 +100,9 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { * documentation directory. Default is `false` */ const copyTransformedContents = ( - file: string, - transformedContent?: string, - doCopy: boolean = false + filename: string, + doCopy: boolean = false, + transformedContent?: string ) => { const fileInFinalDocDir = changeToFinalDocDir(file); const existingBuffer = existsSync(fileInFinalDocDir) @@ -152,6 +152,7 @@ const transformMarkdown = (file: string) => { copyTransformedContents( file, + !verifyOnly, prettier.format(transformed, { parser: 'markdown', useTabs: false, @@ -159,8 +160,7 @@ const transformMarkdown = (file: string) => { endOfLine: 'auto', printWidth: 100, singleQuote: true, - }), - !verifyOnly + }) ); }; @@ -191,7 +191,7 @@ const transformHtml = (filename: string) => { }; const transformedHTML = insertAutoGeneratedComment(filename); - copyTransformedContents(filename, transformedHTML, !verifyOnly); + copyTransformedContents(filename, !verifyOnly, transformedHTML); }; /** Main method (entry point) */ @@ -214,8 +214,7 @@ const transformHtml = (filename: string) => { dot: includeFilesStartingWithDot, }); otherFiles.forEach((file: string) => { - const transformedContents = readSyncedUTF8file(file); // no transformation is done; just get the contents - copyTransformedContents(file, transformedContents, !verifyOnly); + copyTransformedContents(file, !verifyOnly); // no transformation }); if (filesWereTransformed) { From fd567f833e76fd4ce4f9155ec0f781ba6c42158d Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Wed, 7 Sep 2022 14:15:54 -0700 Subject: [PATCH 19/56] (minor) clarify var names (file -> filename); comments --- src/docs.mts | 50 +++++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index cf5f54ae91..0c62ea2784 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,9 +1,8 @@ /** - * @file Transform documentation source files into files suitable for publishing and optionally copy - * the transformed files from the source directory to the directory used for the final, published - * documentation directory. The list of files transformed and copied to final documentation - * directory are logged to the console. If a file in the source directory has the same contents in - * the final directory, nothing is done (the final directory is up-to-date). + * @file Transform documentation source files into files suitable for publishing and optionally copy the transformed files from the source directory + * to the directory used for the final, published documentation directory. The list of files transformed and copied to final documentation directory + * are logged to the console. If a file in the source directory has the same contents in the final directory, nothing is done (the final directory + * is up-to-date). * @example * docs * Run with no option flags @@ -21,11 +20,10 @@ * If the --git option is used, the command `git add docs` will be run after all transformations (and/or verifications) have completed successfully * If not files were transformed, the git command is not run. * - * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to - * get their absolute paths. Ensures that the location of those 2 directories is not dependent on - * where this file resides. + * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to get their absolute paths. Ensures that the + * location of those 2 directories is not dependent on where this file resides. * - * @todo Write a test file for this. (Will need to be able to deal with globby. Jest has trouble with it. + * @todo Write a test file for this. (Will need to be able to deal .mts file. Jest has trouble with it.) */ import { remark } from 'remark'; @@ -57,12 +55,10 @@ const git: boolean = process.argv.includes('--git'); let filesWereTransformed = false; /** - * Given a source file name and path, return the documentation destination full path and file name - * Create the destination path if it does not already exist. + * Given a source file name and path, return the documentation destination full path and file name Create the destination path if it does not already exist. * * @param {string} file - Name of the file (including full path) - * @returns {string} Name of the file with the path changed from the source directory to final - * documentation directory + * @returns {string} Name of the file with the path changed from the source directory to final documentation directory * @todo Possible Improvement: combine with lint-staged to only copy files that have changed */ const changeToFinalDocDir = (file: string): string => { @@ -72,8 +68,7 @@ const changeToFinalDocDir = (file: string): string => { }; /** - * Log messages to the console showing if the transformed file copied to the final documentation - * directory or still needs to be copied. + * Log messages to the console showing if the transformed file copied to the final documentation directory or still needs to be copied. * * @param {string} filename Name of the file that was transformed * @param {boolean} wasCopied Whether or not the file was copied @@ -90,25 +85,23 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { }; /** - * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the - * transformed contents to the final documentation directory if the doCopy flag is true. Log - * messages to the console. + * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the transformed contents to the final documentation + * directory if the doCopy flag is true. Log messages to the console. * - * @param {string} file Name of the file that will be verified + * @param {string} filename Name of the file that will be verified * @param {string} [transformedContent] New contents for the file - * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final - * documentation directory. Default is `false` + * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final documentation directory. Default is `false` */ const copyTransformedContents = ( filename: string, doCopy: boolean = false, transformedContent?: string ) => { - const fileInFinalDocDir = changeToFinalDocDir(file); + const fileInFinalDocDir = changeToFinalDocDir(filename); const existingBuffer = existsSync(fileInFinalDocDir) ? readFileSync(fileInFinalDocDir) : Buffer.from('#NEW FILE#'); - const newBuffer = transformedContent ? Buffer.from(transformedContent) : readFileSync(file); + const newBuffer = transformedContent ? Buffer.from(transformedContent) : readFileSync(filename); if (existingBuffer.equals(newBuffer)) { return; // Files are same, skip. } @@ -120,15 +113,15 @@ const copyTransformedContents = ( logWasOrShouldBeTransformed(fileInFinalDocDir, doCopy); }; -const readSyncedUTF8file = (file: string): string => { - return readFileSync(file, 'utf8'); +const readSyncedUTF8file = (filename: string): string => { + return readFileSync(filename, 'utf8'); }; /** * Transform a markdown file and write the transformed file to the directory for published documentation * - * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one - * place where the documentation is published), this will show the code used for the mermaid diagram + * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one place where the documentation is published), this will + * show the code used for the mermaid diagram * 2. Add the text that says the file is automatically generated * 3. Use prettier to format the file Verify that the file has been changed and write out the changes * @@ -167,8 +160,7 @@ const transformMarkdown = (file: string) => { /** * Transform an HTML file and write the transformed file to the directory for published documentation * - * - Add the text that says the file is automatically generated Verify that the file has been changed - * and write out the changes + * - Add the text that says the file is automatically generated Verify that the file has been changed and write out the changes * * @param filename {string} name of the HTML file to transform */ From fe8f52fb1b74820906d4ad13ee3467e88cc1ceca Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 8 Sep 2022 03:35:50 +0100 Subject: [PATCH 20/56] test: disable coverage for `.jison` files Coverage for `.jison` files doesn't make sense, since most of the created JS lines are auto-generated. If jison ever adds a source-map feature, we can renable coverage for jison. --- jest.config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jest.config.js b/jest.config.js index 65ea3ef58e..acb5d6c5dc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,6 +11,10 @@ module.exports = { { 'token-stack': true }, ], }, + coveragePathIgnorePatterns: [ + '/node_modules/', + '^.+\\.jison$', // might be able to fix in future if .jison adds source-map support + ], transformIgnorePatterns: ['/node_modules/(?!dagre-d3-renderer/lib|khroma).*\\.js'], testPathIgnorePatterns: ['/node_modules/', '.cache', './cypress'], moduleNameMapper: { From b760e717d0985d1adc19c7bd703513217f4e03c0 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 8 Sep 2022 03:38:32 +0100 Subject: [PATCH 21/56] build(dev-deps): remove unused `coveralls` This devDependency is currently unused, and seems to have been unused for a while. --- package.json | 1 - yarn.lock | 93 ++-------------------------------------------------- 2 files changed, 2 insertions(+), 92 deletions(-) diff --git a/package.json b/package.json index a791f05747..fec1c6c485 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "babel-jest": "^29.0.2", "babel-loader": "^8.2.2", "concurrently": "^7.0.0", - "coveralls": "^3.0.2", "css-to-string-loader": "^0.1.3", "cypress": "9.7.0", "cypress-image-snapshot": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 58c3d2818f..93968e5c81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3245,7 +3245,7 @@ ajv-keywords@^5.0.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -4622,17 +4622,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -coveralls@^3.0.2: - version "3.1.1" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081" - integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== - dependencies: - js-yaml "^3.13.1" - lcov-parse "^1.0.0" - log-driver "^1.2.7" - minimist "^1.2.5" - request "^2.88.2" - create-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" @@ -6697,19 +6686,6 @@ handlebars@^4.7.6: optionalDependencies: uglify-js "^3.1.4" -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" @@ -6972,15 +6948,6 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - http-signature@~1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" @@ -8205,16 +8172,6 @@ jsonparse@^1.2.0: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jsprim@^1.2.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" - integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" - jsprim@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-2.0.2.tgz#77ca23dbcd4135cd364800d22ff82c2185803d4d" @@ -8297,11 +8254,6 @@ lazystream@^1.0.0: dependencies: readable-stream "^2.0.5" -lcov-parse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" - integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= - lead@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" @@ -8491,11 +8443,6 @@ lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-driver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== - log-symbols@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" @@ -9324,11 +9271,6 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -10464,32 +10406,6 @@ request-progress@^3.0.0: dependencies: throttleit "^1.0.0" -request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -11124,7 +11040,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.14.1, sshpk@^1.7.0: +sshpk@^1.14.1: version "1.16.1" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== @@ -12080,11 +11996,6 @@ uuid@8.3.2, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uvu@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.3.tgz#3d83c5bc1230f153451877bfc7f4aea2392219ae" From 5d7258570523c02f82ffab3fd77e9cfda5215a17 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 8 Sep 2022 03:51:42 +0100 Subject: [PATCH 22/56] ci: re-enable coveralls coverage upload Reverts commits: - Disabling coveralls temporarilly https://github.com/mermaid-js/mermaid/commit/aedf0663379dc4d03e898b39874fc0686bfd8697 - Tmo disabling of coveralls https://github.com/mermaid-js/mermaid/commit/a6b4cb24b8208f661bae838489059296a0ec07e4 I'm not 100% sure whether the `parallel` option is needed, but I've left it disabled for now, since it'd would mean that we need to merge both the `test.yml` and the `e2e.yml` file together. --- .github/workflows/e2e | 6 ++++++ .github/workflows/test.yml | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/e2e b/.github/workflows/e2e index 5b716e429e..3388694909 100644 --- a/.github/workflows/e2e +++ b/.github/workflows/e2e @@ -36,3 +36,9 @@ jobs: run: yarn e2e env: CYPRESS_CACHE_FOLDER: .cache/Cypress + + - name: Upload Coverage to Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: e2e diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97aa0a3778..08c35befab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,3 +32,12 @@ jobs: - name: Run Unit Tests run: | yarn ci --coverage + + - name: Upload Coverage to Coveralls + # it feels a bit weird to use @master, but that's what the docs use + # (coveralls also doesn't publish a @v1 we can use) + # https://github.com/marketplace/actions/coveralls-github-action + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: unit From 9acf63f7d6656877784a57f37aa9329a8f088b2d Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" Date: Thu, 8 Sep 2022 07:44:36 -0700 Subject: [PATCH 23/56] (formatting only) sort imports just to force a new CI lint check --- src/docs.mts | 61 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 0c62ea2784..fe1922bdbc 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,8 +1,9 @@ /** - * @file Transform documentation source files into files suitable for publishing and optionally copy the transformed files from the source directory - * to the directory used for the final, published documentation directory. The list of files transformed and copied to final documentation directory - * are logged to the console. If a file in the source directory has the same contents in the final directory, nothing is done (the final directory - * is up-to-date). + * @file Transform documentation source files into files suitable for publishing and optionally copy + * the transformed files from the source directory to the directory used for the final, published + * documentation directory. The list of files transformed and copied to final documentation + * directory are logged to the console. If a file in the source directory has the same contents in + * the final directory, nothing is done (the final directory is up-to-date). * @example * docs * Run with no option flags @@ -20,23 +21,24 @@ * If the --git option is used, the command `git add docs` will be run after all transformations (and/or verifications) have completed successfully * If not files were transformed, the git command is not run. * - * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to get their absolute paths. Ensures that the - * location of those 2 directories is not dependent on where this file resides. + * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to + * get their absolute paths. Ensures that the location of those 2 directories is not dependent on + * where this file resides. * - * @todo Write a test file for this. (Will need to be able to deal .mts file. Jest has trouble with it.) + * @todo Write a test file for this. (Will need to be able to deal .mts file. Jest has trouble with + * it.) */ - -import { remark } from 'remark'; -import type { Code, Root } from 'mdast'; import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; -import { JSDOM } from 'jsdom'; -// @ts-ignore -import flatmap from 'unist-util-flatmap'; +import { exec } from 'child_process'; import { globby } from 'globby'; +import { JSDOM } from 'jsdom'; +import type { Code, Root } from 'mdast'; import { join, dirname } from 'path'; -import { exec } from 'child_process'; // @ts-ignore import prettier from 'prettier'; +import { remark } from 'remark'; +// @ts-ignore +import flatmap from 'unist-util-flatmap'; const SOURCE_DOCS_DIR = 'src/docs'; const FINAL_DOCS_DIR = 'docs'; @@ -55,10 +57,12 @@ const git: boolean = process.argv.includes('--git'); let filesWereTransformed = false; /** - * Given a source file name and path, return the documentation destination full path and file name Create the destination path if it does not already exist. + * Given a source file name and path, return the documentation destination full path and file name + * Create the destination path if it does not already exist. * * @param {string} file - Name of the file (including full path) - * @returns {string} Name of the file with the path changed from the source directory to final documentation directory + * @returns {string} Name of the file with the path changed from the source directory to final + * documentation directory * @todo Possible Improvement: combine with lint-staged to only copy files that have changed */ const changeToFinalDocDir = (file: string): string => { @@ -68,7 +72,8 @@ const changeToFinalDocDir = (file: string): string => { }; /** - * Log messages to the console showing if the transformed file copied to the final documentation directory or still needs to be copied. + * Log messages to the console showing if the transformed file copied to the final documentation + * directory or still needs to be copied. * * @param {string} filename Name of the file that was transformed * @param {boolean} wasCopied Whether or not the file was copied @@ -85,12 +90,14 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { }; /** - * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the transformed contents to the final documentation - * directory if the doCopy flag is true. Log messages to the console. + * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the + * transformed contents to the final documentation directory if the doCopy flag is true. Log + * messages to the console. * * @param {string} filename Name of the file that will be verified * @param {string} [transformedContent] New contents for the file - * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final documentation directory. Default is `false` + * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final + * documentation directory. Default is `false` */ const copyTransformedContents = ( filename: string, @@ -118,10 +125,12 @@ const readSyncedUTF8file = (filename: string): string => { }; /** - * Transform a markdown file and write the transformed file to the directory for published documentation + * Transform a markdown file and write the transformed file to the directory for published + * documentation * - * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one place where the documentation is published), this will - * show the code used for the mermaid diagram + * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one + * place where the documentation is published), this will show the code used for the mermaid + * diagram * 2. Add the text that says the file is automatically generated * 3. Use prettier to format the file Verify that the file has been changed and write out the changes * @@ -158,9 +167,11 @@ const transformMarkdown = (file: string) => { }; /** - * Transform an HTML file and write the transformed file to the directory for published documentation + * Transform an HTML file and write the transformed file to the directory for published + * documentation * - * - Add the text that says the file is automatically generated Verify that the file has been changed and write out the changes + * - Add the text that says the file is automatically generated Verify that the file has been changed + * and write out the changes * * @param filename {string} name of the HTML file to transform */ From 2826bf6823e1270ff0d8d1b45395cce521f80e6c Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 8 Sep 2022 21:51:42 +0530 Subject: [PATCH 24/56] fix: Formatting issue --- src/docs.mts | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index fe1922bdbc..dfd6a761fd 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -54,6 +54,15 @@ const WARN_DOCSDIR_DOESNT_MATCH = `Changed files were transformed in ${SOURCE_DO const verifyOnly: boolean = process.argv.includes('--verify'); const git: boolean = process.argv.includes('--git'); +// TODO: Read from .prettierrc? +const prettierConfig: prettier.Config = { + useTabs: false, + tabWidth: 2, + endOfLine: 'auto', + printWidth: 100, + singleQuote: true, +}; + let filesWereTransformed = false; /** @@ -151,19 +160,11 @@ const transformMarkdown = (file: string) => { // Add the AUTOGENERATED_TEXT to the start of the file const transformed = `${AUTOGENERATED_TEXT}\n${remark.stringify(out)}`; - - copyTransformedContents( - file, - !verifyOnly, - prettier.format(transformed, { - parser: 'markdown', - useTabs: false, - tabWidth: 2, - endOfLine: 'auto', - printWidth: 100, - singleQuote: true, - }) - ); + const formatted = prettier.format(transformed, { + parser: 'markdown', + ...prettierConfig, + }); + copyTransformedContents(file, !verifyOnly, formatted); }; /** @@ -194,7 +195,11 @@ const transformHtml = (filename: string) => { }; const transformedHTML = insertAutoGeneratedComment(filename); - copyTransformedContents(filename, !verifyOnly, transformedHTML); + const formattedHTML = prettier.format(transformedHTML, { + parser: 'html', + ...prettierConfig, + }); + copyTransformedContents(filename, !verifyOnly, formattedHTML); }; /** Main method (entry point) */ From b0559df9033f120bd2b5e150a99db635a7900902 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 8 Sep 2022 21:52:31 +0530 Subject: [PATCH 25/56] chore: Updated doc files --- docs/8.6.0_docs.md | 2 +- docs/CHANGELOG.md | 2 +- docs/Configuration.md | 2 +- docs/README.md | 2 +- docs/SUMMARY.md | 2 +- docs/Setup.md | 2 +- docs/Tutorials.md | 2 +- docs/_navbar.md | 2 +- docs/_sidebar.md | 2 +- docs/accessibility.md | 2 +- docs/breakingChanges.md | 2 +- docs/c4c.md | 2 +- docs/classDiagram.md | 2 +- docs/developer-docs/configuration.md | 2 +- docs/development.md | 2 +- docs/diagrams-and-syntax-and-examples/flowchart.md | 2 +- docs/directives.md | 2 +- docs/entityRelationshipDiagram.md | 2 +- docs/examples.md | 2 +- docs/faq.md | 2 +- docs/flowchart.md | 2 +- docs/gantt.md | 2 +- docs/gitgraph.md | 2 +- docs/index.html | 2 +- docs/integrations.md | 2 +- docs/introduction.md | 2 +- docs/landing/index.html | 6 +++--- docs/mermaidCLI.md | 2 +- docs/mindmap.md | 2 +- docs/n00b-advanced.md | 2 +- docs/n00b-gettingStarted.md | 2 +- docs/n00b-overview.md | 2 +- docs/n00b-syntaxReference.md | 2 +- docs/newDiagram.md | 2 +- docs/pie.md | 2 +- docs/requirementDiagram.md | 2 +- docs/security.md | 2 +- docs/sequenceDiagram.md | 2 +- docs/stateDiagram.md | 2 +- docs/theming.md | 2 +- docs/upgrading.md | 2 +- docs/usage.md | 2 +- docs/user-journey.md | 2 +- 43 files changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/8.6.0_docs.md b/docs/8.6.0_docs.md index b532a1c94e..9cced28ca6 100644 --- a/docs/8.6.0_docs.md +++ b/docs/8.6.0_docs.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Version 8.6.0 Changes diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d676920b79..20f7afe3a3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Change Log diff --git a/docs/Configuration.md b/docs/Configuration.md index 0df2de104a..1cbaa228f5 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Configuration diff --git a/docs/README.md b/docs/README.md index 9e149dfdb2..e222764889 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # About Mermaid diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 0d32a70101..1b6153b89c 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Summary diff --git a/docs/Setup.md b/docs/Setup.md index 1f948ee018..e02cc1561c 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. diff --git a/docs/Tutorials.md b/docs/Tutorials.md index 0211d35d01..0eac9ccfe6 100644 --- a/docs/Tutorials.md +++ b/docs/Tutorials.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Tutorials diff --git a/docs/_navbar.md b/docs/_navbar.md index 6ec266461f..222926fc48 100644 --- a/docs/_navbar.md +++ b/docs/_navbar.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. - Getting started diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 40e46d835e..a97bd8d726 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. - 📔 Introduction diff --git a/docs/accessibility.md b/docs/accessibility.md index 820fe364ab..70ebef9d17 100644 --- a/docs/accessibility.md +++ b/docs/accessibility.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Accessibility Options diff --git a/docs/breakingChanges.md b/docs/breakingChanges.md index f5bb4ddb3e..01088b9dc4 100644 --- a/docs/breakingChanges.md +++ b/docs/breakingChanges.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Breaking changes diff --git a/docs/c4c.md b/docs/c4c.md index 1b4251785e..48688f1a08 100644 --- a/docs/c4c.md +++ b/docs/c4c.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # C4 Diagrams diff --git a/docs/classDiagram.md b/docs/classDiagram.md index 1576aaa174..6c9ae96fe1 100644 --- a/docs/classDiagram.md +++ b/docs/classDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Class diagrams diff --git a/docs/developer-docs/configuration.md b/docs/developer-docs/configuration.md index a10954416c..e764e200a7 100644 --- a/docs/developer-docs/configuration.md +++ b/docs/developer-docs/configuration.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Configuration diff --git a/docs/development.md b/docs/development.md index 365f639d7e..70762be865 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Development and Contribution 🙌 diff --git a/docs/diagrams-and-syntax-and-examples/flowchart.md b/docs/diagrams-and-syntax-and-examples/flowchart.md index 3aef42ef77..0f798d27fe 100644 --- a/docs/diagrams-and-syntax-and-examples/flowchart.md +++ b/docs/diagrams-and-syntax-and-examples/flowchart.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. --- diff --git a/docs/directives.md b/docs/directives.md index 943dac53f6..8ef732008d 100644 --- a/docs/directives.md +++ b/docs/directives.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Directives diff --git a/docs/entityRelationshipDiagram.md b/docs/entityRelationshipDiagram.md index 34e6a3ac6b..1f24796b68 100644 --- a/docs/entityRelationshipDiagram.md +++ b/docs/entityRelationshipDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Entity Relationship Diagrams diff --git a/docs/examples.md b/docs/examples.md index 174a2c986f..d717083c6a 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Examples diff --git a/docs/faq.md b/docs/faq.md index a1b6e48374..ac5eeeb80b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Frequently Asked Questions diff --git a/docs/flowchart.md b/docs/flowchart.md index 4d469f55e8..3ff17ad028 100644 --- a/docs/flowchart.md +++ b/docs/flowchart.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Flowcharts - Basic Syntax diff --git a/docs/gantt.md b/docs/gantt.md index b0a302d9f1..9d598d9776 100644 --- a/docs/gantt.md +++ b/docs/gantt.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Gantt diagrams diff --git a/docs/gitgraph.md b/docs/gitgraph.md index c423c25154..5f86cf53c8 100644 --- a/docs/gitgraph.md +++ b/docs/gitgraph.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Gitgraph Diagrams diff --git a/docs/index.html b/docs/index.html index 39d454533e..8d291f8e57 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,6 +1,6 @@ - + mermaid - Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, diff --git a/docs/integrations.md b/docs/integrations.md index 16e7357798..57d3bd316c 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Integrations diff --git a/docs/introduction.md b/docs/introduction.md index 38c7c7a0e0..992fbafc1f 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -1 +1 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. diff --git a/docs/landing/index.html b/docs/landing/index.html index 9b1e3749f9..2431ad9bd2 100644 --- a/docs/landing/index.html +++ b/docs/landing/index.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html lang="en"> - <head> + <!--# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs.--><head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> @@ -64,7 +64,7 @@ <h1 class="my-4 text-5xl font-bold leading-tight p-shadow"> using Mermaid.js. </p> <a - href="https://www.amazon.com/Official-Guide-Mermaid-js-beautiful-flowcharts-dp-1801078025/dp/1801078025/ref=mt_other?_encoding=UTF8&me=&qid=1628153965" + href="https://www.amazon.com/Official-Guide-Mermaid-js-beautiful-flowcharts-dp-1801078025/dp/1801078025/ref=mt_other?_encoding=UTF8&me=&qid=1628153965" > <button style="background: #ffa41c; border: 1px solid #ff8f00" @@ -322,7 +322,7 @@ <h3 class="my-4 text-3xl leading-tight"> </p> </h3> <a - href="https://www.amazon.com/Official-Guide-Mermaid-js-beautiful-flowcharts-dp-1801078025/dp/1801078025/ref=mt_other?_encoding=UTF8&me=&qid=1628153965" + href="https://www.amazon.com/Official-Guide-Mermaid-js-beautiful-flowcharts-dp-1801078025/dp/1801078025/ref=mt_other?_encoding=UTF8&me=&qid=1628153965" > <button style="background: #ffa41c; border: 1px solid #ff8f00" diff --git a/docs/mermaidCLI.md b/docs/mermaidCLI.md index e3249315b7..0d32c54728 100644 --- a/docs/mermaidCLI.md +++ b/docs/mermaidCLI.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # mermaid CLI diff --git a/docs/mindmap.md b/docs/mindmap.md index 6ab954f5b6..85dba5eb36 100644 --- a/docs/mindmap.md +++ b/docs/mindmap.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Mindmap diff --git a/docs/n00b-advanced.md b/docs/n00b-advanced.md index 4e9d74b98c..b8970142a6 100644 --- a/docs/n00b-advanced.md +++ b/docs/n00b-advanced.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Advanced n00b mermaid (Coming soon..) diff --git a/docs/n00b-gettingStarted.md b/docs/n00b-gettingStarted.md index f3ade55592..5055425394 100644 --- a/docs/n00b-gettingStarted.md +++ b/docs/n00b-gettingStarted.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # A Mermaid User-Guide for Beginners diff --git a/docs/n00b-overview.md b/docs/n00b-overview.md index 913fcc2f63..c109b63f20 100644 --- a/docs/n00b-overview.md +++ b/docs/n00b-overview.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Overview for Beginners diff --git a/docs/n00b-syntaxReference.md b/docs/n00b-syntaxReference.md index 9f18e3d282..d25c6425e6 100644 --- a/docs/n00b-syntaxReference.md +++ b/docs/n00b-syntaxReference.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Diagram Syntax diff --git a/docs/newDiagram.md b/docs/newDiagram.md index e2191f1de4..285cb7637a 100644 --- a/docs/newDiagram.md +++ b/docs/newDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Adding a New Diagram/Chart 📊 diff --git a/docs/pie.md b/docs/pie.md index 1e13e38729..79dcbfee53 100644 --- a/docs/pie.md +++ b/docs/pie.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Pie chart diagrams diff --git a/docs/requirementDiagram.md b/docs/requirementDiagram.md index c510183d95..d319678716 100644 --- a/docs/requirementDiagram.md +++ b/docs/requirementDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Requirement Diagram diff --git a/docs/security.md b/docs/security.md index e2990eb5b5..ee9033ca21 100644 --- a/docs/security.md +++ b/docs/security.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Security diff --git a/docs/sequenceDiagram.md b/docs/sequenceDiagram.md index ae0bd5e458..97968a6766 100644 --- a/docs/sequenceDiagram.md +++ b/docs/sequenceDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Sequence diagrams diff --git a/docs/stateDiagram.md b/docs/stateDiagram.md index 6af3b0bc49..8ea9fd2398 100644 --- a/docs/stateDiagram.md +++ b/docs/stateDiagram.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # State diagrams diff --git a/docs/theming.md b/docs/theming.md index 287499effe..9ba136ec44 100644 --- a/docs/theming.md +++ b/docs/theming.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Theme Configuration diff --git a/docs/upgrading.md b/docs/upgrading.md index fd7f72d823..c4d7bd3bda 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Upgrading diff --git a/docs/usage.md b/docs/usage.md index 02bd1bb133..e59670d028 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # Usage diff --git a/docs/user-journey.md b/docs/user-journey.md index 9e213f425f..e0d924f85f 100644 --- a/docs/user-journey.md +++ b/docs/user-journey.md @@ -1,4 +1,4 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit corresponding file in src/docs. +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please edit the corresponding file in src/docs. # User Journey Diagram From f8eaccb4c1bdf7fb0545c82adb5368db1ba9a3d3 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod <sidharthv96@gmail.com> Date: Thu, 8 Sep 2022 21:54:51 +0530 Subject: [PATCH 26/56] fix: Run precommit hook for doc.mts changes too --- .lintstagedrc.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index db16ea99ae..b88abda4b2 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,5 @@ { "src/docs/**": ["yarn docs:build --git"], - "*.{ts,js,json,html,md}": ["eslint --fix", "prettier --write"] + "src/docs.mts": ["yarn docs:build --git"], + "*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"] } From 8ca91d6303cc2a9a16bebf94411a9fd563fd766a Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" <registrations@ashleycaroline.com> Date: Fri, 9 Sep 2022 18:32:26 -0700 Subject: [PATCH 27/56] add eslint-disable no-console for file --- src/docs.mts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/docs.mts b/src/docs.mts index dfd6a761fd..dc7ec29e32 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ + /** * @file Transform documentation source files into files suitable for publishing and optionally copy * the transformed files from the source directory to the directory used for the final, published From fc9d22562ba9a62de770ab50a0c4cf0c591a6421 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Sat, 10 Sep 2022 15:53:50 +0200 Subject: [PATCH 28/56] Creating detectors and moving out diagram specific code from the diagramAPI --- cypress/platform/knsv.html | 24 +- docs/Setup.md | 31 +- package.json | 2 +- src/diagram-api/detectType.ts | 37 +-- src/diagram-api/diagram-orchestration.ts | 300 +++++++++++++++++- src/diagram-api/diagramAPI.ts | 212 +------------ src/diagrams/c4/c4Detector.ts | 5 + src/diagrams/class/classDetector-V2.ts | 9 + src/diagrams/class/classDetector.ts | 8 + src/diagrams/er/erDetector.ts | 5 + src/diagrams/flowchart/flowDetector-v2.ts | 8 + src/diagrams/flowchart/flowDetector.ts | 8 + src/diagrams/gantt/ganttDetector.ts | 5 + src/diagrams/info/infoDetector.ts | 5 + src/diagrams/pie/pieDetector.ts | 5 + .../requirement/requirementDetector.ts | 5 + src/diagrams/sequence/sequenceDetector.ts | 5 + src/diagrams/state/stateDetector-V2.ts | 8 + src/diagrams/state/stateDetector.ts | 8 + src/diagrams/user-journey/journeyDetector.ts | 5 + src/docs/Setup.md | 31 +- 21 files changed, 442 insertions(+), 284 deletions(-) create mode 100644 src/diagrams/c4/c4Detector.ts create mode 100644 src/diagrams/class/classDetector-V2.ts create mode 100644 src/diagrams/class/classDetector.ts create mode 100644 src/diagrams/er/erDetector.ts create mode 100644 src/diagrams/flowchart/flowDetector-v2.ts create mode 100644 src/diagrams/flowchart/flowDetector.ts create mode 100644 src/diagrams/gantt/ganttDetector.ts create mode 100644 src/diagrams/info/infoDetector.ts create mode 100644 src/diagrams/pie/pieDetector.ts create mode 100644 src/diagrams/requirement/requirementDetector.ts create mode 100644 src/diagrams/sequence/sequenceDetector.ts create mode 100644 src/diagrams/state/stateDetector-V2.ts create mode 100644 src/diagrams/state/stateDetector.ts create mode 100644 src/diagrams/user-journey/journeyDetector.ts diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html index c98ce70c82..6ce5450820 100644 --- a/cypress/platform/knsv.html +++ b/cypress/platform/knsv.html @@ -38,7 +38,7 @@ </style> </head> <body> - <pre class="mermaid2" style="width: 50%"> + <pre class="mermaid" style="width: 50%"> flowchart LR classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px; classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px; @@ -99,7 +99,7 @@ class A someclass; class C someclass; </pre> - <pre class="mermaid2" style="width: 50%"> + <pre class="mermaid" style="width: 50%"> sequenceDiagram title: My Sequence Diagram Title accTitle: My Acc Sequence Diagram @@ -109,14 +109,14 @@ John-->>Alice: Great! Alice-)John: See you later! </pre> - <pre class="mermaid2" style="width: 50%"> + <pre class="mermaid" style="width: 50%"> graph TD A -->|000| B B -->|111| C linkStyle 1 stroke:#ff3,stroke-width:4px,color:red; </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> journey accTitle: My User Journey Diagram accDescr: My User Journey Diagram Description @@ -130,10 +130,10 @@ Go downstairs: 5: Me Sit down: 5: Me </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> info </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> requirementDiagram accTitle: My req Diagram accDescr: My req Diagram Description @@ -174,7 +174,7 @@ test_req - contains -> test_req3 test_req <- copies - test_entity2 </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> gantt dateFormat YYYY-MM-DD title Adding GANTT diagram functionality to mermaid @@ -206,7 +206,7 @@ Add gantt diagram to demo page :20h Add another diagram to demo page :48h </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> stateDiagram state Active { Idle @@ -234,7 +234,7 @@ end B ->> A: Return </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> classDiagram accTitle: My class diagram accDescr: My class diagram Description @@ -259,7 +259,7 @@ A->>Bob: Hola Bob-->A: Pasten ! </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> gitGraph commit id: "ZERO" branch develop @@ -288,7 +288,7 @@ C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> classDiagram Animal "1" <|-- Duck Animal <|-- Fish @@ -311,7 +311,7 @@ +run() } </pre> - <pre class="mermaid2" style="width: 100%"> + <pre class="mermaid" style="width: 100%"> erDiagram CAR ||--o{ NAMED-DRIVER : allows CAR { diff --git a/docs/Setup.md b/docs/Setup.md index 1f948ee018..2ef56e1d8d 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -1407,6 +1407,15 @@ This sets the auto-wrap padding for the diagram (sides only) **Notes:** Default value: 0. +## parse + +### Parameters + +- `text` **[string][5]** +- `parseError` **[Function][6]?** + +Returns **[boolean][7]** + ## setSiteConfig ## setSiteConfig @@ -1424,7 +1433,7 @@ function _Default value: At default, will mirror Global Config_ - `conf` **MermaidConfig** The base currentConfig to use as siteConfig -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## getSiteConfig @@ -1436,7 +1445,7 @@ Returns **[object][5]** The siteConfig **Notes**: Returns **any** values in siteConfig. -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## setConfig @@ -1475,10 +1484,10 @@ $(function () { ### Parameters -- `id` **[string][6]** The id of the element to be rendered -- `text` **[string][6]** The graph definition -- `cb` **function (svgCode: [string][6], bindFunctions: function (element: [Element][7]): void): void** -- `container` **[Element][7]** Selector to element in which a div with the graph temporarily will be +- `id` **[string][5]** The id of the element to be rendered +- `text` **[string][5]** The graph definition +- `cb` **function (svgCode: [string][5], bindFunctions: function (element: [Element][9]): void): void** +- `container` **[Element][9]** Selector to element in which a div with the graph temporarily will be inserted. If one is provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is completed. @@ -1517,7 +1526,7 @@ Pushes in a directive to the configuration ### Parameters -- `directive` **[object][5]** The directive to push in +- `directive` **[object][8]** The directive to push in ## reset @@ -1615,6 +1624,8 @@ Returns **void** [2]: Setup.md?id=render [3]: 8.6.0_docs.md [4]: #mermaidapi-configuration-defaults -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[7]: https://developer.mozilla.org/docs/Web/API/Element +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[9]: https://developer.mozilla.org/docs/Web/API/Element diff --git a/package.json b/package.json index a791f05747..fa3b69dda3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "9.1.6", + "version": "9.2.0-rc1", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid.min.js", "module": "dist/mermaid.esm.min.mjs", diff --git a/src/diagram-api/detectType.ts b/src/diagram-api/detectType.ts index 87b6817671..817de5149d 100644 --- a/src/diagram-api/detectType.ts +++ b/src/diagram-api/detectType.ts @@ -1,26 +1,12 @@ import { MermaidConfig } from '../config.type'; -export type DiagramDetector = (text: string) => boolean; +export type DiagramDetector = (text: string, config?: MermaidConfig) => boolean; const directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const anyComment = /\s*%%.*\n/gm; const detectors: Record<string, DiagramDetector> = {}; -const diagramMatchers: Record<string, RegExp> = { - c4: /^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/, - sequence: /^\s*sequenceDiagram/, - gantt: /^\s*gantt/, - classDiagram: /^\s*classDiagram-v2/, - stateDiagram: /^\s*stateDiagram-v2/, - 'flowchart-v2': /^\s*flowchart/, // Might need to add |graph to fix #3391 - info: /^\s*info/, - pie: /^\s*pie/, - er: /^\s*erDiagram/, - journey: /^\s*journey/, - // gitGraph: /^\s*gitGraph/, - requirement: /^\s*requirement(Diagram)?/, -}; /** * @function detectType Detects the type of the graph text. Takes into consideration the possible @@ -47,28 +33,9 @@ const diagramMatchers: Record<string, RegExp> = { */ export const detectType = function (text: string, config?: MermaidConfig): string { text = text.replace(directive, '').replace(anyComment, '\n'); - for (const [diagram, matcher] of Object.entries(diagramMatchers)) { - if (text.match(matcher)) { - return diagram; - } - } - - if (text.match(/^\s*classDiagram/)) { - if (config?.class?.defaultRenderer === 'dagre-wrapper') return 'classDiagram'; - return 'class'; - } - - if (text.match(/^\s*stateDiagram/)) { - if (config?.state?.defaultRenderer === 'dagre-wrapper') return 'stateDiagram'; - return 'state'; - } - - if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') { - return 'flowchart-v2'; - } for (const [key, detector] of Object.entries(detectors)) { - if (detector(text)) { + if (detector(text, config)) { return key; } } diff --git a/src/diagram-api/diagram-orchestration.ts b/src/diagram-api/diagram-orchestration.ts index ea0c76ffa9..b9b0520c9f 100644 --- a/src/diagram-api/diagram-orchestration.ts +++ b/src/diagram-api/diagram-orchestration.ts @@ -1,20 +1,310 @@ import { registerDiagram } from './diagramAPI'; -import * as mindmapDb from '../diagrams/mindmap/mindmapDb'; -import mindmapRenderer from '../diagrams/mindmap/mindmapRenderer'; + // @ts-ignore: TODO Fix ts errors import mindmapParser from '../diagrams/mindmap/parser/mindmap'; +import * as mindmapDb from '../diagrams/mindmap/mindmapDb'; import { mindmapDetector } from '../diagrams/mindmap/mindmapDetector'; +import mindmapRenderer from '../diagrams/mindmap/mindmapRenderer'; import mindmapStyles from '../diagrams/mindmap/styles'; -import gitGraphDb from '../diagrams/git/gitGraphAst'; -import gitGraphRenderer from '../diagrams/git/gitGraphRenderer'; // @ts-ignore: TODO Fix ts errors import gitGraphParser from '../diagrams/git/parser/gitGraph'; import { gitGraphDetector } from '../diagrams/git/gitGraphDetector'; +import gitGraphDb from '../diagrams/git/gitGraphAst'; +import gitGraphRenderer from '../diagrams/git/gitGraphRenderer'; import gitGraphStyles from '../diagrams/git/styles'; +// @ts-ignore: TODO Fix ts errors +import c4Parser from '../diagrams/c4/parser/c4Diagram'; +import { c4Detector } from '../diagrams/c4/c4Detector'; +import c4Db from '../diagrams/c4/c4Db'; +import c4Renderer from '../diagrams/c4/c4Renderer'; +import c4Styles from '../diagrams/c4/styles'; + +// @ts-ignore: TODO Fix ts errors +import classParser from '../diagrams/class/parser/classDiagram'; +import { classDetector } from '../diagrams/class/classDetector'; +import { classDetectorV2 } from '../diagrams/class/classDetector-V2'; +import classDb from '../diagrams/class/classDb'; +import classRenderer from '../diagrams/class/classRenderer'; +import classRendererV2 from '../diagrams/class/classRenderer-v2'; +import classStyles from '../diagrams/class/styles'; + +// @ts-ignore: TODO Fix ts errors +import erParser from '../diagrams/er/parser/erDiagram'; +import { erDetector } from '../diagrams/er/erDetector'; +import erDb from '../diagrams/er/erDb'; +import erRenderer from '../diagrams/er/erRenderer'; +import erStyles from '../diagrams/er/styles'; + +// @ts-ignore: TODO Fix ts errors +import flowParser from '../diagrams/flowchart/parser/flow'; +import { flowDetector } from '../diagrams/flowchart/flowDetector'; +import { flowDetectorV2 } from '../diagrams/flowchart/flowDetector-v2'; +import flowDb from '../diagrams/flowchart/flowDb'; +import flowRenderer from '../diagrams/flowchart/flowRenderer'; +import flowRendererV2 from '../diagrams/flowchart/flowRenderer-v2'; +import flowStyles from '../diagrams/flowchart/styles'; + +// @ts-ignore: TODO Fix ts errors +import ganttParser from '../diagrams/gantt/parser/gantt'; +import { ganttDetector } from '../diagrams/gantt/ganttDetector'; +import ganttDb from '../diagrams/gantt/ganttDb'; +import ganttRenderer from '../diagrams/gantt/ganttRenderer'; +import ganttStyles from '../diagrams/gantt/styles'; + +// @ts-ignore: TODO Fix ts errors +import infoParser from '../diagrams/info/parser/info'; +import infoDb from '../diagrams/info/infoDb'; +import infoRenderer from '../diagrams/info/infoRenderer'; +import { infoDetector } from '../diagrams/info/infoDetector'; +import infoStyles from '../diagrams/info/styles'; + +// @ts-ignore: TODO Fix ts errors +import pieParser from '../diagrams/pie/parser/pie'; +import { pieDetector } from '../diagrams/pie/pieDetector'; +import pieDb from '../diagrams/pie/pieDb'; +import pieRenderer from '../diagrams/pie/pieRenderer'; +import pieStyles from '../diagrams/pie/styles'; + +// @ts-ignore: TODO Fix ts errors +import requirementParser from '../diagrams/requirement/parser/requirementDiagram'; +import { requirementDetector } from '../diagrams/requirement/requirementDetector'; +import requirementDb from '../diagrams/requirement/requirementDb'; +import requirementRenderer from '../diagrams/requirement/requirementRenderer'; +import requirementStyles from '../diagrams/requirement/styles'; + +// @ts-ignore: TODO Fix ts errors +import sequenceParser from '../diagrams/sequence/parser/sequenceDiagram'; +import { sequenceDetector } from '../diagrams/sequence/sequenceDetector'; +import sequenceDb from '../diagrams/sequence/sequenceDb'; +import sequenceRenderer from '../diagrams/sequence/sequenceRenderer'; +import sequenceStyles from '../diagrams/sequence/styles'; + +// @ts-ignore: TODO Fix ts errors +import stateParser from '../diagrams/state/parser/stateDiagram'; +import { stateDetector } from '../diagrams/state/stateDetector'; +import { stateDetectorV2 } from '../diagrams/state/stateDetector-V2'; +import stateDb from '../diagrams/state/stateDb'; +import stateRenderer from '../diagrams/state/stateRenderer'; +import stateRendererV2 from '../diagrams/state/stateRenderer-v2'; +import stateStyles from '../diagrams/state/styles'; + +// @ts-ignore: TODO Fix ts errors +import journeyParser from '../diagrams/user-journey/parser/journey'; +import { journeyDetector } from '../diagrams/user-journey/journeyDetector'; +import journeyDb from '../diagrams/user-journey/journeyDb'; +import journeyRenderer from '../diagrams/user-journey/journeyRenderer'; +import journeyStyles from '../diagrams/user-journey/styles'; + export const addDiagrams = () => { - // Register mindmap and other built-in diagrams + registerDiagram( + 'c4', + { + parser: c4Parser, + db: c4Db, + renderer: c4Renderer, + styles: c4Styles, + init: (cnf) => { + c4Renderer.setConf(cnf.c4); + }, + }, + c4Detector + ); + registerDiagram( + 'class', + { + parser: classParser, + db: classDb, + renderer: classRenderer, + styles: classStyles, + init: (cnf) => { + if (!cnf.class) { + cnf.class = {}; + } + cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + classDb.clear(); + }, + }, + classDetector + ); + registerDiagram( + 'classDiagram', + { + parser: classParser, + db: classDb, + renderer: classRendererV2, + styles: classStyles, + init: (cnf) => { + if (!cnf.class) { + cnf.class = {}; + } + cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + classDb.clear(); + }, + }, + classDetectorV2 + ); + registerDiagram( + 'er', + { + parser: erParser, + db: erDb, + renderer: erRenderer, + styles: erStyles, + }, + erDetector + ); + registerDiagram( + 'gantt', + { + parser: ganttParser, + db: ganttDb, + renderer: ganttRenderer, + styles: ganttStyles, + }, + ganttDetector + ); + registerDiagram( + 'info', + { + parser: infoParser, + db: infoDb, + renderer: infoRenderer, + styles: infoStyles, + }, + infoDetector + ); + registerDiagram( + 'pie', + { + parser: pieParser, + db: pieDb, + renderer: pieRenderer, + styles: pieStyles, + }, + pieDetector + ); + registerDiagram( + 'requirement', + { + parser: requirementParser, + db: requirementDb, + renderer: requirementRenderer, + styles: requirementStyles, + }, + requirementDetector + ); + registerDiagram( + 'sequence', + { + parser: sequenceParser, + db: sequenceDb, + renderer: sequenceRenderer, + styles: sequenceStyles, + init: (cnf) => { + if (!cnf.sequence) { + cnf.sequence = {}; + } + cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + if ('sequenceDiagram' in cnf) { + throw new Error( + '`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.' + ); + } + sequenceDb.setWrap(cnf.wrap); + sequenceRenderer.setConf(cnf.sequence); + }, + }, + sequenceDetector + ); + registerDiagram( + 'state', + { + parser: stateParser, + db: stateDb, + renderer: stateRenderer, + styles: stateStyles, + init: (cnf) => { + if (!cnf.state) { + cnf.state = {}; + } + cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + stateDb.clear(); + }, + }, + stateDetector + ); + registerDiagram( + 'stateDiagram', + { + parser: stateParser, + db: stateDb, + renderer: stateRendererV2, + styles: stateStyles, + init: (cnf) => { + if (!cnf.state) { + cnf.state = {}; + } + cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + stateDb.clear(); + }, + }, + stateDetectorV2 + ); + registerDiagram( + 'journey', + { + parser: journeyParser, + db: journeyDb, + renderer: journeyRenderer, + styles: journeyStyles, + init: (cnf) => { + journeyRenderer.setConf(cnf.journey); + journeyDb.clear(); + }, + }, + journeyDetector + ); + + registerDiagram( + 'flowchart', + { + parser: flowParser, + db: flowDb, + renderer: flowRendererV2, + styles: flowStyles, + init: (cnf) => { + flowRenderer.setConf(cnf.flowchart); + if (!cnf.flowchart) { + cnf.flowchart = {}; + } + cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + flowDb.clear(); + flowDb.setGen('gen-1'); + }, + }, + flowDetector + ); + registerDiagram( + 'flowchart-v2', + { + parser: flowParser, + db: flowDb, + renderer: flowRendererV2, + styles: flowStyles, + init: (cnf) => { + flowRendererV2.setConf(cnf.flowchart); + if (!cnf.flowchart) { + cnf.flowchart = {}; + } + cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + flowDb.clear(); + flowDb.setGen('gen-2'); + }, + }, + flowDetectorV2 + ); registerDiagram( 'gitGraph', { parser: gitGraphParser, db: gitGraphDb, renderer: gitGraphRenderer, styles: gitGraphStyles }, diff --git a/src/diagram-api/diagramAPI.ts b/src/diagram-api/diagramAPI.ts index 652e664653..eab74a0228 100644 --- a/src/diagram-api/diagramAPI.ts +++ b/src/diagram-api/diagramAPI.ts @@ -1,62 +1,3 @@ -import c4Db from '../diagrams/c4/c4Db'; -import c4Renderer from '../diagrams/c4/c4Renderer'; -import c4Styles from '../diagrams/c4/styles'; -// @ts-ignore: TODO Fix ts errors -import c4Parser from '../diagrams/c4/parser/c4Diagram'; -import classDb from '../diagrams/class/classDb'; -import classRenderer from '../diagrams/class/classRenderer'; -import classRendererV2 from '../diagrams/class/classRenderer-v2'; -import classStyles from '../diagrams/class/styles'; -// @ts-ignore: TODO Fix ts errors -import classParser from '../diagrams/class/parser/classDiagram'; -import erDb from '../diagrams/er/erDb'; -import erRenderer from '../diagrams/er/erRenderer'; -// @ts-ignore: TODO Fix ts errors -import erParser from '../diagrams/er/parser/erDiagram'; -import erStyles from '../diagrams/er/styles'; -import flowDb from '../diagrams/flowchart/flowDb'; -import flowRenderer from '../diagrams/flowchart/flowRenderer'; -import flowRendererV2 from '../diagrams/flowchart/flowRenderer-v2'; -import flowStyles from '../diagrams/flowchart/styles'; -// @ts-ignore: TODO Fix ts errors -import flowParser from '../diagrams/flowchart/parser/flow'; -import ganttDb from '../diagrams/gantt/ganttDb'; -import ganttRenderer from '../diagrams/gantt/ganttRenderer'; -// @ts-ignore: TODO Fix ts errors -import ganttParser from '../diagrams/gantt/parser/gantt'; -import ganttStyles from '../diagrams/gantt/styles'; - -import infoDb from '../diagrams/info/infoDb'; -import infoRenderer from '../diagrams/info/infoRenderer'; -// @ts-ignore: TODO Fix ts errors -import infoParser from '../diagrams/info/parser/info'; -import infoStyles from '../diagrams/info/styles'; -// @ts-ignore: TODO Fix ts errors -import pieParser from '../diagrams/pie/parser/pie'; -import pieDb from '../diagrams/pie/pieDb'; -import pieRenderer from '../diagrams/pie/pieRenderer'; -import pieStyles from '../diagrams/pie/styles'; -// @ts-ignore: TODO Fix ts errors -import requirementParser from '../diagrams/requirement/parser/requirementDiagram'; -import requirementDb from '../diagrams/requirement/requirementDb'; -import requirementRenderer from '../diagrams/requirement/requirementRenderer'; -import requirementStyles from '../diagrams/requirement/styles'; -// @ts-ignore: TODO Fix ts errors -import sequenceParser from '../diagrams/sequence/parser/sequenceDiagram'; -import sequenceDb from '../diagrams/sequence/sequenceDb'; -import sequenceRenderer from '../diagrams/sequence/sequenceRenderer'; -import sequenceStyles from '../diagrams/sequence/styles'; -// @ts-ignore: TODO Fix ts errors -import stateParser from '../diagrams/state/parser/stateDiagram'; -import stateDb from '../diagrams/state/stateDb'; -import stateRenderer from '../diagrams/state/stateRenderer'; -import stateRendererV2 from '../diagrams/state/stateRenderer-v2'; -import stateStyles from '../diagrams/state/styles'; -import journeyDb from '../diagrams/user-journey/journeyDb'; -import journeyRenderer from '../diagrams/user-journey/journeyRenderer'; -import journeyStyles from '../diagrams/user-journey/styles'; -// @ts-ignore: TODO Fix ts errors -import journeyParser from '../diagrams/user-journey/parser/journey'; import { addDetector, DiagramDetector } from './detectType'; import { log as _log } from '../logger'; import { getConfig as _getConfig } from '../config'; @@ -73,158 +14,7 @@ export interface DiagramDefinition { init?: (config: MermaidConfig) => void; } -const diagrams: Record<string, DiagramDefinition> = { - c4: { - db: c4Db, - renderer: c4Renderer, - parser: c4Parser, - init: (cnf) => { - c4Renderer.setConf(cnf.c4); - }, - styles: c4Styles, - }, - class: { - db: classDb, - renderer: classRenderer, - parser: classParser, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - classDb.clear(); - }, - styles: classStyles, - }, - classDiagram: { - db: classDb, - renderer: classRendererV2, - parser: classParser, - init: (cnf) => { - if (!cnf.class) { - cnf.class = {}; - } - cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - classDb.clear(); - }, - styles: classStyles, - }, - er: { - db: erDb, - renderer: erRenderer, - parser: erParser, - styles: erStyles, - }, - flowchart: { - db: flowDb, - renderer: flowRenderer, - parser: flowParser, - init: (cnf) => { - flowRenderer.setConf(cnf.flowchart); - if (!cnf.flowchart) { - cnf.flowchart = {}; - } - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - flowDb.clear(); - flowDb.setGen('gen-1'); - }, - styles: flowStyles, - }, - 'flowchart-v2': { - db: flowDb, - renderer: flowRendererV2, - parser: flowParser, - init: (cnf) => { - flowRendererV2.setConf(cnf.flowchart); - if (!cnf.flowchart) { - cnf.flowchart = {}; - } - cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - flowDb.clear(); - flowDb.setGen('gen-2'); - }, - styles: flowStyles, - }, - gantt: { - db: ganttDb, - renderer: ganttRenderer, - parser: ganttParser, - styles: ganttStyles, - }, - info: { - db: infoDb, - renderer: infoRenderer, - parser: infoParser, - styles: infoStyles, - }, - pie: { - db: pieDb, - renderer: pieRenderer, - parser: pieParser, - styles: pieStyles, - }, - requirement: { - db: requirementDb, - renderer: requirementRenderer, - parser: requirementParser, - styles: requirementStyles, - }, - sequence: { - db: sequenceDb, - renderer: sequenceRenderer, - parser: sequenceParser, - init: (cnf) => { - if (!cnf.sequence) { - cnf.sequence = {}; - } - cnf.sequence.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - if ('sequenceDiagram' in cnf) { - throw new Error( - '`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.' - ); - } - sequenceDb.setWrap(cnf.wrap); - sequenceRenderer.setConf(cnf.sequence); - }, - styles: sequenceStyles, - }, - state: { - db: stateDb, - renderer: stateRenderer, - parser: stateParser, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - stateDb.clear(); - }, - styles: stateStyles, - }, - stateDiagram: { - db: stateDb, - renderer: stateRendererV2, - parser: stateParser, - init: (cnf) => { - if (!cnf.state) { - cnf.state = {}; - } - cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - stateDb.clear(); - }, - styles: stateStyles, - }, - journey: { - db: journeyDb, - renderer: journeyRenderer, - parser: journeyParser, - init: (cnf) => { - journeyRenderer.setConf(cnf.journey); - journeyDb.clear(); - }, - styles: journeyStyles, - }, -}; +const diagrams: Record<string, DiagramDefinition> = {}; export const registerDiagram = ( id: string, diff --git a/src/diagrams/c4/c4Detector.ts b/src/diagrams/c4/c4Detector.ts new file mode 100644 index 0000000000..2be62bff10 --- /dev/null +++ b/src/diagrams/c4/c4Detector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const c4Detector: DiagramDetector = (txt) => { + return txt.match(/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/) !== null; +}; diff --git a/src/diagrams/class/classDetector-V2.ts b/src/diagrams/class/classDetector-V2.ts new file mode 100644 index 0000000000..a0e2701007 --- /dev/null +++ b/src/diagrams/class/classDetector-V2.ts @@ -0,0 +1,9 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const classDetectorV2: DiagramDetector = (txt, config) => { + // If we have confgured to use dagre-wrapper then we should return true in this function for classDiagram code thus making it use the new class diagram + if (txt.match(/^\s*classDiagram/) !== null && config?.class?.defaultRenderer === 'dagre-wrapper') + return true; + // We have not opted to use the new renderer so we should return true if we detect a class diagram + return txt.match(/^\s*classDiagram-v2/) !== null; +}; diff --git a/src/diagrams/class/classDetector.ts b/src/diagrams/class/classDetector.ts new file mode 100644 index 0000000000..19d8bd2f58 --- /dev/null +++ b/src/diagrams/class/classDetector.ts @@ -0,0 +1,8 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const classDetector: DiagramDetector = (txt, config) => { + // If we have confgured to use dagre-wrapper then we should never return true in this function + if (config?.class?.defaultRenderer === 'dagre-wrapper') return false; + // We have not opted to use the new renderer so we should return true if we detect a class diagram + return txt.match(/^\s*classDiagram/) !== null; +}; diff --git a/src/diagrams/er/erDetector.ts b/src/diagrams/er/erDetector.ts new file mode 100644 index 0000000000..a17eafb817 --- /dev/null +++ b/src/diagrams/er/erDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const erDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*erDiagram/) !== null; +}; diff --git a/src/diagrams/flowchart/flowDetector-v2.ts b/src/diagrams/flowchart/flowDetector-v2.ts new file mode 100644 index 0000000000..f73748c797 --- /dev/null +++ b/src/diagrams/flowchart/flowDetector-v2.ts @@ -0,0 +1,8 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const flowDetectorV2: DiagramDetector = (txt, config) => { + // If we have confgured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram + if (config?.flowchart?.defaultRenderer === 'dagre-wrapper' && txt.match(/^\s*graph/) !== null) + return true; + return txt.match(/^\s*flowchart/) !== null; +}; diff --git a/src/diagrams/flowchart/flowDetector.ts b/src/diagrams/flowchart/flowDetector.ts new file mode 100644 index 0000000000..edc9096c08 --- /dev/null +++ b/src/diagrams/flowchart/flowDetector.ts @@ -0,0 +1,8 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const flowDetector: DiagramDetector = (txt, config) => { + // If we have confired to only use new flow charts this function shohuld always return false + // as in not signalling true for a legacy flowchart + if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') return false; + return txt.match(/^\s*graph/) !== null; +}; diff --git a/src/diagrams/gantt/ganttDetector.ts b/src/diagrams/gantt/ganttDetector.ts new file mode 100644 index 0000000000..926792dcf6 --- /dev/null +++ b/src/diagrams/gantt/ganttDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const ganttDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*gantt/) !== null; +}; diff --git a/src/diagrams/info/infoDetector.ts b/src/diagrams/info/infoDetector.ts new file mode 100644 index 0000000000..68f2ac794f --- /dev/null +++ b/src/diagrams/info/infoDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const infoDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*info/) !== null; +}; diff --git a/src/diagrams/pie/pieDetector.ts b/src/diagrams/pie/pieDetector.ts new file mode 100644 index 0000000000..1e122b0e0f --- /dev/null +++ b/src/diagrams/pie/pieDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const pieDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*pie/) !== null; +}; diff --git a/src/diagrams/requirement/requirementDetector.ts b/src/diagrams/requirement/requirementDetector.ts new file mode 100644 index 0000000000..2e1aa93aeb --- /dev/null +++ b/src/diagrams/requirement/requirementDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const requirementDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*requirement(Diagram)?/) !== null; +}; diff --git a/src/diagrams/sequence/sequenceDetector.ts b/src/diagrams/sequence/sequenceDetector.ts new file mode 100644 index 0000000000..e684332554 --- /dev/null +++ b/src/diagrams/sequence/sequenceDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const sequenceDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*sequenceDiagram/) !== null; +}; diff --git a/src/diagrams/state/stateDetector-V2.ts b/src/diagrams/state/stateDetector-V2.ts new file mode 100644 index 0000000000..8082a47bdb --- /dev/null +++ b/src/diagrams/state/stateDetector-V2.ts @@ -0,0 +1,8 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const stateDetectorV2: DiagramDetector = (text, config) => { + if (text.match(/^\s*stateDiagram-v2/) !== null) return true; + if (text.match(/^\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') + return true; + return false; +}; diff --git a/src/diagrams/state/stateDetector.ts b/src/diagrams/state/stateDetector.ts new file mode 100644 index 0000000000..79dd6586bb --- /dev/null +++ b/src/diagrams/state/stateDetector.ts @@ -0,0 +1,8 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const stateDetector: DiagramDetector = (txt, config) => { + // If we have confired to only use new state diagrams this function should always return false + // as in not signalling true for a legacy state diagram + if (config?.state?.defaultRenderer === 'dagre-wrapper') return false; + return txt.match(/^\s*stateDiagram/) !== null; +}; diff --git a/src/diagrams/user-journey/journeyDetector.ts b/src/diagrams/user-journey/journeyDetector.ts new file mode 100644 index 0000000000..77c8688ae9 --- /dev/null +++ b/src/diagrams/user-journey/journeyDetector.ts @@ -0,0 +1,5 @@ +import type { DiagramDetector } from '../../diagram-api/detectType'; + +export const journeyDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*journey/) !== null; +}; diff --git a/src/docs/Setup.md b/src/docs/Setup.md index a9d8e87e20..41e7068255 100644 --- a/src/docs/Setup.md +++ b/src/docs/Setup.md @@ -1405,6 +1405,15 @@ This sets the auto-wrap padding for the diagram (sides only) **Notes:** Default value: 0. +## parse + +### Parameters + +- `text` **[string][5]** +- `parseError` **[Function][6]?** + +Returns **[boolean][7]** + ## setSiteConfig ## setSiteConfig @@ -1422,7 +1431,7 @@ function _Default value: At default, will mirror Global Config_ - `conf` **MermaidConfig** The base currentConfig to use as siteConfig -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## getSiteConfig @@ -1434,7 +1443,7 @@ Returns **[object][5]** The siteConfig **Notes**: Returns **any** values in siteConfig. -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## setConfig @@ -1473,10 +1482,10 @@ $(function () { ### Parameters -- `id` **[string][6]** The id of the element to be rendered -- `text` **[string][6]** The graph definition -- `cb` **function (svgCode: [string][6], bindFunctions: function (element: [Element][7]): void): void** -- `container` **[Element][7]** Selector to element in which a div with the graph temporarily will be +- `id` **[string][5]** The id of the element to be rendered +- `text` **[string][5]** The graph definition +- `cb` **function (svgCode: [string][5], bindFunctions: function (element: [Element][9]): void): void** +- `container` **[Element][9]** Selector to element in which a div with the graph temporarily will be inserted. If one is provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is completed. @@ -1515,7 +1524,7 @@ Pushes in a directive to the configuration ### Parameters -- `directive` **[object][5]** The directive to push in +- `directive` **[object][8]** The directive to push in ## reset @@ -1613,6 +1622,8 @@ Returns **void** [2]: Setup.md?id=render [3]: 8.6.0_docs.md [4]: #mermaidapi-configuration-defaults -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[7]: https://developer.mozilla.org/docs/Web/API/Element +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[9]: https://developer.mozilla.org/docs/Web/API/Element From 6ad9208119969a7952ecbf4ae5f7c0780383edb0 Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" <ashley.engelund@gmail.com> Date: Sun, 11 Sep 2022 11:37:23 -0700 Subject: [PATCH 29/56] eslint fixes --- src/docs.mts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index dc7ec29e32..6fcea6e607 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -36,10 +36,9 @@ import { globby } from 'globby'; import { JSDOM } from 'jsdom'; import type { Code, Root } from 'mdast'; import { join, dirname } from 'path'; -// @ts-ignore import prettier from 'prettier'; import { remark } from 'remark'; -// @ts-ignore +// @ts-ignore No typescript declaration file import flatmap from 'unist-util-flatmap'; const SOURCE_DOCS_DIR = 'src/docs'; @@ -90,9 +89,8 @@ const changeToFinalDocDir = (file: string): string => { * @param {boolean} wasCopied Whether or not the file was copied */ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { - let changeMsg: string; + const changeMsg = wasCopied ? LOGMSG_TRANSFORMED : LOGMSG_TO_BE_TRANSFORMED; let logMsg: string; - changeMsg = wasCopied ? LOGMSG_TRANSFORMED : LOGMSG_TO_BE_TRANSFORMED; logMsg = ` File ${changeMsg}: ${filename}`; if (wasCopied) { logMsg += LOGMSG_COPIED; @@ -106,15 +104,11 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { * messages to the console. * * @param {string} filename Name of the file that will be verified - * @param {string} [transformedContent] New contents for the file * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final * documentation directory. Default is `false` + * @param {string} [transformedContent] New contents for the file */ -const copyTransformedContents = ( - filename: string, - doCopy: boolean = false, - transformedContent?: string -) => { +const copyTransformedContents = (filename: string, doCopy = false, transformedContent?: string) => { const fileInFinalDocDir = changeToFinalDocDir(filename); const existingBuffer = existsSync(fileInFinalDocDir) ? readFileSync(fileInFinalDocDir) From 9cc7da09fcf259abd634bcd9d2ce9c8e5ed9716a Mon Sep 17 00:00:00 2001 From: "Ashley Engelund (weedySeaDragon @ github)" <ashley.engelund@gmail.com> Date: Sun, 11 Sep 2022 14:10:34 -0700 Subject: [PATCH 30/56] formatting --- src/docs.mts | 72 ++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/src/docs.mts b/src/docs.mts index 6fcea6e607..318f03de0d 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -1,10 +1,11 @@ /* eslint-disable no-console */ /** - * @file Transform documentation source files into files suitable for publishing and optionally copy - * the transformed files from the source directory to the directory used for the final, published - * documentation directory. The list of files transformed and copied to final documentation - * directory are logged to the console. If a file in the source directory has the same contents in + * @file Transform documentation source files into files suitable for publishing + * and optionally copy the transformed files from the source directory to the + * directory used for the final, published documentation directory. The list + * of files transformed and copied to final documentation directory are logged + * to the console. If a file in the source directory has the same contents in * the final directory, nothing is done (the final directory is up-to-date). * @example * docs @@ -23,12 +24,12 @@ * If the --git option is used, the command `git add docs` will be run after all transformations (and/or verifications) have completed successfully * If not files were transformed, the git command is not run. * - * @todo Ensure that the documentation source and final paths are correct by using process.cwd() to - * get their absolute paths. Ensures that the location of those 2 directories is not dependent on - * where this file resides. + * @todo Ensure that the documentation source and final paths are correct by + * using process.cwd() to get their absolute paths. Ensures that the location + * of those 2 directories is not dependent on where this file resides. * - * @todo Write a test file for this. (Will need to be able to deal .mts file. Jest has trouble with - * it.) + * @todo Write a test file for this. (Will need to be able to deal .mts file. + * Jest has trouble with it.) */ import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'fs'; import { exec } from 'child_process'; @@ -67,13 +68,14 @@ const prettierConfig: prettier.Config = { let filesWereTransformed = false; /** - * Given a source file name and path, return the documentation destination full path and file name - * Create the destination path if it does not already exist. + * Given a source file name and path, return the documentation destination full + * path and file name Create the destination path if it does not already exist. * * @param {string} file - Name of the file (including full path) - * @returns {string} Name of the file with the path changed from the source directory to final - * documentation directory - * @todo Possible Improvement: combine with lint-staged to only copy files that have changed + * @returns {string} Name of the file with the path changed from the source + * directory to final documentation directory + * @todo Possible Improvement: combine with lint-staged to only copy files that + * have changed */ const changeToFinalDocDir = (file: string): string => { const newDir = file.replace(SOURCE_DOCS_DIR, FINAL_DOCS_DIR); @@ -82,8 +84,8 @@ const changeToFinalDocDir = (file: string): string => { }; /** - * Log messages to the console showing if the transformed file copied to the final documentation - * directory or still needs to be copied. + * Log messages to the console showing if the transformed file copied to the + * final documentation directory or still needs to be copied. * * @param {string} filename Name of the file that was transformed * @param {boolean} wasCopied Whether or not the file was copied @@ -99,13 +101,14 @@ const logWasOrShouldBeTransformed = (filename: string, wasCopied: boolean) => { }; /** - * If the file contents were transformed, set the _filesWereTransformed_ flag to true and copy the - * transformed contents to the final documentation directory if the doCopy flag is true. Log - * messages to the console. + * If the file contents were transformed, set the _filesWereTransformed_ flag to + * true and copy the transformed contents to the final documentation directory + * if the doCopy flag is true. Log messages to the console. * * @param {string} filename Name of the file that will be verified - * @param {boolean} [doCopy=false] Whether we should copy that transformedContents to the final - * documentation directory. Default is `false` + * @param {boolean} [doCopy=false] Whether we should copy that + * transformedContents to the final documentation directory. Default is + * `false`. Default is `false` * @param {string} [transformedContent] New contents for the file */ const copyTransformedContents = (filename: string, doCopy = false, transformedContent?: string) => { @@ -130,14 +133,15 @@ const readSyncedUTF8file = (filename: string): string => { }; /** - * Transform a markdown file and write the transformed file to the directory for published - * documentation + * Transform a markdown file and write the transformed file to the directory for + * published documentation * - * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the docsify site (one - * place where the documentation is published), this will show the code used for the mermaid - * diagram + * 1. Add a `mermaid-example` block before every `mermaid` or `mmd` block On the + * docsify site (one place where the documentation is published), this will + * show the code used for the mermaid diagram * 2. Add the text that says the file is automatically generated - * 3. Use prettier to format the file Verify that the file has been changed and write out the changes + * 3. Use prettier to format the file Verify that the file has been changed and + * write out the changes * * @param file {string} name of the file that will be verified */ @@ -164,17 +168,17 @@ const transformMarkdown = (file: string) => { }; /** - * Transform an HTML file and write the transformed file to the directory for published - * documentation + * Transform an HTML file and write the transformed file to the directory for + * published documentation * - * - Add the text that says the file is automatically generated Verify that the file has been changed - * and write out the changes + * - Add the text that says the file is automatically generated Verify that the + * file has been changed and write out the changes * * @param filename {string} name of the HTML file to transform */ const transformHtml = (filename: string) => { /** - * Insert the '...auto generated...' comment into an HTML file after the <html> element + * Insert the '...auto generated...' comment into an HTML file after the<html> element * * @param fileName {string} file name that should have the comment inserted * @returns {string} The contents of the file with the comment inserted @@ -204,7 +208,9 @@ const transformHtml = (filename: string) => { const includeFilesStartingWithDot = true; console.log('Transforming markdown files...'); - const mdFiles = await globby([join(sourceDirGlob, '*.md')], { dot: includeFilesStartingWithDot }); + const mdFiles = await globby([join(sourceDirGlob, '*.md')], { + dot: includeFilesStartingWithDot, + }); mdFiles.forEach(transformMarkdown); console.log('Transforming html files...'); From 152795666932cf92af33635d2f98dcbe93e911ba Mon Sep 17 00:00:00 2001 From: Alois Klink <alois@aloisklink.com> Date: Sun, 4 Sep 2022 01:56:43 +0100 Subject: [PATCH 31/56] fix(git): support unusual prefixes in branch name jison throws an error if a branch name starts with an unusual prefix. For example, a branch named `branch/test-branch` will throw a parse error, since jison thinks it's a `branch` command, and not a branch id. An easy fix is to use the `(?=\s|$)` regex to ensure that only 'branch ' or 'branch\n' will be parsed as the branch command. Fixes: https://github.com/mermaid-js/mermaid/issues/3362 --- src/diagrams/git/gitGraphParserV2.spec.js | 28 +++++++++++++++++++++++ src/diagrams/git/parser/gitGraph.jison | 10 ++++---- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/diagrams/git/gitGraphParserV2.spec.js b/src/diagrams/git/gitGraphParserV2.spec.js index 9a33e288fd..b69dd97ac3 100644 --- a/src/diagrams/git/gitGraphParserV2.spec.js +++ b/src/diagrams/git/gitGraphParserV2.spec.js @@ -363,6 +363,34 @@ describe('when parsing a gitGraph', function () { expect(Object.keys(parser.yy.getBranches()).length).toBe(2); }); + it('should allow branch names starting with unusual prefixes', function () { + const str = `gitGraph: + commit + %% branch names starting with numbers are not recommended, but are supported by git + branch branch01 + branch checkout02 + branch cherry-pick03 + branch branch/example-branch + branch merge/test_merge + `; + + parser.parse(str); + const commits = parser.yy.getCommits(); + expect(Object.keys(commits).length).toBe(1); + expect(parser.yy.getCurrentBranch()).toBe('merge/test_merge'); + expect(parser.yy.getDirection()).toBe('LR'); + expect(Object.keys(parser.yy.getBranches()).length).toBe(6); + expect(Object.keys(parser.yy.getBranches())).toEqual( + expect.arrayContaining([ + 'branch01', + 'checkout02', + 'cherry-pick03', + 'branch/example-branch', + 'merge/test_merge', + ]) + ); + }); + it('should handle new branch checkout', function () { const str = `gitGraph: commit diff --git a/src/diagrams/git/parser/gitGraph.jison b/src/diagrams/git/parser/gitGraph.jison index 29edec8083..15909a3143 100644 --- a/src/diagrams/git/parser/gitGraph.jison +++ b/src/diagrams/git/parser/gitGraph.jison @@ -36,7 +36,7 @@ accDescr\s*"{"\s* { this.begin("ac \#[^\n]* /* skip comments */ \%%[^\n]* /* skip comments */ "gitGraph" return 'GG'; -"commit" return 'COMMIT'; +commit(?=\s|$) return 'COMMIT'; "id:" return 'COMMIT_ID'; "type:" return 'COMMIT_TYPE'; "msg:" return 'COMMIT_MSG'; @@ -44,12 +44,12 @@ accDescr\s*"{"\s* { this.begin("ac "REVERSE" return 'REVERSE'; "HIGHLIGHT" return 'HIGHLIGHT'; "tag:" return 'COMMIT_TAG'; -"branch" return 'BRANCH'; +branch(?=\s|$) return 'BRANCH'; "order:" return 'ORDER'; -"merge" return 'MERGE'; -"cherry-pick" return 'CHERRY_PICK'; +merge(?=\s|$) return 'MERGE'; +cherry-pick(?=\s|$) return 'CHERRY_PICK'; // "reset" return 'RESET'; -"checkout" return 'CHECKOUT'; +checkout(?=\s|$) return 'CHECKOUT'; "LR" return 'DIR'; "BT" return 'DIR'; ":" return ':'; From bfa69aa084783ae606769132fc21b9d8f697a319 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod <sidharthv96@gmail.com> Date: Mon, 12 Sep 2022 10:55:13 +0530 Subject: [PATCH 32/56] chore(docs): Remove edit this page --- docs/mindmap.md | 2 -- src/docs/mindmap.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/mindmap.md b/docs/mindmap.md index 6ab954f5b6..8a7e21eb7f 100644 --- a/docs/mindmap.md +++ b/docs/mindmap.md @@ -2,8 +2,6 @@ # Mindmap -**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/docs/mindmap.md) - > Mindmap: This is an experimental diagram for now. The syntax and properties can change in future releases. The syntax is stabel except for the icon integration which is the experimental part. "A mind map is a diagram used to visually organize information into a hierarchy, showing relationships among pieces of the whole. It is often created around a single concept, drawn as an image in the center of a blank page, to which associated representations of ideas such as images, words and parts of words are added. Major ideas are connected directly to the central concept, and other ideas branch out from those major ideas." Wikipedia diff --git a/src/docs/mindmap.md b/src/docs/mindmap.md index d7f1b48171..85a05e04b5 100644 --- a/src/docs/mindmap.md +++ b/src/docs/mindmap.md @@ -1,7 +1,5 @@ # Mindmap -**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/src/docs/mindmap.md) - > Mindmap: This is an experimental diagram for now. The syntax and properties can change in future releases. The syntax is stabel except for the icon integration which is the experimental part. "A mind map is a diagram used to visually organize information into a hierarchy, showing relationships among pieces of the whole. It is often created around a single concept, drawn as an image in the center of a blank page, to which associated representations of ideas such as images, words and parts of words are added. Major ideas are connected directly to the central concept, and other ideas branch out from those major ideas." Wikipedia From 213309f5e238c458a9560b355d218c95a69197ca Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Mon, 12 Sep 2022 07:41:56 +0200 Subject: [PATCH 33/56] Fix for broken tests --- src/diagram-api/diagramAPI.spec.ts | 3 +++ src/diagrams/sequence/sequenceDiagram.spec.js | 8 ++------ src/mermaid.spec.js | 3 +++ test.js | 8 -------- 4 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 test.js diff --git a/src/diagram-api/diagramAPI.spec.ts b/src/diagram-api/diagramAPI.spec.ts index f72384c114..e0c7a283d4 100644 --- a/src/diagram-api/diagramAPI.spec.ts +++ b/src/diagram-api/diagramAPI.spec.ts @@ -1,5 +1,8 @@ import { detectType } from './detectType'; import { getDiagram, registerDiagram } from './diagramAPI'; +import { addDiagrams } from './diagram-orchestration'; + +addDiagrams(); describe('DiagramAPI', () => { it('should return default diagrams', () => { diff --git a/src/diagrams/sequence/sequenceDiagram.spec.js b/src/diagrams/sequence/sequenceDiagram.spec.js index 808eb567ef..5479e49e40 100644 --- a/src/diagrams/sequence/sequenceDiagram.spec.js +++ b/src/diagrams/sequence/sequenceDiagram.spec.js @@ -1,12 +1,8 @@ -// import sequence from './parser/sequenceDiagram'; -// import sequenceDb from './sequenceDb'; import * as configApi from '../../config'; -// import renderer from './sequenceRenderer'; import mermaidAPI from '../../mermaidAPI'; -// import '../../diagram-api/diagramAPI'; import Diagram from '../../Diagram'; - -// console.log('sequenceDiagram', sequenceDb); +import { addDiagrams } from '../../diagram-api/diagram-orchestration'; +addDiagrams(); /** * @param conf * @param key diff --git a/src/mermaid.spec.js b/src/mermaid.spec.js index c6014dfff1..ef870072e8 100644 --- a/src/mermaid.spec.js +++ b/src/mermaid.spec.js @@ -4,6 +4,9 @@ import flowDb from './diagrams/flowchart/flowDb'; import flowParser from './diagrams/flowchart/parser/flow'; import flowRenderer from './diagrams/flowchart/flowRenderer'; import Diagram from './Diagram'; +import { addDiagrams } from './diagram-api/diagram-orchestration'; + +addDiagrams(); const spyOn = jest.spyOn; diff --git a/test.js b/test.js deleted file mode 100644 index fa728c6eda..0000000000 --- a/test.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * - */ -function apa() { - // comment's - const a = 1; - return 'apa' + a; -} From 9e5e7b31e948a99b0b781fc43e1946764ffa4579 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Mon, 12 Sep 2022 08:51:52 +0200 Subject: [PATCH 34/56] Limiting the interaction between the mermaid diagram and Mermaid to the diagramAPI --- src/diagram-api/diagramAPI.ts | 21 ++++++++++++++------- src/diagrams/mindmap/mindmap.spec.js | 2 +- src/diagrams/mindmap/mindmapDb.js | 3 +-- src/diagrams/mindmap/svgDraw.js | 2 -- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/diagram-api/diagramAPI.ts b/src/diagram-api/diagramAPI.ts index eab74a0228..232933e0df 100644 --- a/src/diagram-api/diagramAPI.ts +++ b/src/diagram-api/diagramAPI.ts @@ -1,11 +1,23 @@ -import { addDetector, DiagramDetector } from './detectType'; -import { log as _log } from '../logger'; +import { addDetector, DiagramDetector as _DiagramDetector } from './detectType'; +import { log as _log, setLogLevel as _setLogLevel } from '../logger'; import { getConfig as _getConfig } from '../config'; import { sanitizeText as _sanitizeText } from '../diagrams/common/common'; import { MermaidConfig } from '../config.type'; import { setupGraphViewbox as _setupGraphViewbox } from '../setupGraphViewbox'; import { addStylesForDiagram } from '../styles'; +/* + Packaging and exposing resources for externa diagrams so that they can import + diagramAPI and have access to selct parts of mermaid common code reqiored to + create diagrams worling like the internal diagrams. +*/ +export const log = _log; +export const setLogLevel = _setLogLevel; +export type DiagramDetector = _DiagramDetector; +export const getConfig = _getConfig; +export const sanitizeText = (text: string) => _sanitizeText(text, getConfig()); +export const setupGraphViewbox = _setupGraphViewbox; + export interface DiagramDefinition { db: any; renderer: any; @@ -35,8 +47,3 @@ export const getDiagram = (name: string): DiagramDefinition => { } throw new Error(`Diagram ${name} not found.`); }; - -export const log = _log; -export const getConfig = _getConfig; -export const sanitizeText = (text: string) => _sanitizeText(text, getConfig()); -export const setupGraphViewbox = _setupGraphViewbox; diff --git a/src/diagrams/mindmap/mindmap.spec.js b/src/diagrams/mindmap/mindmap.spec.js index 155b566fb1..e7909ef50b 100644 --- a/src/diagrams/mindmap/mindmap.spec.js +++ b/src/diagrams/mindmap/mindmap.spec.js @@ -1,6 +1,6 @@ import { parser as mindmap } from './parser/mindmap'; import * as mindmapDB from './mindmapDb'; -import { setLogLevel } from '../../logger'; +import { setLogLevel } from '../../diagram-api/diagramAPI'; describe('when parsing a mindmap ', function () { beforeEach(function () { diff --git a/src/diagrams/mindmap/mindmapDb.js b/src/diagrams/mindmap/mindmapDb.js index 48b242c9e0..68906c5fb0 100644 --- a/src/diagrams/mindmap/mindmapDb.js +++ b/src/diagrams/mindmap/mindmapDb.js @@ -1,6 +1,5 @@ /** Created by knut on 15-01-14. */ -import { sanitizeText, getConfig } from '../../diagram-api/diagramAPI'; -import { log as _log } from '../../logger'; +import { sanitizeText, getConfig, log as _log } from '../../diagram-api/diagramAPI'; let nodes = []; let cnt = 0; diff --git a/src/diagrams/mindmap/svgDraw.js b/src/diagrams/mindmap/svgDraw.js index 511c46e206..0b5c5e264a 100644 --- a/src/diagrams/mindmap/svgDraw.js +++ b/src/diagrams/mindmap/svgDraw.js @@ -1,4 +1,3 @@ -const lineBreakRegex = /<br\s*\/?>/gi; import { select } from 'd3'; import * as db from './mindmapDb'; @@ -15,7 +14,6 @@ function wrap(text, width) { .reverse(), word, line = [], - lineNumber = 0, lineHeight = 1.1, // ems y = text.attr('y'), dy = parseFloat(text.attr('dy')), From ca5fbb7fa8934428f636642f843224945279e3fa Mon Sep 17 00:00:00 2001 From: mmorel-35 <mmorel-35@users.noreply.github.com> Date: Mon, 12 Sep 2022 07:20:57 +0000 Subject: [PATCH 35/56] chore: update browsers list --- docs/Setup.md | 31 +++++++++++++++++++++---------- src/docs/Setup.md | 31 +++++++++++++++++++++---------- yarn.lock | 6 +++--- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/docs/Setup.md b/docs/Setup.md index 1f948ee018..2ef56e1d8d 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -1407,6 +1407,15 @@ This sets the auto-wrap padding for the diagram (sides only) **Notes:** Default value: 0. +## parse + +### Parameters + +- `text` **[string][5]** +- `parseError` **[Function][6]?** + +Returns **[boolean][7]** + ## setSiteConfig ## setSiteConfig @@ -1424,7 +1433,7 @@ function _Default value: At default, will mirror Global Config_ - `conf` **MermaidConfig** The base currentConfig to use as siteConfig -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## getSiteConfig @@ -1436,7 +1445,7 @@ Returns **[object][5]** The siteConfig **Notes**: Returns **any** values in siteConfig. -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## setConfig @@ -1475,10 +1484,10 @@ $(function () { ### Parameters -- `id` **[string][6]** The id of the element to be rendered -- `text` **[string][6]** The graph definition -- `cb` **function (svgCode: [string][6], bindFunctions: function (element: [Element][7]): void): void** -- `container` **[Element][7]** Selector to element in which a div with the graph temporarily will be +- `id` **[string][5]** The id of the element to be rendered +- `text` **[string][5]** The graph definition +- `cb` **function (svgCode: [string][5], bindFunctions: function (element: [Element][9]): void): void** +- `container` **[Element][9]** Selector to element in which a div with the graph temporarily will be inserted. If one is provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is completed. @@ -1517,7 +1526,7 @@ Pushes in a directive to the configuration ### Parameters -- `directive` **[object][5]** The directive to push in +- `directive` **[object][8]** The directive to push in ## reset @@ -1615,6 +1624,8 @@ Returns **void** [2]: Setup.md?id=render [3]: 8.6.0_docs.md [4]: #mermaidapi-configuration-defaults -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[7]: https://developer.mozilla.org/docs/Web/API/Element +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[9]: https://developer.mozilla.org/docs/Web/API/Element diff --git a/src/docs/Setup.md b/src/docs/Setup.md index a9d8e87e20..41e7068255 100644 --- a/src/docs/Setup.md +++ b/src/docs/Setup.md @@ -1405,6 +1405,15 @@ This sets the auto-wrap padding for the diagram (sides only) **Notes:** Default value: 0. +## parse + +### Parameters + +- `text` **[string][5]** +- `parseError` **[Function][6]?** + +Returns **[boolean][7]** + ## setSiteConfig ## setSiteConfig @@ -1422,7 +1431,7 @@ function _Default value: At default, will mirror Global Config_ - `conf` **MermaidConfig** The base currentConfig to use as siteConfig -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## getSiteConfig @@ -1434,7 +1443,7 @@ Returns **[object][5]** The siteConfig **Notes**: Returns **any** values in siteConfig. -Returns **[object][5]** The siteConfig +Returns **[object][8]** The siteConfig ## setConfig @@ -1473,10 +1482,10 @@ $(function () { ### Parameters -- `id` **[string][6]** The id of the element to be rendered -- `text` **[string][6]** The graph definition -- `cb` **function (svgCode: [string][6], bindFunctions: function (element: [Element][7]): void): void** -- `container` **[Element][7]** Selector to element in which a div with the graph temporarily will be +- `id` **[string][5]** The id of the element to be rendered +- `text` **[string][5]** The graph definition +- `cb` **function (svgCode: [string][5], bindFunctions: function (element: [Element][9]): void): void** +- `container` **[Element][9]** Selector to element in which a div with the graph temporarily will be inserted. If one is provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is completed. @@ -1515,7 +1524,7 @@ Pushes in a directive to the configuration ### Parameters -- `directive` **[object][5]** The directive to push in +- `directive` **[object][8]** The directive to push in ## reset @@ -1613,6 +1622,8 @@ Returns **void** [2]: Setup.md?id=render [3]: 8.6.0_docs.md [4]: #mermaidapi-configuration-defaults -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[7]: https://developer.mozilla.org/docs/Web/API/Element +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[9]: https://developer.mozilla.org/docs/Web/API/Element diff --git a/yarn.lock b/yarn.lock index 58c3d2818f..8b0ce83d11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3937,9 +3937,9 @@ camelcase@^6.2.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001359: - version "1.0.30001390" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001390.tgz" - integrity sha512-sS4CaUM+/+vqQUlCvCJ2WtDlV81aWtHhqeEVkLokVJJa3ViN4zDxAGfq9R8i1m90uGHxo99cy10Od+lvn3hf0g== + version "1.0.30001397" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001397.tgz" + integrity sha512-SW9N2TbCdLf0eiNDRrrQXx2sOkaakNZbCjgNpPyMJJbiOrU5QzMIrXOVMRM1myBXTD5iTkdrtU/EguCrBocHlA== caseless@~0.12.0: version "0.12.0" From 885e69c809e3fb31f42e4df54f0aeb7603853bb7 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Mon, 12 Sep 2022 10:53:45 +0200 Subject: [PATCH 36/56] Fix for issue with setting the loglevel via numbers --- src/logger.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logger.ts b/src/logger.ts index 57c9cf4bb8..b01934e88b 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -36,6 +36,8 @@ export const setLogLevel = function (level: keyof typeof LEVELS | number | strin if (level in LEVELS) { numericLevel = LEVELS[level as keyof typeof LEVELS]; } + } else if (typeof level === 'number') { + numericLevel = level; } log.trace = () => {}; log.debug = () => {}; From 06365faef32af6a266125e8e36aef51589877822 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Mon, 12 Sep 2022 11:24:58 +0200 Subject: [PATCH 37/56] Moving out tests from mermaid.spec.js --- src/diagram-api/diagramAPI.ts | 4 +- .../flowchart/flowRenderer.addEdges.spec.js | 154 ++++++++++++++++++ src/mermaid.spec.js | 148 ----------------- 3 files changed, 156 insertions(+), 150 deletions(-) create mode 100644 src/diagrams/flowchart/flowRenderer.addEdges.spec.js diff --git a/src/diagram-api/diagramAPI.ts b/src/diagram-api/diagramAPI.ts index 232933e0df..9a86c5b51d 100644 --- a/src/diagram-api/diagramAPI.ts +++ b/src/diagram-api/diagramAPI.ts @@ -6,8 +6,8 @@ import { MermaidConfig } from '../config.type'; import { setupGraphViewbox as _setupGraphViewbox } from '../setupGraphViewbox'; import { addStylesForDiagram } from '../styles'; -/* - Packaging and exposing resources for externa diagrams so that they can import +/* + Packaging and exposing resources for externa diagrams so that they can import diagramAPI and have access to selct parts of mermaid common code reqiored to create diagrams worling like the internal diagrams. */ diff --git a/src/diagrams/flowchart/flowRenderer.addEdges.spec.js b/src/diagrams/flowchart/flowRenderer.addEdges.spec.js new file mode 100644 index 0000000000..1bcb076f10 --- /dev/null +++ b/src/diagrams/flowchart/flowRenderer.addEdges.spec.js @@ -0,0 +1,154 @@ +import flowDb from './flowDb'; +import flowParser from './parser/flow'; +import flowRenderer from './flowRenderer'; +import Diagram from '../../Diagram'; +import { addDiagrams } from '../../diagram-api/diagram-orchestration'; +addDiagrams(); +afterEach(() => { + jest.restoreAllMocks(); +}); + +describe('when using mermaid and ', function () { + describe('when calling addEdges ', function () { + beforeEach(function () { + flowParser.parser.yy = flowDb; + flowDb.clear(); + flowDb.setGen('gen-2'); + }); + it('should handle edges with text', function () { + const diag = new Diagram('graph TD;A-->|text ex|B;'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('normal'); + expect(options.label.match('text ex')).toBeTruthy(); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + + it('should handle edges without text', function () { + const diag = new Diagram('graph TD;A-->B;'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('normal'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + + it('should handle open-ended edges', function () { + const diag = new Diagram('graph TD;A---B;'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('none'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + + it('should handle edges with styles defined', function () { + const diag = new Diagram('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2;'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('none'); + expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + it('should handle edges with interpolation defined', function () { + const diag = new Diagram('graph TD;A---B; linkStyle 0 interpolate basis'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('none'); + expect(options.curve).toBe('basis'); // mocked as string + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + it('should handle edges with text and styles defined', function () { + const diag = new Diagram( + 'graph TD;A---|the text|B; linkStyle 0 stroke:val1,stroke-width:val2;' + ); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('none'); + expect(options.label.match('the text')).toBeTruthy(); + expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + + it('should set fill to "none" by default when handling edges', function () { + const diag = new Diagram('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2;'); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B'); + expect(options.arrowhead).toBe('none'); + expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + + it('should not set fill to none if fill is set in linkStyle', function () { + const diag = new Diagram( + 'graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2,fill:blue;' + ); + diag.db.getVertices(); + const edges = diag.db.getEdges(); + const mockG = { + setEdge: function (start, end, options) { + expect(start).toContain('flowchart-A-'); + expect(end).toContain('flowchart-B-'); + expect(options.arrowhead).toBe('none'); + expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:blue;'); + }, + }; + + flowRenderer.addEdges(edges, mockG, diag); + }); + }); +}); diff --git a/src/mermaid.spec.js b/src/mermaid.spec.js index ef870072e8..fcd83a61bb 100644 --- a/src/mermaid.spec.js +++ b/src/mermaid.spec.js @@ -2,11 +2,6 @@ import mermaid from './mermaid'; import { mermaidAPI } from './mermaidAPI'; import flowDb from './diagrams/flowchart/flowDb'; import flowParser from './diagrams/flowchart/parser/flow'; -import flowRenderer from './diagrams/flowchart/flowRenderer'; -import Diagram from './Diagram'; -import { addDiagrams } from './diagram-api/diagram-orchestration'; - -addDiagrams(); const spyOn = jest.spyOn; @@ -61,149 +56,6 @@ describe('when using mermaid and ', function () { }); }); - describe('when calling addEdges ', function () { - beforeEach(function () { - flowParser.parser.yy = flowDb; - flowDb.clear(); - flowDb.setGen('gen-2'); - }); - it('should handle edges with text', function () { - const diag = new Diagram('graph TD;A-->|text ex|B;'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('normal'); - expect(options.label.match('text ex')).toBeTruthy(); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - - it('should handle edges without text', function () { - const diag = new Diagram('graph TD;A-->B;'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('normal'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - - it('should handle open-ended edges', function () { - const diag = new Diagram('graph TD;A---B;'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('none'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - - it('should handle edges with styles defined', function () { - const diag = new Diagram('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2;'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('none'); - expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - it('should handle edges with interpolation defined', function () { - const diag = new Diagram('graph TD;A---B; linkStyle 0 interpolate basis'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('none'); - expect(options.curve).toBe('basis'); // mocked as string - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - it('should handle edges with text and styles defined', function () { - const diag = new Diagram( - 'graph TD;A---|the text|B; linkStyle 0 stroke:val1,stroke-width:val2;' - ); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('none'); - expect(options.label.match('the text')).toBeTruthy(); - expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - - it('should set fill to "none" by default when handling edges', function () { - const diag = new Diagram('graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2;'); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B'); - expect(options.arrowhead).toBe('none'); - expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:none;'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - - it('should not set fill to none if fill is set in linkStyle', function () { - const diag = new Diagram( - 'graph TD;A---B; linkStyle 0 stroke:val1,stroke-width:val2,fill:blue;' - ); - diag.db.getVertices(); - const edges = diag.db.getEdges(); - const mockG = { - setEdge: function (start, end, options) { - expect(start).toContain('flowchart-A-'); - expect(end).toContain('flowchart-B-'); - expect(options.arrowhead).toBe('none'); - expect(options.style).toBe('stroke:val1;stroke-width:val2;fill:blue;'); - }, - }; - - flowRenderer.addEdges(edges, mockG, diag); - }); - }); - describe('checking validity of input ', function () { beforeEach(function () { flowParser.parser.yy = flowDb; From 7f56112f8ed232472447521d1004746b665b2f96 Mon Sep 17 00:00:00 2001 From: Ashley Engelund <weedySeaDragon@users.noreply.github.com> Date: Mon, 12 Sep 2022 09:17:40 -0700 Subject: [PATCH 38/56] change wording of console log message (use comma) Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com> --- src/docs.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs.mts b/src/docs.mts index 318f03de0d..06a1f4bff8 100644 --- a/src/docs.mts +++ b/src/docs.mts @@ -49,7 +49,7 @@ const AUTOGENERATED_TEXT = `# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. Please const LOGMSG_TRANSFORMED = 'transformed'; const LOGMSG_TO_BE_TRANSFORMED = 'to be transformed'; -const LOGMSG_COPIED = ` ...and copied to ${FINAL_DOCS_DIR}`; +const LOGMSG_COPIED = `, and copied to ${FINAL_DOCS_DIR}`; const WARN_DOCSDIR_DOESNT_MATCH = `Changed files were transformed in ${SOURCE_DOCS_DIR} but do not match the files in ${FINAL_DOCS_DIR}. Please run yarn docs:build after making changes to ${SOURCE_DOCS_DIR} to update the ${FINAL_DOCS_DIR} directory with the transformed files.`; From 07638f5505fe50550723c59c907fc99466708637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 19:27:45 +0200 Subject: [PATCH 39/56] chore(deps): bump actions/checkout from 2 to 3 (#3449) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index c7015dbe7f..396ff4e6ed 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,7 +14,7 @@ jobs: name: check tests if: github.repository_owner == 'mermaid-js' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - uses: testomatio/check-tests@stable From 3d32280c49125c135cf08a3086e184971a1c6f85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 19:30:43 +0200 Subject: [PATCH 40/56] chore(deps-dev): bump typescript from 4.8.2 to 4.8.3 (#3446) Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.2 to 4.8.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.8.2...v4.8.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c6c95ed411..9cd7b42711 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "ts-jest": "^28.0.8", "ts-loader": "^9.3.1", "ts-node": "^10.9.1", - "typescript": "^4.8.2", + "typescript": "^4.8.3", "unist-util-flatmap": "^1.0.0", "webpack": "^5.53.0", "webpack-cli": "^4.7.2", diff --git a/yarn.lock b/yarn.lock index 10b6ff7ad3..cedce91292 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11735,10 +11735,10 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^4.6.4, typescript@^4.8.2: - version "4.8.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" - integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== +typescript@^4.6.4, typescript@^4.8.3: + version "4.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.3.tgz#d59344522c4bc464a65a730ac695007fdb66dd88" + integrity sha512-goMHfm00nWPa8UvR/CPSvykqf6dVV8x/dp0c5mFTMTIu0u0FlGWRioyy7Nn0PGAdHxpJZnuO/ut+PpQ8UiHAig== uglify-js@^3.1.4: version "3.14.4" From b5dcb4f34582f789b6ac4126d79f5bc7efe26835 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod <sidharthv96@gmail.com> Date: Tue, 13 Sep 2022 21:39:19 +0530 Subject: [PATCH 41/56] chore: Turn off eslint rules in spec, demos, etc. --- .eslintrc.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 0da42ae61b..02753280c9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -63,6 +63,13 @@ "rules": { "no-console": "off" } + }, + { + "files": ["./**/*.spec.{ts,js}", "./cypress/**", "./demos/**", "./**/docs/**"], + "rules": { + "jsdoc/require-jsdoc": "off", + "@typescript-eslint/no-unused-vars": "off" + } } ] } From 4fc4d71350d69ff6c029aa83e37dd155184c182a Mon Sep 17 00:00:00 2001 From: Sidharth Vinod <sidharthv96@gmail.com> Date: Tue, 13 Sep 2022 21:39:58 +0530 Subject: [PATCH 42/56] chore: fix eslint warnings --- src/dagre-wrapper/createLabel.js | 4 +-- src/dagre-wrapper/nodes.js | 6 ++-- src/diagrams/c4/c4Db.js | 7 ++-- src/diagrams/c4/c4Renderer.js | 6 ++-- src/diagrams/c4/svgDraw.js | 1 - src/diagrams/class/classRenderer-v2.js | 16 --------- src/diagrams/class/classRenderer.js | 7 +--- src/diagrams/er/erDb.js | 5 +-- src/diagrams/flowchart/flowRenderer.js | 2 -- src/diagrams/gantt/ganttDb.js | 12 ++----- src/diagrams/gantt/ganttRenderer.js | 1 - src/diagrams/git/gitGraphRenderer.js | 35 ++++--------------- src/diagrams/info/infoRenderer.js | 1 - src/diagrams/mindmap/mindmapRenderer.js | 7 ++-- src/diagrams/mindmap/styles.js | 2 +- src/diagrams/pie/pieDb.js | 3 -- src/diagrams/requirement/requirementDb.js | 6 +--- .../requirement/requirementRenderer.js | 1 - src/diagrams/sequence/sequenceDb.js | 3 -- src/diagrams/state/stateDb.js | 8 ----- src/diagrams/state/stateRenderer-v2.js | 1 - src/diagrams/user-journey/journeyDb.js | 7 ---- src/utils.ts | 16 --------- 23 files changed, 25 insertions(+), 132 deletions(-) diff --git a/src/dagre-wrapper/createLabel.js b/src/dagre-wrapper/createLabel.js index 631fb7645e..ba0ce4a5d1 100644 --- a/src/dagre-wrapper/createLabel.js +++ b/src/dagre-wrapper/createLabel.js @@ -1,11 +1,9 @@ import { select } from 'd3'; import { log } from '../logger'; import { getConfig } from '../config'; -import { sanitizeText, evaluate } from '../diagrams/common/common'; +import { evaluate } from '../diagrams/common/common'; import { decodeEntities } from '../mermaidAPI'; -const sanitizeTxt = (txt) => sanitizeText(txt, getConfig()); - /** * @param dom * @param styleFn diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js index 344210e93d..f25eb2e86b 100644 --- a/src/dagre-wrapper/nodes.js +++ b/src/dagre-wrapper/nodes.js @@ -6,9 +6,7 @@ import intersect from './intersect/index.js'; import createLabel from './createLabel'; import note from './shapes/note'; import { parseMember } from '../diagrams/class/svgDraw'; -import { evaluate, sanitizeText as sanitize } from '../diagrams/common/common'; - -const sanitizeText = (txt) => sanitize(txt, getConfig()); +import { evaluate } from '../diagrams/common/common'; const question = (parent, node) => { const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true); @@ -348,7 +346,7 @@ const rect = (parent, node) => { }; const labelRect = (parent, node) => { - const { shapeSvg, bbox, halfPadding } = labelHelper(parent, node, 'label', true); + const { shapeSvg } = labelHelper(parent, node, 'label', true); log.trace('Classes = ', node.classes); // add the rect diff --git a/src/diagrams/c4/c4Db.js b/src/diagrams/c4/c4Db.js index d53d6d31ff..aa597a179a 100644 --- a/src/diagrams/c4/c4Db.js +++ b/src/diagrams/c4/c4Db.js @@ -1,6 +1,5 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import { log } from '../../logger'; import { sanitizeText } from '../common/common'; import { setAccTitle, getAccTitle, getAccDescription, setAccDescription } from '../../commonDb'; @@ -21,7 +20,6 @@ let boundarys = [ let rels = []; let title = ''; let wrapEnabled = false; -let description = ''; let c4ShapeInRow = 4; let c4BoundaryInRow = 2; var c4Type; @@ -636,13 +634,13 @@ export const updateLayoutConfig = function (typeC4Shape, c4ShapeInRowParam, c4Bo let c4BoundaryInRowValue = c4BoundaryInRow; if (typeof c4ShapeInRowParam === 'object') { - let [key, value] = Object.entries(c4ShapeInRowParam)[0]; + let [, value] = Object.entries(c4ShapeInRowParam)[0]; c4ShapeInRowValue = parseInt(value); } else { c4ShapeInRowValue = parseInt(c4ShapeInRowParam); } if (typeof c4BoundaryInRowParam === 'object') { - let [key, value] = Object.entries(c4BoundaryInRowParam)[0]; + let [, value] = Object.entries(c4BoundaryInRowParam)[0]; c4BoundaryInRowValue = parseInt(value); } else { c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); @@ -721,7 +719,6 @@ export const clear = function () { boundaryParseStack = ['']; title = ''; wrapEnabled = false; - description = ''; c4ShapeInRow = 4; c4BoundaryInRow = 2; }; diff --git a/src/diagrams/c4/c4Renderer.js b/src/diagrams/c4/c4Renderer.js index 137b89b890..c3402d0b94 100644 --- a/src/diagrams/c4/c4Renderer.js +++ b/src/diagrams/c4/c4Renderer.js @@ -1,5 +1,5 @@ import { select } from 'd3'; -import svgDraw, { drawText, fixLifeLineHeights } from './svgDraw'; +import svgDraw from './svgDraw'; import { log } from '../../logger'; import { parser } from './parser/c4Diagram'; import common from '../common/common'; @@ -298,7 +298,7 @@ export const drawC4ShapeArray = function (currentBounds, diagram, c4ShapeArray, currentBounds.insert(c4Shape); - const height = svgDraw.drawC4Shape(diagram, c4Shape, conf); + svgDraw.drawC4Shape(diagram, c4Shape, conf); } currentBounds.bumpLastMargin(conf.c4ShapeMargin); @@ -616,7 +616,7 @@ export const draw = function (_text, id, _version, diagObj) { globalBoundaryMaxY = conf.diagramMarginY; const title = diagObj.db.getTitle(); - const c4type = diagObj.db.getC4Type(); + const c4type = diagObj.db.getC4Type(); // TODO: @knsv: remove this? let currentBoundarys = diagObj.db.getBoundarys(''); // switch (c4type) { // case 'C4Context': diff --git a/src/diagrams/c4/svgDraw.js b/src/diagrams/c4/svgDraw.js index c67fb2649b..5666d9f844 100644 --- a/src/diagrams/c4/svgDraw.js +++ b/src/diagrams/c4/svgDraw.js @@ -1,5 +1,4 @@ import common from '../common/common'; -import { addFunction } from '../../interactionDb'; import { sanitizeUrl } from '@braintree/sanitize-url'; export const drawRect = function (elem, rectData) { diff --git a/src/diagrams/class/classRenderer-v2.js b/src/diagrams/class/classRenderer-v2.js index a211ab5522..20722e6d05 100644 --- a/src/diagrams/class/classRenderer-v2.js +++ b/src/diagrams/class/classRenderer-v2.js @@ -3,7 +3,6 @@ import graphlib from 'graphlib'; import { log } from '../../logger'; import { getConfig } from '../../config'; import { render } from '../../dagre-wrapper/index.js'; -// import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; import { curveLinear } from 'd3'; import { interpolateToCurve, getStylesFromArray } from '../../utils'; import { setupGraphViewbox } from '../../setupGraphViewbox'; @@ -11,7 +10,6 @@ import common from '../common/common'; import addSVGAccessibilityFields from '../../accessibility'; let idCache = {}; -const padding = 20; const sanitizeText = (txt) => common.sanitizeText(txt, getConfig()); @@ -235,20 +233,6 @@ export const addRelations = function (relations, g) { }); }; -/** - * Gets the ID with the same label as in the cache - * - * @param {string} label The label to look for - * @returns {string} The resulting ID - */ -const getGraphId = function (label) { - const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label); - - if (foundEntry) { - return foundEntry[0]; - } -}; - /** * Merges the value of `conf` with the passed `cnf` * diff --git a/src/diagrams/class/classRenderer.js b/src/diagrams/class/classRenderer.js index 6536cb5a17..612a7d8796 100644 --- a/src/diagrams/class/classRenderer.js +++ b/src/diagrams/class/classRenderer.js @@ -10,12 +10,6 @@ import addSVGAccessibilityFields from '../../accessibility'; let idCache = {}; const padding = 20; -const confa = { - dividerMargin: 10, - padding: 5, - textHeight: 10, -}; - /** * Gets the ID with the same label as in the cache * @@ -163,6 +157,7 @@ export const draw = function (text, id, _version, diagObj) { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); + // TODO: @knsv doc is not used, bug? const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found diff --git a/src/diagrams/er/erDb.js b/src/diagrams/er/erDb.js index 856d54979d..ad3454f846 100644 --- a/src/diagrams/er/erDb.js +++ b/src/diagrams/er/erDb.js @@ -1,7 +1,7 @@ import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -12,8 +12,6 @@ import { let entities = {}; let relationships = []; -let title = ''; -let description = ''; const Cardinality = { ZERO_OR_ONE: 'ZERO_OR_ONE', @@ -78,7 +76,6 @@ const getRelationships = () => relationships; const clear = function () { entities = {}; relationships = []; - title = ''; commonClear(); }; diff --git a/src/diagrams/flowchart/flowRenderer.js b/src/diagrams/flowchart/flowRenderer.js index 5b14330ddc..0c3aa3623e 100644 --- a/src/diagrams/flowchart/flowRenderer.js +++ b/src/diagrams/flowchart/flowRenderer.js @@ -29,8 +29,6 @@ export const setConf = function (cnf) { * @param diagObj */ export const addVertices = function (vert, g, svgId, root, _doc, diagObj) { - const securityLevel = getConfig().securityLevel; - const svg = !root ? select(`[id="${svgId}"]`) : root.select(`[id="${svgId}"]`); const doc = !_doc ? document : _doc; const keys = Object.keys(vert); diff --git a/src/diagrams/gantt/ganttDb.js b/src/diagrams/gantt/ganttDb.js index f6a526759e..5d072b9037 100644 --- a/src/diagrams/gantt/ganttDb.js +++ b/src/diagrams/gantt/ganttDb.js @@ -4,7 +4,7 @@ import { log } from '../../logger'; import * as configApi from '../../config'; import utils from '../../utils'; import mermaidAPI from '../../mermaidAPI'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -21,8 +21,6 @@ let todayMarker = ''; let includes = []; let excludes = []; let links = {}; -let title = ''; -let accDescription = ''; let sections = []; let tasks = []; let currentSection = ''; @@ -34,10 +32,6 @@ let topAxis = false; // The serial order of the task in the script let lastOrder = 0; -const sanitizeText = function (txt) { - return common.sanitizeText(txt, configApi.getConfig()); -}; - export const parseDirective = function (statement, context, type) { mermaidAPI.parseDirective(this, statement, context, type); }; @@ -47,7 +41,6 @@ export const clear = function () { tasks = []; currentSection = ''; funs = []; - title = ''; taskCnt = 0; lastTask = undefined; lastTaskID = undefined; @@ -247,7 +240,8 @@ const getStartDate = function (prevTime, dateFormat, str) { * - `ms` for milliseconds * * @param {string} str - A string representing the duration. - * @returns {moment.Duration} A moment duration, including an invalid moment for invalid input string. + * @returns {moment.Duration} A moment duration, including an invalid moment for invalid input + * string. */ const parseDuration = function (str) { const statement = /^(\d+(?:\.\d+)?)([yMwdhms]|ms)$/.exec(str.trim()); diff --git a/src/diagrams/gantt/ganttRenderer.js b/src/diagrams/gantt/ganttRenderer.js index 5a24d6d3f6..3b12bc1911 100644 --- a/src/diagrams/gantt/ganttRenderer.js +++ b/src/diagrams/gantt/ganttRenderer.js @@ -391,7 +391,6 @@ export const draw = function (text, id, version, diagObj) { if (securityLevel === 'sandbox') { let sandboxElement; sandboxElement = select('#i' + id); - const root = select(sandboxElement.nodes()[0].contentDocument.body); const doc = sandboxElement.nodes()[0].contentDocument; rectangles diff --git a/src/diagrams/git/gitGraphRenderer.js b/src/diagrams/git/gitGraphRenderer.js index 5a9036b88e..2a538f791a 100644 --- a/src/diagrams/git/gitGraphRenderer.js +++ b/src/diagrams/git/gitGraphRenderer.js @@ -5,7 +5,6 @@ import { getConfig } from '../../config'; import addSVGAccessibilityFields from '../../accessibility'; let allCommitsDict = {}; -let branchNum; const commitType = { NORMAL: 0, @@ -83,7 +82,7 @@ const drawCommits = (svg, commits, modifyGraph) => { const sortedKeys = keys.sort((a, b) => { return commits[a].seq - commits[b].seq; }); - sortedKeys.forEach((key, index) => { + sortedKeys.forEach((key) => { const commit = commits[key]; const y = branchPos[commit.branch].pos; @@ -290,18 +289,15 @@ const drawCommits = (svg, commits, modifyGraph) => { }; /** - * Detect if there are other commits between commit1's x-position and commit2's x-position on the same - * branch as commit2. + * Detect if there are other commits between commit1's x-position and commit2's x-position on the + * same branch as commit2. * * @param {any} commit1 * @param {any} commit2 * @param allCommits - * @returns {boolean} if there are commits between commit1's x-position and commit2's x-position + * @returns {boolean} If there are commits between commit1's x-position and commit2's x-position */ const hasOverlappingCommits = (commit1, commit2, allCommits) => { - const commit1Pos = commitPos[commit2.id]; - const commit2Pos = commitPos[commit1.id]; - // Find commits on the same branch as commit2 const keys = Object.keys(allCommits); const overlappingComits = keys.filter((key) => { @@ -322,7 +318,7 @@ const hasOverlappingCommits = (commit1, commit2, allCommits) => { * @param {any} y1 * @param {any} y2 * @param {any} _depth - * @returns {number} y value between y1 and y2 + * @returns {number} Y value between y1 and y2 */ const findLane = (y1, y2, _depth) => { const depth = _depth || 0; @@ -355,25 +351,11 @@ const findLane = (y1, y2, _depth) => { * @param {any} allCommits */ const drawArrow = (svg, commit1, commit2, allCommits) => { - const conf = getConfig(); - const p1 = commitPos[commit1.id]; const p2 = commitPos[commit2.id]; const overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); // log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id); - let url = ''; - if (conf.arrowMarkerAbsolute) { - url = - window.location.protocol + - '//' + - window.location.host + - window.location.pathname + - window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } - let arc = ''; let arc2 = ''; let radius = 0; @@ -431,7 +413,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => { } ${p2.y}`; } } - const arrow = svg + svg .append('path') .attr('d', lineDef) .attr('class', 'arrow arrow' + (colorClassNum % THEME_COLOR_LIMIT)); @@ -439,10 +421,7 @@ const drawArrow = (svg, commit1, commit2, allCommits) => { const drawArrows = (svg, commits) => { const gArrows = svg.append('g').attr('class', 'commit-arrows'); - let pos = 0; - - const k = Object.keys(commits); - k.forEach((key, index) => { + Object.keys(commits).forEach((key) => { const commit = commits[key]; if (commit.parents && commit.parents.length > 0) { commit.parents.forEach((parent) => { diff --git a/src/diagrams/info/infoRenderer.js b/src/diagrams/info/infoRenderer.js index 9e81b9ffbe..b50178481b 100644 --- a/src/diagrams/info/infoRenderer.js +++ b/src/diagrams/info/infoRenderer.js @@ -27,7 +27,6 @@ export const draw = (text, id, version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Parse the graph definition // parser.parse(text); diff --git a/src/diagrams/mindmap/mindmapRenderer.js b/src/diagrams/mindmap/mindmapRenderer.js index caa8baedbf..37cce58bf6 100644 --- a/src/diagrams/mindmap/mindmapRenderer.js +++ b/src/diagrams/mindmap/mindmapRenderer.js @@ -2,7 +2,7 @@ import { select } from 'd3'; import { log, getConfig, setupGraphViewbox } from '../../diagram-api/diagramAPI'; import svgDraw from './svgDraw'; -import { BoundingBox, Layout, Tree } from 'non-layered-tidy-tree-layout'; +import { BoundingBox, Layout } from 'non-layered-tidy-tree-layout'; import clone from 'fast-clone'; import * as db from './mindmapDb'; @@ -193,6 +193,7 @@ function layoutMindmap(node, conf) { // Merge the trees into a single tree const result = mergeTrees(node, trees); + // TODO: @knsv The function is not called bug? eachNode; return node; } @@ -232,13 +233,11 @@ export const draw = (text, id, version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; - // Parse the graph definition const svg = root.select('#' + id); - const g = svg.append('g'); + svg.append('g'); const mm = diagObj.db.getMindmap(); // Draw the graph and start with drawing the nodes without proper position diff --git a/src/diagrams/mindmap/styles.js b/src/diagrams/mindmap/styles.js index 76d6a9c1b1..f6afaa6125 100644 --- a/src/diagrams/mindmap/styles.js +++ b/src/diagrams/mindmap/styles.js @@ -1,4 +1,4 @@ -import { darken, lighten, adjust, invert, isDark } from 'khroma'; +import { darken, lighten, isDark } from 'khroma'; const genSections = (options) => { let sections = ''; diff --git a/src/diagrams/pie/pieDb.js b/src/diagrams/pie/pieDb.js index def0242a36..8ef4d9efc0 100644 --- a/src/diagrams/pie/pieDb.js +++ b/src/diagrams/pie/pieDb.js @@ -13,8 +13,6 @@ import { } from '../../commonDb'; let sections = {}; -let title = ''; -let description = ''; let showData = false; export const parseDirective = function (statement, context, type) { @@ -49,7 +47,6 @@ const cleanupValue = function (value) { const clear = function () { sections = {}; - title = ''; showData = false; commonClear(); }; diff --git a/src/diagrams/requirement/requirementDb.js b/src/diagrams/requirement/requirementDb.js index f78bd5509d..9d48f0b2dc 100644 --- a/src/diagrams/requirement/requirementDb.js +++ b/src/diagrams/requirement/requirementDb.js @@ -1,7 +1,7 @@ import * as configApi from '../../config'; import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; -import common from '../common/common'; + import { setAccTitle, getAccTitle, @@ -15,10 +15,6 @@ let latestRequirement = {}; let requirements = {}; let latestElement = {}; let elements = {}; -let title = ''; -let accDescription = ''; - -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); const RequirementType = { REQUIREMENT: 'Requirement', diff --git a/src/diagrams/requirement/requirementRenderer.js b/src/diagrams/requirement/requirementRenderer.js index 7a43edaee3..d10c43066c 100644 --- a/src/diagrams/requirement/requirementRenderer.js +++ b/src/diagrams/requirement/requirementRenderer.js @@ -320,7 +320,6 @@ export const draw = (text, id, _version, diagObj) => { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; const svg = root.select(`[id='${id}']`); markers.insertLineEndings(svg, conf); diff --git a/src/diagrams/sequence/sequenceDb.js b/src/diagrams/sequence/sequenceDb.js index 7d03091277..6c863e204e 100644 --- a/src/diagrams/sequence/sequenceDb.js +++ b/src/diagrams/sequence/sequenceDb.js @@ -16,8 +16,6 @@ let prevActor = undefined; let actors = {}; let messages = []; const notes = []; -let diagramTitle = ''; -let description = ''; let sequenceNumbersEnabled = false; let wrapEnabled; @@ -153,7 +151,6 @@ export const clear = function () { actors = {}; messages = []; sequenceNumbersEnabled = false; - diagramTitle = ''; commonClear(); }; diff --git a/src/diagrams/state/stateDb.js b/src/diagrams/state/stateDb.js index 7092cf1d6e..96f92af8a8 100644 --- a/src/diagrams/state/stateDb.js +++ b/src/diagrams/state/stateDb.js @@ -11,8 +11,6 @@ import { clear as commonClear, } from '../../commonDb'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - const clone = (o) => JSON.parse(JSON.stringify(o)); let rootDoc = []; @@ -121,10 +119,6 @@ let documents = { let currentDocument = documents.root; let startCnt = 0; -let endCnt = 0; // let stateCnt = 0; - -let title = 'State diagram'; -let description = ''; /** * Function called by parser when a node definition has been found. @@ -179,7 +173,6 @@ export const clear = function (saveCommon) { currentDocument = documents.root; startCnt = 0; - endCnt = 0; classes = []; if (!saveCommon) { commonClear(); @@ -211,7 +204,6 @@ export const addRelation = function (_id1, _id2, title) { type1 = 'start'; } if (_id2 === '[*]') { - endCnt++; id2 = 'end' + startCnt; type2 = 'end'; } diff --git a/src/diagrams/state/stateRenderer-v2.js b/src/diagrams/state/stateRenderer-v2.js index 4452f94918..13c474b5e1 100644 --- a/src/diagrams/state/stateRenderer-v2.js +++ b/src/diagrams/state/stateRenderer-v2.js @@ -283,7 +283,6 @@ export const draw = function (text, id, _version, diag) { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; const svg = root.select(`[id="${id}"]`); // Run the renderer. This is what draws the final graph. diff --git a/src/diagrams/user-journey/journeyDb.js b/src/diagrams/user-journey/journeyDb.js index d8f27b93cf..0707636f56 100644 --- a/src/diagrams/user-journey/journeyDb.js +++ b/src/diagrams/user-journey/journeyDb.js @@ -1,6 +1,5 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; -import common from '../common/common'; import { setAccTitle, getAccTitle, @@ -11,10 +10,6 @@ import { clear as commonClear, } from '../../commonDb'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - -let title = ''; -let description = ''; let currentSection = ''; const sections = []; @@ -29,8 +24,6 @@ export const clear = function () { sections.length = 0; tasks.length = 0; currentSection = ''; - title = ''; - description = ''; rawTasks.length = 0; commonClear(); }; diff --git a/src/utils.ts b/src/utils.ts index 9caad7edd3..8861e7d096 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -39,7 +39,6 @@ const directive = /[%]{2}[{]\s*(?:(?:(\w+)\s*:|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; const directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; -const anyComment = /\s*%%.*\n/gm; /** * @function detectInit Detects the init config object from the text @@ -329,7 +328,6 @@ const calcLabelPosition = (points) => { const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { let prevPoint; - let totalDistance = 0; log.info('our points', points); if (points[0] !== initialPosition) { points = points.reverse(); @@ -389,7 +387,6 @@ const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { // Todo looking to faster cloning method let points = JSON.parse(JSON.stringify(_points)); let prevPoint; - let totalDistance = 0; log.info('our points', points); if (position !== 'start_left' && position !== 'start_right') { points = points.reverse(); @@ -728,19 +725,6 @@ export const calculateTextDimensions = memoize( (text, config) => `${text}-${config.fontSize}-${config.fontWeight}-${config.fontFamily}` ); -/** - * Applys d3 attributes - * - * @param {any} d3Elem D3 Element to apply the attributes onto - * @param {[string, string][]} attrs Object.keys equivalent format of key to value mapping of - * attributes - */ -const d3Attrs = function (d3Elem, attrs) { - for (const attr of attrs) { - d3Elem.attr(attr[0], attr[1]); - } -}; - export const initIdGenerator = class iterator { constructor(deterministic, seed) { this.deterministic = deterministic; From 39081b6bfb69104a31b35646be918a1339746f39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 07:03:17 +0000 Subject: [PATCH 43/56] chore(deps-dev): bump eslint from 8.23.0 to 8.23.1 Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.23.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.23.0...v8.23.1) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> --- package.json | 2 +- yarn.lock | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 9cd7b42711..c86558cfd5 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "cypress": "9.7.0", "cypress-image-snapshot": "^4.0.1", "documentation": "13.2.0", - "eslint": "^8.23.0", + "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-html": "^7.1.0", diff --git a/yarn.lock b/yarn.lock index cedce91292..a930e05b8c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1740,10 +1740,10 @@ esquery "^1.4.0" jsdoc-type-pratt-parser "~3.1.0" -"@eslint/eslintrc@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.1.tgz#de0807bfeffc37b964a7d0400e0c348ce5a2543d" - integrity sha512-OhSY22oQQdw3zgPOOwdoj01l/Dzl1Z+xyUP33tkSN+aqyEhymJCcPHyXt+ylW8FSe0TfRC2VG+ROQOapD0aZSQ== +"@eslint/eslintrc@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.2.tgz#58b69582f3b7271d8fa67fe5251767a5b38ea356" + integrity sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -5706,12 +5706,12 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.23.0: - version "8.23.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.0.tgz#a184918d288820179c6041bb3ddcc99ce6eea040" - integrity sha512-pBG/XOn0MsJcKcTRLr27S5HpzQo4kLr+HjLQIyK4EiCsijDl/TB+h5uEuJU6bQ8Edvwz1XWOjpaP2qgnXGpTcA== +eslint@^8.23.1: + version "8.23.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.23.1.tgz#cfd7b3f7fdd07db8d16b4ac0516a29c8d8dca5dc" + integrity sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg== dependencies: - "@eslint/eslintrc" "^1.3.1" + "@eslint/eslintrc" "^1.3.2" "@humanwhocodes/config-array" "^0.10.4" "@humanwhocodes/gitignore-to-minimatch" "^1.0.2" "@humanwhocodes/module-importer" "^1.0.1" @@ -5730,7 +5730,6 @@ eslint@^8.23.0: 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" @@ -5739,6 +5738,7 @@ eslint@^8.23.0: 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" @@ -8015,6 +8015,11 @@ js-base64@3.7.2: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== +js-sdsl@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.4.tgz#78793c90f80e8430b7d8dc94515b6c77d98a26a6" + integrity sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" From 0c0d37efb296a4e183de75f875c580cefb3c7630 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:17:49 +0100 Subject: [PATCH 44/56] chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 (#3448) Bumps [babel-jest](https://github.com/facebook/jest/tree/HEAD/packages/babel-jest) from 29.0.2 to 29.0.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.3/packages/babel-jest) --- updated-dependencies: - dependency-name: babel-jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> --- package.json | 2 +- yarn.lock | 70 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index c86558cfd5..1cd73c72f5 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "@types/stylis": "^4.0.2", "@typescript-eslint/eslint-plugin": "^5.36.1", "@typescript-eslint/parser": "^5.36.1", - "babel-jest": "^29.0.2", + "babel-jest": "^29.0.3", "babel-loader": "^8.2.2", "concurrently": "^7.0.0", "css-to-string-loader": "^0.1.3", diff --git a/yarn.lock b/yarn.lock index a930e05b8c..08946cb6bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2022,22 +2022,22 @@ slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/transform@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.2.tgz#eef90ebd939b68bf2c2508d9e914377871869146" - integrity sha512-lajVQx2AnsR+Pa17q2zR7eikz2PkPs1+g/qPbZkqQATeS/s6eT55H+yHcsLfuI/0YQ/4VSBepSu3bOX+44q0aA== +"@jest/transform@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.3.tgz#9eb1fed2072a0354f190569807d1250572fb0970" + integrity sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.0.2" + jest-haste-map "^29.0.3" jest-regex-util "^29.0.0" - jest-util "^29.0.2" + jest-util "^29.0.3" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -2067,6 +2067,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" + integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== + dependencies: + "@jest/schemas" "^29.0.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" @@ -3516,12 +3528,12 @@ babel-jest@^28.1.3: graceful-fs "^4.2.9" slash "^3.0.0" -babel-jest@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.2.tgz#7efde496c07607949e9be499bf277aa1543ded95" - integrity sha512-yTu4/WSi/HzarjQtrJSwV+/0maoNt+iP0DmpvFJdv9yY+5BuNle8TbheHzzcSWj5gIHfuhpbLYHWRDYhWKyeKQ== +babel-jest@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.0.3.tgz#64e156a47a77588db6a669a88dedff27ed6e260f" + integrity sha512-ApPyHSOhS/sVzwUOQIWJmdvDhBsMG01HX9z7ogtkp1TToHGGUWFlnXJUIzCgKPSfiYLn3ibipCYzsKSURHEwLg== dependencies: - "@jest/transform" "^29.0.2" + "@jest/transform" "^29.0.3" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.0.2" @@ -7665,20 +7677,20 @@ jest-haste-map@^28.1.3: optionalDependencies: fsevents "^2.3.2" -jest-haste-map@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.2.tgz#cac403a595e6e43982c9776b5c4dae63e38b22c5" - integrity sha512-SOorh2ysQ0fe8gsF4gaUDhoMIWAvi2hXOkwThEO48qT3JqA8GLAUieQcIvdSEd6M0scRDe1PVmKc5tXR3Z0U0A== +jest-haste-map@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.0.3.tgz#d7f3f7180f558d760eacc5184aac5a67f20ef939" + integrity sha512-uMqR99+GuBHo0RjRhOE4iA6LmsxEwRdgiIAQgMU/wdT2XebsLDz5obIwLZm/Psj+GwSEQhw9AfAVKGYbh2G55A== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.0.0" - jest-util "^29.0.2" - jest-worker "^29.0.2" + jest-util "^29.0.3" + jest-worker "^29.0.3" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: @@ -7909,6 +7921,18 @@ jest-util@^29.0.2: graceful-fs "^4.2.9" picomatch "^2.2.3" +jest-util@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" + integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== + dependencies: + "@jest/types" "^29.0.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-validate@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.3.tgz#e322267fd5e7c64cea4629612c357bbda96229df" @@ -7953,10 +7977,10 @@ jest-worker@^28.1.3: merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.2.tgz#46c9f2cb9a19663d22babbacf998e4b5d7c46574" - integrity sha512-EyvBlYcvd2pg28yg5A3OODQnqK9LI1kitnGUZUG5/NYIeaRgewtYBKB5wlr7oXj8zPCkzev7EmnTCsrXK7V+Xw== +jest-worker@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.3.tgz#c2ba0aa7e41eec9eb0be8e8a322ae6518df72647" + integrity sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng== dependencies: "@types/node" "*" merge-stream "^2.0.0" From ff971c8300422156b1b9a3b0b388beb1ebbadd2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 19:19:54 +0100 Subject: [PATCH 45/56] chore(deps-dev): bump jest-environment-jsdom from 29.0.2 to 29.0.3 (#3441) Bumps [jest-environment-jsdom](https://github.com/facebook/jest/tree/HEAD/packages/jest-environment-jsdom) from 29.0.2 to 29.0.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v29.0.3/packages/jest-environment-jsdom) --- updated-dependencies: - dependency-name: jest-environment-jsdom dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 96 ++++++++++++++++++++++++++-------------------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 1cd73c72f5..58763341bc 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "husky": "^8.0.0", "identity-obj-proxy": "^3.0.0", "jest": "^28.0.3", - "jest-environment-jsdom": "^29.0.2", + "jest-environment-jsdom": "^29.0.3", "jison": "^0.4.18", "js-base64": "3.7.2", "lint-staged": "^13.0.0", diff --git a/yarn.lock b/yarn.lock index 08946cb6bc..eaef9a6402 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1869,15 +1869,15 @@ "@types/node" "*" jest-mock "^28.1.3" -"@jest/environment@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.2.tgz#9e4b6d4c9bce5bfced6f63945d8c8e571394f572" - integrity sha512-Yf+EYaLOrVCgts/aTS5nGznU4prZUPa5k9S63Yct8YSOKj2jkdS17hHSUKhk5jxDFMyCy1PXknypDw7vfgc/mA== +"@jest/environment@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.3.tgz#7745ec30a954e828e8cc6df6a13280d3b51d8f35" + integrity sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA== dependencies: - "@jest/fake-timers" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/fake-timers" "^29.0.3" + "@jest/types" "^29.0.3" "@types/node" "*" - jest-mock "^29.0.2" + jest-mock "^29.0.3" "@jest/expect-utils@^28.1.3": version "28.1.3" @@ -1906,17 +1906,17 @@ jest-mock "^28.1.3" jest-util "^28.1.3" -"@jest/fake-timers@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.2.tgz#6f15f4d8eb1089d445e3f73473ddc434faa2f798" - integrity sha512-2JhQeWU28fvmM5r33lxg6BxxkTKaVXs6KMaJ6eXSM8ml/MaWkt2BvbIO8G9KWAJFMdBXWbn+2h9OK1/s5urKZA== +"@jest/fake-timers@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.0.3.tgz#ad5432639b715d45a86a75c47fd75019bc36b22c" + integrity sha512-tmbUIo03x0TdtcZCESQ0oQSakPCpo7+s6+9mU19dd71MptkP4zCwoeZqna23//pgbhtT1Wq02VmA9Z9cNtvtCQ== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^29.0.2" - jest-mock "^29.0.2" - jest-util "^29.0.2" + jest-message-util "^29.0.3" + jest-mock "^29.0.3" + jest-util "^29.0.3" "@jest/globals@^28.1.3": version "28.1.3" @@ -2055,10 +2055,10 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jest/types@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1" - integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew== +"@jest/types@^29.0.2", "@jest/types@^29.0.3": + version "29.0.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" + integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -7627,18 +7627,18 @@ jest-each@^28.1.3: jest-util "^28.1.3" pretty-format "^28.1.3" -jest-environment-jsdom@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.0.2.tgz#d616a19416d0dda5155b854d301197fb6092dff0" - integrity sha512-hWqC9FQI5yT04lTd4VJnzT5QObxq0xrSrqpGkqsYfxPeJYjyhriI7W2oJC5HZ1UbhnvA+8GS1nzgPsstvRpdVw== +jest-environment-jsdom@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.0.3.tgz#0c6ee841133dd6acbe957bceaceea93b7ec60ca9" + integrity sha512-KIGvpm12c71hoYTjL4wC2c8K6KfhOHJqJtaHc1IApu5rG047YWZoEP13BlbucWfzGISBrmli8KFqdhdQEa8Wnw== dependencies: - "@jest/environment" "^29.0.2" - "@jest/fake-timers" "^29.0.2" - "@jest/types" "^29.0.2" + "@jest/environment" "^29.0.3" + "@jest/fake-timers" "^29.0.3" + "@jest/types" "^29.0.3" "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^29.0.2" - jest-util "^29.0.2" + jest-mock "^29.0.3" + jest-util "^29.0.3" jsdom "^20.0.0" jest-environment-node@^28.1.3: @@ -7744,18 +7744,18 @@ jest-message-util@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.2.tgz#b2781dfb6a2d1c63830d9684c5148ae3155c6154" - integrity sha512-kcJAgms3ckJV0wUoLsAM40xAhY+pb9FVSZwicjFU9PFkaTNmqh9xd99/CzKse48wPM1ANUQKmp03/DpkY+lGrA== +jest-message-util@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.3.tgz#f0254e1ffad21890c78355726202cc91d0a40ea8" + integrity sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^29.0.2" + pretty-format "^29.0.3" slash "^3.0.0" stack-utils "^2.0.3" @@ -7767,12 +7767,12 @@ jest-mock@^28.1.3: "@jest/types" "^28.1.3" "@types/node" "*" -jest-mock@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.2.tgz#d7810966a6338aca6a440c3cd9f19276477840ad" - integrity sha512-giWXOIT23UCxHCN2VUfUJ0Q7SmiqQwfSFXlCaIhW5anITpNQ+3vuLPQdKt5wkuwM37GrbFyHIClce8AAK9ft9g== +jest-mock@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.3.tgz#4f0093f6a9cb2ffdb9c44a07a3912f0c098c8de9" + integrity sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -7909,12 +7909,12 @@ jest-util@^28.0.0, jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a" - integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ== +jest-util@^29.0.2, jest-util@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" + integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== dependencies: - "@jest/types" "^29.0.2" + "@jest/types" "^29.0.3" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" @@ -9873,10 +9873,10 @@ pretty-format@^28.0.0, pretty-format@^28.1.3: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^29.0.2: - version "29.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.2.tgz#7f7666a7bf05ba2bcacde61be81c6db64f6f3be6" - integrity sha512-wp3CdtUa3cSJVFn3Miu5a1+pxc1iPIQTenOAn+x5erXeN1+ryTcLesV5pbK/rlW5EKwp27x38MoYfNGaNXDDhg== +pretty-format@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811" + integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q== dependencies: "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" From c636b873e92d17ce0cdb449e08a8937d63eee879 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:42:54 +0000 Subject: [PATCH 46/56] chore(deps-dev): bump @babel/core from 7.18.13 to 7.19.0 (#3447) --- package.json | 2 +- yarn.lock | 139 ++++++++++++++++++++++++--------------------------- 2 files changed, 65 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 58763341bc..f418d5558b 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ }, "devDependencies": { "@applitools/eyes-cypress": "^3.25.7", - "@babel/core": "^7.14.6", + "@babel/core": "^7.19.0", "@babel/eslint-parser": "^7.14.7", "@babel/preset-env": "^7.14.7", "@babel/register": "^7.14.5", diff --git a/yarn.lock b/yarn.lock index eaef9a6402..0ecfbd61a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -244,6 +244,11 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== +"@babel/compat-data@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" + integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== + "@babel/core@7.12.3": version "7.12.3" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" @@ -266,21 +271,21 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.14.6": - version "7.18.13" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.13.tgz#9be8c44512751b05094a4d3ab05fc53a47ce00ac" - integrity sha512-ZisbOvRRusFktksHSG6pjj1CSvkPkcZq/KHD45LAkVP/oiHJkNBZWfpvlLmX8OtHDG8IuzsFlVRWo08w7Qxn0A== +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.0.tgz#d2f5f4f2033c00de8096be3c9f45772563e150c3" + integrity sha512-reM4+U7B9ss148rh2n1Qs9ASS+w94irYXga7c2jaQv9RVzpS7Mv1a9rnYYwuDa45G+DkORt9g6An2k/V4d9LbQ== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.13" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helpers" "^7.18.9" - "@babel/parser" "^7.18.13" + "@babel/generator" "^7.19.0" + "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helpers" "^7.19.0" + "@babel/parser" "^7.19.0" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.18.13" - "@babel/types" "^7.18.13" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -305,12 +310,12 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.18.13", "@babel/generator@^7.7.2": - version "7.18.13" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.13.tgz#59550cbb9ae79b8def15587bdfbaa388c4abf212" - integrity sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ== +"@babel/generator@^7.12.1", "@babel/generator@^7.19.0", "@babel/generator@^7.7.2": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" + integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== dependencies: - "@babel/types" "^7.18.13" + "@babel/types" "^7.19.0" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" @@ -336,12 +341,12 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.6" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz#69e64f57b524cde3e5ff6cc5a9f4a387ee5563bf" - integrity sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.0.tgz#537ec8339d53e806ed422f1e06c8f17d55b96bb0" + integrity sha512-Ai5bNWXIvwDvWM7njqsG3feMlL9hCVQsPYXodsZyLwshYkZVJt59Gftau4VrE8S9IT9asd2uSP1hG6wCNw+sXA== dependencies: - "@babel/compat-data" "^7.18.8" + "@babel/compat-data" "^7.19.0" "@babel/helper-validator-option" "^7.18.6" browserslist "^4.20.2" semver "^6.3.0" @@ -438,6 +443,14 @@ "@babel/template" "^7.18.6" "@babel/types" "^7.18.9" +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" @@ -480,19 +493,19 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz#5a1079c005135ed627442df31a42887e80fcb712" - integrity sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g== +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" + integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" "@babel/helper-simple-access" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.18.6" - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@babel/helper-optimise-call-expression@^7.16.7": version "7.16.7" @@ -639,14 +652,14 @@ "@babel/traverse" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/helpers@^7.12.1", "@babel/helpers@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.9.tgz#4bef3b893f253a1eced04516824ede94dcfe7ff9" - integrity sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ== +"@babel/helpers@^7.12.1", "@babel/helpers@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.19.0.tgz#f30534657faf246ae96551d88dd31e9d1fa1fc18" + integrity sha512-DRBCKGwIEdqY3+rPJgG/dKfQy9+08rHIAJx8q2p+HSWP87s2HCrQmaAMMyMll2kIXKCW0cO1RdQskx15Xakftg== dependencies: - "@babel/template" "^7.18.6" - "@babel/traverse" "^7.18.9" - "@babel/types" "^7.18.9" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.19.0" + "@babel/types" "^7.19.0" "@babel/highlight@^7.18.6": version "7.18.6" @@ -662,10 +675,10 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.3.tgz#a305415ebe7a6c7023b40b5122a0662d928334cd" integrity sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw== -"@babel/parser@^7.1.0", "@babel/parser@^7.10.5", "@babel/parser@^7.12.3", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.13": - version "7.18.13" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.13.tgz#5b2dd21cae4a2c5145f1fbd8ca103f9313d3b7e4" - integrity sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg== +"@babel/parser@^7.1.0", "@babel/parser@^7.10.5", "@babel/parser@^7.12.3", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.0.tgz#497fcafb1d5b61376959c1c338745ef0577aa02c" + integrity sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -1497,26 +1510,26 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.10.5", "@babel/traverse@^7.12.1", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.10", "@babel/traverse@^7.18.13", "@babel/traverse@^7.18.6", "@babel/traverse@^7.18.9", "@babel/traverse@^7.7.2": - version "7.18.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.13.tgz#5ab59ef51a997b3f10c4587d648b9696b6cb1a68" - integrity sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA== +"@babel/traverse@^7.10.5", "@babel/traverse@^7.12.1", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.10", "@babel/traverse@^7.18.6", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.0", "@babel/traverse@^7.7.2": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.0.tgz#eb9c561c7360005c592cc645abafe0c3c4548eed" + integrity sha512-4pKpFRDh+utd2mbRC8JLnlsMUii3PMHjpL6a0SZ4NMZy7YFP9aXORxEhdMVOc9CpWtDF09IkciQLEhK7Ml7gRA== dependencies: "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.18.13" + "@babel/generator" "^7.19.0" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.18.13" - "@babel/types" "^7.18.13" + "@babel/parser" "^7.19.0" + "@babel/types" "^7.19.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.18.13", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.18.13" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.13.tgz#30aeb9e514f4100f7c1cb6e5ba472b30e48f519a" - integrity sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ== +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600" + integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA== dependencies: "@babel/helper-string-parser" "^7.18.10" "@babel/helper-validator-identifier" "^7.18.6" @@ -2055,18 +2068,6 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jest/types@^29.0.2", "@jest/types@^29.0.3": - version "29.0.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" - integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - "@jest/types@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" @@ -7909,18 +7910,6 @@ jest-util@^28.0.0, jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-util@^29.0.2, jest-util@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" - integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== - dependencies: - "@jest/types" "^29.0.3" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - jest-util@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" From 6312eb9dcf5860b392563e401424efdc2de650d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 21:39:53 +0100 Subject: [PATCH 47/56] chore(deps-dev): bump @typescript-eslint/parser from 5.36.1 to 5.37.0 (#3451) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.36.1 to 5.37.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.37.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 50 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index f418d5558b..ab79f0a752 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@types/jest": "^28.1.7", "@types/stylis": "^4.0.2", "@typescript-eslint/eslint-plugin": "^5.36.1", - "@typescript-eslint/parser": "^5.36.1", + "@typescript-eslint/parser": "^5.37.0", "babel-jest": "^29.0.3", "babel-loader": "^8.2.2", "concurrently": "^7.0.0", diff --git a/yarn.lock b/yarn.lock index 0ecfbd61a2..954d510a95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2818,14 +2818,14 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.36.1.tgz#931c22c7bacefd17e29734628cdec8b2acdcf1ce" - integrity sha512-/IsgNGOkBi7CuDfUbwt1eOqUXF9WGVBW9dwEe1pi+L32XrTsZIgmDFIi2RxjzsvB/8i+MIf5JIoTEH8LOZ368A== - dependencies: - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/typescript-estree" "5.36.1" +"@typescript-eslint/parser@^5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.37.0.tgz#c382077973f3a4ede7453fb14cadcad3970cbf3b" + integrity sha512-01VzI/ipYKuaG5PkE5+qyJ6m02fVALmMPY3Qq5BHflDx3y4VobbLdHQkSMg9VPRS4KdNt4oYTMaomFoHonBGAw== + dependencies: + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/typescript-estree" "5.37.0" debug "^4.3.4" "@typescript-eslint/scope-manager@5.10.1": @@ -2844,6 +2844,14 @@ "@typescript-eslint/types" "5.36.1" "@typescript-eslint/visitor-keys" "5.36.1" +"@typescript-eslint/scope-manager@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.37.0.tgz#044980e4f1516a774a418dafe701a483a6c9f9ca" + integrity sha512-F67MqrmSXGd/eZnujjtkPgBQzgespu/iCZ+54Ok9X5tALb9L2v3G+QBSoWkXG0p3lcTJsL+iXz5eLUEdSiJU9Q== + dependencies: + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/visitor-keys" "5.37.0" + "@typescript-eslint/type-utils@5.36.1": version "5.36.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625" @@ -2864,6 +2872,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c" integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg== +"@typescript-eslint/types@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.37.0.tgz#09e4870a5f3af7af3f84e08d792644a87d232261" + integrity sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA== + "@typescript-eslint/typescript-estree@5.10.1": version "5.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" @@ -2890,6 +2903,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.37.0.tgz#956dcf5c98363bcb97bdd5463a0a86072ff79355" + integrity sha512-JkFoFIt/cx59iqEDSgIGnQpCTRv96MQnXCYvJi7QhBC24uyuzbD8wVbajMB1b9x4I0octYFJ3OwjAwNqk1AjDA== + dependencies: + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/visitor-keys" "5.37.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.36.1": version "5.36.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad" @@ -2930,6 +2956,14 @@ "@typescript-eslint/types" "5.36.1" eslint-visitor-keys "^3.3.0" +"@typescript-eslint/visitor-keys@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.37.0.tgz#7b72dd343295ea11e89b624995abc7103c554eee" + integrity sha512-Hp7rT4cENBPIzMwrlehLW/28EVCOcE9U1Z1BQTc8EA8v5qpr7GRGuG+U58V5tTY48zvUOA3KHvw3rA8tY9fbdA== + dependencies: + "@typescript-eslint/types" "5.37.0" + eslint-visitor-keys "^3.3.0" + "@wdio/config@7.16.11": version "7.16.11" resolved "https://registry.yarnpkg.com/@wdio/config/-/config-7.16.11.tgz#c35a0efb9c7ec6c80e3324e9818f636010087e97" From 9394abce229cbc4d49c70de8e49abe0031b629f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 21:45:25 +0100 Subject: [PATCH 48/56] chore(deps-dev): bump @babel/preset-env from 7.18.10 to 7.19.0 (#3442) Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.10 to 7.19.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.19.0/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 118 ++++++++++++++++++++++++++------------------------- 2 files changed, 62 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index ab79f0a752..97ba17367c 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@applitools/eyes-cypress": "^3.25.7", "@babel/core": "^7.19.0", "@babel/eslint-parser": "^7.14.7", - "@babel/preset-env": "^7.14.7", + "@babel/preset-env": "^7.19.0", "@babel/register": "^7.14.5", "@commitlint/cli": "^17.1.2", "@commitlint/config-conventional": "^17.0.0", diff --git a/yarn.lock b/yarn.lock index 954d510a95..a079e10b50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -239,12 +239,7 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" - integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== - -"@babel/compat-data@^7.19.0": +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.0.tgz#2a592fd89bacb1fcde68de31bee4f2f2dacb0e86" integrity sha512-y5rqgTTPTmaF5e2nVhOxw+Ur9HDJLsWb6U/KpgUzRZEdPfE6VOubXBKLdbcUTijzRptednSBDQbYZBOSqJxpJw== @@ -385,6 +380,14 @@ "@babel/helper-annotate-as-pure" "^7.18.6" regexpu-core "^5.1.0" +"@babel/helper-create-regexp-features-plugin@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz#7976aca61c0984202baca73d84e2337a5424a41b" + integrity sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + regexpu-core "^5.1.0" + "@babel/helper-define-polyfill-provider@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz#bd10d0aca18e8ce012755395b05a79f45eca5073" @@ -493,7 +496,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.19.0": +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.0.tgz#309b230f04e22c58c6a2c0c0c7e50b216d350c30" integrity sha512-3HBZ377Fe14RbLIA+ac3sY4PTgpxHVkFrESaWhoI5PuyXPBBX8+C34qblV9G89ZtycGJCmCI/Ut+VUDK4bltNQ== @@ -521,10 +524,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" + integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== "@babel/helper-remap-async-to-generator@^7.18.6": version "7.18.6" @@ -696,13 +699,13 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" "@babel/plugin-proposal-optional-chaining" "^7.18.9" -"@babel/plugin-proposal-async-generator-functions@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.18.10.tgz#85ea478c98b0095c3e4102bff3b67d306ed24952" - integrity sha512-1mFuY2TOsR1hxbjCo4QL+qlIjV07p4H4EUYw2J/WCqsvFV6V9X9z9YhXbWndc/4fw+hYGlDT7egYxliMp5O6Ew== +"@babel/plugin-proposal-async-generator-functions@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.19.0.tgz#cf5740194f170467df20581712400487efc79ff1" + integrity sha512-nhEByMUTx3uZueJ/QkJuSlCfN4FGg+xy+vRsfGQGzSauq5ks2Deid2+05Q3KhfaUjvec1IGhw/Zm3cFm8JigTQ== dependencies: "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-syntax-async-generators" "^7.8.4" @@ -1102,16 +1105,17 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-classes@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.18.9.tgz#90818efc5b9746879b869d5ce83eb2aa48bbc3da" - integrity sha512-EkRQxsxoytpTlKJmSPYrsOMjCILacAjtSVkd4gChEe2kXjFCun3yohhW5I7plXJhCemM0gKsaGMcO8tinvCA5g== +"@babel/plugin-transform-classes@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz#0e61ec257fba409c41372175e7c1e606dc79bb20" + integrity sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-compilation-targets" "^7.19.0" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-replace-supers" "^7.18.9" "@babel/helper-split-export-declaration" "^7.18.6" globals "^11.1.0" @@ -1123,10 +1127,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-destructuring@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.9.tgz#68906549c021cb231bee1db21d3b5b095f8ee292" - integrity sha512-p5VCYNddPLkZTq4XymQIaIfZNJwT9YsjkPOhkVEqt6QIpQFZVM9IltqqYpOEkJoN1DPznmxUDyZ5CTZs/ZCuHA== +"@babel/plugin-transform-destructuring@^7.18.13": + version "7.18.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.13.tgz#9e03bc4a94475d62b7f4114938e6c5c33372cbf5" + integrity sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow== dependencies: "@babel/helper-plugin-utils" "^7.18.9" @@ -1210,14 +1214,14 @@ "@babel/helper-simple-access" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.18.9.tgz#545df284a7ac6a05125e3e405e536c5853099a06" - integrity sha512-zY/VSIbbqtoRoJKo2cDTewL364jSlZGvn0LKOf9ntbfxOvjfmyrdtEEOAdswOswhZEb8UH3jDkCKHd1sPgsS0A== +"@babel/plugin-transform-modules-systemjs@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.0.tgz#5f20b471284430f02d9c5059d9b9a16d4b085a1f" + integrity sha512-x9aiR0WXAWmOWsqcsnrzGR+ieaTMVyGyffPVA7F8cXAGt/UxefYv6uSHZLkAFChN5M5Iy1+wjE+xJuPt22H39A== dependencies: "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-module-transforms" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-validator-identifier" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" @@ -1229,13 +1233,13 @@ "@babel/helper-module-transforms" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.18.6.tgz#c89bfbc7cc6805d692f3a49bc5fc1b630007246d" - integrity sha512-UmEOGF8XgaIqD74bC8g7iV3RYj8lMf0Bw7NJzvnS9qQhM4mg+1WHKotUIdjxgD2RGrgFLZZPCFPFj3P/kVDYhg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.0.tgz#58c52422e4f91a381727faed7d513c89d7f41ada" + integrity sha512-HDSuqOQzkU//kfGdiHBt71/hkDTApw4U/cMVgKgX7PqfB3LOaK+2GtCEsBu1dL9CkswDm0Gwehht1dCr421ULQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-create-regexp-features-plugin" "^7.19.0" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/plugin-transform-new-target@^7.18.6": version "7.18.6" @@ -1321,12 +1325,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-spread@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.18.9.tgz#6ea7a6297740f381c540ac56caf75b05b74fb664" - integrity sha512-39Q814wyoOPtIB/qGopNIL9xDChOE1pNU0ZY5dO0owhiVt/5kFm4li+/bBtwc7QotG0u5EPzqhZdjMtmqBqyQA== +"@babel/plugin-transform-spread@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz#dd60b4620c2fec806d60cfaae364ec2188d593b6" + integrity sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" "@babel/plugin-transform-sticky-regex@^7.18.6": @@ -1365,18 +1369,18 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/preset-env@^7.12.1", "@babel/preset-env@^7.14.7": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.10.tgz#83b8dfe70d7eea1aae5a10635ab0a5fe60dfc0f4" - integrity sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA== +"@babel/preset-env@^7.12.1", "@babel/preset-env@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.0.tgz#fd18caf499a67d6411b9ded68dc70d01ed1e5da7" + integrity sha512-1YUju1TAFuzjIQqNM9WsF4U6VbD/8t3wEAlw3LFYuuEr+ywqLRcSXxFKz4DCEj+sN94l/XTDiUXYRrsvMpz9WQ== dependencies: - "@babel/compat-data" "^7.18.8" - "@babel/helper-compilation-targets" "^7.18.9" - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/compat-data" "^7.19.0" + "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-validator-option" "^7.18.6" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-async-generator-functions" "^7.18.10" + "@babel/plugin-proposal-async-generator-functions" "^7.19.0" "@babel/plugin-proposal-class-properties" "^7.18.6" "@babel/plugin-proposal-class-static-block" "^7.18.6" "@babel/plugin-proposal-dynamic-import" "^7.18.6" @@ -1410,9 +1414,9 @@ "@babel/plugin-transform-async-to-generator" "^7.18.6" "@babel/plugin-transform-block-scoped-functions" "^7.18.6" "@babel/plugin-transform-block-scoping" "^7.18.9" - "@babel/plugin-transform-classes" "^7.18.9" + "@babel/plugin-transform-classes" "^7.19.0" "@babel/plugin-transform-computed-properties" "^7.18.9" - "@babel/plugin-transform-destructuring" "^7.18.9" + "@babel/plugin-transform-destructuring" "^7.18.13" "@babel/plugin-transform-dotall-regex" "^7.18.6" "@babel/plugin-transform-duplicate-keys" "^7.18.9" "@babel/plugin-transform-exponentiation-operator" "^7.18.6" @@ -1422,9 +1426,9 @@ "@babel/plugin-transform-member-expression-literals" "^7.18.6" "@babel/plugin-transform-modules-amd" "^7.18.6" "@babel/plugin-transform-modules-commonjs" "^7.18.6" - "@babel/plugin-transform-modules-systemjs" "^7.18.9" + "@babel/plugin-transform-modules-systemjs" "^7.19.0" "@babel/plugin-transform-modules-umd" "^7.18.6" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.18.6" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.0" "@babel/plugin-transform-new-target" "^7.18.6" "@babel/plugin-transform-object-super" "^7.18.6" "@babel/plugin-transform-parameters" "^7.18.8" @@ -1432,14 +1436,14 @@ "@babel/plugin-transform-regenerator" "^7.18.6" "@babel/plugin-transform-reserved-words" "^7.18.6" "@babel/plugin-transform-shorthand-properties" "^7.18.6" - "@babel/plugin-transform-spread" "^7.18.9" + "@babel/plugin-transform-spread" "^7.19.0" "@babel/plugin-transform-sticky-regex" "^7.18.6" "@babel/plugin-transform-template-literals" "^7.18.9" "@babel/plugin-transform-typeof-symbol" "^7.18.9" "@babel/plugin-transform-unicode-escapes" "^7.18.10" "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.18.10" + "@babel/types" "^7.19.0" babel-plugin-polyfill-corejs2 "^0.3.2" babel-plugin-polyfill-corejs3 "^0.5.3" babel-plugin-polyfill-regenerator "^0.4.0" From 3cc898ca4cf371e0e488ae545eb18f0035034983 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:49:43 +0000 Subject: [PATCH 49/56] chore(deps-dev): bump concurrently from 7.3.0 to 7.4.0 (#3445) --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 97ba17367c..6ef7aaaee7 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@typescript-eslint/parser": "^5.37.0", "babel-jest": "^29.0.3", "babel-loader": "^8.2.2", - "concurrently": "^7.0.0", + "concurrently": "^7.4.0", "css-to-string-loader": "^0.1.3", "cypress": "9.7.0", "cypress-image-snapshot": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index a079e10b50..ebed78cdd4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4408,13 +4408,13 @@ concat-stream@~1.5.0: readable-stream "~2.0.0" typedarray "~0.0.5" -concurrently@^7.0.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.3.0.tgz#eb45cdbc8df43da195f619aba218a980cae49184" - integrity sha512-IiDwm+8DOcFEInca494A8V402tNTQlJaYq78RF2rijOrKEk/AOHTxhN4U1cp7GYKYX5Q6Ymh1dLTBlzIMN0ikA== +concurrently@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-7.4.0.tgz#bb0e344964bc172673577c420db21e963f2f7368" + integrity sha512-M6AfrueDt/GEna/Vg9BqQ+93yuvzkSKmoTixnwEJkH0LlcGrRC2eCmjeG1tLLHIYfpYJABokqSGyMcXjm96AFA== dependencies: chalk "^4.1.0" - date-fns "^2.16.1" + date-fns "^2.29.1" lodash "^4.17.21" rxjs "^7.0.0" shell-quote "^1.7.3" @@ -5078,10 +5078,10 @@ data-urls@^3.0.1, data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" -date-fns@^2.16.1: - version "2.27.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.27.0.tgz#e1ff3c3ddbbab8a2eaadbb6106be2929a5a2d92b" - integrity sha512-sj+J0Mo2p2X1e306MHq282WS4/A8Pz/95GIFcsPNMPMZVI3EUrAdSv90al1k+p74WGLCruMXk23bfEDZa71X9Q== +date-fns@^2.29.1: + version "2.29.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" + integrity sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA== dateformat@^3.0.0: version "3.0.3" From 13809b50251845475e6dca65cc395761be38fbd2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:51:35 +0000 Subject: [PATCH 50/56] chore(deps-dev): bump @typescript-eslint/eslint-plugin (#3457) --- package.json | 2 +- yarn.lock | 126 ++++++++++----------------------------------------- 2 files changed, 24 insertions(+), 104 deletions(-) diff --git a/package.json b/package.json index 6ef7aaaee7..96523bc228 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "@types/dompurify": "^2.3.4", "@types/jest": "^28.1.7", "@types/stylis": "^4.0.2", - "@typescript-eslint/eslint-plugin": "^5.36.1", + "@typescript-eslint/eslint-plugin": "^5.37.0", "@typescript-eslint/parser": "^5.37.0", "babel-jest": "^29.0.3", "babel-loader": "^8.2.2", diff --git a/yarn.lock b/yarn.lock index ebed78cdd4..a78af620db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2807,14 +2807,14 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@^5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.36.1.tgz#471f64dc53600025e470dad2ca4a9f2864139019" - integrity sha512-iC40UK8q1tMepSDwiLbTbMXKDxzNy+4TfPWgIL661Ym0sD42vRcQU93IsZIrmi+x292DBr60UI/gSwfdVYexCA== - dependencies: - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/type-utils" "5.36.1" - "@typescript-eslint/utils" "5.36.1" +"@typescript-eslint/eslint-plugin@^5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.37.0.tgz#5ccdd5d9004120f28fc6e717fb4b5c9bddcfbc04" + integrity sha512-Fde6W0IafXktz1UlnhGkrrmnnGpAo1kyX7dnyHHVrmwJOn72Oqm3eYtddrpOwwel2W8PAK9F3pIL5S+lfoM0og== + dependencies: + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/type-utils" "5.37.0" + "@typescript-eslint/utils" "5.37.0" debug "^4.3.4" functional-red-black-tree "^1.0.1" ignore "^5.2.0" @@ -2832,22 +2832,6 @@ "@typescript-eslint/typescript-estree" "5.37.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz#f0539c73804d2423506db2475352a4dec36cd809" - integrity sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg== - dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" - -"@typescript-eslint/scope-manager@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.36.1.tgz#23c49b7ddbcffbe09082e6694c2524950766513f" - integrity sha512-pGC2SH3/tXdu9IH3ItoqciD3f3RRGCh7hb9zPdN2Drsr341zgd6VbhP5OHQO/reUqihNltfPpMpTNihFMarP2w== - dependencies: - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/visitor-keys" "5.36.1" - "@typescript-eslint/scope-manager@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.37.0.tgz#044980e4f1516a774a418dafe701a483a6c9f9ca" @@ -2856,57 +2840,21 @@ "@typescript-eslint/types" "5.37.0" "@typescript-eslint/visitor-keys" "5.37.0" -"@typescript-eslint/type-utils@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.36.1.tgz#016fc2bff6679f54c0b2df848a493f0ca3d4f625" - integrity sha512-xfZhfmoQT6m3lmlqDvDzv9TiCYdw22cdj06xY0obSznBsT///GK5IEZQdGliXpAOaRL34o8phEvXzEo/VJx13Q== +"@typescript-eslint/type-utils@5.37.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.37.0.tgz#43ed2f567ada49d7e33a6e4b6f9babd060445fe5" + integrity sha512-BSx/O0Z0SXOF5tY0bNTBcDEKz2Ec20GVYvq/H/XNKiUorUFilH7NPbFUuiiyzWaSdN3PA8JV0OvYx0gH/5aFAQ== dependencies: - "@typescript-eslint/typescript-estree" "5.36.1" - "@typescript-eslint/utils" "5.36.1" + "@typescript-eslint/typescript-estree" "5.37.0" + "@typescript-eslint/utils" "5.37.0" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.1.tgz#dca9bd4cb8c067fc85304a31f38ec4766ba2d1ea" - integrity sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q== - -"@typescript-eslint/types@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.36.1.tgz#1cf0e28aed1cb3ee676917966eb23c2f8334ce2c" - integrity sha512-jd93ShpsIk1KgBTx9E+hCSEuLCUFwi9V/urhjOWnOaksGZFbTOxAT47OH2d4NLJnLhkVD+wDbB48BuaycZPLBg== - "@typescript-eslint/types@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.37.0.tgz#09e4870a5f3af7af3f84e08d792644a87d232261" integrity sha512-3frIJiTa5+tCb2iqR/bf7XwU20lnU05r/sgPJnRpwvfZaqCJBrl8Q/mw9vr3NrNdB/XtVyMA0eppRMMBqdJ1bA== -"@typescript-eslint/typescript-estree@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz#b268e67be0553f8790ba3fe87113282977adda15" - integrity sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ== - dependencies: - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/visitor-keys" "5.10.1" - debug "^4.3.2" - globby "^11.0.4" - is-glob "^4.0.3" - semver "^7.3.5" - tsutils "^3.21.0" - -"@typescript-eslint/typescript-estree@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.36.1.tgz#b857f38d6200f7f3f4c65cd0a5afd5ae723f2adb" - integrity sha512-ih7V52zvHdiX6WcPjsOdmADhYMDN15SylWRZrT2OMy80wzKbc79n8wFW0xpWpU0x3VpBz/oDgTm2xwDAnFTl+g== - dependencies: - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/visitor-keys" "5.36.1" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - "@typescript-eslint/typescript-estree@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.37.0.tgz#956dcf5c98363bcb97bdd5463a0a86072ff79355" @@ -2920,46 +2868,18 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.36.1.tgz#136d5208cc7a3314b11c646957f8f0b5c01e07ad" - integrity sha512-lNj4FtTiXm5c+u0pUehozaUWhh7UYKnwryku0nxJlYUEWetyG92uw2pr+2Iy4M/u0ONMKzfrx7AsGBTCzORmIg== - dependencies: - "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.36.1" - "@typescript-eslint/types" "5.36.1" - "@typescript-eslint/typescript-estree" "5.36.1" - eslint-scope "^5.1.1" - eslint-utils "^3.0.0" - -"@typescript-eslint/utils@^5.10.0": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.1.tgz#fa682a33af47080ba2c4368ee0ad2128213a1196" - integrity sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw== +"@typescript-eslint/utils@5.37.0", "@typescript-eslint/utils@^5.10.0": + version "5.37.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.37.0.tgz#7784cb8e91390c4f90ccaffd24a0cf9874df81b2" + integrity sha512-jUEJoQrWbZhmikbcWSMDuUSxEE7ID2W/QCV/uz10WtQqfOuKZUqFGjqLJ+qhDd17rjgp+QJPqTdPIBWwoob2NQ== dependencies: "@types/json-schema" "^7.0.9" - "@typescript-eslint/scope-manager" "5.10.1" - "@typescript-eslint/types" "5.10.1" - "@typescript-eslint/typescript-estree" "5.10.1" + "@typescript-eslint/scope-manager" "5.37.0" + "@typescript-eslint/types" "5.37.0" + "@typescript-eslint/typescript-estree" "5.37.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/visitor-keys@5.10.1": - version "5.10.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz#29102de692f59d7d34ecc457ed59ab5fc558010b" - integrity sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ== - dependencies: - "@typescript-eslint/types" "5.10.1" - eslint-visitor-keys "^3.0.0" - -"@typescript-eslint/visitor-keys@5.36.1": - version "5.36.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.36.1.tgz#7731175312d65738e501780f923896d200ad1615" - integrity sha512-ojB9aRyRFzVMN3b5joSYni6FAS10BBSCAfKJhjJAV08t/a95aM6tAhz+O1jF+EtgxktuSO3wJysp2R+Def/IWQ== - dependencies: - "@typescript-eslint/types" "5.36.1" - eslint-visitor-keys "^3.3.0" - "@typescript-eslint/visitor-keys@5.37.0": version "5.37.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.37.0.tgz#7b72dd343295ea11e89b624995abc7103c554eee" @@ -5752,7 +5672,7 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0: +eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== @@ -6658,7 +6578,7 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" -globby@^11.0.4, globby@^11.1.0: +globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== From 5c51ce13938a96e877015ff4b6bc64406d87e92a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 20:59:12 +0000 Subject: [PATCH 51/56] chore(deps-dev): bump eslint-plugin-jest from 27.0.1 to 27.0.4 (#3458) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 96523bc228..44c9138271 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-cypress": "^2.12.1", "eslint-plugin-html": "^7.1.0", - "eslint-plugin-jest": "^27.0.1", + "eslint-plugin-jest": "^27.0.4", "eslint-plugin-jsdoc": "^39.3.6", "eslint-plugin-json": "^3.1.0", "eslint-plugin-markdown": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index a78af620db..71a505d780 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5609,10 +5609,10 @@ eslint-plugin-html@^7.1.0: dependencies: htmlparser2 "^8.0.1" -eslint-plugin-jest@^27.0.1: - version "27.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.0.1.tgz#3e67ee2051411540988c62075e8788702a1064da" - integrity sha512-LosUsrkwVSs/8Z/I8Hqn5vWgTEsHrfIquDEKOsV8/cl+gbFR4tiRCE1AimEotsHjSC0Rx1tYm6vPhw8C3ktmmg== +eslint-plugin-jest@^27.0.4: + version "27.0.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.0.4.tgz#ab9c7b3f48bfade4762c24c415a5d9bbc0174a61" + integrity sha512-BuvY78pHMpMJ6Cio7sKg6jrqEcnRYPUc4Nlihku4vKx3FjlmMINSX4vcYokZIe+8TKcyr1aI5Kq7vYwgJNdQSA== dependencies: "@typescript-eslint/utils" "^5.10.0" From 3dff5a90f1644a5de58bae8aed0a266e9063a526 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod <sidharthv96@gmail.com> Date: Wed, 14 Sep 2022 09:02:34 +0530 Subject: [PATCH 52/56] Apply suggestions from code review Co-authored-by: Alois Klink <alois@aloisklink.com> --- src/diagrams/c4/c4Db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diagrams/c4/c4Db.js b/src/diagrams/c4/c4Db.js index aa597a179a..79028a0c5c 100644 --- a/src/diagrams/c4/c4Db.js +++ b/src/diagrams/c4/c4Db.js @@ -634,13 +634,13 @@ export const updateLayoutConfig = function (typeC4Shape, c4ShapeInRowParam, c4Bo let c4BoundaryInRowValue = c4BoundaryInRow; if (typeof c4ShapeInRowParam === 'object') { - let [, value] = Object.entries(c4ShapeInRowParam)[0]; + const value = Object.values(c4ShapeInRowParam)[0]; c4ShapeInRowValue = parseInt(value); } else { c4ShapeInRowValue = parseInt(c4ShapeInRowParam); } if (typeof c4BoundaryInRowParam === 'object') { - let [, value] = Object.entries(c4BoundaryInRowParam)[0]; + const value = Object.values(c4BoundaryInRowParam)[0]; c4BoundaryInRowValue = parseInt(value); } else { c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); From 9acdc0bc2e58b3b084b756a78f0a1d7991fa752a Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist <knsv@sveido.com> Date: Wed, 14 Sep 2022 10:58:59 +0200 Subject: [PATCH 53/56] Cleanup fixing som lingering issues --- src/diagrams/c4/c4Renderer.js | 1 - src/diagrams/class/classRenderer.js | 2 -- src/diagrams/mindmap/mindmapRenderer.js | 4 +--- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/diagrams/c4/c4Renderer.js b/src/diagrams/c4/c4Renderer.js index c3402d0b94..dceca28871 100644 --- a/src/diagrams/c4/c4Renderer.js +++ b/src/diagrams/c4/c4Renderer.js @@ -616,7 +616,6 @@ export const draw = function (_text, id, _version, diagObj) { globalBoundaryMaxY = conf.diagramMarginY; const title = diagObj.db.getTitle(); - const c4type = diagObj.db.getC4Type(); // TODO: @knsv: remove this? let currentBoundarys = diagObj.db.getBoundarys(''); // switch (c4type) { // case 'C4Context': diff --git a/src/diagrams/class/classRenderer.js b/src/diagrams/class/classRenderer.js index 612a7d8796..c1236afea7 100644 --- a/src/diagrams/class/classRenderer.js +++ b/src/diagrams/class/classRenderer.js @@ -157,8 +157,6 @@ export const draw = function (text, id, _version, diagObj) { securityLevel === 'sandbox' ? select(sandboxElement.nodes()[0].contentDocument.body) : select('body'); - // TODO: @knsv doc is not used, bug? - const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; // Fetch the default direction, use TD if none was found const diagram = root.select(`[id='${id}']`); diff --git a/src/diagrams/mindmap/mindmapRenderer.js b/src/diagrams/mindmap/mindmapRenderer.js index 37cce58bf6..1519dc4065 100644 --- a/src/diagrams/mindmap/mindmapRenderer.js +++ b/src/diagrams/mindmap/mindmapRenderer.js @@ -192,9 +192,7 @@ function layoutMindmap(node, conf) { }); // Merge the trees into a single tree - const result = mergeTrees(node, trees); - // TODO: @knsv The function is not called bug? - eachNode; + mergeTrees(node, trees); return node; } /** From e9239f83e9164bd9488547d295962b1a9a968eb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 01:55:27 +0100 Subject: [PATCH 54/56] chore(deps-dev): bump webpack-dev-server from 4.10.1 to 4.11.0 (#3450) Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 4.10.1 to 4.11.0. - [Release notes](https://github.com/webpack/webpack-dev-server/releases) - [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.10.1...v4.11.0) --- updated-dependencies: - dependency-name: webpack-dev-server dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Tested-by: Alois Klink <19716675+aloisklink@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 44c9138271..c111a98061 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "unist-util-flatmap": "^1.0.0", "webpack": "^5.53.0", "webpack-cli": "^4.7.2", - "webpack-dev-server": "^4.10.1", + "webpack-dev-server": "^4.11.0", "webpack-merge": "^5.8.0", "webpack-node-externals": "^3.0.0" }, diff --git a/yarn.lock b/yarn.lock index 71a505d780..ed24ef7442 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12299,10 +12299,10 @@ webpack-dev-middleware@^5.3.1: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.10.1: - version "4.10.1" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.1.tgz#124ac9ac261e75303d74d95ab6712b4aec3e12ed" - integrity sha512-FIzMq3jbBarz3ld9l7rbM7m6Rj1lOsgq/DyLGMX/fPEB1UBUPtf5iL/4eNfhx8YYJTRlzfv107UfWSWcBK5Odw== +webpack-dev-server@^4.11.0: + version "4.11.0" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.11.0.tgz#290ee594765cd8260adfe83b2d18115ea04484e7" + integrity sha512-L5S4Q2zT57SK7tazgzjMiSMBdsw+rGYIX27MgPgx7LDhWO0lViPrHKoLS7jo5In06PWYAhlYu3PbyoC6yAThbw== dependencies: "@types/bonjour" "^3.5.9" "@types/connect-history-api-fallback" "^1.3.5" From 6340c157e8cb125bc0edc56ec61b5dad13757b60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 07:42:13 +0200 Subject: [PATCH 55/56] chore(deps): bump stylis from 4.1.1 to 4.1.2 (#3439) Bumps [stylis](https://github.com/thysultan/stylis.js) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/thysultan/stylis.js/releases) - [Commits](https://github.com/thysultan/stylis.js/compare/v4.1.1...v4.1.2) --- updated-dependencies: - dependency-name: stylis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c111a98061..997cafd533 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "khroma": "^2.0.0", "moment-mini": "^2.24.0", "non-layered-tidy-tree-layout": "^2.0.2", - "stylis": "^4.0.10" + "stylis": "^4.1.2" }, "devDependencies": { "@applitools/eyes-cypress": "^3.25.7", diff --git a/yarn.lock b/yarn.lock index ed24ef7442..624f5ea008 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11270,10 +11270,10 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -stylis@^4.0.10: - version "4.1.1" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.1.tgz#e46c6a9bbf7c58db1e65bb730be157311ae1fe12" - integrity sha512-lVrM/bNdhVX2OgBFNa2YJ9Lxj7kPzylieHd3TNjuGE0Re9JB7joL5VUKOVH1kdNNJTgGPpT8hmwIAPLaSyEVFQ== +stylis@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.2.tgz#870b3c1c2275f51b702bb3da9e94eedad87bba41" + integrity sha512-Nn2CCrG2ZaFziDxaZPN43CXqn+j7tcdjPFCkRBkFue8QYXC2HdEwnw5TCBo4yQZ2WxKYeSi0fdoOrtEqgDrXbA== subarg@^1.0.0: version "1.0.0" From 064c3134e5a3c67c005f5ac69d2c8bea3c41184a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Sep 2022 07:42:28 +0200 Subject: [PATCH 56/56] chore(deps): bump dompurify from 2.3.10 to 2.4.0 (#3444) Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.3.10 to 2.4.0. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/2.3.10...2.4.0) --- updated-dependencies: - dependency-name: dompurify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 997cafd533..2174df185c 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "d3": "^7.0.0", "dagre": "^0.8.5", "dagre-d3": "^0.6.4", - "dompurify": "2.3.10", + "dompurify": "2.4.0", "fast-clone": "^1.5.13", "graphlib": "^2.1.8", "khroma": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index 624f5ea008..c8ba00606e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5370,10 +5370,10 @@ domhandler@^5.0.1, domhandler@^5.0.2: dependencies: domelementtype "^2.3.0" -dompurify@2.3.10: - version "2.3.10" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.10.tgz#901f7390ffe16a91a5a556b94043314cd4850385" - integrity sha512-o7Fg/AgC7p/XpKjf/+RC3Ok6k4St5F7Q6q6+Nnm3p2zGWioAY6dh0CbbuwOhH2UcSzKsdniE/YnE2/92JcsA+g== +dompurify@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.4.0.tgz#c9c88390f024c2823332615c9e20a453cf3825dd" + integrity sha512-Be9tbQMZds4a3C6xTmz68NlMfeONA//4dOavl/1rNw50E+/QO0KVpbcU0PcaW0nsQxurXls9ZocqFxk8R2mWEA== domutils@^3.0.1: version "3.0.1"