diff --git a/package.json b/package.json index 1502af6e9e..f59cf5e093 100644 --- a/package.json +++ b/package.json @@ -49,18 +49,18 @@ "@braintree/sanitize-url": "^3.1.0", "crypto-random-string": "^3.0.1", "d3": "^5.7.0", - "dagre-d3": "dagrejs/dagre-d3", + "dagre-d3-unofficial": "0.6.4", "dagre": "^0.8.4", "graphlib": "^2.1.7", "he": "^1.2.0", "lodash": "^4.17.11", "minify": "^4.1.1", "moment-mini": "^2.22.1", - "prettier": "^1.18.2", "scope-css": "^1.2.1" }, "devDependencies": { "documentation": "^12.0.1", + "prettier": "^1.18.2", "eslint": "^6.3.0", "eslint-config-prettier": "^6.3.0", "eslint-plugin-prettier": "^3.1.0", diff --git a/src/diagrams/flowchart/flowChartShapes.js b/src/diagrams/flowchart/flowChartShapes.js index ed69c48015..abca11dfd2 100644 --- a/src/diagrams/flowchart/flowChartShapes.js +++ b/src/diagrams/flowchart/flowChartShapes.js @@ -1,4 +1,4 @@ -import dagreD3 from 'dagre-d3'; +import dagreD3 from 'dagre-d3-unofficial'; function question(parent, bbox, node) { const w = bbox.width; diff --git a/src/diagrams/flowchart/flowRenderer.js b/src/diagrams/flowchart/flowRenderer.js index 473d1398c2..835124179e 100644 --- a/src/diagrams/flowchart/flowRenderer.js +++ b/src/diagrams/flowchart/flowRenderer.js @@ -6,11 +6,10 @@ import flow from './parser/flow'; import { getConfig } from '../../config'; const newDagreD3 = true; -import dagreD3 from 'dagre-d3'; +import dagreD3 from 'dagre-d3-unofficial'; // const newDagreD3 = false; -// import dagreD3 from '../../../../dagre-d3-renderer/dist/dagre-d3.core.js'; -import addHtmlLabel from 'dagre-d3/lib/label/add-html-label.js'; +import addHtmlLabel from 'dagre-d3-unofficial/lib/label/add-html-label.js'; import { logger } from '../../logger'; import { interpolateToCurve } from '../../utils'; import flowChartShapes from './flowChartShapes'; diff --git a/webpack.config.base.js b/webpack.config.base.js index 0a02420a35..dcde900d4c 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -1,10 +1,10 @@ -import path from 'path' +import path from 'path'; const amdRule = { parser: { amd: false // https://github.com/lodash/lodash/issues/3052 } -} +}; const jisonRule = { test: /\.jison$/, @@ -14,7 +14,7 @@ const jisonRule = { 'token-stack': true } } -} +}; const jsRule = { test: /\.js$/, include: [ @@ -24,16 +24,13 @@ const jsRule = { use: { loader: 'babel-loader' } -} +}; -const scssRule = { // load scss to string +const scssRule = { + // load scss to string test: /\.scss$/, - use: [ - { loader: 'css-to-string-loader' }, - { loader: 'css-loader' }, - { loader: 'sass-loader' } - ] -} + use: [{ loader: 'css-to-string-loader' }, { loader: 'css-loader' }, { loader: 'sass-loader' }] +}; export const jsConfig = () => { return { @@ -43,7 +40,10 @@ export const jsConfig = () => { mermaid: './src/mermaid.js' }, resolve: { - extensions: ['.wasm', '.mjs', '.js', '.json', '.jison'] + extensions: ['.wasm', '.mjs', '.js', '.json', '.jison'], + alias: { + 'dagre-d3': 'dagre-d3-unofficial' + } }, node: { fs: 'empty' // jison generated code requires 'fs' @@ -59,5 +59,5 @@ export const jsConfig = () => { rules: [amdRule, jsRule, scssRule, jisonRule] }, devtool: 'source-map' - } -} + }; +}; diff --git a/yarn.lock b/yarn.lock index 75ff603e35..e6377b0e53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3641,9 +3641,10 @@ d3@^5.12, d3@^5.7.0: d3-voronoi "1" d3-zoom "1" -dagre-d3@dagrejs/dagre-d3: - version "0.6.4-pre" - resolved "https://codeload.github.com/dagrejs/dagre-d3/tar.gz/e1a00e5cb518f5d2304a35647e024f31d178e55b" +dagre-d3-unofficial@0.6.4: + version "0.6.4" + resolved "https://registry.yarnpkg.com/dagre-d3-unofficial/-/dagre-d3-unofficial-0.6.4.tgz#c3d0c3993e53942b9ab977a98ac980b6e7c620eb" + integrity sha512-xihvMCALDS/X646WyqBSMN1kl7f0K1Urd42EKYgmyISwML1Bep1MCMm+2Q3TIJe6y8TwHKmW6oYXnP5I0J/LIg== dependencies: d3 "^5.12" dagre "^0.8.4"