vis-dev-utils 4.0.45 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel-preset/index.cjs +102 -0
- package/babel-preset/index.cjs.map +1 -0
- package/babel-preset/{index.js → index.mjs} +58 -31
- package/babel-preset/index.mjs.map +1 -0
- package/bin/ci-utils.js +35 -41
- package/bin/ci-utils.js.map +1 -1
- package/bin/generate-examples-index.js +779 -1265
- package/bin/generate-examples-index.js.map +1 -1
- package/bin/test-e2e-interop.js +431 -3492
- package/bin/test-e2e-interop.js.map +1 -1
- package/declarations/babel-preset/index.d.ts +23 -0
- package/declarations/babel-preset/index.d.ts.map +1 -0
- package/declarations/ci-utils/index.d.ts +2 -0
- package/declarations/ci-utils/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/cli.d.ts +44 -0
- package/declarations/generate-examples-index/cli.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/builder.d.ts +53 -0
- package/declarations/generate-examples-index/content-builder/builder.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/common.d.ts +47 -0
- package/declarations/generate-examples-index/content-builder/common.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/format.d.ts +5 -0
- package/declarations/generate-examples-index/content-builder/format.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/html/index.d.ts +3 -0
- package/declarations/generate-examples-index/content-builder/html/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/index.d.ts +6 -0
- package/declarations/generate-examples-index/content-builder/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/md/index.d.ts +3 -0
- package/declarations/generate-examples-index/content-builder/md/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/playground/codepen.d.ts +6 -0
- package/declarations/generate-examples-index/content-builder/playground/codepen.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/playground/data.d.ts +8 -0
- package/declarations/generate-examples-index/content-builder/playground/data.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/playground/index.d.ts +4 -0
- package/declarations/generate-examples-index/content-builder/playground/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/playground/jsfiddle.d.ts +6 -0
- package/declarations/generate-examples-index/content-builder/playground/jsfiddle.d.ts.map +1 -0
- package/declarations/generate-examples-index/content-builder/screenshots/index.d.ts +26 -0
- package/declarations/generate-examples-index/content-builder/screenshots/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/index.d.ts +2 -0
- package/declarations/generate-examples-index/index.d.ts.map +1 -0
- package/declarations/generate-examples-index/paths.d.ts +16 -0
- package/declarations/generate-examples-index/paths.d.ts.map +1 -0
- package/declarations/generate-examples-index/types.d.ts +61 -0
- package/declarations/generate-examples-index/types.d.ts.map +1 -0
- package/declarations/module/constants.d.ts +2 -0
- package/declarations/module/constants.d.ts.map +1 -0
- package/declarations/{generate-rollup-configuration → module/generate-rollup-configuration}/index.d.ts +4 -3
- package/declarations/module/generate-rollup-configuration/index.d.ts.map +1 -0
- package/declarations/{header.d.ts → module/header.d.ts} +1 -3
- package/declarations/module/header.d.ts.map +1 -0
- package/declarations/module/index.d.ts.map +1 -0
- package/declarations/module/inspect-npm-pack.d.ts +8 -0
- package/declarations/module/inspect-npm-pack.d.ts.map +1 -0
- package/declarations/module/util.d.ts.map +1 -0
- package/declarations/test-e2e-interop/cli.d.ts +18 -0
- package/declarations/test-e2e-interop/cli.d.ts.map +1 -0
- package/declarations/test-e2e-interop/index.d.ts +2 -0
- package/declarations/test-e2e-interop/index.d.ts.map +1 -0
- package/declarations/test-e2e-interop/test.d.ts +23 -0
- package/declarations/test-e2e-interop/test.d.ts.map +1 -0
- package/declarations/test-e2e-interop/util.d.ts +49 -0
- package/declarations/test-e2e-interop/util.d.ts.map +1 -0
- package/dist/vis-dev-utils.cjs +871 -0
- package/dist/vis-dev-utils.cjs.map +1 -0
- package/dist/vis-dev-utils.mjs +864 -0
- package/dist/vis-dev-utils.mjs.map +1 -0
- package/package.json +85 -63
- package/babel-register/index.js +0 -110
- package/babel-register/index.js.map +0 -1
- package/declarations/constants.d.ts +0 -2
- package/declarations/constants.d.ts.map +0 -1
- package/declarations/generate-rollup-configuration/index.d.ts.map +0 -1
- package/declarations/header.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/inspect-npm-pack.d.ts +0 -8
- package/declarations/inspect-npm-pack.d.ts.map +0 -1
- package/declarations/util.d.ts.map +0 -1
- package/dist/vis-dev-utils.cjs.js +0 -777
- package/dist/vis-dev-utils.cjs.js.map +0 -1
- package/dist/vis-dev-utils.esm.js +0 -771
- package/dist/vis-dev-utils.esm.js.map +0 -1
- package/lib/header.d.ts +0 -38
- package/lib/header.d.ts.map +0 -1
- package/lib/header.js +0 -85
- package/lib/header.js.map +0 -1
- package/lib/inspect-npm-pack.d.ts +0 -8
- package/lib/inspect-npm-pack.d.ts.map +0 -1
- package/lib/inspect-npm-pack.js +0 -74
- package/lib/inspect-npm-pack.js.map +0 -1
- /package/declarations/{index.d.ts → module/index.d.ts} +0 -0
- /package/declarations/{util.d.ts → module/util.d.ts} +0 -0
- /package/eslint-shareable-config/{index.js → index.cjs} +0 -0
|
@@ -1,771 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vis-dev-utils
|
|
3
|
-
* http://visjs.org/
|
|
4
|
-
*
|
|
5
|
-
* Development utilities for the Vis family projects.
|
|
6
|
-
*
|
|
7
|
-
* @version 4.0.45
|
|
8
|
-
* @date 2023-11-13T21:21:31.898Z
|
|
9
|
-
*
|
|
10
|
-
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
|
11
|
-
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
|
12
|
-
*
|
|
13
|
-
* @license
|
|
14
|
-
* vis.js is dual licensed under both
|
|
15
|
-
*
|
|
16
|
-
* 1. The Apache 2.0 License
|
|
17
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* and
|
|
20
|
-
*
|
|
21
|
-
* 2. The MIT License
|
|
22
|
-
* http://opensource.org/licenses/MIT
|
|
23
|
-
*
|
|
24
|
-
* vis.js may be distributed under either license.
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
import _Object$freeze from '@babel/runtime-corejs3/core-js-stable/object/freeze';
|
|
28
|
-
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
29
|
-
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
30
|
-
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
31
|
-
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
32
|
-
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
33
|
-
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
34
|
-
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
35
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
36
|
-
import _toConsumableArray from '@babel/runtime-corejs3/helpers/toConsumableArray';
|
|
37
|
-
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
38
|
-
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
39
|
-
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
40
|
-
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
41
|
-
import _Number$MAX_SAFE_INTEGER from '@babel/runtime-corejs3/core-js-stable/number/max-safe-integer';
|
|
42
|
-
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
43
|
-
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
44
|
-
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
45
|
-
import _flatMapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/flat-map';
|
|
46
|
-
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
47
|
-
import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
48
|
-
import _Object$create from '@babel/runtime-corejs3/core-js-stable/object/create';
|
|
49
|
-
import _endsWithInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/ends-with';
|
|
50
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
51
|
-
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
52
|
-
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
53
|
-
import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
|
|
54
|
-
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
55
|
-
import analyzerPlugin from 'rollup-plugin-analyzer';
|
|
56
|
-
import babelPlugin from '@rollup/plugin-babel';
|
|
57
|
-
import chaiFs from 'chai-fs';
|
|
58
|
-
import commonjsPlugin from '@rollup/plugin-commonjs';
|
|
59
|
-
import copyPlugin from 'rollup-plugin-copy';
|
|
60
|
-
import jsonPlugin from '@rollup/plugin-json';
|
|
61
|
-
import nodeResolvePlugin from '@rollup/plugin-node-resolve';
|
|
62
|
-
import postcssAssetsPlugin from 'postcss-assets';
|
|
63
|
-
import postcssPlugin from 'rollup-plugin-postcss';
|
|
64
|
-
import stripCodePlugin from 'rollup-plugin-strip-code';
|
|
65
|
-
import terserPlugin from '@rollup/plugin-terser';
|
|
66
|
-
import typescriptPlugin from 'rollup-plugin-typescript2';
|
|
67
|
-
import { sync } from 'find-up';
|
|
68
|
-
import { readFileSync } from 'node:fs';
|
|
69
|
-
import { resolve, sep, join } from 'node:path';
|
|
70
|
-
import { string } from 'rollup-plugin-string';
|
|
71
|
-
import { config, use, expect } from 'chai';
|
|
72
|
-
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
73
|
-
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
74
|
-
import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
|
|
75
|
-
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
76
|
-
import { execSync } from 'node:child_process';
|
|
77
|
-
import { setGracefulCleanup, fileSync } from 'tmp-promise';
|
|
78
|
-
|
|
79
|
-
var BABEL_IGNORE_RE = _Object$freeze(/[\\/]node_modules[\\/](?!.*[\\/]esnext[\\/])/);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Take a string and return a doc block comment.
|
|
83
|
-
*
|
|
84
|
-
* @param string - The raw text to be included in the comment.
|
|
85
|
-
* @throws If the string already contains a comment.
|
|
86
|
-
* @returns A block doc comment string that can be for example prepended to a
|
|
87
|
-
* bundled JavaScript file.
|
|
88
|
-
*/
|
|
89
|
-
function textToComment(string) {
|
|
90
|
-
var _context, _context2;
|
|
91
|
-
if (_includesInstanceProperty(string).call(string, "*/")) {
|
|
92
|
-
throw new Error("Don't include comments in the input string. It will be converted automatically.");
|
|
93
|
-
}
|
|
94
|
-
return "/**\n" + _mapInstanceProperty(_context = _mapInstanceProperty(_context2 = string
|
|
95
|
-
// Remove empty lines from the start.
|
|
96
|
-
.replace(/^[\n\r]*/, "")
|
|
97
|
-
// Remove empty lines from the end.
|
|
98
|
-
.replace(/[\n\r\s]*$/, "")
|
|
99
|
-
// Process each line on it's own from now on.
|
|
100
|
-
.split("\n")
|
|
101
|
-
// Prefix each line with an asterisk.
|
|
102
|
-
).call(_context2, function (line) {
|
|
103
|
-
return " * " + line;
|
|
104
|
-
})
|
|
105
|
-
// Remove trailing white space.
|
|
106
|
-
).call(_context, function (line) {
|
|
107
|
-
return line.replace(/[^\S\r\n]*$/, "");
|
|
108
|
-
})
|
|
109
|
-
// Join back into a string.
|
|
110
|
-
.join("\n") + "\n */\n";
|
|
111
|
-
}
|
|
112
|
-
var packageJSON = JSON.parse(readFileSync(sync("package.json"), "utf8"));
|
|
113
|
-
var buildHeader = function buildHeader(_ref) {
|
|
114
|
-
var _context3, _context4, _context5, _context6, _context7;
|
|
115
|
-
var customText = _ref.customText,
|
|
116
|
-
date = _ref.date,
|
|
117
|
-
description = _ref.description,
|
|
118
|
-
homepage = _ref.homepage,
|
|
119
|
-
name = _ref.name,
|
|
120
|
-
version = _ref.version;
|
|
121
|
-
return textToComment(_concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = "\n".concat(name, "\n")).call(_context7, homepage, "\n\n")).call(_context6, description, "\n\n@version ")).call(_context5, version, "\n@date ")).call(_context4, date, "\n\n@copyright (c) 2011-2017 Almende B.V, http://almende.com\n@copyright (c) 2017-2019 visjs contributors, https://github.com/visjs\n\n@license\nvis.js is dual licensed under both\n\n 1. The Apache 2.0 License\n http://www.apache.org/licenses/LICENSE-2.0\n\n and\n\n 2. The MIT License\n http://opensource.org/licenses/MIT\n\nvis.js may be distributed under either license.\n\n")).call(_context3, customText, "\n"));
|
|
122
|
-
};
|
|
123
|
-
var defaultDate = new Date().toISOString();
|
|
124
|
-
var defaultDescription = packageJSON.description;
|
|
125
|
-
var defaultHomepage = packageJSON.homepage;
|
|
126
|
-
var defaultName = packageJSON.name;
|
|
127
|
-
var defaultVersion = packageJSON.version;
|
|
128
|
-
/**
|
|
129
|
-
* Generate a dynamic header banner.
|
|
130
|
-
*
|
|
131
|
-
* @param options - Optional information to be included. Otherwise no custom
|
|
132
|
-
* text will be appended, the date will be the time when this module was
|
|
133
|
-
* imported (most likely the start of the build process) and the rest will be
|
|
134
|
-
* read from package.json.
|
|
135
|
-
* @throws If the string already contains a comment.
|
|
136
|
-
* @returns Ready to use banner text.
|
|
137
|
-
*/
|
|
138
|
-
function generateHeader(options) {
|
|
139
|
-
var _ref2 = options || {},
|
|
140
|
-
_ref2$customText = _ref2.customText,
|
|
141
|
-
customText = _ref2$customText === void 0 ? "" : _ref2$customText,
|
|
142
|
-
_ref2$date = _ref2.date,
|
|
143
|
-
date = _ref2$date === void 0 ? defaultDate : _ref2$date,
|
|
144
|
-
_ref2$description = _ref2.description,
|
|
145
|
-
description = _ref2$description === void 0 ? defaultDescription : _ref2$description,
|
|
146
|
-
_ref2$homepage = _ref2.homepage,
|
|
147
|
-
homepage = _ref2$homepage === void 0 ? defaultHomepage : _ref2$homepage,
|
|
148
|
-
_ref2$name = _ref2.name,
|
|
149
|
-
name = _ref2$name === void 0 ? defaultName : _ref2$name,
|
|
150
|
-
_ref2$version = _ref2.version,
|
|
151
|
-
version = _ref2$version === void 0 ? defaultVersion : _ref2$version;
|
|
152
|
-
return buildHeader({
|
|
153
|
-
customText: customText,
|
|
154
|
-
date: date,
|
|
155
|
-
description: description,
|
|
156
|
-
homepage: homepage,
|
|
157
|
-
name: name,
|
|
158
|
-
version: version
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
var _excluded = ["dependencies", "devDependencies", "peerDependencies"];
|
|
163
|
-
var _context, _context2;
|
|
164
|
-
function ownKeys$1(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
165
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context25, _context26; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context25 = ownKeys$1(Object(t), !0)).call(_context25, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context26 = ownKeys$1(Object(t))).call(_context26, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
166
|
-
var rawGlobby = import('globby');
|
|
167
|
-
config.truncateThreshold = _Number$MAX_SAFE_INTEGER;
|
|
168
|
-
use(chaiFs);
|
|
169
|
-
var VIS_DEBUG = _includesInstanceProperty(_context = ["1", "true", "y", "yes"]).call(_context, process.env["VIS_DEBUG"] || "false");
|
|
170
|
-
var VIS_TEST = _includesInstanceProperty(_context2 = ["1", "true", "y", "yes"]).call(_context2, process.env["VIS_TEST"] || "false");
|
|
171
|
-
/**
|
|
172
|
-
* Simple glob with workaround for non-posix paths.
|
|
173
|
-
*
|
|
174
|
-
* @param pattern - Single glob pattern.
|
|
175
|
-
* @returns Globbed paths.
|
|
176
|
-
*/
|
|
177
|
-
function glob(_x) {
|
|
178
|
-
return _glob.apply(this, arguments);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* These are the dependencies that follow standalone/peer/ESNext export
|
|
182
|
-
* structure.
|
|
183
|
-
*/
|
|
184
|
-
function _glob() {
|
|
185
|
-
_glob = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(pattern) {
|
|
186
|
-
return _regeneratorRuntime.wrap(function _callee$(_context11) {
|
|
187
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
188
|
-
case 0:
|
|
189
|
-
_context11.next = 2;
|
|
190
|
-
return rawGlobby;
|
|
191
|
-
case 2:
|
|
192
|
-
return _context11.abrupt("return", _context11.sent.default(sep === "\\" ? pattern.replace(/\\/g, "/") : pattern));
|
|
193
|
-
case 3:
|
|
194
|
-
case "end":
|
|
195
|
-
return _context11.stop();
|
|
196
|
-
}
|
|
197
|
-
}, _callee);
|
|
198
|
-
}));
|
|
199
|
-
return _glob.apply(this, arguments);
|
|
200
|
-
}
|
|
201
|
-
var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-network", "vis-timeline", "vis-util", "vis-uuid"];
|
|
202
|
-
/**
|
|
203
|
-
* This ensures that dependencies on Vis projects point to ESNext builds.
|
|
204
|
-
*
|
|
205
|
-
* @param deps - The original dependencies as listed in package.json.
|
|
206
|
-
* @returns An array of dependencies for Rollup.
|
|
207
|
-
*/
|
|
208
|
-
function processDependencies(deps) {
|
|
209
|
-
var depNames = _Array$isArray(deps) ? deps : _Object$keys(deps);
|
|
210
|
-
return _flatMapInstanceProperty(depNames).call(depNames, function (key) {
|
|
211
|
-
return _includesInstanceProperty(dependenciesWithVisExportStructure).call(dependenciesWithVisExportStructure, key) ? [key + "/esnext"] : [key];
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* This ensures that all Vis projects are imported using ESNext builds.
|
|
216
|
-
* Importing standalone versions will not only cause problems in production but
|
|
217
|
-
* will log warnings during build process and won't work at all.
|
|
218
|
-
*
|
|
219
|
-
* @param globals - The original globals.
|
|
220
|
-
* @returns Globals forcing the use of ESNext builds for Vis projects.
|
|
221
|
-
*/
|
|
222
|
-
function processGlobals(globals) {
|
|
223
|
-
var _context3;
|
|
224
|
-
return _reduceInstanceProperty(_context3 = _Object$entries(globals)).call(_context3, function (acc, _ref) {
|
|
225
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
226
|
-
key = _ref2[0],
|
|
227
|
-
value = _ref2[1];
|
|
228
|
-
acc[_includesInstanceProperty(dependenciesWithVisExportStructure).call(dependenciesWithVisExportStructure, key) ? key + "/esnext" : key] = value;
|
|
229
|
-
return acc;
|
|
230
|
-
}, _Object$create(null));
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* @param path
|
|
234
|
-
*/
|
|
235
|
-
function isTS(path) {
|
|
236
|
-
return _endsWithInstanceProperty(path).call(path, ".ts");
|
|
237
|
-
}
|
|
238
|
-
/*
|
|
239
|
-
* Make sure that Chai doesn't throw and therefore stop execution on failed
|
|
240
|
-
* validations during debugging.
|
|
241
|
-
*/
|
|
242
|
-
var validate = VIS_DEBUG ? function (callback) {
|
|
243
|
-
try {
|
|
244
|
-
callback(expect);
|
|
245
|
-
} catch (error) {
|
|
246
|
-
console.error(error);
|
|
247
|
-
}
|
|
248
|
-
} : function (callback) {
|
|
249
|
-
return void callback(expect);
|
|
250
|
-
};
|
|
251
|
-
/**
|
|
252
|
-
* Transform ESNext import paths to match the build version being constructed.
|
|
253
|
-
*
|
|
254
|
-
* @param buildVariant - ESNext or peer build. This is not available for
|
|
255
|
-
* standalone as only peer and ESNext have imports.
|
|
256
|
-
* @param moduleFormat - What kind of module system to use.
|
|
257
|
-
* @returns Path overrides for Rollup.
|
|
258
|
-
*/
|
|
259
|
-
function getPaths(buildVariant, moduleFormat) {
|
|
260
|
-
/**
|
|
261
|
-
* @param lib
|
|
262
|
-
*/
|
|
263
|
-
function getPath(lib) {
|
|
264
|
-
var _context4, _context5, _context6;
|
|
265
|
-
return _defineProperty({}, "vis-".concat(lib, "/esnext"), _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = "vis-".concat(lib, "/")).call(_context6, buildVariant, "/")).call(_context5, moduleFormat, "/vis-")).call(_context4, lib, ".js"));
|
|
266
|
-
}
|
|
267
|
-
return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, getPath("charts")), getPath("data")), getPath("graph3d")), getPath("network")), getPath("timeline")), getPath("util")), getPath("uuid"));
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Change target's dest so that it's relative to given dir(s).
|
|
271
|
-
*
|
|
272
|
-
* @param dirs - The directories there targets should be relative to.
|
|
273
|
-
* @returns A function that can be directly supplied to Array.map().
|
|
274
|
-
*/
|
|
275
|
-
function scopeCopyTarget() {
|
|
276
|
-
for (var _len = arguments.length, dirs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
277
|
-
dirs[_key] = arguments[_key];
|
|
278
|
-
}
|
|
279
|
-
return function (target) {
|
|
280
|
-
var dest = _Array$isArray(target.dest) ? target.dest : [target.dest];
|
|
281
|
-
var bundleDest = _flatMapInstanceProperty(dest).call(dest, function (path) {
|
|
282
|
-
return _mapInstanceProperty(dirs).call(dirs, function (dir) {
|
|
283
|
-
return join(dir, path);
|
|
284
|
-
});
|
|
285
|
-
});
|
|
286
|
-
return _objectSpread$1(_objectSpread$1({}, target), {}, {
|
|
287
|
-
dest: bundleDest
|
|
288
|
-
});
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
var injectCSS = true;
|
|
292
|
-
var minimize = true;
|
|
293
|
-
var transpile = true;
|
|
294
|
-
var generateRollupPluginArray = function generateRollupPluginArray(libraryFilename, assets, copyTargetsBundle, copyTargetsVariant, tsconfig, mode, bundleType) {
|
|
295
|
-
var _context7, _context8, _context9, _context10;
|
|
296
|
-
var _ref4 = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {},
|
|
297
|
-
_ref4$injectCSS = _ref4.injectCSS,
|
|
298
|
-
injectCSS = _ref4$injectCSS === void 0 ? false : _ref4$injectCSS,
|
|
299
|
-
_ref4$minimize = _ref4.minimize,
|
|
300
|
-
minimize = _ref4$minimize === void 0 ? false : _ref4$minimize,
|
|
301
|
-
_ref4$strip = _ref4.strip,
|
|
302
|
-
strip = _ref4$strip === void 0 ? mode === "production" : _ref4$strip,
|
|
303
|
-
_ref4$transpile = _ref4.transpile,
|
|
304
|
-
transpile = _ref4$transpile === void 0 ? false : _ref4$transpile,
|
|
305
|
-
_ref4$typescript = _ref4.typescript,
|
|
306
|
-
typescript = _ref4$typescript === void 0 ? false : _ref4$typescript;
|
|
307
|
-
var fullLibraryFilename = _concatInstanceProperty(_context7 = "".concat(libraryFilename)).call(_context7, minimize ? ".min" : "");
|
|
308
|
-
var bundleDir = bundleType;
|
|
309
|
-
var bundleVariantDirs = _mapInstanceProperty(_context8 = ["esm", "umd"]).call(_context8, function (variant) {
|
|
310
|
-
return join(bundleDir, variant);
|
|
311
|
-
});
|
|
312
|
-
return _concatInstanceProperty(_context9 = []).call(_context9, _toConsumableArray(strip ? [
|
|
313
|
-
// This should be first because it removes code from source files.
|
|
314
|
-
// It's much easier to follow if the removal happens before any
|
|
315
|
-
// transformations.
|
|
316
|
-
stripCodePlugin({
|
|
317
|
-
start_comment: "develblock:start",
|
|
318
|
-
end_comment: "develblock:end"
|
|
319
|
-
})] : [
|
|
320
|
-
// Remove the comments marking devel blocks as they can cause problems
|
|
321
|
-
// later on because transpilation shuffles things around which may
|
|
322
|
-
// lead to all kinds of issues including syntax errors.
|
|
323
|
-
stripCodePlugin({
|
|
324
|
-
pattern: /[\t ]*\/\* ?develblock:(start|end) ?\*\//g
|
|
325
|
-
})]), [analyzerPlugin(VIS_DEBUG ? undefined : {
|
|
326
|
-
limit: 10,
|
|
327
|
-
summaryOnly: true
|
|
328
|
-
}), copyPlugin({
|
|
329
|
-
verbose: VIS_DEBUG,
|
|
330
|
-
targets: _concatInstanceProperty(_context10 = [
|
|
331
|
-
// JavaScript
|
|
332
|
-
{
|
|
333
|
-
src: resolve(__dirname, "assets/bundle-root.js"),
|
|
334
|
-
dest: bundleDir,
|
|
335
|
-
rename: "index.js"
|
|
336
|
-
}, {
|
|
337
|
-
src: resolve(__dirname, "assets/bundle-index.js"),
|
|
338
|
-
dest: bundleVariantDirs,
|
|
339
|
-
rename: "index.js",
|
|
340
|
-
transform: function transform(content) {
|
|
341
|
-
return content.toString().replace("{{filename}}", libraryFilename);
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
// TypeScript
|
|
345
|
-
{
|
|
346
|
-
src: resolve(__dirname, "assets/bundle-root.d.ts"),
|
|
347
|
-
dest: bundleDir,
|
|
348
|
-
rename: "index.d.ts"
|
|
349
|
-
}, {
|
|
350
|
-
src: resolve(__dirname, "assets/bundle-index.d.ts"),
|
|
351
|
-
dest: bundleVariantDirs,
|
|
352
|
-
rename: "index.d.ts",
|
|
353
|
-
transform: function transform(content) {
|
|
354
|
-
return content.toString().replace("{{filename}}", libraryFilename);
|
|
355
|
-
}
|
|
356
|
-
}, {
|
|
357
|
-
src: resolve(__dirname, "assets/bundle-file.d.ts"),
|
|
358
|
-
dest: bundleVariantDirs,
|
|
359
|
-
rename: "".concat(fullLibraryFilename, ".d.ts"),
|
|
360
|
-
transform: function transform(content) {
|
|
361
|
-
return content.toString().replace("{{bundle-type}}", bundleType);
|
|
362
|
-
}
|
|
363
|
-
}]).call(_context10, _toConsumableArray(_mapInstanceProperty(copyTargetsBundle).call(copyTargetsBundle, scopeCopyTarget(bundleDir))), _toConsumableArray(_mapInstanceProperty(copyTargetsVariant).call(copyTargetsVariant, scopeCopyTarget.apply(void 0, _toConsumableArray(bundleVariantDirs)))))
|
|
364
|
-
}), nodeResolvePlugin({
|
|
365
|
-
browser: true,
|
|
366
|
-
extensions: [".js", ".json", ".ts"],
|
|
367
|
-
mainFields: ["jsnext", "module", "main"],
|
|
368
|
-
preferBuiltins: false
|
|
369
|
-
})], _toConsumableArray(typescript ? [typescriptPlugin({
|
|
370
|
-
tsconfig: tsconfig
|
|
371
|
-
})] : []), [commonjsPlugin(), postcssPlugin({
|
|
372
|
-
extract: !injectCSS && "styles/".concat(fullLibraryFilename, ".css"),
|
|
373
|
-
inject: injectCSS,
|
|
374
|
-
minimize: minimize,
|
|
375
|
-
// Prevent the sourcemaps from being injected into JS files.
|
|
376
|
-
sourceMap: !injectCSS,
|
|
377
|
-
plugins: [postcssAssetsPlugin({
|
|
378
|
-
loadPaths: [assets]
|
|
379
|
-
})]
|
|
380
|
-
}), jsonPlugin(), string({
|
|
381
|
-
include: "**/*.txt"
|
|
382
|
-
})], _toConsumableArray(transpile ? [babelPlugin({
|
|
383
|
-
babelHelpers: "runtime",
|
|
384
|
-
babelrc: false,
|
|
385
|
-
configFile: false,
|
|
386
|
-
exclude: BABEL_IGNORE_RE,
|
|
387
|
-
extensions: [".js", ".ts"],
|
|
388
|
-
presets: [["vis-dev-utils/babel-preset", {
|
|
389
|
-
ts: true
|
|
390
|
-
}]]
|
|
391
|
-
})] : []), _toConsumableArray(minimize ? [terserPlugin({
|
|
392
|
-
format: {
|
|
393
|
-
comments: "some"
|
|
394
|
-
}
|
|
395
|
-
})] : []));
|
|
396
|
-
};
|
|
397
|
-
/**
|
|
398
|
-
* Prepare ready to use Rollup configuration file.
|
|
399
|
-
*
|
|
400
|
-
* @remarks
|
|
401
|
-
* IMPORTANT: Use `babel.config.js` in the root of the project, `.babelrc` files
|
|
402
|
-
* are ignored.
|
|
403
|
-
*
|
|
404
|
-
* You can surround any piece of code with `stripInProduction: { debug code }`
|
|
405
|
-
* to strip it from the generated bundles unless VIS_DEBUG=true environmental
|
|
406
|
-
* variable is set. This is useful for example to render bounding boxes during
|
|
407
|
-
* debugging but automatically switch it off without any performance or bundle
|
|
408
|
-
* size penalty in production. Debugger statements are also automatically
|
|
409
|
-
* stripped.
|
|
410
|
-
*
|
|
411
|
-
* Plugins:
|
|
412
|
-
* - `\@rollup/plugin-babel` (skipped in ESNext)
|
|
413
|
-
* - `\@rollup/plugin-commonjs`
|
|
414
|
-
* - `\@rollup/plugin-json`
|
|
415
|
-
* - `\@rollup/plugin-node-resolve`
|
|
416
|
-
* - `\@rollup/plugin-strip` (skipped with VIS_DEBUG=true env var)
|
|
417
|
-
* - `\@rollup/plugin-terser` (only in minified)
|
|
418
|
-
* - `postcss-assets`
|
|
419
|
-
* - `rollup-plugin-copy`
|
|
420
|
-
* - `rollup-plugin-postcss`
|
|
421
|
-
* - `rollup-plugin-typescript2` (skipped if the entry is .js)
|
|
422
|
-
* @param options - See {@link GRCOptions}.
|
|
423
|
-
* @param mode - Whether the code should be processed for production,
|
|
424
|
-
* development or testing.
|
|
425
|
-
* @returns Ready to use configuration object that can be just exported from
|
|
426
|
-
* `rollup.config.js` or mutated in any way if necessary.
|
|
427
|
-
*/
|
|
428
|
-
function generateRollupConfiguration(_x2) {
|
|
429
|
-
return _generateRollupConfiguration.apply(this, arguments);
|
|
430
|
-
}
|
|
431
|
-
function _generateRollupConfiguration() {
|
|
432
|
-
_generateRollupConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
433
|
-
var _context15, _context18, _context19, _context20, _context21, _context22, _context23;
|
|
434
|
-
var mode,
|
|
435
|
-
_ref5,
|
|
436
|
-
_ref5$assets,
|
|
437
|
-
assets,
|
|
438
|
-
_ref5$copyTargets,
|
|
439
|
-
_ref5$copyTargets2,
|
|
440
|
-
_ref5$copyTargets2$bu,
|
|
441
|
-
copyTargetsBundle,
|
|
442
|
-
_ref5$copyTargets2$va,
|
|
443
|
-
copyTargetsVariant,
|
|
444
|
-
_ref5$externalForPeer,
|
|
445
|
-
externalForPeerBuild,
|
|
446
|
-
_ref5$globals,
|
|
447
|
-
globals,
|
|
448
|
-
_ref5$header,
|
|
449
|
-
header,
|
|
450
|
-
_ref5$libraryFilename,
|
|
451
|
-
libraryFilename,
|
|
452
|
-
_ref5$packageJSON,
|
|
453
|
-
_ref5$packageJSON2,
|
|
454
|
-
_ref5$packageJSON2$de,
|
|
455
|
-
dependencies,
|
|
456
|
-
_ref5$packageJSON2$de2,
|
|
457
|
-
devDependencies,
|
|
458
|
-
_ref5$packageJSON2$pe,
|
|
459
|
-
peerDependencies,
|
|
460
|
-
packageJSONRest,
|
|
461
|
-
_ref5$entryPoints,
|
|
462
|
-
entryPoint,
|
|
463
|
-
_ref5$tsconfig,
|
|
464
|
-
tsconfig,
|
|
465
|
-
_yield$Promise$all,
|
|
466
|
-
_yield$Promise$all2,
|
|
467
|
-
esnextEntry,
|
|
468
|
-
peerEntry,
|
|
469
|
-
standaloneEntry,
|
|
470
|
-
banner,
|
|
471
|
-
external,
|
|
472
|
-
commonOutput,
|
|
473
|
-
commonOutputESM,
|
|
474
|
-
commonOutputUMD,
|
|
475
|
-
getPlugins,
|
|
476
|
-
_args3 = arguments;
|
|
477
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context24) {
|
|
478
|
-
while (1) switch (_context24.prev = _context24.next) {
|
|
479
|
-
case 0:
|
|
480
|
-
mode = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
|
|
481
|
-
_ref5 = options || {}, _ref5$assets = _ref5.assets, assets = _ref5$assets === void 0 ? "." : _ref5$assets, _ref5$copyTargets = _ref5.copyTargets, _ref5$copyTargets2 = _ref5$copyTargets === void 0 ? {} : _ref5$copyTargets, _ref5$copyTargets2$bu = _ref5$copyTargets2.bundle, copyTargetsBundle = _ref5$copyTargets2$bu === void 0 ? [] : _ref5$copyTargets2$bu, _ref5$copyTargets2$va = _ref5$copyTargets2.variant, copyTargetsVariant = _ref5$copyTargets2$va === void 0 ? [] : _ref5$copyTargets2$va, _ref5$externalForPeer = _ref5.externalForPeerBuild, externalForPeerBuild = _ref5$externalForPeer === void 0 ? [] : _ref5$externalForPeer, _ref5$globals = _ref5.globals, globals = _ref5$globals === void 0 ? {} : _ref5$globals, _ref5$header = _ref5.header, header = _ref5$header === void 0 ? {
|
|
482
|
-
name: "Unknown Library"
|
|
483
|
-
} : _ref5$header, _ref5$libraryFilename = _ref5.libraryFilename, libraryFilename = _ref5$libraryFilename === void 0 ? "unknown-library" : _ref5$libraryFilename, _ref5$packageJSON = _ref5.packageJSON, _ref5$packageJSON2 = _ref5$packageJSON === void 0 ? {} : _ref5$packageJSON, _ref5$packageJSON2$de = _ref5$packageJSON2.dependencies, dependencies = _ref5$packageJSON2$de === void 0 ? {} : _ref5$packageJSON2$de, _ref5$packageJSON2$de2 = _ref5$packageJSON2.devDependencies, devDependencies = _ref5$packageJSON2$de2 === void 0 ? {} : _ref5$packageJSON2$de2, _ref5$packageJSON2$pe = _ref5$packageJSON2.peerDependencies, peerDependencies = _ref5$packageJSON2$pe === void 0 ? {} : _ref5$packageJSON2$pe, packageJSONRest = _objectWithoutProperties(_ref5$packageJSON2, _excluded), _ref5$entryPoints = _ref5.entryPoints, entryPoint = _ref5$entryPoints === void 0 ? "./src" : _ref5$entryPoints, _ref5$tsconfig = _ref5.tsconfig, tsconfig = _ref5$tsconfig === void 0 ? "tsconfig.json" : _ref5$tsconfig;
|
|
484
|
-
validate(function (expect) {
|
|
485
|
-
// Note: Every array is a superset of empty array.
|
|
486
|
-
if (_Object$keys(peerDependencies).length > 0) {
|
|
487
|
-
expect(_Object$keys(dependencies), "The dependencies and peer dependencies have to be disjoint sets").to.be.an("array").that.does.not.include.any.members(_Object$keys(peerDependencies));
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
validate(function (expect) {
|
|
491
|
-
_includesInstanceProperty(expect(_Object$keys(devDependencies), "For convenience all peer dependencies also have to be dev dependencies").to.be.an("array").that).all.members(_Object$keys(peerDependencies));
|
|
492
|
-
});
|
|
493
|
-
validate(function (expect) {
|
|
494
|
-
_includesInstanceProperty(expect(_Object$keys(peerDependencies), "Peer build externals have to be a subset of peer dependencies").to.be.an("array").that).all.members(externalForPeerBuild);
|
|
495
|
-
});
|
|
496
|
-
validate(function (expect) {
|
|
497
|
-
var _context12, _context13, _context14;
|
|
498
|
-
expect(_sortInstanceProperty(_context12 = _concatInstanceProperty(_context13 = []).call(_context13, _toConsumableArray(_Object$keys(dependencies)), _toConsumableArray(_Object$keys(peerDependencies)))).call(_context12), "Globals have to be provided for all runtime and peer dependencies but nothing else").to.be.an("array").that.deep.equals(_sortInstanceProperty(_context14 = _Object$keys(globals)).call(_context14));
|
|
499
|
-
});
|
|
500
|
-
validate(function (expect) {
|
|
501
|
-
expect(resolve(assets), "Assets have to be a directory").to.be.a("string").and.a.directory();
|
|
502
|
-
});
|
|
503
|
-
validate(function (expect) {
|
|
504
|
-
expect(entryPoint, "The entry point has to be directory").to.be.a("string").and.a.directory();
|
|
505
|
-
});
|
|
506
|
-
_context24.next = 10;
|
|
507
|
-
return _Promise.all(_mapInstanceProperty(_context15 = ["ESNext", "peer", "standalone"]).call(_context15, /*#__PURE__*/function () {
|
|
508
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(name) {
|
|
509
|
-
var filenameGlob, files;
|
|
510
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context17) {
|
|
511
|
-
while (1) switch (_context17.prev = _context17.next) {
|
|
512
|
-
case 0:
|
|
513
|
-
filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
|
|
514
|
-
_context17.next = 3;
|
|
515
|
-
return glob(resolve(entryPoint, filenameGlob));
|
|
516
|
-
case 3:
|
|
517
|
-
files = _context17.sent;
|
|
518
|
-
validate(function (expect) {
|
|
519
|
-
var _context16;
|
|
520
|
-
expect(files, _concatInstanceProperty(_context16 = "There has to be a single entry file (".concat(filenameGlob, ") for the ")).call(_context16, name, " build")).to.have.lengthOf(1).and.to.have.ownProperty("0").that.is.a.file();
|
|
521
|
-
});
|
|
522
|
-
return _context17.abrupt("return", files[0]);
|
|
523
|
-
case 6:
|
|
524
|
-
case "end":
|
|
525
|
-
return _context17.stop();
|
|
526
|
-
}
|
|
527
|
-
}, _callee2);
|
|
528
|
-
}));
|
|
529
|
-
return function (_x3) {
|
|
530
|
-
return _ref6.apply(this, arguments);
|
|
531
|
-
};
|
|
532
|
-
}()));
|
|
533
|
-
case 10:
|
|
534
|
-
_yield$Promise$all = _context24.sent;
|
|
535
|
-
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
|
|
536
|
-
esnextEntry = _yield$Promise$all2[0];
|
|
537
|
-
peerEntry = _yield$Promise$all2[1];
|
|
538
|
-
standaloneEntry = _yield$Promise$all2[2];
|
|
539
|
-
validate(function (expect) {
|
|
540
|
-
expect(resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
|
|
541
|
-
});
|
|
542
|
-
validate(function (expect) {
|
|
543
|
-
_includesInstanceProperty(expect(packageJSONRest, "The directories with built files have to be included in the package").to.have.ownProperty("files").that.is.an("array").and).all.members(["declarations", "esnext", "peer", "standalone"]);
|
|
544
|
-
});
|
|
545
|
-
validate(function (expect) {
|
|
546
|
-
expect(packageJSONRest, "Package JSON's type property has to point to the declarations").to.have.ownProperty("types").that.is.a("string").and.equals("declarations/index.d.ts");
|
|
547
|
-
});
|
|
548
|
-
validate(function (expect) {
|
|
549
|
-
expect(packageJSONRest, "Package JSON's browser property has to point to the minifed UMD build").to.have.ownProperty("browser").that.is.a("string").and.equals("peer/umd/".concat(libraryFilename, ".min.js"));
|
|
550
|
-
});
|
|
551
|
-
validate(function (expect) {
|
|
552
|
-
expect(packageJSONRest, "Package JSON's main property has to point to the UMD build").to.have.ownProperty("main").that.is.a("string").and.equals("peer/umd/".concat(libraryFilename, ".js"));
|
|
553
|
-
});
|
|
554
|
-
validate(function (expect) {
|
|
555
|
-
expect(packageJSONRest, "Package JSON's modul property has to point to the ESM build").to.have.ownProperty("module").that.is.a("string").and.equals("peer/esm/".concat(libraryFilename, ".js"));
|
|
556
|
-
});
|
|
557
|
-
validate(function (expect) {
|
|
558
|
-
expect(packageJSONRest, "Package JSON's jsnext has to point to the ESNext build").to.have.ownProperty("jsnext").that.is.a("string").and.equals("esnext/esm/".concat(libraryFilename, ".js"));
|
|
559
|
-
});
|
|
560
|
-
// Note: .to.not.exist sounds great but doesn't work.
|
|
561
|
-
validate(function (expect) {
|
|
562
|
-
expect(resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
|
|
563
|
-
});
|
|
564
|
-
validate(function (expect) {
|
|
565
|
-
expect(resolve("./babel.config.js"), "There has to be a babel.config.js config file.").to.not.be.a.path;
|
|
566
|
-
});
|
|
567
|
-
banner = generateHeader(header);
|
|
568
|
-
external = {
|
|
569
|
-
// No dependencies are bundled.
|
|
570
|
-
esnext: processDependencies(_concatInstanceProperty(_context18 = []).call(_context18, _toConsumableArray(_Object$keys(dependencies)), _toConsumableArray(_Object$keys(peerDependencies)), _toConsumableArray(_Object$keys(devDependencies)))),
|
|
571
|
-
// Only dependencies that cause compatibility issues are not bundled.
|
|
572
|
-
peer: processDependencies(externalForPeerBuild),
|
|
573
|
-
// No runtime dependencies, everything's bundled.
|
|
574
|
-
standalone: []
|
|
575
|
-
};
|
|
576
|
-
commonOutput = {
|
|
577
|
-
banner: banner,
|
|
578
|
-
dir: ".",
|
|
579
|
-
globals: processGlobals(globals),
|
|
580
|
-
sourcemap: VIS_TEST ? "inline" : true
|
|
581
|
-
};
|
|
582
|
-
commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
|
|
583
|
-
format: "esm"
|
|
584
|
-
});
|
|
585
|
-
commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
|
|
586
|
-
exports: "named",
|
|
587
|
-
extend: true,
|
|
588
|
-
format: "umd",
|
|
589
|
-
name: "vis",
|
|
590
|
-
strict: false // Regenerator runtime causes issues with CSP in strict mode.
|
|
591
|
-
}); // Note: Binding more than 4 at a time is not typesafe in TS.
|
|
592
|
-
getPlugins = _bindInstanceProperty(_context19 = _bindInstanceProperty(_context20 = _bindInstanceProperty(_context21 = _bindInstanceProperty(_context22 = _bindInstanceProperty(_context23 = _bindInstanceProperty(generateRollupPluginArray).call(generateRollupPluginArray, null, libraryFilename)).call(_context23, null, assets)).call(_context22, null, copyTargetsBundle)).call(_context21, null, copyTargetsVariant)).call(_context20, null, tsconfig)).call(_context19, null, mode);
|
|
593
|
-
return _context24.abrupt("return", [{
|
|
594
|
-
external: external.standalone,
|
|
595
|
-
input: standaloneEntry,
|
|
596
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
597
|
-
entryFileNames: "standalone/esm/".concat(libraryFilename, ".js")
|
|
598
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
599
|
-
entryFileNames: "standalone/umd/".concat(libraryFilename, ".js")
|
|
600
|
-
})],
|
|
601
|
-
plugins: getPlugins("standalone", {
|
|
602
|
-
injectCSS: injectCSS,
|
|
603
|
-
transpile: transpile,
|
|
604
|
-
typescript: isTS(standaloneEntry)
|
|
605
|
-
})
|
|
606
|
-
}, {
|
|
607
|
-
external: external.standalone,
|
|
608
|
-
input: standaloneEntry,
|
|
609
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
610
|
-
entryFileNames: "standalone/esm/".concat(libraryFilename, ".min.js")
|
|
611
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
612
|
-
entryFileNames: "standalone/umd/".concat(libraryFilename, ".min.js")
|
|
613
|
-
})],
|
|
614
|
-
plugins: getPlugins("standalone", {
|
|
615
|
-
injectCSS: injectCSS,
|
|
616
|
-
minimize: minimize,
|
|
617
|
-
transpile: transpile,
|
|
618
|
-
typescript: isTS(standaloneEntry)
|
|
619
|
-
})
|
|
620
|
-
}, {
|
|
621
|
-
external: external.peer,
|
|
622
|
-
input: peerEntry,
|
|
623
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
624
|
-
entryFileNames: "peer/esm/".concat(libraryFilename, ".js"),
|
|
625
|
-
paths: getPaths("peer", "esm")
|
|
626
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
627
|
-
entryFileNames: "peer/umd/".concat(libraryFilename, ".js"),
|
|
628
|
-
paths: getPaths("peer", "umd")
|
|
629
|
-
})],
|
|
630
|
-
plugins: getPlugins("peer", {
|
|
631
|
-
transpile: transpile,
|
|
632
|
-
typescript: isTS(peerEntry)
|
|
633
|
-
})
|
|
634
|
-
}, {
|
|
635
|
-
external: external.peer,
|
|
636
|
-
input: peerEntry,
|
|
637
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
638
|
-
entryFileNames: "peer/esm/".concat(libraryFilename, ".min.js"),
|
|
639
|
-
paths: getPaths("peer", "esm")
|
|
640
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
641
|
-
entryFileNames: "peer/umd/".concat(libraryFilename, ".min.js"),
|
|
642
|
-
paths: getPaths("peer", "umd")
|
|
643
|
-
})],
|
|
644
|
-
plugins: getPlugins("peer", {
|
|
645
|
-
minimize: minimize,
|
|
646
|
-
transpile: transpile,
|
|
647
|
-
typescript: isTS(peerEntry)
|
|
648
|
-
})
|
|
649
|
-
}, {
|
|
650
|
-
external: external.esnext,
|
|
651
|
-
input: esnextEntry,
|
|
652
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
653
|
-
entryFileNames: "esnext/esm/".concat(libraryFilename, ".js"),
|
|
654
|
-
paths: getPaths("esnext", "esm")
|
|
655
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
656
|
-
entryFileNames: "esnext/umd/".concat(libraryFilename, ".js"),
|
|
657
|
-
paths: getPaths("esnext", "umd")
|
|
658
|
-
})],
|
|
659
|
-
plugins: getPlugins("esnext", {
|
|
660
|
-
typescript: isTS(esnextEntry)
|
|
661
|
-
})
|
|
662
|
-
}, {
|
|
663
|
-
external: external.esnext,
|
|
664
|
-
input: esnextEntry,
|
|
665
|
-
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
666
|
-
entryFileNames: "esnext/esm/".concat(libraryFilename, ".min.js"),
|
|
667
|
-
paths: getPaths("esnext", "esm")
|
|
668
|
-
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
669
|
-
entryFileNames: "esnext/umd/".concat(libraryFilename, ".min.js"),
|
|
670
|
-
paths: getPaths("esnext", "umd")
|
|
671
|
-
})],
|
|
672
|
-
plugins: getPlugins("esnext", {
|
|
673
|
-
minimize: minimize,
|
|
674
|
-
typescript: isTS(esnextEntry)
|
|
675
|
-
})
|
|
676
|
-
}]);
|
|
677
|
-
case 31:
|
|
678
|
-
case "end":
|
|
679
|
-
return _context24.stop();
|
|
680
|
-
}
|
|
681
|
-
}, _callee3);
|
|
682
|
-
}));
|
|
683
|
-
return _generateRollupConfiguration.apply(this, arguments);
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
687
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context8, _context9; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context8 = ownKeys(Object(t), !0)).call(_context8, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context9 = ownKeys(Object(t))).call(_context9, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
688
|
-
setGracefulCleanup();
|
|
689
|
-
var PACK_CMD = ["npm", "pack", "--dry-run"];
|
|
690
|
-
/**
|
|
691
|
-
* @param textOrLines
|
|
692
|
-
* @param message
|
|
693
|
-
*/
|
|
694
|
-
function logStderr(textOrLines, message) {
|
|
695
|
-
console.group('"npm pack" output');
|
|
696
|
-
console.error(_Array$isArray(textOrLines) ? textOrLines.join("\n") : textOrLines);
|
|
697
|
-
console.groupEnd();
|
|
698
|
-
throw new Error(message);
|
|
699
|
-
}
|
|
700
|
-
/**
|
|
701
|
-
*
|
|
702
|
-
*/
|
|
703
|
-
function runNpmPack() {
|
|
704
|
-
var _context;
|
|
705
|
-
var tmpFile = fileSync().name;
|
|
706
|
-
// There are issues with incomplete output when the stderr is read directly
|
|
707
|
-
// into Node. Saving it into tmp file using shell redirection and reading it
|
|
708
|
-
// from there doesn't exhibit those issues.
|
|
709
|
-
execSync(_concatInstanceProperty(_context = "".concat(PACK_CMD.join(" "), " 2> ")).call(_context, tmpFile), {
|
|
710
|
-
encoding: "utf-8",
|
|
711
|
-
env: _objectSpread(_objectSpread({}, process.env), {}, {
|
|
712
|
-
LC_ALL: "C"
|
|
713
|
-
})
|
|
714
|
-
});
|
|
715
|
-
var lines = readFileSync(tmpFile, "utf-8").split(/[\r\n]+/);
|
|
716
|
-
return lines;
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* @param lines
|
|
720
|
-
*/
|
|
721
|
-
function extractFiles(lines) {
|
|
722
|
-
var _context2, _context3, _context4, _context5, _context6;
|
|
723
|
-
var fileListingStart = _indexOfInstanceProperty(lines).call(lines, "npm notice === Tarball Contents === ");
|
|
724
|
-
var fileListingEnd = _indexOfInstanceProperty(lines).call(lines, "npm notice === Tarball Details === ");
|
|
725
|
-
if (fileListingStart === -1 || fileListingEnd === -1) {
|
|
726
|
-
logStderr(lines.join("\n"), 'Couldn\'t find tarball contents in "npm pack" output.');
|
|
727
|
-
}
|
|
728
|
-
var files = _mapInstanceProperty(_context2 = _sortInstanceProperty(_context3 = _mapInstanceProperty(_context4 = _mapInstanceProperty(_context5 = _mapInstanceProperty(_context6 = _sliceInstanceProperty(lines).call(lines, fileListingStart + 1, fileListingEnd)).call(_context6, function (line) {
|
|
729
|
-
return line.replace(/^npm notice /, "");
|
|
730
|
-
})).call(_context5, function (line) {
|
|
731
|
-
return _trimInstanceProperty(line).call(line);
|
|
732
|
-
})).call(_context4, function (line) {
|
|
733
|
-
return line.replace(/^([^ ]+) +(.*)/, function (_, size, path) {
|
|
734
|
-
var _context7;
|
|
735
|
-
return _concatInstanceProperty(_context7 = "".concat(path)).call(_context7, size === "0" ? "(empty)" : " ");
|
|
736
|
-
});
|
|
737
|
-
})).call(_context3)).call(_context2, function (line) {
|
|
738
|
-
return line.replace(/^(.*)(.{7})$/, "$2 $1");
|
|
739
|
-
});
|
|
740
|
-
if (files.length === 0) {
|
|
741
|
-
logStderr(lines, 'No files found in "npm pack" output.');
|
|
742
|
-
}
|
|
743
|
-
return files;
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* @param lines
|
|
747
|
-
*/
|
|
748
|
-
function extractName(lines) {
|
|
749
|
-
var nameLine = _findInstanceProperty(lines).call(lines, function (line) {
|
|
750
|
-
return /^npm notice name:/.test(line);
|
|
751
|
-
});
|
|
752
|
-
if (nameLine == null) {
|
|
753
|
-
logStderr(lines, 'Can\'t find the name of the package in "npm pack" output.');
|
|
754
|
-
}
|
|
755
|
-
return nameLine.replace(/^npm notice name: */, "");
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
*
|
|
759
|
-
*/
|
|
760
|
-
function inspectNpmPack() {
|
|
761
|
-
var lines = runNpmPack();
|
|
762
|
-
var files = extractFiles(lines);
|
|
763
|
-
var name = extractName(lines);
|
|
764
|
-
return {
|
|
765
|
-
name: name,
|
|
766
|
-
files: files
|
|
767
|
-
};
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
export { BABEL_IGNORE_RE, generateHeader, generateRollupConfiguration, inspectNpmPack, textToComment };
|
|
771
|
-
//# sourceMappingURL=vis-dev-utils.esm.js.map
|