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
@@ -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[\\/])/);
@@ -160,7 +162,8 @@ function generateHeader(options) {
160
162
  var _excluded = ["dependencies", "devDependencies", "peerDependencies"];
161
163
  var _context, _context2;
162
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; }
163
- 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(_context22 = ownKeys$1(Object(source), !0)).call(_context22, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context23 = ownKeys$1(Object(source))).call(_context23, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
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');
164
167
  config.truncateThreshold = _Number$MAX_SAFE_INTEGER;
165
168
  use(chaiFs);
166
169
  var VIS_DEBUG = _includesInstanceProperty(_context = ["1", "true", "y", "yes"]).call(_context, process.env["VIS_DEBUG"] || "false");
@@ -171,13 +174,30 @@ var VIS_TEST = _includesInstanceProperty(_context2 = ["1", "true", "y", "yes"]).
171
174
  * @param pattern - Single glob pattern.
172
175
  * @returns Globbed paths.
173
176
  */
174
- function glob(pattern) {
175
- return sync$1(sep === "\\" ? pattern.replace(/\\/g, "/") : pattern);
177
+ function glob(_x) {
178
+ return _glob.apply(this, arguments);
176
179
  }
177
180
  /**
178
181
  * These are the dependencies that follow standalone/peer/ESNext export
179
182
  * structure.
180
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
+ }
181
201
  var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-network", "vis-timeline", "vis-util", "vis-uuid"];
182
202
  /**
183
203
  * This ensures that dependencies on Vis projects point to ESNext builds.
@@ -399,215 +419,262 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
399
419
  * @returns Ready to use configuration object that can be just exported from
400
420
  * `rollup.config.js` or mutated in any way if necessary.
401
421
  */
402
- function generateRollupConfiguration(options) {
403
- var _context14, _context16, _context17, _context18, _context19, _context20, _context21;
404
- var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
405
- var _ref5 = options || {},
406
- _ref5$assets = _ref5.assets,
407
- assets = _ref5$assets === void 0 ? "." : _ref5$assets,
408
- _ref5$copyTargets = _ref5.copyTargets;
409
- _ref5$copyTargets = _ref5$copyTargets === void 0 ? {} : _ref5$copyTargets;
410
- var _ref5$copyTargets$bun = _ref5$copyTargets.bundle,
411
- copyTargetsBundle = _ref5$copyTargets$bun === void 0 ? [] : _ref5$copyTargets$bun,
412
- _ref5$copyTargets$var = _ref5$copyTargets.variant,
413
- copyTargetsVariant = _ref5$copyTargets$var === void 0 ? [] : _ref5$copyTargets$var,
414
- _ref5$externalForPeer = _ref5.externalForPeerBuild,
415
- externalForPeerBuild = _ref5$externalForPeer === void 0 ? [] : _ref5$externalForPeer,
416
- _ref5$globals = _ref5.globals,
417
- globals = _ref5$globals === void 0 ? {} : _ref5$globals,
418
- _ref5$header = _ref5.header,
419
- header = _ref5$header === void 0 ? {
420
- name: "Unknown Library"
421
- } : _ref5$header,
422
- _ref5$libraryFilename = _ref5.libraryFilename,
423
- libraryFilename = _ref5$libraryFilename === void 0 ? "unknown-library" : _ref5$libraryFilename,
424
- _ref5$packageJSON = _ref5.packageJSON;
425
- _ref5$packageJSON = _ref5$packageJSON === void 0 ? {} : _ref5$packageJSON;
426
- var _ref5$packageJSON$dep = _ref5$packageJSON.dependencies,
427
- dependencies = _ref5$packageJSON$dep === void 0 ? {} : _ref5$packageJSON$dep,
428
- _ref5$packageJSON$dev = _ref5$packageJSON.devDependencies,
429
- devDependencies = _ref5$packageJSON$dev === void 0 ? {} : _ref5$packageJSON$dev,
430
- _ref5$packageJSON$pee = _ref5$packageJSON.peerDependencies,
431
- peerDependencies = _ref5$packageJSON$pee === void 0 ? {} : _ref5$packageJSON$pee,
432
- packageJSONRest = _objectWithoutProperties(_ref5$packageJSON, _excluded),
433
- _ref5$entryPoints = _ref5.entryPoints,
434
- entryPoint = _ref5$entryPoints === void 0 ? "./src" : _ref5$entryPoints,
435
- _ref5$tsconfig = _ref5.tsconfig,
436
- tsconfig = _ref5$tsconfig === void 0 ? "tsconfig.json" : _ref5$tsconfig;
437
- validate(function (expect) {
438
- // Note: Every array is a superset of empty array.
439
- if (_Object$keys(peerDependencies).length > 0) {
440
- 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));
441
- }
442
- });
443
- validate(function (expect) {
444
- _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));
445
- });
446
- validate(function (expect) {
447
- _includesInstanceProperty(expect(_Object$keys(peerDependencies), "Peer build externals have to be a subset of peer dependencies").to.be.an("array").that).all.members(externalForPeerBuild);
448
- });
449
- validate(function (expect) {
450
- var _context11, _context12, _context13;
451
- expect(_sortInstanceProperty(_context11 = _concatInstanceProperty(_context12 = []).call(_context12, _toConsumableArray(_Object$keys(dependencies)), _toConsumableArray(_Object$keys(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(_context13 = _Object$keys(globals)).call(_context13));
452
- });
453
- validate(function (expect) {
454
- expect(resolve(assets), "Assets have to be a directory").to.be.a("string").and.a.directory();
455
- });
456
- validate(function (expect) {
457
- expect(entryPoint, "The entry point has to be directory").to.be.a("string").and.a.directory();
458
- });
459
- var _map = _mapInstanceProperty(_context14 = ["ESNext", "peer", "standalone"]).call(_context14, function (name) {
460
- var filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
461
- var files = glob(resolve(entryPoint, filenameGlob));
462
- validate(function (expect) {
463
- var _context15;
464
- expect(files, _concatInstanceProperty(_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();
465
- });
466
- return files[0];
467
- }),
468
- _map2 = _slicedToArray(_map, 3),
469
- esnextEntry = _map2[0],
470
- peerEntry = _map2[1],
471
- standaloneEntry = _map2[2];
472
- validate(function (expect) {
473
- expect(resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
474
- });
475
- validate(function (expect) {
476
- _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"]);
477
- });
478
- validate(function (expect) {
479
- 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");
480
- });
481
- validate(function (expect) {
482
- 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"));
483
- });
484
- validate(function (expect) {
485
- 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"));
486
- });
487
- validate(function (expect) {
488
- 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"));
489
- });
490
- validate(function (expect) {
491
- 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"));
492
- });
493
- // Note: .to.not.exist sounds great but doesn't work.
494
- validate(function (expect) {
495
- expect(resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
496
- });
497
- validate(function (expect) {
498
- expect(resolve("./babel.config.js"), "There has to be a babel.config.js config file.").to.not.be.a.path;
499
- });
500
- var banner = generateHeader(header);
501
- var external = {
502
- // No dependencies are bundled.
503
- esnext: processDependencies(_concatInstanceProperty(_context16 = []).call(_context16, _toConsumableArray(_Object$keys(dependencies)), _toConsumableArray(_Object$keys(peerDependencies)), _toConsumableArray(_Object$keys(devDependencies)))),
504
- // Only dependencies that cause compatibility issues are not bundled.
505
- peer: processDependencies(externalForPeerBuild),
506
- // No runtime dependencies, everything's bundled.
507
- standalone: []
508
- };
509
- var commonOutput = {
510
- banner: banner,
511
- dir: ".",
512
- globals: processGlobals(globals),
513
- sourcemap: VIS_TEST ? "inline" : true
514
- };
515
- var commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
516
- format: "esm"
517
- });
518
- var commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
519
- exports: "named",
520
- extend: true,
521
- format: "umd",
522
- name: "vis",
523
- strict: false // Regenerator runtime causes issues with CSP in strict mode.
524
- });
525
- // Note: Binding more than 4 at a time is not typesafe in TS.
526
- var getPlugins = _bindInstanceProperty(_context17 = _bindInstanceProperty(_context18 = _bindInstanceProperty(_context19 = _bindInstanceProperty(_context20 = _bindInstanceProperty(_context21 = _bindInstanceProperty(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);
527
- return [{
528
- external: external.standalone,
529
- input: standaloneEntry,
530
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
531
- entryFileNames: "standalone/esm/".concat(libraryFilename, ".js")
532
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
533
- entryFileNames: "standalone/umd/".concat(libraryFilename, ".js")
534
- })],
535
- plugins: getPlugins("standalone", {
536
- injectCSS: injectCSS,
537
- transpile: transpile,
538
- typescript: isTS(standaloneEntry)
539
- })
540
- }, {
541
- external: external.standalone,
542
- input: standaloneEntry,
543
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
544
- entryFileNames: "standalone/esm/".concat(libraryFilename, ".min.js")
545
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
546
- entryFileNames: "standalone/umd/".concat(libraryFilename, ".min.js")
547
- })],
548
- plugins: getPlugins("standalone", {
549
- injectCSS: injectCSS,
550
- minimize: minimize,
551
- transpile: transpile,
552
- typescript: isTS(standaloneEntry)
553
- })
554
- }, {
555
- external: external.peer,
556
- input: peerEntry,
557
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
558
- entryFileNames: "peer/esm/".concat(libraryFilename, ".js"),
559
- paths: getPaths("peer", "esm")
560
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
561
- entryFileNames: "peer/umd/".concat(libraryFilename, ".js"),
562
- paths: getPaths("peer", "umd")
563
- })],
564
- plugins: getPlugins("peer", {
565
- transpile: transpile,
566
- typescript: isTS(peerEntry)
567
- })
568
- }, {
569
- external: external.peer,
570
- input: peerEntry,
571
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
572
- entryFileNames: "peer/esm/".concat(libraryFilename, ".min.js"),
573
- paths: getPaths("peer", "esm")
574
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
575
- entryFileNames: "peer/umd/".concat(libraryFilename, ".min.js"),
576
- paths: getPaths("peer", "umd")
577
- })],
578
- plugins: getPlugins("peer", {
579
- minimize: minimize,
580
- transpile: transpile,
581
- typescript: isTS(peerEntry)
582
- })
583
- }, {
584
- external: external.esnext,
585
- input: esnextEntry,
586
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
587
- entryFileNames: "esnext/esm/".concat(libraryFilename, ".js"),
588
- paths: getPaths("esnext", "esm")
589
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
590
- entryFileNames: "esnext/umd/".concat(libraryFilename, ".js"),
591
- paths: getPaths("esnext", "umd")
592
- })],
593
- plugins: getPlugins("esnext", {
594
- typescript: isTS(esnextEntry)
595
- })
596
- }, {
597
- external: external.esnext,
598
- input: esnextEntry,
599
- output: [_objectSpread$1(_objectSpread$1({}, commonOutputESM), {}, {
600
- entryFileNames: "esnext/esm/".concat(libraryFilename, ".min.js"),
601
- paths: getPaths("esnext", "esm")
602
- }), _objectSpread$1(_objectSpread$1({}, commonOutputUMD), {}, {
603
- entryFileNames: "esnext/umd/".concat(libraryFilename, ".min.js"),
604
- paths: getPaths("esnext", "umd")
605
- })],
606
- plugins: getPlugins("esnext", {
607
- minimize: minimize,
608
- typescript: isTS(esnextEntry)
609
- })
610
- }];
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);
611
678
  }
612
679
 
613
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; }