mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-02-04 07:13:25 +08:00
Minor cleanups
This commit is contained in:
parent
ca2c112c9a
commit
aa63f320f8
@ -1,6 +1,7 @@
|
|||||||
import jison from 'jison';
|
import jison from 'jison';
|
||||||
|
|
||||||
export const transformJison = (src: string): string => {
|
export const transformJison = (src: string): string => {
|
||||||
|
// @ts-ignore - Jison is not typed properly
|
||||||
const parser = new jison.Generator(src, {
|
const parser = new jison.Generator(src, {
|
||||||
moduleType: 'js',
|
moduleType: 'js',
|
||||||
'token-stack': true,
|
'token-stack': true,
|
||||||
|
@ -7,8 +7,8 @@ import { MermaidBuildOptions, defaultOptions, getBuildConfig } from './util.js';
|
|||||||
const shouldVisualize = process.argv.includes('--visualize');
|
const shouldVisualize = process.argv.includes('--visualize');
|
||||||
|
|
||||||
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
||||||
const commonOptions = { ...defaultOptions, entryName } as const;
|
const commonOptions: MermaidBuildOptions = { ...defaultOptions, entryName } as const;
|
||||||
const buildConfigs = [
|
const buildConfigs: MermaidBuildOptions[] = [
|
||||||
// package.mjs
|
// package.mjs
|
||||||
{ ...commonOptions },
|
{ ...commonOptions },
|
||||||
// package.min.mjs
|
// package.min.mjs
|
||||||
|
@ -8,7 +8,7 @@ import { jisonPlugin } from './jisonPlugin.js';
|
|||||||
|
|
||||||
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
||||||
|
|
||||||
export interface MermaidBuildOptions {
|
export interface MermaidBuildOptions extends BuildOptions {
|
||||||
minify: boolean;
|
minify: boolean;
|
||||||
core: boolean;
|
core: boolean;
|
||||||
metafile: boolean;
|
metafile: boolean;
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"$root/*": ["src/*"]
|
"$root/*": ["src/*"]
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"include": ["./src/**/*.ts", "./package.json"],
|
"include": ["./src/**/*.ts", "./package.json"]
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ export default defineConfig({
|
|||||||
plugins: [
|
plugins: [
|
||||||
jison(),
|
jison(),
|
||||||
jsonSchemaPlugin(), // handles .schema.yaml JSON Schema files
|
jsonSchemaPlugin(), // handles .schema.yaml JSON Schema files
|
||||||
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
|
||||||
typescript({ compilerOptions: { declaration: false } }),
|
typescript({ compilerOptions: { declaration: false } }),
|
||||||
],
|
],
|
||||||
test: {
|
test: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user