Skip to content

Commit

Permalink
fixed webpack4
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Jan 27, 2020
1 parent 49ed7b8 commit 820301f
Show file tree
Hide file tree
Showing 5 changed files with 460 additions and 370 deletions.
2 changes: 1 addition & 1 deletion packages/lib/array.merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build:cjs": "BABEL_ENV=build babel src -d build/cjs/src --root-mode upward",
"build:es": "BABEL_ENV=es babel src -d build/es/src --root-mode upward",
"build": "rm -rf build && npm run build:cjs && npm run build:es",
"prepublishOnly": "npm run test && npm run build",
"prepublishOnly": "npm run test",
"test": "npm run build && mocha 'build/cjs/**/__tests__/*.js'"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/organism-react-d3-uml/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "organism-react-d3-uml",
"version": "0.3.0",
"version": "0.3.1",
"description": "React D3 UML",
"repository": "react-atomic/react-atomic-organism",
"main": "./build/cjs/src/index.js",
Expand Down Expand Up @@ -42,7 +42,7 @@
"build:es": "BABEL_ENV=es babel src -d build/es/src --root-mode upward && BABEL_ENV=es babel ui -d build/es/ui --root-mode upward",
"build": "npm run clean && npm run build:cjs && npm run build:es",
"test": "npm run build && mocha 'build/cjs/**/__tests__/*.js' -r jsdom-global/register",
"prepublishOnly": "npm run test && npm run build"
"prepublishOnly": "npm run test"
},
"files": [
"build",
Expand Down
7 changes: 3 additions & 4 deletions packages/organism-react-d3-uml/src/lib/dagre/lib/debug.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import * as util from './util';
import {Graph} from './graphlib';

export {debugOrdering};


/* istanbul ignore next */
function debugOrdering(g) {
const debugOrdering = g => {
var layerMatrix = util.buildLayerMatrix(g);

var h = new Graph({ compound: true, multigraph: true }).setGraph({});
Expand All @@ -30,3 +27,5 @@ function debugOrdering(g) {

return h;
}

export default debugOrdering;
37 changes: 20 additions & 17 deletions packages/organism-react-d3-uml/src/lib/graphlib/lib/json.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
import { isUndefined } from '../../lodash-lite'
import Graph from './graph'
export {write, read};

function write(g) {
var json = {
options: {
directed: g.isDirected(),
multigraph: g.isMultigraph(),
compound: g.isCompound()
},
nodes: writeNodes(g),
edges: writeEdges(g)
};
if (!isUndefined(g.graph())) {
json.value = {...g.graph()};
}
return json;
}

function writeNodes(g) {
return g.nodes().map(function(v) {
Expand Down Expand Up @@ -47,7 +31,23 @@ function writeEdges(g) {
});
}

function read(json) {
const write = g => {
var json = {
options: {
directed: g.isDirected(),
multigraph: g.isMultigraph(),
compound: g.isCompound()
},
nodes: writeNodes(g),
edges: writeEdges(g)
};
if (!isUndefined(g.graph())) {
json.value = {...g.graph()};
}
return json;
}

const read = json => {
var g = new Graph(json.options).setGraph(json.value);
json.nodes.forEach(function(entry) {
g.setNode(entry.v, entry.value);
Expand All @@ -60,3 +60,6 @@ function read(json) {
});
return g;
}

export {write, read};
export default {write, read};
Loading

0 comments on commit 820301f

Please sign in to comment.