mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 17:59:39 +02:00
chore: Linear build
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
"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: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\"",
|
||||
"release": "pnpm build",
|
||||
"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 * as mindmapDB from './mindmapDb';
|
||||
// import { injectUtils } from './mermaidUtils';
|
||||
// Todo fix utils functions for tests
|
||||
import {
|
||||
// log,
|
||||
setLogLevel,
|
||||
// getConfig,
|
||||
// sanitizeText,
|
||||
// setupGraphViewBox,
|
||||
} from '../../diagram-api/diagramAPI';
|
||||
|
||||
// injectUtils(log, setLogLevel, getConfig, sanitizeText, setupGraphViewBox);
|
||||
import { setLogLevel } from '../../diagram-api/diagramAPI';
|
||||
|
||||
describe('when parsing a mindmap ', 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 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> => {
|
||||
await init;
|
||||
mermaid.initialize(config);
|
||||
const svg = await mermaid.renderAsync(id, code);
|
||||
return svg;
|
||||
|
Reference in New Issue
Block a user