mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-17 03:04:07 +01:00
Merge branch 'develop' into fix-markdown-labels-6087
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
!viewbox
|
||||||
|
# It should be viewBox
|
||||||
# This file contains coding related terms
|
# This file contains coding related terms
|
||||||
ALPHANUM
|
ALPHANUM
|
||||||
antiscript
|
antiscript
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ rscratch
|
|||||||
shiki
|
shiki
|
||||||
Slidev
|
Slidev
|
||||||
sparkline
|
sparkline
|
||||||
|
speccharts
|
||||||
sphinxcontrib
|
sphinxcontrib
|
||||||
ssim
|
ssim
|
||||||
stylis
|
stylis
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
|
|||||||
|
|
||||||
const external: string[] = ['require', 'fs', 'path'];
|
const external: string[] = ['require', 'fs', 'path'];
|
||||||
const outFileName = getFileName(name, options);
|
const outFileName = getFileName(name, options);
|
||||||
|
const { dependencies, version } = JSON.parse(
|
||||||
|
readFileSync(resolve(__dirname, `../packages/${packageName}/package.json`), 'utf-8')
|
||||||
|
);
|
||||||
const output: BuildOptions = buildOptions({
|
const output: BuildOptions = buildOptions({
|
||||||
...rest,
|
...rest,
|
||||||
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
||||||
@@ -82,15 +85,13 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
|
|||||||
chunkNames: `chunks/${outFileName}/[name]-[hash]`,
|
chunkNames: `chunks/${outFileName}/[name]-[hash]`,
|
||||||
define: {
|
define: {
|
||||||
// This needs to be stringified for esbuild
|
// This needs to be stringified for esbuild
|
||||||
includeLargeFeatures: `${includeLargeFeatures}`,
|
'injected.includeLargeFeatures': `${includeLargeFeatures}`,
|
||||||
|
'injected.version': `'${version}'`,
|
||||||
'import.meta.vitest': 'undefined',
|
'import.meta.vitest': 'undefined',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (core) {
|
if (core) {
|
||||||
const { dependencies } = JSON.parse(
|
|
||||||
readFileSync(resolve(__dirname, `../packages/${packageName}/package.json`), 'utf-8')
|
|
||||||
);
|
|
||||||
// Core build is used to generate file without bundled dependencies.
|
// Core build is used to generate file without bundled dependencies.
|
||||||
// This is used by downstream projects to bundle dependencies themselves.
|
// This is used by downstream projects to bundle dependencies themselves.
|
||||||
// Ignore dependencies and any dependencies of dependencies
|
// Ignore dependencies and any dependencies of dependencies
|
||||||
|
|||||||
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
@@ -42,5 +42,4 @@ jobs:
|
|||||||
publish: pnpm changeset:publish
|
publish: pnpm changeset:publish
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
NPM_CONFIG_PROVENANCE: true
|
NPM_CONFIG_PROVENANCE: true
|
||||||
|
|||||||
7
.github/workflows/validate-lockfile.yml
vendored
7
.github/workflows/validate-lockfile.yml
vendored
@@ -18,13 +18,6 @@ jobs:
|
|||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
|
|
||||||
|
|
||||||
- name: Validate pnpm-lock.yaml entries
|
- name: Validate pnpm-lock.yaml entries
|
||||||
id: validate # give this step an ID so we can reference its outputs
|
id: validate # give this step an ID so we can reference its outputs
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
'import.meta.vitest': 'undefined',
|
'import.meta.vitest': 'undefined',
|
||||||
|
'injected.includeLargeFeatures': 'true',
|
||||||
|
'injected.version': `'0.0.0'`,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [],
|
extensions: [],
|
||||||
@@ -94,10 +96,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
}),
|
}),
|
||||||
...visualizerOptions(packageName, core),
|
...visualizerOptions(packageName, core),
|
||||||
],
|
],
|
||||||
define: {
|
|
||||||
// Needs to be string
|
|
||||||
includeLargeFeatures: 'true',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (watch && config.build) {
|
if (watch && config.build) {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export const openURLAndVerifyRendering = (
|
|||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.window().should('have.property', 'rendered', true);
|
cy.window().should('have.property', 'rendered', true);
|
||||||
cy.get('svg').should('be.visible');
|
cy.get('svg').should('be.visible');
|
||||||
|
// cspell:ignore viewbox
|
||||||
cy.get('svg').should('not.have.attr', 'viewbox');
|
cy.get('svg').should('not.have.attr', 'viewbox');
|
||||||
|
|
||||||
if (validation) {
|
if (validation) {
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ To add an integration to this list, see the [Integrations - create page](./integ
|
|||||||
- [GitHub Writer](https://github.com/ckeditor/github-writer)
|
- [GitHub Writer](https://github.com/ckeditor/github-writer)
|
||||||
- [SVG diagram generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator)
|
- [SVG diagram generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator)
|
||||||
- [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) ✅
|
- [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) ✅
|
||||||
|
- [GNU Octave](https://octave.org/) ✅
|
||||||
|
- [octave_mermaid_js](https://github.com/CNOCTAVE/octave_mermaid_js) ✅
|
||||||
- [Mermaid Plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/20146-mermaid)
|
- [Mermaid Plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/20146-mermaid)
|
||||||
- [MonsterWriter](https://www.monsterwriter.com/) ✅
|
- [MonsterWriter](https://www.monsterwriter.com/) ✅
|
||||||
- [Joplin](https://joplinapp.org) ✅
|
- [Joplin](https://joplinapp.org) ✅
|
||||||
@@ -272,6 +274,7 @@ Communication tools and platforms
|
|||||||
- [reveal.js-mermaid-plugin](https://github.com/ludwick/reveal.js-mermaid-plugin)
|
- [reveal.js-mermaid-plugin](https://github.com/ludwick/reveal.js-mermaid-plugin)
|
||||||
- [Reveal CK](https://github.com/jedcn/reveal-ck)
|
- [Reveal CK](https://github.com/jedcn/reveal-ck)
|
||||||
- [reveal-ck-mermaid-plugin](https://github.com/tmtm/reveal-ck-mermaid-plugin)
|
- [reveal-ck-mermaid-plugin](https://github.com/tmtm/reveal-ck-mermaid-plugin)
|
||||||
|
- [speccharts: Turn your test suites into specification diagrams](https://github.com/arnaudrenaud/speccharts)
|
||||||
- [Vitepress Plugin](https://github.com/sametcn99/vitepress-mermaid-renderer)
|
- [Vitepress Plugin](https://github.com/sametcn99/vitepress-mermaid-renderer)
|
||||||
|
|
||||||
<!--- cspell:ignore Blazorade HueHive --->
|
<!--- cspell:ignore Blazorade HueHive --->
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
"elk",
|
"elk",
|
||||||
"mermaid"
|
"mermaid"
|
||||||
],
|
],
|
||||||
"scripts": {},
|
"scripts": {
|
||||||
|
"clean": "rimraf dist"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mermaid-js/mermaid"
|
"url": "https://github.com/mermaid-js/mermaid"
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
"mermaid",
|
"mermaid",
|
||||||
"layout"
|
"layout"
|
||||||
],
|
],
|
||||||
"scripts": {},
|
"scripts": {
|
||||||
|
"clean": "rimraf dist"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mermaid-js/mermaid"
|
"url": "https://github.com/mermaid-js/mermaid"
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export const addDiagrams = () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (includeLargeFeatures) {
|
if (injected.includeLargeFeatures) {
|
||||||
registerLazyLoadedDiagrams(flowchartElk, mindmap, architecture);
|
registerLazyLoadedDiagrams(flowchartElk, mindmap, architecture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ const renderKatexUnsanitized = async (text: string, config: MermaidConfig): Prom
|
|||||||
return text.replace(katexRegex, 'MathML is unsupported in this environment.');
|
return text.replace(katexRegex, 'MathML is unsupported in this environment.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeLargeFeatures) {
|
if (injected.includeLargeFeatures) {
|
||||||
const { default: katex } = await import('katex');
|
const { default: katex } = await import('katex');
|
||||||
const outputMode =
|
const outputMode =
|
||||||
config.forceLegacyMathML || (!isMathMLSupported() && config.legacyMathML)
|
config.forceLegacyMathML || (!isMathMLSupported() && config.legacyMathML)
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import type { InfoFields, InfoDB } from './infoTypes.js';
|
import type { InfoFields, InfoDB } from './infoTypes.js';
|
||||||
import packageJson from '../../../package.json' assert { type: 'json' };
|
|
||||||
|
|
||||||
export const DEFAULT_INFO_DB: InfoFields = {
|
export const DEFAULT_INFO_DB: InfoFields = {
|
||||||
version: packageJson.version + (includeLargeFeatures ? '' : '-tiny'),
|
version: injected.version + (injected.includeLargeFeatures ? '' : '-tiny'),
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const getVersion = (): string => DEFAULT_INFO_DB.version;
|
export const getVersion = (): string => DEFAULT_INFO_DB.version;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { MarkdownOptions } from 'vitepress';
|
import type { MarkdownOptions } from 'vitepress';
|
||||||
import { defineConfig } from 'vitepress';
|
import { defineConfig } from 'vitepress';
|
||||||
import packageJson from '../../../package.json' assert { type: 'json' };
|
import packageJson from '../../../package.json' with { type: 'json' };
|
||||||
import { addCanonicalUrls } from './canonical-urls.js';
|
import { addCanonicalUrls } from './canonical-urls.js';
|
||||||
import MermaidExample from './mermaid-markdown-all.js';
|
import MermaidExample from './mermaid-markdown-all.js';
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ To add an integration to this list, see the [Integrations - create page](./integ
|
|||||||
- [GitHub Writer](https://github.com/ckeditor/github-writer)
|
- [GitHub Writer](https://github.com/ckeditor/github-writer)
|
||||||
- [SVG diagram generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator)
|
- [SVG diagram generator](https://github.com/SimonKenyonShepard/mermaidjs-github-svg-generator)
|
||||||
- [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) ✅
|
- [GitLab](https://docs.gitlab.com/ee/user/markdown.html#diagrams-and-flowcharts) ✅
|
||||||
|
- [GNU Octave](https://octave.org/) ✅
|
||||||
|
- [octave_mermaid_js](https://github.com/CNOCTAVE/octave_mermaid_js) ✅
|
||||||
- [Mermaid Plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/20146-mermaid)
|
- [Mermaid Plugin for JetBrains IDEs](https://plugins.jetbrains.com/plugin/20146-mermaid)
|
||||||
- [MonsterWriter](https://www.monsterwriter.com/) ✅
|
- [MonsterWriter](https://www.monsterwriter.com/) ✅
|
||||||
- [Joplin](https://joplinapp.org) ✅
|
- [Joplin](https://joplinapp.org) ✅
|
||||||
@@ -267,6 +269,7 @@ Communication tools and platforms
|
|||||||
- [reveal.js-mermaid-plugin](https://github.com/ludwick/reveal.js-mermaid-plugin)
|
- [reveal.js-mermaid-plugin](https://github.com/ludwick/reveal.js-mermaid-plugin)
|
||||||
- [Reveal CK](https://github.com/jedcn/reveal-ck)
|
- [Reveal CK](https://github.com/jedcn/reveal-ck)
|
||||||
- [reveal-ck-mermaid-plugin](https://github.com/tmtm/reveal-ck-mermaid-plugin)
|
- [reveal-ck-mermaid-plugin](https://github.com/tmtm/reveal-ck-mermaid-plugin)
|
||||||
|
- [speccharts: Turn your test suites into specification diagrams](https://github.com/arnaudrenaud/speccharts)
|
||||||
- [Vitepress Plugin](https://github.com/sametcn99/vitepress-mermaid-renderer)
|
- [Vitepress Plugin](https://github.com/sametcn99/vitepress-mermaid-renderer)
|
||||||
|
|
||||||
<!--- cspell:ignore Blazorade HueHive --->
|
<!--- cspell:ignore Blazorade HueHive --->
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { select } from 'd3';
|
|||||||
import { compile, serialize, stringify } from 'stylis';
|
import { compile, serialize, stringify } from 'stylis';
|
||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
import isEmpty from 'lodash-es/isEmpty.js';
|
import isEmpty from 'lodash-es/isEmpty.js';
|
||||||
import packageJson from '../package.json' assert { type: 'json' };
|
|
||||||
import { addSVGa11yTitleDescription, setA11yDiagramInfo } from './accessibility.js';
|
import { addSVGa11yTitleDescription, setA11yDiagramInfo } from './accessibility.js';
|
||||||
import assignWithDepth from './assignWithDepth.js';
|
import assignWithDepth from './assignWithDepth.js';
|
||||||
import * as configApi from './config.js';
|
import * as configApi from './config.js';
|
||||||
@@ -421,12 +420,12 @@ const render = async function (
|
|||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
// Draw the diagram with the renderer
|
// Draw the diagram with the renderer
|
||||||
try {
|
try {
|
||||||
await diag.renderer.draw(text, id, packageJson.version, diag);
|
await diag.renderer.draw(text, id, injected.version, diag);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (config.suppressErrorRendering) {
|
if (config.suppressErrorRendering) {
|
||||||
removeTempElements();
|
removeTempElements();
|
||||||
} else {
|
} else {
|
||||||
errorRenderer.draw(text, id, packageJson.version);
|
errorRenderer.draw(text, id, injected.version);
|
||||||
}
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const registerDefaultLayoutLoaders = () => {
|
|||||||
name: 'dagre',
|
name: 'dagre',
|
||||||
loader: async () => await import('./layout-algorithms/dagre/index.js'),
|
loader: async () => await import('./layout-algorithms/dagre/index.js'),
|
||||||
},
|
},
|
||||||
...(includeLargeFeatures
|
...(injected.includeLargeFeatures
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
name: 'cose-bilkent',
|
name: 'cose-bilkent',
|
||||||
|
|||||||
5
packages/mermaid/src/type.d.ts
vendored
5
packages/mermaid/src/type.d.ts
vendored
@@ -1,2 +1,5 @@
|
|||||||
// eslint-disable-next-line no-var
|
// eslint-disable-next-line no-var
|
||||||
declare var includeLargeFeatures: boolean;
|
declare var injected: {
|
||||||
|
version: string;
|
||||||
|
includeLargeFeatures: boolean;
|
||||||
|
};
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
// Needs to be string
|
// Needs to be string
|
||||||
includeLargeFeatures: 'true',
|
'injected.includeLargeFeatures': 'true',
|
||||||
'import.meta.vitest': 'undefined',
|
'import.meta.vitest': 'undefined',
|
||||||
|
packageVersion: "'0.0.0'",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user