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 15, 2020
1 parent 3a3a2fd commit 18fd0f1
Show file tree
Hide file tree
Showing 42 changed files with 5,570 additions and 2,693 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
root: ..
paths:
- "repo/dist"
- "repo/esnext"
- "repo/peer"
- "repo/standalone"
- "repo/styles"

lint:
executor: node
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ gen/
# generated files
/coverage/
/dist/
/esnext/
/examples/examples.css
/examples/generated/
/examples/index.html
/examples/thumbnails/
/peer/
/standalone/
/vis-graph3d-0.0.0-no-version.tgz
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", { ts: true }]]
};
7 changes: 7 additions & 0 deletions declarations/entry-esnext.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const Graph3d: any;
export const Graph3dCamera: any;
export const Graph3dFilter: any;
export const Graph3dPoint2d: any;
export const Graph3dPoint3d: any;
export const Graph3dSlider: any;
export const Graph3dStepNumber: any;
1 change: 1 addition & 0 deletions declarations/entry-peer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./entry-esnext";
2 changes: 2 additions & 0 deletions declarations/entry-standalone.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./entry-esnext";
export * from "vis-data/esnext";
2 changes: 1 addition & 1 deletion examples/graph3d/01_basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/02_camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
td {font: 10pt arial}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/03_filter_data.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/04_animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/05_line.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/06_moving_dots.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/07_dot_cloud_colors.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/08_dot_cloud_size.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<style>
body {font: 10pt arial;}
</style>
<script type="text/javascript" src="../../dist/vis-graph3d.min.js"></script>
<script type="text/javascript" src="../../standalone/umd/vis-graph3d.min.js"></script>

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/09_mobile.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!-- for mobile devices like android and iphone -->
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" />

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/10_styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/11_tooltips.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
5 changes: 3 additions & 2 deletions examples/graph3d/12_custom_labels.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
body {font: 10pt arial;}
</style>

<script type="text/javascript" src="../../dist/vis-graph3d.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/moment.js"></script>
<script type="text/javascript" src="../../standalone/umd/vis-graph3d.min.js"></script>

<script type="text/javascript">
var data = null;
Expand Down Expand Up @@ -59,7 +60,7 @@
},

xValueLabel: function(value) {
return vis.moment().add(value, 'days').format('DD MMM');
return moment().add(value, 'days').format('DD MMM');
},

yValueLabel: function(value) {
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/13_disable_zoom.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/14_zoom_ctrl_scroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/15_styling_per_point.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
body {font: 10pt arial;}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/16_styling_surface.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
</style>

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

<script type="text/javascript">
var data = null;
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<title>Graph 3D | Playground</title>

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

<script type="text/javascript" src="playground.js"></script>
<script type="text/javascript" src="csv2array.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/graph3d/rotateAxisLabels/rotateAxisLabels.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
text-align: center;
}
</style>
<script type="application/javascript" src="../../../dist/vis-graph3d.min.js"></script>
<script type="application/javascript" src="../../../standalone/umd/vis-graph3d.min.js"></script>
<script type="application/javascript">
var graph = null;

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// utils
var util = require('vis-util');
var util = require('vis-util/esnext');
exports.util = util;
exports.DOMutil = require('./lib/DOMutil');

// data
var { DataSet, DataView, Queue } = require('vis-data');
var { DataSet, DataView, Queue } = require('vis-data/esnext');
exports.DataSet = DataSet;
exports.DataView = DataView;
exports.Queue = Queue;
Expand Down
17 changes: 17 additions & 0 deletions lib/entry-esnext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Graph3d from "./graph3d/Graph3d";
import Graph3dCamera from "./graph3d/Camera";
import Graph3dFilter from "./graph3d/Filter";
import Graph3dPoint2d from "./graph3d/Point2d";
import Graph3dPoint3d from "./graph3d/Point3d";
import Graph3dSlider from "./graph3d/Slider";
import Graph3dStepNumber from "./graph3d/StepNumber";

export {
Graph3d,
Graph3dCamera,
Graph3dFilter,
Graph3dPoint2d,
Graph3dPoint3d,
Graph3dSlider,
Graph3dStepNumber
};
1 change: 1 addition & 0 deletions lib/entry-peer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./entry-esnext";
2 changes: 2 additions & 0 deletions lib/entry-standalone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./entry-esnext";
export * from "vis-data/esnext";
4 changes: 2 additions & 2 deletions lib/graph3d/Camera.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Point3d = require('./Point3d');
import Point3d from "./Point3d";

/**
* The camera is mounted on a (virtual) camera arm. The camera arm can rotate
Expand Down Expand Up @@ -176,4 +176,4 @@ Camera.prototype.calculateCameraOrientation = function() {
this.cameraLocation.z = this.cameraLocation.z + dy * sin(xa);
};

module.exports = Camera;
export default Camera;
15 changes: 7 additions & 8 deletions lib/graph3d/DataGroup.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var { DataSet } = require('vis-data');
var { DataView } = require('vis-data');
var Range = require('./Range');
var Filter = require('./Filter');
var Settings = require('./Settings');
var Point3d = require('./Point3d');
import { DataSet } from "vis-data/esnext";
import { DataView } from "vis-data/esnext";
import Range from "./Range";
import Filter from "./Filter";
import * as Settings from "./Settings";
import Point3d from "./Point3d";


/**
Expand Down Expand Up @@ -461,5 +461,4 @@ DataGroup.prototype._getDataPoints = function (data) {
return dataPoints;
};


module.exports = DataGroup;
export default DataGroup;
4 changes: 2 additions & 2 deletions lib/graph3d/Filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var { DataView } = require('vis-data');
import { DataView } from 'vis-data/esnext';

/**
* @class Filter
Expand Down Expand Up @@ -211,4 +211,4 @@ Filter.prototype.loadInBackground = function(index) {
}
};

module.exports = Filter;
export default Filter;
24 changes: 12 additions & 12 deletions lib/graph3d/Graph3d.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var Emitter = require('emitter-component');
var util = require('vis-util');
var Point3d = require('./Point3d');
var Point2d = require('./Point2d');
var Slider = require('./Slider');
var StepNumber = require('./StepNumber');
var Settings = require('./Settings');
var Validator = require("./../shared/Validator").Validator;
var printStyle = require('./../shared/Validator').printStyle;
var {allOptions} = require('./options.js');
var DataGroup = require('./DataGroup');
import Emitter from "component-emitter";
import * as util from "vis-util/esnext";
import Point3d from "./Point3d";
import Point2d from "./Point2d";
import Slider from "./Slider";
import StepNumber from "./StepNumber";
import * as Settings from "./Settings";
import { Validator } from "./../shared/Validator";
import { printStyle } from "./../shared/Validator";
import { allOptions } from "./options.js";
import DataGroup from "./DataGroup";


/// enumerate the available styles
Expand Down Expand Up @@ -2558,4 +2558,4 @@ Graph3d.prototype.setSize = function(width, height) {
// -----------------------------------------------------------------------------


module.exports = Graph3d;
export default Graph3d;
11 changes: 4 additions & 7 deletions lib/graph3d/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// This modules handles the options for Graph3d.
//
////////////////////////////////////////////////////////////////////////////////
var util = require('vis-util');
var Camera = require('./Camera');
var Point3d = require('./Point3d');
import * as util from "vis-util/esnext";
import Camera from "./Camera";
import Point3d from "./Point3d";


// enumerate the available styles
Expand Down Expand Up @@ -564,7 +564,4 @@ function setCameraPosition(cameraPosition, dst) {
}


module.exports.STYLE = STYLE;
module.exports.setDefaults = setDefaults;
module.exports.setOptions = setOptions;
module.exports.setCameraPosition = setCameraPosition;
export { STYLE, setCameraPosition, setDefaults, setOptions };
4 changes: 2 additions & 2 deletions lib/graph3d/Slider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var util = require('vis-util');
import * as util from "vis-util/esnext";

/**
* An html slider control with start/stop/prev/next buttons
Expand Down Expand Up @@ -346,4 +346,4 @@ Slider.prototype._onMouseUp = function (event) { // eslint-disable-line no-unus
util.preventDefault();
};

module.exports = Slider;
export default Slider;
14 changes: 10 additions & 4 deletions lib/module/hammer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import propagatingHammerJS from "propagating-hammerjs";
import HammerJS from "hammerjs";

/**
* Setup a mock hammer.js object, for unit testing.
*
Expand All @@ -23,16 +26,19 @@ function hammerMock() {
}


let moduleExport
if (typeof window !== 'undefined') {
var propagating = require('propagating-hammerjs');
var Hammer = window['Hammer'] || require('hammerjs');
module.exports = propagating(Hammer, {
var propagating = propagatingHammerJS;
var Hammer = window['Hammer'] || HammerJS;
moduleExport = propagating(Hammer, {
preventDefault: 'mouse'
});
}
else {
module.exports = function () {
moduleExport = function () {
// hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
return hammerMock();
}
}

export default moduleExport;
Loading

0 comments on commit 18fd0f1

Please sign in to comment.