Skip to content

Commit

Permalink
feat(build): use common build process
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomaash committed Mar 8, 2020
1 parent b359e91 commit aa9b42f
Show file tree
Hide file tree
Showing 43 changed files with 1,858 additions and 1,743 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ coverage/
/cypress/videos/
/declarations/
/dist/
/esnext/
/examples/examples.css
/examples/index.html
/examples/static/
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extension": ["ts", "js"],
"require": ["./babel.mocha.js"],
"require": ["vis-dev-utils/babel-register"],
"spec": ["./test/**/*.test.js", "./test/**/*.test.ts"]
}
4 changes: 4 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
exclude: require("vis-dev-utils").BABEL_IGNORE_RE,
presets: [["vis-dev-utils/babel-preset", { css: true, ts: true }]]
};
3 changes: 0 additions & 3 deletions babel.mocha.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/pages/pollution.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

const library = document.createElement("script");
library.type = "text/javascript";
library.src = "../../standalone/umd/vis-network.min.js";
library.src = "../../standalone/umd/vis-network.js";
library.onload = async () => {
// check for pollution
await new Promise(resolve => setTimeout(resolve, waitTime));
Expand Down
9 changes: 2 additions & 7 deletions cypress/pages/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
<head>
<title>Vis Network | Cypress | Simple</title>

<script
type="text/javascript"
src="../../standalone/umd/vis-network.min.js"
></script>

<style type="text/css">
html,
body,
Expand Down Expand Up @@ -40,10 +35,10 @@

<script
type="text/javascript"
src="../../../../dist/vis-network.min.js"
src="../../standalone/umd/vis-network.js"
></script>
<link
href="../../../../dist/vis-network.min.css"
href="../../styles/vis-network.css"
rel="stylesheet"
type="text/css"
/>
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions lib/entry-peer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./entry-esnext";
10 changes: 10 additions & 0 deletions lib/entry-standalone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export * from "./entry-esnext";

// vis-util
import * as util from "vis-util/esnext";
export { util };

// vis-data
import * as data from "vis-data/esnext";
export { data };
export { DataSet, DataView, Queue } from "vis-data/esnext";
6 changes: 3 additions & 3 deletions lib/index-legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import * as DOMutil from "./DOMutil";
export { DOMutil };

// vis-util
import * as util from "vis-util";
import * as util from "vis-util/esnext";
export { util };

// vis-data
import * as data from "vis-data";
import * as data from "vis-data/esnext";
export { data };
export { DataSet, DataView, Queue } from "vis-data";
export { DataSet, DataView, Queue } from "vis-data/esnext";

// bundled external libraries
import * as moment from "./module/moment";
Expand Down
10 changes: 0 additions & 10 deletions lib/index-standalone.ts

This file was deleted.

2 changes: 1 addition & 1 deletion lib/network/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import './shapes';

import Emitter from 'component-emitter';
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import dotparser from './dotparser';
import * as gephiParser from './gephiParser';
import Activator from '../shared/Activator';
Expand Down
2 changes: 1 addition & 1 deletion lib/network/NetworkUtil.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* Utility Class
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/Canvas.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Hammer from '../../module/hammer';
import hammerUtil from '../../hammerUtil';

import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* Create the main frame for the Network.
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/CanvasRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function _initRequestAnimationFrame() {
}
}

import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* The canvas renderer
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/Clustering.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ member:
=========================================================================== */
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import { default as randomUUID } from 'uuid/v4';
import NetworkUtil from'../NetworkUtil';
import Cluster from'./components/nodes/Cluster';
Expand Down
4 changes: 2 additions & 2 deletions lib/network/modules/EdgesHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as util from 'vis-util';
import { DataSet, DataView } from 'vis-data';
import * as util from 'vis-util/esnext';
import { DataSet, DataView } from 'vis-data/esnext';
import Edge from './components/Edge';

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/Groups.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* This class can store groups and options specific for groups.
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/InteractionHandler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import NavigationHandler from './components/NavigationHandler';
import Popup from './../../shared/Popup';

Expand Down
4 changes: 2 additions & 2 deletions lib/network/modules/LayoutEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
*/
'use strict';
import TimSort from 'timsort';
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import NetworkUtil from '../NetworkUtil';
import { HorizontalStrategy, VerticalStrategy } from './components/DirectionStrategy.js';
import {
fillLevelsByDirectionLeaves,
fillLevelsByDirectionRoots
} from "./layout-engine";
import { Alea } from "vis-util";
import { Alea } from "vis-util/esnext";


/**
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/ManipulationSystem.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './ManipulationSystem.css';

import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import { default as randomUUID } from 'uuid/v4';
import Hammer from '../../module/hammer';
import hammerUtil from '../../hammerUtil';
Expand Down
4 changes: 2 additions & 2 deletions lib/network/modules/NodesHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as util from 'vis-util';
import { DataSet, DataView } from 'vis-data';
import * as util from 'vis-util/esnext';
import { DataSet, DataView } from 'vis-data/esnext';
import Node from "./components/Node";

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/PhysicsEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HierarchicalSpringSolver from './components/physics/HierarchicalSpringSol
import CentralGravitySolver from './components/physics/CentralGravitySolver';
import ForceAtlas2BasedRepulsionSolver from './components/physics/FA2BasedRepulsionSolver';
import ForceAtlas2BasedCentralGravitySolver from './components/physics/FA2BasedCentralGravitySolver';
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import { EndPoints } from './components/edges'; // for debugging with _drawForces()


Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/SelectionHandler.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Node from './components/Node';
import Edge from './components/Edge';

import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* The handler for selections
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/View.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

import NetworkUtil from '../NetworkUtil';

Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/Edge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import Label from './shared/Label';
import ComponentUtil from './shared/ComponentUtil';
import { BezierEdgeDynamic, BezierEdgeStatic, CubicBezierEdge, StraightEdge } from './edges';
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/Node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

import Label from './shared/Label';
import ComponentUtil from './shared/ComponentUtil';
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/edges/util/edge-base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { overrideOpacity } from "vis-util";
import { overrideOpacity } from "vis-util/esnext";
import { EndPoints } from "./end-points";
import {
ArrowData,
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/nodes/Cluster.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import Node from "../Node";

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/physics/BarnesHutSolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alea } from "vis-util";
import { Alea } from "vis-util/esnext";

/**
* Barnes Hut Solver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BarnesHutSolver from "./BarnesHutSolver"
import { Alea } from "vis-util";
import { Alea } from "vis-util/esnext";

/**
* @extends BarnesHutSolver
Expand Down
2 changes: 1 addition & 1 deletion lib/network/modules/components/physics/RepulsionSolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alea } from "vis-util";
import { Alea } from "vis-util/esnext";

/**
* Repulsion Solver
Expand Down
4 changes: 2 additions & 2 deletions lib/network/modules/components/shared/ComponentUtil.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

/**
* Helper functions for components
Expand Down Expand Up @@ -164,4 +164,4 @@ class ComponentUtil {

}

export default ComponentUtil;
export default ComponentUtil;
2 changes: 1 addition & 1 deletion lib/network/modules/components/shared/Label.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';
import ComponentUtil from './ComponentUtil';
import LabelSplitter from './LabelSplitter';

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/ColorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './ColorPicker.css';

import Hammer from '../module/hammer';
import hammerUtil from '../hammerUtil';
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';


var htmlColors = {black: '#000000', navy: '#000080', darkblue: '#00008B', mediumblue: '#0000CD', blue: '#0000FF', darkgreen: '#006400', green: '#008000', teal: '#008080', darkcyan: '#008B8B', deepskyblue: '#00BFFF', darkturquoise: '#00CED1', mediumspringgreen: '#00FA9A', lime: '#00FF00', springgreen: '#00FF7F', aqua: '#00FFFF', cyan: '#00FFFF', midnightblue: '#191970', dodgerblue: '#1E90FF', lightseagreen: '#20B2AA', forestgreen: '#228B22', seagreen: '#2E8B57', darkslategray: '#2F4F4F', limegreen: '#32CD32', mediumseagreen: '#3CB371', turquoise: '#40E0D0', royalblue: '#4169E1', steelblue: '#4682B4', darkslateblue: '#483D8B', mediumturquoise: '#48D1CC', indigo: '#4B0082', darkolivegreen: '#556B2F', cadetblue: '#5F9EA0', cornflowerblue: '#6495ED', mediumaquamarine: '#66CDAA', dimgray: '#696969', slateblue: '#6A5ACD', olivedrab: '#6B8E23', slategray: '#708090', lightslategray: '#778899', mediumslateblue: '#7B68EE', lawngreen: '#7CFC00', chartreuse: '#7FFF00', aquamarine: '#7FFFD4', maroon: '#800000', purple: '#800080', olive: '#808000', gray: '#808080', skyblue: '#87CEEB', lightskyblue: '#87CEFA', blueviolet: '#8A2BE2', darkred: '#8B0000', darkmagenta: '#8B008B', saddlebrown: '#8B4513', darkseagreen: '#8FBC8F', lightgreen: '#90EE90', mediumpurple: '#9370D8', darkviolet: '#9400D3', palegreen: '#98FB98', darkorchid: '#9932CC', yellowgreen: '#9ACD32', sienna: '#A0522D', brown: '#A52A2A', darkgray: '#A9A9A9', lightblue: '#ADD8E6', greenyellow: '#ADFF2F', paleturquoise: '#AFEEEE', lightsteelblue: '#B0C4DE', powderblue: '#B0E0E6', firebrick: '#B22222', darkgoldenrod: '#B8860B', mediumorchid: '#BA55D3', rosybrown: '#BC8F8F', darkkhaki: '#BDB76B', silver: '#C0C0C0', mediumvioletred: '#C71585', indianred: '#CD5C5C', peru: '#CD853F', chocolate: '#D2691E', tan: '#D2B48C', lightgrey: '#D3D3D3', palevioletred: '#D87093', thistle: '#D8BFD8', orchid: '#DA70D6', goldenrod: '#DAA520', crimson: '#DC143C', gainsboro: '#DCDCDC', plum: '#DDA0DD', burlywood: '#DEB887', lightcyan: '#E0FFFF', lavender: '#E6E6FA', darksalmon: '#E9967A', violet: '#EE82EE', palegoldenrod: '#EEE8AA', lightcoral: '#F08080', khaki: '#F0E68C', aliceblue: '#F0F8FF', honeydew: '#F0FFF0', azure: '#F0FFFF', sandybrown: '#F4A460', wheat: '#F5DEB3', beige: '#F5F5DC', whitesmoke: '#F5F5F5', mintcream: '#F5FFFA', ghostwhite: '#F8F8FF', salmon: '#FA8072', antiquewhite: '#FAEBD7', linen: '#FAF0E6', lightgoldenrodyellow: '#FAFAD2', oldlace: '#FDF5E6', red: '#FF0000', fuchsia: '#FF00FF', magenta: '#FF00FF', deeppink: '#FF1493', orangered: '#FF4500', tomato: '#FF6347', hotpink: '#FF69B4', coral: '#FF7F50', darkorange: '#FF8C00', lightsalmon: '#FFA07A', orange: '#FFA500', lightpink: '#FFB6C1', pink: '#FFC0CB', gold: '#FFD700', peachpuff: '#FFDAB9', navajowhite: '#FFDEAD', moccasin: '#FFE4B5', bisque: '#FFE4C4', mistyrose: '#FFE4E1', blanchedalmond: '#FFEBCD', papayawhip: '#FFEFD5', lavenderblush: '#FFF0F5', seashell: '#FFF5EE', cornsilk: '#FFF8DC', lemonchiffon: '#FFFACD', floralwhite: '#FFFAF0', snow: '#FFFAFA', yellow: '#FFFF00', lightyellow: '#FFFFE0', ivory: '#FFFFF0', white: '#FFFFFF'};
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/Configurator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './Configurator.css';

import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

import ColorPicker from './ColorPicker';

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/Validator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as util from 'vis-util';
import * as util from 'vis-util/esnext';

let errorFound = false;
let allOptions;
Expand Down
Loading

0 comments on commit aa9b42f

Please sign in to comment.