mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Fix import extensions
This commit is contained in:
parent
fd013286f6
commit
fc80ba66d2
@ -107,7 +107,7 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
||||
},
|
||||
plugins: [
|
||||
jisonPlugin(),
|
||||
// @ts-expect-error
|
||||
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
||||
typescript({ compilerOptions: { declaration: false } }),
|
||||
...visualizerOptions(packageName, core),
|
||||
],
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './parser/exampleDiagram.js';
|
||||
import { parser } from './parser/exampleDiagram.jison';
|
||||
import * as db from './exampleDiagramDb.js';
|
||||
import { injectUtils } from './mermaidUtils.js';
|
||||
// Todo fix utils functions for tests
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './parser/classDiagram.js';
|
||||
import { parser } from './parser/classDiagram.jison';
|
||||
import classDb from './classDb.js';
|
||||
|
||||
describe('class diagram, ', function () {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// @ts-expect-error Jison doesn't export types
|
||||
import { parser } from './parser/classDiagram.js';
|
||||
import { parser } from './parser/classDiagram.jison';
|
||||
import classDb from './classDb.js';
|
||||
import { vi, describe, it, expect } from 'vitest';
|
||||
const spyOn = vi.spyOn;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setConfig } from '../../../config.js';
|
||||
import erDb from '../erDb.js';
|
||||
import erDiagram from './erDiagram.js'; // jison file
|
||||
import erDiagram from './erDiagram.jison'; // jison file
|
||||
|
||||
setConfig({
|
||||
securityLevel: 'strict',
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from './flowDb.js';
|
||||
import { parser } from './parser/flow.js';
|
||||
import { parser } from './parser/flow.jison';
|
||||
import flowRenderer from './flowRenderer.js';
|
||||
import { addDiagrams } from '../../diagram-api/diagram-orchestration.js';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
import { vi } from 'vitest';
|
||||
const spyOn = vi.spyOn;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import flowDb from '../flowDb.js';
|
||||
import flow from './flow.js';
|
||||
import flow from './flow.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './gantt.js';
|
||||
import { parser } from './gantt.jison';
|
||||
import ganttDb from '../ganttDb.js';
|
||||
import { convert } from '../../../tests/util.js';
|
||||
import { vi } from 'vitest';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-env jasmine */
|
||||
// Todo reintroduce without cryptoRandomString
|
||||
import gitGraphAst from './gitGraphAst.js';
|
||||
import { parser } from './parser/gitGraph.js';
|
||||
import { parser } from './parser/gitGraph.jison';
|
||||
//import randomString from 'crypto-random-string';
|
||||
//import cryptoRandomString from 'crypto-random-string';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './parser/info.js';
|
||||
import { parser } from './parser/info.jison';
|
||||
import infoDb from './infoDb.js';
|
||||
describe('when parsing an info graph it', function () {
|
||||
let ex;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser as mindmap } from './parser/mindmap.js';
|
||||
import { parser as mindmap } from './parser/mindmap.jison';
|
||||
import * as mindmapDB from './mindmapDb.js';
|
||||
// Todo fix utils functions for tests
|
||||
import { setLogLevel } from '../../diagram-api/diagramAPI.js';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import pieDb from '../pieDb.js';
|
||||
import pie from './pie.js';
|
||||
import pie from './pie.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { setConfig } from '../../../config.js';
|
||||
import requirementDb from '../requirementDb.js';
|
||||
import reqDiagram from './requirementDiagram.js';
|
||||
import reqDiagram from './requirementDiagram.jison';
|
||||
|
||||
setConfig({
|
||||
securityLevel: 'strict',
|
||||
|
@ -1,5 +1,5 @@
|
||||
import stateDb from '../stateDb.js';
|
||||
import stateDiagram from './stateDiagram.js';
|
||||
import stateDiagram from './stateDiagram.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import stateDb from '../stateDb.js';
|
||||
import stateDiagram from './stateDiagram.js';
|
||||
import stateDiagram from './stateDiagram.jison';
|
||||
import { setConfig } from '../../../config.js';
|
||||
|
||||
setConfig({
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './parser/stateDiagram.js';
|
||||
import { parser } from './parser/stateDiagram.jison';
|
||||
import stateDb from './stateDb.js';
|
||||
import stateDiagram from './parser/stateDiagram.jison';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './parser/stateDiagram.js';
|
||||
import { parser } from './parser/stateDiagram.jison';
|
||||
import stateDb from './stateDb.js';
|
||||
|
||||
describe('state diagram, ', function () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { expectTypeOf } from 'vitest';
|
||||
|
||||
import { parser } from './parser/stateDiagram.js';
|
||||
import { parser } from './parser/stateDiagram.jison';
|
||||
import stateDb from './stateDb.js';
|
||||
import stateRendererV2 from './stateRenderer-v2.js';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser as timeline } from './parser/timeline.js';
|
||||
import { parser as timeline } from './parser/timeline.jison';
|
||||
import * as timelineDB from './timelineDb.js';
|
||||
// import { injectUtils } from './mermaidUtils.js';
|
||||
import * as _commonDb from '../../commonDb.js';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { parser } from './journey.js';
|
||||
import { parser } from './journey.jison';
|
||||
import journeyDb from '../journeyDb.js';
|
||||
|
||||
const parserFnConstructor = (str) => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import mermaid from './mermaid.js';
|
||||
import { mermaidAPI } from './mermaidAPI.js';
|
||||
import './diagram-api/diagram-orchestration';
|
||||
import './diagram-api/diagram-orchestration.js';
|
||||
import { addDiagrams } from './diagram-api/diagram-orchestration.js';
|
||||
import { beforeAll, describe, it, expect, vi } from 'vitest';
|
||||
|
||||
|
@ -1,11 +1,16 @@
|
||||
import jison from './.vite/jisonPlugin.js';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
extensions: [],
|
||||
extensions: ['.js'],
|
||||
},
|
||||
plugins: [jison()],
|
||||
plugins: [
|
||||
jison(),
|
||||
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
||||
typescript({ compilerOptions: { declaration: false } }),
|
||||
],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user