vis-dev-utils 3.0.119 → 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.
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * Development utilities for the Vis family projects.
6
6
  *
7
- * @version 3.0.119
8
- * @date 2023-02-15T13:55:48.580Z
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
@@ -40,6 +40,8 @@ var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWit
40
40
  var _toConsumableArray = require('@babel/runtime-corejs3/helpers/toConsumableArray');
41
41
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
42
42
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
43
+ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/asyncToGenerator');
44
+ var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
43
45
  var _Number$MAX_SAFE_INTEGER = require('@babel/runtime-corejs3/core-js-stable/number/max-safe-integer');
44
46
  var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
45
47
  var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
@@ -52,6 +54,7 @@ var _endsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/i
52
54
  var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
53
55
  var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
54
56
  var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
57
+ var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
55
58
  var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
56
59
  var analyzerPlugin = require('rollup-plugin-analyzer');
57
60
  var babelPlugin = require('rollup-plugin-babel');
@@ -65,21 +68,38 @@ var postcssPlugin = require('rollup-plugin-postcss');
65
68
  var stripCodePlugin = require('rollup-plugin-strip-code');
66
69
  var typescriptPlugin = require('rollup-plugin-typescript2');
67
70
  var findUp = require('find-up');
68
- var fs = require('fs');
69
- var path = require('path');
71
+ var node_fs = require('node:fs');
72
+ var node_path = require('node:path');
70
73
  var rollupPluginString = require('rollup-plugin-string');
71
- var globby = require('globby');
72
74
  var rollupPluginTerser = require('rollup-plugin-terser');
73
75
  var chai = require('chai');
74
76
  var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
75
77
  var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
76
78
  var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
77
79
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
78
- var child_process = require('child_process');
80
+ var node_child_process = require('node:child_process');
79
81
  var tmpPromise = require('tmp-promise');
80
82
 
81
83
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
82
84
 
85
+ function _interopNamespace(e) {
86
+ if (e && e.__esModule) return e;
87
+ var n = Object.create(null);
88
+ if (e) {
89
+ Object.keys(e).forEach(function (k) {
90
+ if (k !== 'default') {
91
+ var d = Object.getOwnPropertyDescriptor(e, k);
92
+ Object.defineProperty(n, k, d.get ? d : {
93
+ enumerable: true,
94
+ get: function () { return e[k]; }
95
+ });
96
+ }
97
+ });
98
+ }
99
+ n["default"] = e;
100
+ return Object.freeze(n);
101
+ }
102
+
83
103
  var _Object$freeze__default = /*#__PURE__*/_interopDefaultLegacy(_Object$freeze);
84
104
  var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefaultLegacy(_Object$getOwnPropertySymbols);
85
105
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_filterInstanceProperty);
@@ -92,6 +112,8 @@ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_obje
92
112
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
93
113
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
94
114
  var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
115
+ var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
116
+ var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
95
117
  var _Number$MAX_SAFE_INTEGER__default = /*#__PURE__*/_interopDefaultLegacy(_Number$MAX_SAFE_INTEGER);
96
118
  var _includesInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_includesInstanceProperty);
97
119
  var _Array$isArray__default = /*#__PURE__*/_interopDefaultLegacy(_Array$isArray);
@@ -104,6 +126,7 @@ var _endsWithInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_end
104
126
  var _concatInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_concatInstanceProperty);
105
127
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_mapInstanceProperty);
106
128
  var _sortInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_sortInstanceProperty);
129
+ var _Promise__default = /*#__PURE__*/_interopDefaultLegacy(_Promise);
107
130
  var _bindInstanceProperty__default = /*#__PURE__*/_interopDefaultLegacy(_bindInstanceProperty);
108
131
  var analyzerPlugin__default = /*#__PURE__*/_interopDefaultLegacy(analyzerPlugin);
109
132
  var babelPlugin__default = /*#__PURE__*/_interopDefaultLegacy(babelPlugin);
@@ -154,7 +177,7 @@ function textToComment(string) {
154
177
  // Join back into a string.
155
178
  .join("\n") + "\n */\n";
156
179
  }
157
- var packageJSON = JSON.parse(fs.readFileSync(findUp.sync("package.json"), "utf8"));
180
+ var packageJSON = JSON.parse(node_fs.readFileSync(findUp.sync("package.json"), "utf8"));
158
181
  var buildHeader = function buildHeader(_ref) {
159
182
  var _context3, _context4, _context5, _context6, _context7;
160
183
  var customText = _ref.customText,
@@ -207,7 +230,8 @@ function generateHeader(options) {
207
230
  var _excluded = ["dependencies", "devDependencies", "peerDependencies"];
208
231
  var _context, _context2;
209
232
  function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
210
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var _context22, _context23; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context22 = ownKeys$1(Object(source), !0)).call(_context22, function (key) { _defineProperty__default["default"](target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context23 = ownKeys$1(Object(source))).call(_context23, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
233
+ 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__default["default"](_context25 = ownKeys$1(Object(source), !0)).call(_context25, function (key) { _defineProperty__default["default"](target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context26 = ownKeys$1(Object(source))).call(_context26, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
234
+ var rawGlobby = Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('globby')); });
211
235
  chai.config.truncateThreshold = _Number$MAX_SAFE_INTEGER__default["default"];
212
236
  chai.use(chaiFs__default["default"]);
213
237
  var VIS_DEBUG = _includesInstanceProperty__default["default"](_context = ["1", "true", "y", "yes"]).call(_context, process.env["VIS_DEBUG"] || "false");
@@ -218,13 +242,30 @@ var VIS_TEST = _includesInstanceProperty__default["default"](_context2 = ["1", "
218
242
  * @param pattern - Single glob pattern.
219
243
  * @returns Globbed paths.
220
244
  */
221
- function glob(pattern) {
222
- return globby.sync(path.sep === "\\" ? pattern.replace(/\\/g, "/") : pattern);
245
+ function glob(_x) {
246
+ return _glob.apply(this, arguments);
223
247
  }
224
248
  /**
225
249
  * These are the dependencies that follow standalone/peer/ESNext export
226
250
  * structure.
227
251
  */
252
+ function _glob() {
253
+ _glob = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(pattern) {
254
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context11) {
255
+ while (1) switch (_context11.prev = _context11.next) {
256
+ case 0:
257
+ _context11.next = 2;
258
+ return rawGlobby;
259
+ case 2:
260
+ return _context11.abrupt("return", _context11.sent.default(node_path.sep === "\\" ? pattern.replace(/\\/g, "/") : pattern));
261
+ case 3:
262
+ case "end":
263
+ return _context11.stop();
264
+ }
265
+ }, _callee);
266
+ }));
267
+ return _glob.apply(this, arguments);
268
+ }
228
269
  var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-network", "vis-timeline", "vis-util", "vis-uuid"];
229
270
  /**
230
271
  * This ensures that dependencies on Vis projects point to ESNext builds.
@@ -305,9 +346,9 @@ function scopeCopyTarget() {
305
346
  }
306
347
  return function (target) {
307
348
  var dest = _Array$isArray__default["default"](target.dest) ? target.dest : [target.dest];
308
- var bundleDest = _flatMapInstanceProperty__default["default"](dest).call(dest, function (path$1) {
349
+ var bundleDest = _flatMapInstanceProperty__default["default"](dest).call(dest, function (path) {
309
350
  return _mapInstanceProperty__default["default"](dirs).call(dirs, function (dir) {
310
- return path.join(dir, path$1);
351
+ return node_path.join(dir, path);
311
352
  });
312
353
  });
313
354
  return _objectSpread$1(_objectSpread$1({}, target), {}, {
@@ -334,7 +375,7 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
334
375
  var fullLibraryFilename = _concatInstanceProperty__default["default"](_context7 = "".concat(libraryFilename)).call(_context7, minimize ? ".min" : "");
335
376
  var bundleDir = bundleType;
336
377
  var bundleVariantDirs = _mapInstanceProperty__default["default"](_context8 = ["esm", "umd"]).call(_context8, function (variant) {
337
- return path.join(bundleDir, variant);
378
+ return node_path.join(bundleDir, variant);
338
379
  });
339
380
  return _concatInstanceProperty__default["default"](_context9 = []).call(_context9, _toConsumableArray__default["default"](strip ? [
340
381
  // This should be first because it removes code from source files.
@@ -357,11 +398,11 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
357
398
  targets: _concatInstanceProperty__default["default"](_context10 = [
358
399
  // JavaScript
359
400
  {
360
- src: path.resolve(__dirname, "assets/bundle-root.js"),
401
+ src: node_path.resolve(__dirname, "assets/bundle-root.js"),
361
402
  dest: bundleDir,
362
403
  rename: "index.js"
363
404
  }, {
364
- src: path.resolve(__dirname, "assets/bundle-index.js"),
405
+ src: node_path.resolve(__dirname, "assets/bundle-index.js"),
365
406
  dest: bundleVariantDirs,
366
407
  rename: "index.js",
367
408
  transform: function transform(content) {
@@ -370,18 +411,18 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
370
411
  },
371
412
  // TypeScript
372
413
  {
373
- src: path.resolve(__dirname, "assets/bundle-root.d.ts"),
414
+ src: node_path.resolve(__dirname, "assets/bundle-root.d.ts"),
374
415
  dest: bundleDir,
375
416
  rename: "index.d.ts"
376
417
  }, {
377
- src: path.resolve(__dirname, "assets/bundle-index.d.ts"),
418
+ src: node_path.resolve(__dirname, "assets/bundle-index.d.ts"),
378
419
  dest: bundleVariantDirs,
379
420
  rename: "index.d.ts",
380
421
  transform: function transform(content) {
381
422
  return content.toString().replace("{{filename}}", libraryFilename);
382
423
  }
383
424
  }, {
384
- src: path.resolve(__dirname, "assets/bundle-file.d.ts"),
425
+ src: node_path.resolve(__dirname, "assets/bundle-file.d.ts"),
385
426
  dest: bundleVariantDirs,
386
427
  rename: "".concat(fullLibraryFilename, ".d.ts"),
387
428
  transform: function transform(content) {
@@ -446,215 +487,262 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
446
487
  * @returns Ready to use configuration object that can be just exported from
447
488
  * `rollup.config.js` or mutated in any way if necessary.
448
489
  */
449
- function generateRollupConfiguration(options) {
450
- var _context14, _context16, _context17, _context18, _context19, _context20, _context21;
451
- var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
452
- var _ref5 = options || {},
453
- _ref5$assets = _ref5.assets,
454
- assets = _ref5$assets === void 0 ? "." : _ref5$assets,
455
- _ref5$copyTargets = _ref5.copyTargets;
456
- _ref5$copyTargets = _ref5$copyTargets === void 0 ? {} : _ref5$copyTargets;
457
- var _ref5$copyTargets$bun = _ref5$copyTargets.bundle,
458
- copyTargetsBundle = _ref5$copyTargets$bun === void 0 ? [] : _ref5$copyTargets$bun,
459
- _ref5$copyTargets$var = _ref5$copyTargets.variant,
460
- copyTargetsVariant = _ref5$copyTargets$var === void 0 ? [] : _ref5$copyTargets$var,
461
- _ref5$externalForPeer = _ref5.externalForPeerBuild,
462
- externalForPeerBuild = _ref5$externalForPeer === void 0 ? [] : _ref5$externalForPeer,
463
- _ref5$globals = _ref5.globals,
464
- globals = _ref5$globals === void 0 ? {} : _ref5$globals,
465
- _ref5$header = _ref5.header,
466
- header = _ref5$header === void 0 ? {
467
- name: "Unknown Library"
468
- } : _ref5$header,
469
- _ref5$libraryFilename = _ref5.libraryFilename,
470
- libraryFilename = _ref5$libraryFilename === void 0 ? "unknown-library" : _ref5$libraryFilename,
471
- _ref5$packageJSON = _ref5.packageJSON;
472
- _ref5$packageJSON = _ref5$packageJSON === void 0 ? {} : _ref5$packageJSON;
473
- var _ref5$packageJSON$dep = _ref5$packageJSON.dependencies,
474
- dependencies = _ref5$packageJSON$dep === void 0 ? {} : _ref5$packageJSON$dep,
475
- _ref5$packageJSON$dev = _ref5$packageJSON.devDependencies,
476
- devDependencies = _ref5$packageJSON$dev === void 0 ? {} : _ref5$packageJSON$dev,
477
- _ref5$packageJSON$pee = _ref5$packageJSON.peerDependencies,
478
- peerDependencies = _ref5$packageJSON$pee === void 0 ? {} : _ref5$packageJSON$pee,
479
- packageJSONRest = _objectWithoutProperties__default["default"](_ref5$packageJSON, _excluded),
480
- _ref5$entryPoints = _ref5.entryPoints,
481
- entryPoint = _ref5$entryPoints === void 0 ? "./src" : _ref5$entryPoints,
482
- _ref5$tsconfig = _ref5.tsconfig,
483
- 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__default["default"](peerDependencies).length > 0) {
487
- expect(_Object$keys__default["default"](dependencies), "The dependencies and peer dependencies have to be disjoint sets").to.be.an("array").that.does.not.include.any.members(_Object$keys__default["default"](peerDependencies));
488
- }
489
- });
490
- validate(function (expect) {
491
- _includesInstanceProperty__default["default"](expect(_Object$keys__default["default"](devDependencies), "For convenience all peer dependencies also have to be dev dependencies").to.be.an("array").that).all.members(_Object$keys__default["default"](peerDependencies));
492
- });
493
- validate(function (expect) {
494
- _includesInstanceProperty__default["default"](expect(_Object$keys__default["default"](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 _context11, _context12, _context13;
498
- expect(_sortInstanceProperty__default["default"](_context11 = _concatInstanceProperty__default["default"](_context12 = []).call(_context12, _toConsumableArray__default["default"](_Object$keys__default["default"](dependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](peerDependencies)))).call(_context11), "Globals have to be provided for all runtime and peer dependencies but nothing else").to.be.an("array").that.deep.equals(_sortInstanceProperty__default["default"](_context13 = _Object$keys__default["default"](globals)).call(_context13));
499
- });
500
- validate(function (expect) {
501
- expect(path.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
- var _map = _mapInstanceProperty__default["default"](_context14 = ["ESNext", "peer", "standalone"]).call(_context14, function (name) {
507
- var filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
508
- var files = glob(path.resolve(entryPoint, filenameGlob));
509
- validate(function (expect) {
510
- var _context15;
511
- expect(files, _concatInstanceProperty__default["default"](_context15 = "There has to be a single entry file (".concat(filenameGlob, ") for the ")).call(_context15, name, " build")).to.have.lengthOf(1).and.to.have.ownProperty("0").that.is.a.file();
512
- });
513
- return files[0];
514
- }),
515
- _map2 = _slicedToArray__default["default"](_map, 3),
516
- esnextEntry = _map2[0],
517
- peerEntry = _map2[1],
518
- standaloneEntry = _map2[2];
519
- validate(function (expect) {
520
- expect(path.resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
521
- });
522
- validate(function (expect) {
523
- _includesInstanceProperty__default["default"](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"]);
524
- });
525
- validate(function (expect) {
526
- 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");
527
- });
528
- validate(function (expect) {
529
- 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"));
530
- });
531
- validate(function (expect) {
532
- 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"));
533
- });
534
- validate(function (expect) {
535
- 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"));
536
- });
537
- validate(function (expect) {
538
- 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"));
539
- });
540
- // Note: .to.not.exist sounds great but doesn't work.
541
- validate(function (expect) {
542
- expect(path.resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
543
- });
544
- validate(function (expect) {
545
- expect(path.resolve("./babel.config.js"), "There has to be a babel.config.js config file.").to.not.be.a.path;
546
- });
547
- var banner = generateHeader(header);
548
- var external = {
549
- // No dependencies are bundled.
550
- esnext: processDependencies(_concatInstanceProperty__default["default"](_context16 = []).call(_context16, _toConsumableArray__default["default"](_Object$keys__default["default"](dependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](peerDependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](devDependencies)))),
551
- // Only dependencies that cause compatibility issues are not bundled.
552
- peer: processDependencies(externalForPeerBuild),
553
- // No runtime dependencies, everything's bundled.
554
- standalone: []
555
- };
556
- var commonOutput = {
557
- banner: banner,
558
- dir: ".",
559
- globals: processGlobals(globals),
560
- sourcemap: VIS_TEST ? "inline" : true
561
- };
562
- var commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
563
- format: "esm"
564
- });
565
- var commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
566
- exports: "named",
567
- extend: true,
568
- format: "umd",
569
- name: "vis",
570
- strict: false // Regenerator runtime causes issues with CSP in strict mode.
571
- });
572
- // Note: Binding more than 4 at a time is not typesafe in TS.
573
- var getPlugins = _bindInstanceProperty__default["default"](_context17 = _bindInstanceProperty__default["default"](_context18 = _bindInstanceProperty__default["default"](_context19 = _bindInstanceProperty__default["default"](_context20 = _bindInstanceProperty__default["default"](_context21 = _bindInstanceProperty__default["default"](generateRollupPluginArray).call(generateRollupPluginArray, null, libraryFilename)).call(_context21, null, assets)).call(_context20, null, copyTargetsBundle)).call(_context19, null, copyTargetsVariant)).call(_context18, null, tsconfig)).call(_context17, null, mode);
574
- return [{
575
- external: external.standalone,
576
- input: standaloneEntry,
577
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
578
- entryFileNames: "standalone/esm/".concat(libraryFilename, ".js")
579
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
580
- entryFileNames: "standalone/umd/".concat(libraryFilename, ".js")
581
- })],
582
- plugins: getPlugins("standalone", {
583
- injectCSS: injectCSS,
584
- transpile: transpile,
585
- typescript: isTS(standaloneEntry)
586
- })
587
- }, {
588
- external: external.standalone,
589
- input: standaloneEntry,
590
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
591
- entryFileNames: "standalone/esm/".concat(libraryFilename, ".min.js")
592
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
593
- entryFileNames: "standalone/umd/".concat(libraryFilename, ".min.js")
594
- })],
595
- plugins: getPlugins("standalone", {
596
- injectCSS: injectCSS,
597
- minimize: minimize,
598
- transpile: transpile,
599
- typescript: isTS(standaloneEntry)
600
- })
601
- }, {
602
- external: external.peer,
603
- input: peerEntry,
604
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
605
- entryFileNames: "peer/esm/".concat(libraryFilename, ".js"),
606
- paths: getPaths("peer", "esm")
607
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
608
- entryFileNames: "peer/umd/".concat(libraryFilename, ".js"),
609
- paths: getPaths("peer", "umd")
610
- })],
611
- plugins: getPlugins("peer", {
612
- transpile: transpile,
613
- typescript: isTS(peerEntry)
614
- })
615
- }, {
616
- external: external.peer,
617
- input: peerEntry,
618
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
619
- entryFileNames: "peer/esm/".concat(libraryFilename, ".min.js"),
620
- paths: getPaths("peer", "esm")
621
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
622
- entryFileNames: "peer/umd/".concat(libraryFilename, ".min.js"),
623
- paths: getPaths("peer", "umd")
624
- })],
625
- plugins: getPlugins("peer", {
626
- minimize: minimize,
627
- transpile: transpile,
628
- typescript: isTS(peerEntry)
629
- })
630
- }, {
631
- external: external.esnext,
632
- input: esnextEntry,
633
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
634
- entryFileNames: "esnext/esm/".concat(libraryFilename, ".js"),
635
- paths: getPaths("esnext", "esm")
636
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
637
- entryFileNames: "esnext/umd/".concat(libraryFilename, ".js"),
638
- paths: getPaths("esnext", "umd")
639
- })],
640
- plugins: getPlugins("esnext", {
641
- typescript: isTS(esnextEntry)
642
- })
643
- }, {
644
- external: external.esnext,
645
- input: esnextEntry,
646
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
647
- entryFileNames: "esnext/esm/".concat(libraryFilename, ".min.js"),
648
- paths: getPaths("esnext", "esm")
649
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
650
- entryFileNames: "esnext/umd/".concat(libraryFilename, ".min.js"),
651
- paths: getPaths("esnext", "umd")
652
- })],
653
- plugins: getPlugins("esnext", {
654
- minimize: minimize,
655
- typescript: isTS(esnextEntry)
656
- })
657
- }];
490
+ function generateRollupConfiguration(_x2) {
491
+ return _generateRollupConfiguration.apply(this, arguments);
492
+ }
493
+ function _generateRollupConfiguration() {
494
+ _generateRollupConfiguration = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(options) {
495
+ var _context15, _context18, _context19, _context20, _context21, _context22, _context23;
496
+ var mode,
497
+ _ref5,
498
+ _ref5$assets,
499
+ assets,
500
+ _ref5$copyTargets,
501
+ _ref5$copyTargets2,
502
+ _ref5$copyTargets2$bu,
503
+ copyTargetsBundle,
504
+ _ref5$copyTargets2$va,
505
+ copyTargetsVariant,
506
+ _ref5$externalForPeer,
507
+ externalForPeerBuild,
508
+ _ref5$globals,
509
+ globals,
510
+ _ref5$header,
511
+ header,
512
+ _ref5$libraryFilename,
513
+ libraryFilename,
514
+ _ref5$packageJSON,
515
+ _ref5$packageJSON2,
516
+ _ref5$packageJSON2$de,
517
+ dependencies,
518
+ _ref5$packageJSON2$de2,
519
+ devDependencies,
520
+ _ref5$packageJSON2$pe,
521
+ peerDependencies,
522
+ packageJSONRest,
523
+ _ref5$entryPoints,
524
+ entryPoint,
525
+ _ref5$tsconfig,
526
+ tsconfig,
527
+ _yield$Promise$all,
528
+ _yield$Promise$all2,
529
+ esnextEntry,
530
+ peerEntry,
531
+ standaloneEntry,
532
+ banner,
533
+ external,
534
+ commonOutput,
535
+ commonOutputESM,
536
+ commonOutputUMD,
537
+ getPlugins,
538
+ _args3 = arguments;
539
+ return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context24) {
540
+ while (1) switch (_context24.prev = _context24.next) {
541
+ case 0:
542
+ mode = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
543
+ _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 ? {
544
+ name: "Unknown Library"
545
+ } : _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__default["default"](_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;
546
+ validate(function (expect) {
547
+ // Note: Every array is a superset of empty array.
548
+ if (_Object$keys__default["default"](peerDependencies).length > 0) {
549
+ expect(_Object$keys__default["default"](dependencies), "The dependencies and peer dependencies have to be disjoint sets").to.be.an("array").that.does.not.include.any.members(_Object$keys__default["default"](peerDependencies));
550
+ }
551
+ });
552
+ validate(function (expect) {
553
+ _includesInstanceProperty__default["default"](expect(_Object$keys__default["default"](devDependencies), "For convenience all peer dependencies also have to be dev dependencies").to.be.an("array").that).all.members(_Object$keys__default["default"](peerDependencies));
554
+ });
555
+ validate(function (expect) {
556
+ _includesInstanceProperty__default["default"](expect(_Object$keys__default["default"](peerDependencies), "Peer build externals have to be a subset of peer dependencies").to.be.an("array").that).all.members(externalForPeerBuild);
557
+ });
558
+ validate(function (expect) {
559
+ var _context12, _context13, _context14;
560
+ expect(_sortInstanceProperty__default["default"](_context12 = _concatInstanceProperty__default["default"](_context13 = []).call(_context13, _toConsumableArray__default["default"](_Object$keys__default["default"](dependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](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__default["default"](_context14 = _Object$keys__default["default"](globals)).call(_context14));
561
+ });
562
+ validate(function (expect) {
563
+ expect(node_path.resolve(assets), "Assets have to be a directory").to.be.a("string").and.a.directory();
564
+ });
565
+ validate(function (expect) {
566
+ expect(entryPoint, "The entry point has to be directory").to.be.a("string").and.a.directory();
567
+ });
568
+ _context24.next = 10;
569
+ return _Promise__default["default"].all(_mapInstanceProperty__default["default"](_context15 = ["ESNext", "peer", "standalone"]).call(_context15, /*#__PURE__*/function () {
570
+ var _ref6 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(name) {
571
+ var filenameGlob, files;
572
+ return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context17) {
573
+ while (1) switch (_context17.prev = _context17.next) {
574
+ case 0:
575
+ filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
576
+ _context17.next = 3;
577
+ return glob(node_path.resolve(entryPoint, filenameGlob));
578
+ case 3:
579
+ files = _context17.sent;
580
+ validate(function (expect) {
581
+ var _context16;
582
+ expect(files, _concatInstanceProperty__default["default"](_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();
583
+ });
584
+ return _context17.abrupt("return", files[0]);
585
+ case 6:
586
+ case "end":
587
+ return _context17.stop();
588
+ }
589
+ }, _callee2);
590
+ }));
591
+ return function (_x3) {
592
+ return _ref6.apply(this, arguments);
593
+ };
594
+ }()));
595
+ case 10:
596
+ _yield$Promise$all = _context24.sent;
597
+ _yield$Promise$all2 = _slicedToArray__default["default"](_yield$Promise$all, 3);
598
+ esnextEntry = _yield$Promise$all2[0];
599
+ peerEntry = _yield$Promise$all2[1];
600
+ standaloneEntry = _yield$Promise$all2[2];
601
+ validate(function (expect) {
602
+ expect(node_path.resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
603
+ });
604
+ validate(function (expect) {
605
+ _includesInstanceProperty__default["default"](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"]);
606
+ });
607
+ validate(function (expect) {
608
+ 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");
609
+ });
610
+ validate(function (expect) {
611
+ 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"));
612
+ });
613
+ validate(function (expect) {
614
+ 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"));
615
+ });
616
+ validate(function (expect) {
617
+ 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"));
618
+ });
619
+ validate(function (expect) {
620
+ 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"));
621
+ });
622
+ // Note: .to.not.exist sounds great but doesn't work.
623
+ validate(function (expect) {
624
+ expect(node_path.resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
625
+ });
626
+ validate(function (expect) {
627
+ expect(node_path.resolve("./babel.config.js"), "There has to be a babel.config.js config file.").to.not.be.a.path;
628
+ });
629
+ banner = generateHeader(header);
630
+ external = {
631
+ // No dependencies are bundled.
632
+ esnext: processDependencies(_concatInstanceProperty__default["default"](_context18 = []).call(_context18, _toConsumableArray__default["default"](_Object$keys__default["default"](dependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](peerDependencies)), _toConsumableArray__default["default"](_Object$keys__default["default"](devDependencies)))),
633
+ // Only dependencies that cause compatibility issues are not bundled.
634
+ peer: processDependencies(externalForPeerBuild),
635
+ // No runtime dependencies, everything's bundled.
636
+ standalone: []
637
+ };
638
+ commonOutput = {
639
+ banner: banner,
640
+ dir: ".",
641
+ globals: processGlobals(globals),
642
+ sourcemap: VIS_TEST ? "inline" : true
643
+ };
644
+ commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
645
+ format: "esm"
646
+ });
647
+ commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
648
+ exports: "named",
649
+ extend: true,
650
+ format: "umd",
651
+ name: "vis",
652
+ strict: false // Regenerator runtime causes issues with CSP in strict mode.
653
+ }); // Note: Binding more than 4 at a time is not typesafe in TS.
654
+ getPlugins = _bindInstanceProperty__default["default"](_context19 = _bindInstanceProperty__default["default"](_context20 = _bindInstanceProperty__default["default"](_context21 = _bindInstanceProperty__default["default"](_context22 = _bindInstanceProperty__default["default"](_context23 = _bindInstanceProperty__default["default"](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);
655
+ return _context24.abrupt("return", [{
656
+ external: external.standalone,
657
+ input: standaloneEntry,
658
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
659
+ entryFileNames: "standalone/esm/".concat(libraryFilename, ".js")
660
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
661
+ entryFileNames: "standalone/umd/".concat(libraryFilename, ".js")
662
+ })],
663
+ plugins: getPlugins("standalone", {
664
+ injectCSS: injectCSS,
665
+ transpile: transpile,
666
+ typescript: isTS(standaloneEntry)
667
+ })
668
+ }, {
669
+ external: external.standalone,
670
+ input: standaloneEntry,
671
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
672
+ entryFileNames: "standalone/esm/".concat(libraryFilename, ".min.js")
673
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
674
+ entryFileNames: "standalone/umd/".concat(libraryFilename, ".min.js")
675
+ })],
676
+ plugins: getPlugins("standalone", {
677
+ injectCSS: injectCSS,
678
+ minimize: minimize,
679
+ transpile: transpile,
680
+ typescript: isTS(standaloneEntry)
681
+ })
682
+ }, {
683
+ external: external.peer,
684
+ input: peerEntry,
685
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
686
+ entryFileNames: "peer/esm/".concat(libraryFilename, ".js"),
687
+ paths: getPaths("peer", "esm")
688
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
689
+ entryFileNames: "peer/umd/".concat(libraryFilename, ".js"),
690
+ paths: getPaths("peer", "umd")
691
+ })],
692
+ plugins: getPlugins("peer", {
693
+ transpile: transpile,
694
+ typescript: isTS(peerEntry)
695
+ })
696
+ }, {
697
+ external: external.peer,
698
+ input: peerEntry,
699
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
700
+ entryFileNames: "peer/esm/".concat(libraryFilename, ".min.js"),
701
+ paths: getPaths("peer", "esm")
702
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
703
+ entryFileNames: "peer/umd/".concat(libraryFilename, ".min.js"),
704
+ paths: getPaths("peer", "umd")
705
+ })],
706
+ plugins: getPlugins("peer", {
707
+ minimize: minimize,
708
+ transpile: transpile,
709
+ typescript: isTS(peerEntry)
710
+ })
711
+ }, {
712
+ external: external.esnext,
713
+ input: esnextEntry,
714
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
715
+ entryFileNames: "esnext/esm/".concat(libraryFilename, ".js"),
716
+ paths: getPaths("esnext", "esm")
717
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
718
+ entryFileNames: "esnext/umd/".concat(libraryFilename, ".js"),
719
+ paths: getPaths("esnext", "umd")
720
+ })],
721
+ plugins: getPlugins("esnext", {
722
+ typescript: isTS(esnextEntry)
723
+ })
724
+ }, {
725
+ external: external.esnext,
726
+ input: esnextEntry,
727
+ output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
728
+ entryFileNames: "esnext/esm/".concat(libraryFilename, ".min.js"),
729
+ paths: getPaths("esnext", "esm")
730
+ }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
731
+ entryFileNames: "esnext/umd/".concat(libraryFilename, ".min.js"),
732
+ paths: getPaths("esnext", "umd")
733
+ })],
734
+ plugins: getPlugins("esnext", {
735
+ minimize: minimize,
736
+ typescript: isTS(esnextEntry)
737
+ })
738
+ }]);
739
+ case 31:
740
+ case "end":
741
+ return _context24.stop();
742
+ }
743
+ }, _callee3);
744
+ }));
745
+ return _generateRollupConfiguration.apply(this, arguments);
658
746
  }
659
747
 
660
748
  function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -680,13 +768,13 @@ function runNpmPack() {
680
768
  // There are issues with incomplete output when the stderr is read directly
681
769
  // into Node. Saving it into tmp file using shell redirection and reading it
682
770
  // from there doesn't exhibit those issues.
683
- child_process.execSync(_concatInstanceProperty__default["default"](_context = "".concat(PACK_CMD.join(" "), " 2> ")).call(_context, tmpFile), {
771
+ node_child_process.execSync(_concatInstanceProperty__default["default"](_context = "".concat(PACK_CMD.join(" "), " 2> ")).call(_context, tmpFile), {
684
772
  encoding: "utf-8",
685
773
  env: _objectSpread(_objectSpread({}, process.env), {}, {
686
774
  LC_ALL: "C"
687
775
  })
688
776
  });
689
- var lines = fs.readFileSync(tmpFile, "utf-8").split(/[\r\n]+/);
777
+ var lines = node_fs.readFileSync(tmpFile, "utf-8").split(/[\r\n]+/);
690
778
  return lines;
691
779
  }
692
780
  /**