vis-dev-utils 3.0.118 → 3.0.120
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-register/index.js +26 -12
- package/babel-register/index.js.map +1 -1
- package/bin/ci-utils.js +4 -8
- package/bin/ci-utils.js.map +1 -1
- package/bin/generate-examples-index.js +755 -1015
- package/bin/generate-examples-index.js.map +1 -1
- package/bin/test-e2e-interop.js +2827 -828
- package/bin/test-e2e-interop.js.map +1 -1
- package/declarations/generate-rollup-configuration/index.d.ts +2 -1
- package/declarations/generate-rollup-configuration/index.d.ts.map +1 -1
- package/dist/vis-dev-utils.cjs.js +368 -347
- package/dist/vis-dev-utils.cjs.js.map +1 -1
- package/dist/vis-dev-utils.esm.js +336 -336
- package/dist/vis-dev-utils.esm.js.map +1 -1
- package/package.json +15 -16
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Development utilities for the Vis family projects.
|
|
6
6
|
*
|
|
7
|
-
* @version 3.0.
|
|
8
|
-
* @date 2023-02-
|
|
7
|
+
* @version 3.0.120
|
|
8
|
+
* @date 2023-02-15T20:06:40.240Z
|
|
9
9
|
*
|
|
10
10
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
|
11
11
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
|
@@ -36,6 +36,8 @@ import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWitho
|
|
|
36
36
|
import _toConsumableArray from '@babel/runtime-corejs3/helpers/toConsumableArray';
|
|
37
37
|
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
38
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';
|
|
39
41
|
import _Number$MAX_SAFE_INTEGER from '@babel/runtime-corejs3/core-js-stable/number/max-safe-integer';
|
|
40
42
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
41
43
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
@@ -48,6 +50,7 @@ import _endsWithInstanceProperty from '@babel/runtime-corejs3/core-js-stable/ins
|
|
|
48
50
|
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
49
51
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
50
52
|
import _sortInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/sort';
|
|
53
|
+
import _Promise from '@babel/runtime-corejs3/core-js-stable/promise';
|
|
51
54
|
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
52
55
|
import analyzerPlugin from 'rollup-plugin-analyzer';
|
|
53
56
|
import babelPlugin from 'rollup-plugin-babel';
|
|
@@ -61,17 +64,16 @@ import postcssPlugin from 'rollup-plugin-postcss';
|
|
|
61
64
|
import stripCodePlugin from 'rollup-plugin-strip-code';
|
|
62
65
|
import typescriptPlugin from 'rollup-plugin-typescript2';
|
|
63
66
|
import { sync } from 'find-up';
|
|
64
|
-
import { readFileSync } from 'fs';
|
|
65
|
-
import { resolve, sep, join } from 'path';
|
|
67
|
+
import { readFileSync } from 'node:fs';
|
|
68
|
+
import { resolve, sep, join } from 'node:path';
|
|
66
69
|
import { string } from 'rollup-plugin-string';
|
|
67
|
-
import { sync as sync$1 } from 'globby';
|
|
68
70
|
import { terser } from 'rollup-plugin-terser';
|
|
69
71
|
import { config, use, expect } from 'chai';
|
|
70
72
|
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
71
73
|
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
72
74
|
import _trimInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/trim';
|
|
73
75
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
74
|
-
import { execSync } from 'child_process';
|
|
76
|
+
import { execSync } from 'node:child_process';
|
|
75
77
|
import { setGracefulCleanup, fileSync } from 'tmp-promise';
|
|
76
78
|
|
|
77
79
|
var BABEL_IGNORE_RE = _Object$freeze(/[\\/]node_modules[\\/](?!.*[\\/]esnext[\\/])/);
|
|
@@ -84,40 +86,40 @@ var BABEL_IGNORE_RE = _Object$freeze(/[\\/]node_modules[\\/](?!.*[\\/]esnext[\\/
|
|
|
84
86
|
* @returns A block doc comment string that can be for example prepended to a
|
|
85
87
|
* bundled JavaScript file.
|
|
86
88
|
*/
|
|
87
|
-
|
|
88
89
|
function textToComment(string) {
|
|
89
90
|
var _context, _context2;
|
|
90
|
-
|
|
91
91
|
if (_includesInstanceProperty(string).call(string, "*/")) {
|
|
92
92
|
throw new Error("Don't include comments in the input string. It will be converted automatically.");
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.replace(/^[\n\r]*/, "")
|
|
97
|
-
|
|
98
|
-
.
|
|
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.
|
|
99
102
|
).call(_context2, function (line) {
|
|
100
103
|
return " * " + line;
|
|
101
|
-
})
|
|
104
|
+
})
|
|
105
|
+
// Remove trailing white space.
|
|
102
106
|
).call(_context, function (line) {
|
|
103
107
|
return line.replace(/[^\S\r\n]*$/, "");
|
|
104
|
-
})
|
|
108
|
+
})
|
|
109
|
+
// Join back into a string.
|
|
105
110
|
.join("\n") + "\n */\n";
|
|
106
111
|
}
|
|
107
112
|
var packageJSON = JSON.parse(readFileSync(sync("package.json"), "utf8"));
|
|
108
|
-
|
|
109
113
|
var buildHeader = function buildHeader(_ref) {
|
|
110
114
|
var _context3, _context4, _context5, _context6, _context7;
|
|
111
|
-
|
|
112
115
|
var customText = _ref.customText,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
date = _ref.date,
|
|
117
|
+
description = _ref.description,
|
|
118
|
+
homepage = _ref.homepage,
|
|
119
|
+
name = _ref.name,
|
|
120
|
+
version = _ref.version;
|
|
118
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"));
|
|
119
122
|
};
|
|
120
|
-
|
|
121
123
|
var defaultDate = new Date().toISOString();
|
|
122
124
|
var defaultDescription = packageJSON.description;
|
|
123
125
|
var defaultHomepage = packageJSON.homepage;
|
|
@@ -133,22 +135,20 @@ var defaultVersion = packageJSON.version;
|
|
|
133
135
|
* @throws If the string already contains a comment.
|
|
134
136
|
* @returns Ready to use banner text.
|
|
135
137
|
*/
|
|
136
|
-
|
|
137
138
|
function generateHeader(options) {
|
|
138
139
|
var _ref2 = options || {},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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
152
|
return buildHeader({
|
|
153
153
|
customText: customText,
|
|
154
154
|
date: date,
|
|
@@ -160,17 +160,13 @@ function generateHeader(options) {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
var _excluded = ["dependencies", "devDependencies", "peerDependencies"];
|
|
163
|
-
|
|
164
163
|
var _context, _context2;
|
|
165
|
-
|
|
166
164
|
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context25, _context26; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context25 = ownKeys$1(Object(source), !0)).call(_context25, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context26 = ownKeys$1(Object(source))).call(_context26, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
166
|
+
var rawGlobby = import('globby');
|
|
169
167
|
config.truncateThreshold = _Number$MAX_SAFE_INTEGER;
|
|
170
168
|
use(chaiFs);
|
|
171
|
-
|
|
172
169
|
var VIS_DEBUG = _includesInstanceProperty(_context = ["1", "true", "y", "yes"]).call(_context, process.env["VIS_DEBUG"] || "false");
|
|
173
|
-
|
|
174
170
|
var VIS_TEST = _includesInstanceProperty(_context2 = ["1", "true", "y", "yes"]).call(_context2, process.env["VIS_TEST"] || "false");
|
|
175
171
|
/**
|
|
176
172
|
* Simple glob with workaround for non-posix paths.
|
|
@@ -178,17 +174,30 @@ var VIS_TEST = _includesInstanceProperty(_context2 = ["1", "true", "y", "yes"]).
|
|
|
178
174
|
* @param pattern - Single glob pattern.
|
|
179
175
|
* @returns Globbed paths.
|
|
180
176
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
function glob(pattern) {
|
|
184
|
-
return sync$1(sep === "\\" ? pattern.replace(/\\/g, "/") : pattern);
|
|
177
|
+
function glob(_x) {
|
|
178
|
+
return _glob.apply(this, arguments);
|
|
185
179
|
}
|
|
186
180
|
/**
|
|
187
181
|
* These are the dependencies that follow standalone/peer/ESNext export
|
|
188
182
|
* structure.
|
|
189
183
|
*/
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
}
|
|
192
201
|
var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-network", "vis-timeline", "vis-util", "vis-uuid"];
|
|
193
202
|
/**
|
|
194
203
|
* This ensures that dependencies on Vis projects point to ESNext builds.
|
|
@@ -196,7 +205,6 @@ var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-networ
|
|
|
196
205
|
* @param deps - The original dependencies as listed in package.json.
|
|
197
206
|
* @returns An array of dependencies for Rollup.
|
|
198
207
|
*/
|
|
199
|
-
|
|
200
208
|
function processDependencies(deps) {
|
|
201
209
|
var depNames = _Array$isArray(deps) ? deps : _Object$keys(deps);
|
|
202
210
|
return _flatMapInstanceProperty(depNames).call(depNames, function (key) {
|
|
@@ -211,16 +219,12 @@ function processDependencies(deps) {
|
|
|
211
219
|
* @param globals - The original globals.
|
|
212
220
|
* @returns Globals forcing the use of ESNext builds for Vis projects.
|
|
213
221
|
*/
|
|
214
|
-
|
|
215
|
-
|
|
216
222
|
function processGlobals(globals) {
|
|
217
223
|
var _context3;
|
|
218
|
-
|
|
219
224
|
return _reduceInstanceProperty(_context3 = _Object$entries(globals)).call(_context3, function (acc, _ref) {
|
|
220
225
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
226
|
+
key = _ref2[0],
|
|
227
|
+
value = _ref2[1];
|
|
224
228
|
acc[_includesInstanceProperty(dependenciesWithVisExportStructure).call(dependenciesWithVisExportStructure, key) ? key + "/esnext" : key] = value;
|
|
225
229
|
return acc;
|
|
226
230
|
}, _Object$create(null));
|
|
@@ -228,8 +232,6 @@ function processGlobals(globals) {
|
|
|
228
232
|
/**
|
|
229
233
|
* @param path
|
|
230
234
|
*/
|
|
231
|
-
|
|
232
|
-
|
|
233
235
|
function isTS(path) {
|
|
234
236
|
return _endsWithInstanceProperty(path).call(path, ".ts");
|
|
235
237
|
}
|
|
@@ -237,8 +239,6 @@ function isTS(path) {
|
|
|
237
239
|
* Make sure that Chai doesn't throw and therefore stop execution on failed
|
|
238
240
|
* validations during debugging.
|
|
239
241
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
242
|
var validate = VIS_DEBUG ? function (callback) {
|
|
243
243
|
try {
|
|
244
244
|
callback(expect);
|
|
@@ -256,17 +256,14 @@ var validate = VIS_DEBUG ? function (callback) {
|
|
|
256
256
|
* @param moduleFormat - What kind of module system to use.
|
|
257
257
|
* @returns Path overrides for Rollup.
|
|
258
258
|
*/
|
|
259
|
-
|
|
260
259
|
function getPaths(buildVariant, moduleFormat) {
|
|
261
260
|
/**
|
|
262
261
|
* @param lib
|
|
263
262
|
*/
|
|
264
263
|
function getPath(lib) {
|
|
265
264
|
var _context4, _context5, _context6;
|
|
266
|
-
|
|
267
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"));
|
|
268
266
|
}
|
|
269
|
-
|
|
270
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"));
|
|
271
268
|
}
|
|
272
269
|
/**
|
|
@@ -275,62 +272,52 @@ function getPaths(buildVariant, moduleFormat) {
|
|
|
275
272
|
* @param dirs - The directories there targets should be relative to.
|
|
276
273
|
* @returns A function that can be directly supplied to Array.map().
|
|
277
274
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
275
|
function scopeCopyTarget() {
|
|
281
276
|
for (var _len = arguments.length, dirs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
282
277
|
dirs[_key] = arguments[_key];
|
|
283
278
|
}
|
|
284
|
-
|
|
285
279
|
return function (target) {
|
|
286
280
|
var dest = _Array$isArray(target.dest) ? target.dest : [target.dest];
|
|
287
|
-
|
|
288
281
|
var bundleDest = _flatMapInstanceProperty(dest).call(dest, function (path) {
|
|
289
282
|
return _mapInstanceProperty(dirs).call(dirs, function (dir) {
|
|
290
283
|
return join(dir, path);
|
|
291
284
|
});
|
|
292
285
|
});
|
|
293
|
-
|
|
294
286
|
return _objectSpread$1(_objectSpread$1({}, target), {}, {
|
|
295
287
|
dest: bundleDest
|
|
296
288
|
});
|
|
297
289
|
};
|
|
298
290
|
}
|
|
299
|
-
|
|
300
291
|
var injectCSS = true;
|
|
301
292
|
var minimize = true;
|
|
302
293
|
var transpile = true;
|
|
303
|
-
|
|
304
294
|
var generateRollupPluginArray = function generateRollupPluginArray(libraryFilename, assets, copyTargetsBundle, copyTargetsVariant, tsconfig, mode, bundleType) {
|
|
305
295
|
var _context7, _context8, _context9, _context10;
|
|
306
|
-
|
|
307
296
|
var _ref4 = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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;
|
|
319
307
|
var fullLibraryFilename = _concatInstanceProperty(_context7 = "".concat(libraryFilename)).call(_context7, minimize ? ".min" : "");
|
|
320
|
-
|
|
321
308
|
var bundleDir = bundleType;
|
|
322
|
-
|
|
323
309
|
var bundleVariantDirs = _mapInstanceProperty(_context8 = ["esm", "umd"]).call(_context8, function (variant) {
|
|
324
310
|
return join(bundleDir, variant);
|
|
325
311
|
});
|
|
326
|
-
|
|
327
|
-
|
|
312
|
+
return _concatInstanceProperty(_context9 = []).call(_context9, _toConsumableArray(strip ? [
|
|
313
|
+
// This should be first because it removes code from source files.
|
|
328
314
|
// It's much easier to follow if the removal happens before any
|
|
329
315
|
// transformations.
|
|
330
316
|
stripCodePlugin({
|
|
331
317
|
start_comment: "develblock:start",
|
|
332
318
|
end_comment: "develblock:end"
|
|
333
|
-
})] : [
|
|
319
|
+
})] : [
|
|
320
|
+
// Remove the comments marking devel blocks as they can cause problems
|
|
334
321
|
// later on because transpilation shuffles things around which may
|
|
335
322
|
// lead to all kinds of issues including syntax errors.
|
|
336
323
|
stripCodePlugin({
|
|
@@ -340,7 +327,8 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
|
|
|
340
327
|
summaryOnly: true
|
|
341
328
|
}), copyPlugin({
|
|
342
329
|
verbose: VIS_DEBUG,
|
|
343
|
-
targets: _concatInstanceProperty(_context10 = [
|
|
330
|
+
targets: _concatInstanceProperty(_context10 = [
|
|
331
|
+
// JavaScript
|
|
344
332
|
{
|
|
345
333
|
src: resolve(__dirname, "assets/bundle-root.js"),
|
|
346
334
|
dest: bundleDir,
|
|
@@ -352,7 +340,8 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
|
|
|
352
340
|
transform: function transform(content) {
|
|
353
341
|
return content.toString().replace("{{filename}}", libraryFilename);
|
|
354
342
|
}
|
|
355
|
-
},
|
|
343
|
+
},
|
|
344
|
+
// TypeScript
|
|
356
345
|
{
|
|
357
346
|
src: resolve(__dirname, "assets/bundle-root.d.ts"),
|
|
358
347
|
dest: bundleDir,
|
|
@@ -430,235 +419,265 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
|
|
|
430
419
|
* @returns Ready to use configuration object that can be just exported from
|
|
431
420
|
* `rollup.config.js` or mutated in any way if necessary.
|
|
432
421
|
*/
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
_ref5$assets
|
|
442
|
-
assets
|
|
443
|
-
_ref5$copyTargets
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
_ref5$
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
422
|
+
function generateRollupConfiguration(_x2) {
|
|
423
|
+
return _generateRollupConfiguration.apply(this, arguments);
|
|
424
|
+
}
|
|
425
|
+
function _generateRollupConfiguration() {
|
|
426
|
+
_generateRollupConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
|
|
427
|
+
var _context15, _context18, _context19, _context20, _context21, _context22, _context23;
|
|
428
|
+
var mode,
|
|
429
|
+
_ref5,
|
|
430
|
+
_ref5$assets,
|
|
431
|
+
assets,
|
|
432
|
+
_ref5$copyTargets,
|
|
433
|
+
_ref5$copyTargets2,
|
|
434
|
+
_ref5$copyTargets2$bu,
|
|
435
|
+
copyTargetsBundle,
|
|
436
|
+
_ref5$copyTargets2$va,
|
|
437
|
+
copyTargetsVariant,
|
|
438
|
+
_ref5$externalForPeer,
|
|
439
|
+
externalForPeerBuild,
|
|
440
|
+
_ref5$globals,
|
|
441
|
+
globals,
|
|
442
|
+
_ref5$header,
|
|
443
|
+
header,
|
|
444
|
+
_ref5$libraryFilename,
|
|
445
|
+
libraryFilename,
|
|
446
|
+
_ref5$packageJSON,
|
|
447
|
+
_ref5$packageJSON2,
|
|
448
|
+
_ref5$packageJSON2$de,
|
|
449
|
+
dependencies,
|
|
450
|
+
_ref5$packageJSON2$de2,
|
|
451
|
+
devDependencies,
|
|
452
|
+
_ref5$packageJSON2$pe,
|
|
453
|
+
peerDependencies,
|
|
454
|
+
packageJSONRest,
|
|
455
|
+
_ref5$entryPoints,
|
|
456
|
+
entryPoint,
|
|
457
|
+
_ref5$tsconfig,
|
|
458
|
+
tsconfig,
|
|
459
|
+
_yield$Promise$all,
|
|
460
|
+
_yield$Promise$all2,
|
|
461
|
+
esnextEntry,
|
|
462
|
+
peerEntry,
|
|
463
|
+
standaloneEntry,
|
|
464
|
+
banner,
|
|
465
|
+
external,
|
|
466
|
+
commonOutput,
|
|
467
|
+
commonOutputESM,
|
|
468
|
+
commonOutputUMD,
|
|
469
|
+
getPlugins,
|
|
470
|
+
_args3 = arguments;
|
|
471
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context24) {
|
|
472
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
473
|
+
case 0:
|
|
474
|
+
mode = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
|
|
475
|
+
_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 ? {
|
|
476
|
+
name: "Unknown Library"
|
|
477
|
+
} : _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;
|
|
478
|
+
validate(function (expect) {
|
|
479
|
+
// Note: Every array is a superset of empty array.
|
|
480
|
+
if (_Object$keys(peerDependencies).length > 0) {
|
|
481
|
+
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));
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
validate(function (expect) {
|
|
485
|
+
_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));
|
|
486
|
+
});
|
|
487
|
+
validate(function (expect) {
|
|
488
|
+
_includesInstanceProperty(expect(_Object$keys(peerDependencies), "Peer build externals have to be a subset of peer dependencies").to.be.an("array").that).all.members(externalForPeerBuild);
|
|
489
|
+
});
|
|
490
|
+
validate(function (expect) {
|
|
491
|
+
var _context12, _context13, _context14;
|
|
492
|
+
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));
|
|
493
|
+
});
|
|
494
|
+
validate(function (expect) {
|
|
495
|
+
expect(resolve(assets), "Assets have to be a directory").to.be.a("string").and.a.directory();
|
|
496
|
+
});
|
|
497
|
+
validate(function (expect) {
|
|
498
|
+
expect(entryPoint, "The entry point has to be directory").to.be.a("string").and.a.directory();
|
|
499
|
+
});
|
|
500
|
+
_context24.next = 10;
|
|
501
|
+
return _Promise.all(_mapInstanceProperty(_context15 = ["ESNext", "peer", "standalone"]).call(_context15, /*#__PURE__*/function () {
|
|
502
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(name) {
|
|
503
|
+
var filenameGlob, files;
|
|
504
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context17) {
|
|
505
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
506
|
+
case 0:
|
|
507
|
+
filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
|
|
508
|
+
_context17.next = 3;
|
|
509
|
+
return glob(resolve(entryPoint, filenameGlob));
|
|
510
|
+
case 3:
|
|
511
|
+
files = _context17.sent;
|
|
512
|
+
validate(function (expect) {
|
|
513
|
+
var _context16;
|
|
514
|
+
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();
|
|
515
|
+
});
|
|
516
|
+
return _context17.abrupt("return", files[0]);
|
|
517
|
+
case 6:
|
|
518
|
+
case "end":
|
|
519
|
+
return _context17.stop();
|
|
520
|
+
}
|
|
521
|
+
}, _callee2);
|
|
522
|
+
}));
|
|
523
|
+
return function (_x3) {
|
|
524
|
+
return _ref6.apply(this, arguments);
|
|
525
|
+
};
|
|
526
|
+
}()));
|
|
527
|
+
case 10:
|
|
528
|
+
_yield$Promise$all = _context24.sent;
|
|
529
|
+
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
|
|
530
|
+
esnextEntry = _yield$Promise$all2[0];
|
|
531
|
+
peerEntry = _yield$Promise$all2[1];
|
|
532
|
+
standaloneEntry = _yield$Promise$all2[2];
|
|
533
|
+
validate(function (expect) {
|
|
534
|
+
expect(resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
|
|
535
|
+
});
|
|
536
|
+
validate(function (expect) {
|
|
537
|
+
_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"]);
|
|
538
|
+
});
|
|
539
|
+
validate(function (expect) {
|
|
540
|
+
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");
|
|
541
|
+
});
|
|
542
|
+
validate(function (expect) {
|
|
543
|
+
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"));
|
|
544
|
+
});
|
|
545
|
+
validate(function (expect) {
|
|
546
|
+
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"));
|
|
547
|
+
});
|
|
548
|
+
validate(function (expect) {
|
|
549
|
+
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"));
|
|
550
|
+
});
|
|
551
|
+
validate(function (expect) {
|
|
552
|
+
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"));
|
|
553
|
+
});
|
|
554
|
+
// Note: .to.not.exist sounds great but doesn't work.
|
|
555
|
+
validate(function (expect) {
|
|
556
|
+
expect(resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
|
|
557
|
+
});
|
|
558
|
+
validate(function (expect) {
|
|
559
|
+
expect(resolve("./babel.config.js"), "There has to be a babel.config.js config file.").to.not.be.a.path;
|
|
560
|
+
});
|
|
561
|
+
banner = generateHeader(header);
|
|
562
|
+
external = {
|
|
563
|
+
// No dependencies are bundled.
|
|
564
|
+
esnext: processDependencies(_concatInstanceProperty(_context18 = []).call(_context18, _toConsumableArray(_Object$keys(dependencies)), _toConsumableArray(_Object$keys(peerDependencies)), _toConsumableArray(_Object$keys(devDependencies)))),
|
|
565
|
+
// Only dependencies that cause compatibility issues are not bundled.
|
|
566
|
+
peer: processDependencies(externalForPeerBuild),
|
|
567
|
+
// No runtime dependencies, everything's bundled.
|
|
568
|
+
standalone: []
|
|
569
|
+
};
|
|
570
|
+
commonOutput = {
|
|
571
|
+
banner: banner,
|
|
572
|
+
dir: ".",
|
|
573
|
+
globals: processGlobals(globals),
|
|
574
|
+
sourcemap: VIS_TEST ? "inline" : true
|
|
575
|
+
};
|
|
576
|
+
commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
|
|
577
|
+
format: "esm"
|
|
578
|
+
});
|
|
579
|
+
commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
|
|
580
|
+
exports: "named",
|
|
581
|
+
extend: true,
|
|
582
|
+
format: "umd",
|
|
583
|
+
name: "vis",
|
|
584
|
+
strict: false // Regenerator runtime causes issues with CSP in strict mode.
|
|
585
|
+
}); // Note: Binding more than 4 at a time is not typesafe in TS.
|
|
586
|
+
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);
|
|
587
|
+
return _context24.abrupt("return", [{
|
|
588
|
+
external: external.standalone,
|
|
589
|
+
input: standaloneEntry,
|
|
590
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
591
|
+
entryFileNames: "standalone/esm/".concat(libraryFilename, ".js")
|
|
592
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
593
|
+
entryFileNames: "standalone/umd/".concat(libraryFilename, ".js")
|
|
594
|
+
})],
|
|
595
|
+
plugins: getPlugins("standalone", {
|
|
596
|
+
injectCSS: injectCSS,
|
|
597
|
+
transpile: transpile,
|
|
598
|
+
typescript: isTS(standaloneEntry)
|
|
599
|
+
})
|
|
600
|
+
}, {
|
|
601
|
+
external: external.standalone,
|
|
602
|
+
input: standaloneEntry,
|
|
603
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
604
|
+
entryFileNames: "standalone/esm/".concat(libraryFilename, ".min.js")
|
|
605
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
606
|
+
entryFileNames: "standalone/umd/".concat(libraryFilename, ".min.js")
|
|
607
|
+
})],
|
|
608
|
+
plugins: getPlugins("standalone", {
|
|
609
|
+
injectCSS: injectCSS,
|
|
610
|
+
minimize: minimize,
|
|
611
|
+
transpile: transpile,
|
|
612
|
+
typescript: isTS(standaloneEntry)
|
|
613
|
+
})
|
|
614
|
+
}, {
|
|
615
|
+
external: external.peer,
|
|
616
|
+
input: peerEntry,
|
|
617
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
618
|
+
entryFileNames: "peer/esm/".concat(libraryFilename, ".js"),
|
|
619
|
+
paths: getPaths("peer", "esm")
|
|
620
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
621
|
+
entryFileNames: "peer/umd/".concat(libraryFilename, ".js"),
|
|
622
|
+
paths: getPaths("peer", "umd")
|
|
623
|
+
})],
|
|
624
|
+
plugins: getPlugins("peer", {
|
|
625
|
+
transpile: transpile,
|
|
626
|
+
typescript: isTS(peerEntry)
|
|
627
|
+
})
|
|
628
|
+
}, {
|
|
629
|
+
external: external.peer,
|
|
630
|
+
input: peerEntry,
|
|
631
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
632
|
+
entryFileNames: "peer/esm/".concat(libraryFilename, ".min.js"),
|
|
633
|
+
paths: getPaths("peer", "esm")
|
|
634
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
635
|
+
entryFileNames: "peer/umd/".concat(libraryFilename, ".min.js"),
|
|
636
|
+
paths: getPaths("peer", "umd")
|
|
637
|
+
})],
|
|
638
|
+
plugins: getPlugins("peer", {
|
|
639
|
+
minimize: minimize,
|
|
640
|
+
transpile: transpile,
|
|
641
|
+
typescript: isTS(peerEntry)
|
|
642
|
+
})
|
|
643
|
+
}, {
|
|
644
|
+
external: external.esnext,
|
|
645
|
+
input: esnextEntry,
|
|
646
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
647
|
+
entryFileNames: "esnext/esm/".concat(libraryFilename, ".js"),
|
|
648
|
+
paths: getPaths("esnext", "esm")
|
|
649
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
650
|
+
entryFileNames: "esnext/umd/".concat(libraryFilename, ".js"),
|
|
651
|
+
paths: getPaths("esnext", "umd")
|
|
652
|
+
})],
|
|
653
|
+
plugins: getPlugins("esnext", {
|
|
654
|
+
typescript: isTS(esnextEntry)
|
|
655
|
+
})
|
|
656
|
+
}, {
|
|
657
|
+
external: external.esnext,
|
|
658
|
+
input: esnextEntry,
|
|
659
|
+
output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
|
|
660
|
+
entryFileNames: "esnext/esm/".concat(libraryFilename, ".min.js"),
|
|
661
|
+
paths: getPaths("esnext", "esm")
|
|
662
|
+
}), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
|
|
663
|
+
entryFileNames: "esnext/umd/".concat(libraryFilename, ".min.js"),
|
|
664
|
+
paths: getPaths("esnext", "umd")
|
|
665
|
+
})],
|
|
666
|
+
plugins: getPlugins("esnext", {
|
|
667
|
+
minimize: minimize,
|
|
668
|
+
typescript: isTS(esnextEntry)
|
|
669
|
+
})
|
|
670
|
+
}]);
|
|
671
|
+
case 31:
|
|
672
|
+
case "end":
|
|
673
|
+
return _context24.stop();
|
|
674
|
+
}
|
|
675
|
+
}, _callee3);
|
|
676
|
+
}));
|
|
677
|
+
return _generateRollupConfiguration.apply(this, arguments);
|
|
658
678
|
}
|
|
659
679
|
|
|
660
680
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
661
|
-
|
|
662
681
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context8 = ownKeys(Object(source), !0)).call(_context8, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
663
682
|
setGracefulCleanup();
|
|
664
683
|
var PACK_CMD = ["npm", "pack", "--dry-run"];
|
|
@@ -666,7 +685,6 @@ var PACK_CMD = ["npm", "pack", "--dry-run"];
|
|
|
666
685
|
* @param textOrLines
|
|
667
686
|
* @param message
|
|
668
687
|
*/
|
|
669
|
-
|
|
670
688
|
function logStderr(textOrLines, message) {
|
|
671
689
|
console.group('"npm pack" output');
|
|
672
690
|
console.error(_Array$isArray(textOrLines) ? textOrLines.join("\n") : textOrLines);
|
|
@@ -676,15 +694,12 @@ function logStderr(textOrLines, message) {
|
|
|
676
694
|
/**
|
|
677
695
|
*
|
|
678
696
|
*/
|
|
679
|
-
|
|
680
|
-
|
|
681
697
|
function runNpmPack() {
|
|
682
698
|
var _context;
|
|
683
|
-
|
|
684
|
-
|
|
699
|
+
var tmpFile = fileSync().name;
|
|
700
|
+
// There are issues with incomplete output when the stderr is read directly
|
|
685
701
|
// into Node. Saving it into tmp file using shell redirection and reading it
|
|
686
702
|
// from there doesn't exhibit those issues.
|
|
687
|
-
|
|
688
703
|
execSync(_concatInstanceProperty(_context = "".concat(PACK_CMD.join(" "), " 2> ")).call(_context, tmpFile), {
|
|
689
704
|
encoding: "utf-8",
|
|
690
705
|
env: _objectSpread(_objectSpread({}, process.env), {}, {
|
|
@@ -697,19 +712,13 @@ function runNpmPack() {
|
|
|
697
712
|
/**
|
|
698
713
|
* @param lines
|
|
699
714
|
*/
|
|
700
|
-
|
|
701
|
-
|
|
702
715
|
function extractFiles(lines) {
|
|
703
716
|
var _context2, _context3, _context4, _context5, _context6;
|
|
704
|
-
|
|
705
717
|
var fileListingStart = _indexOfInstanceProperty(lines).call(lines, "npm notice === Tarball Contents === ");
|
|
706
|
-
|
|
707
718
|
var fileListingEnd = _indexOfInstanceProperty(lines).call(lines, "npm notice === Tarball Details === ");
|
|
708
|
-
|
|
709
719
|
if (fileListingStart === -1 || fileListingEnd === -1) {
|
|
710
720
|
logStderr(lines.join("\n"), 'Couldn\'t find tarball contents in "npm pack" output.');
|
|
711
721
|
}
|
|
712
|
-
|
|
713
722
|
var files = _mapInstanceProperty(_context2 = _sortInstanceProperty(_context3 = _mapInstanceProperty(_context4 = _mapInstanceProperty(_context5 = _mapInstanceProperty(_context6 = _sliceInstanceProperty(lines).call(lines, fileListingStart + 1, fileListingEnd)).call(_context6, function (line) {
|
|
714
723
|
return line.replace(/^npm notice /, "");
|
|
715
724
|
})).call(_context5, function (line) {
|
|
@@ -717,40 +726,31 @@ function extractFiles(lines) {
|
|
|
717
726
|
})).call(_context4, function (line) {
|
|
718
727
|
return line.replace(/^([^ ]+) +(.*)/, function (_, size, path) {
|
|
719
728
|
var _context7;
|
|
720
|
-
|
|
721
729
|
return _concatInstanceProperty(_context7 = "".concat(path)).call(_context7, size === "0" ? "(empty)" : " ");
|
|
722
730
|
});
|
|
723
731
|
})).call(_context3)).call(_context2, function (line) {
|
|
724
732
|
return line.replace(/^(.*)(.{7})$/, "$2 $1");
|
|
725
733
|
});
|
|
726
|
-
|
|
727
734
|
if (files.length === 0) {
|
|
728
735
|
logStderr(lines, 'No files found in "npm pack" output.');
|
|
729
736
|
}
|
|
730
|
-
|
|
731
737
|
return files;
|
|
732
738
|
}
|
|
733
739
|
/**
|
|
734
740
|
* @param lines
|
|
735
741
|
*/
|
|
736
|
-
|
|
737
|
-
|
|
738
742
|
function extractName(lines) {
|
|
739
743
|
var nameLine = _findInstanceProperty(lines).call(lines, function (line) {
|
|
740
744
|
return /^npm notice name:/.test(line);
|
|
741
745
|
});
|
|
742
|
-
|
|
743
746
|
if (nameLine == null) {
|
|
744
747
|
logStderr(lines, 'Can\'t find the name of the package in "npm pack" output.');
|
|
745
748
|
}
|
|
746
|
-
|
|
747
749
|
return nameLine.replace(/^npm notice name: */, "");
|
|
748
750
|
}
|
|
749
751
|
/**
|
|
750
752
|
*
|
|
751
753
|
*/
|
|
752
|
-
|
|
753
|
-
|
|
754
754
|
function inspectNpmPack() {
|
|
755
755
|
var lines = runNpmPack();
|
|
756
756
|
var files = extractFiles(lines);
|