mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 10:20:06 +02:00
chore: Linear build
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
"build:viz": "pnpm build:mermaid --visualize",
|
"build:viz": "pnpm build:mermaid --visualize",
|
||||||
"build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly",
|
"build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-example-diagram/tsconfig.json --emitDeclarationOnly",
|
||||||
"build:watch": "pnpm build:vite --watch",
|
"build:watch": "pnpm build:vite --watch",
|
||||||
"build": "pnpm run -r clean && concurrently \"pnpm build:vite\" \"pnpm build:types\"",
|
"build": "pnpm run -r clean && pnpm build:types && pnpm build:vite",
|
||||||
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"",
|
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"",
|
||||||
"release": "pnpm build",
|
"release": "pnpm build",
|
||||||
"lint": "eslint --cache --cache-strategy content --ignore-path .gitignore . && pnpm lint:jison && prettier --cache --check .",
|
"lint": "eslint --cache --cache-strategy content --ignore-path .gitignore . && pnpm lint:jison && prettier --cache --check .",
|
||||||
|
@@ -1,16 +1,7 @@
|
|||||||
import { parser as mindmap } from './parser/mindmap';
|
import { parser as mindmap } from './parser/mindmap';
|
||||||
import * as mindmapDB from './mindmapDb';
|
import * as mindmapDB from './mindmapDb';
|
||||||
// import { injectUtils } from './mermaidUtils';
|
|
||||||
// Todo fix utils functions for tests
|
// Todo fix utils functions for tests
|
||||||
import {
|
import { setLogLevel } from '../../diagram-api/diagramAPI';
|
||||||
// log,
|
|
||||||
setLogLevel,
|
|
||||||
// getConfig,
|
|
||||||
// sanitizeText,
|
|
||||||
// setupGraphViewBox,
|
|
||||||
} from '../../diagram-api/diagramAPI';
|
|
||||||
|
|
||||||
// injectUtils(log, setLogLevel, getConfig, sanitizeText, setupGraphViewBox);
|
|
||||||
|
|
||||||
describe('when parsing a mindmap ', function () {
|
describe('when parsing a mindmap ', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
export {};
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
interface Window {
|
|
||||||
mermaid: any; // 👈️ turn off type checking
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,17 +1,6 @@
|
|||||||
import mermaid, { type MermaidConfig } from 'mermaid';
|
import mermaid, { type MermaidConfig } from 'mermaid';
|
||||||
// import mindmap from '@mermaid-js/mermaid-mindmap';
|
|
||||||
// import timeline from '@mermaid-js/mermaid-timeline';
|
|
||||||
|
|
||||||
const init = (async () => {
|
|
||||||
try {
|
|
||||||
await mermaid.registerExternalDiagrams([]);
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
export const render = async (id: string, code: string, config: MermaidConfig): Promise<string> => {
|
export const render = async (id: string, code: string, config: MermaidConfig): Promise<string> => {
|
||||||
await init;
|
|
||||||
mermaid.initialize(config);
|
mermaid.initialize(config);
|
||||||
const svg = await mermaid.renderAsync(id, code);
|
const svg = await mermaid.renderAsync(id, code);
|
||||||
return svg;
|
return svg;
|
||||||
|
Reference in New Issue
Block a user