vis-dev-utils 3.0.117 → 3.0.119

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.117
8
- * @date 2022-08-03T22:21:57.208Z
7
+ * @version 3.0.119
8
+ * @date 2023-02-15T13:55:48.580Z
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
@@ -131,40 +131,40 @@ var BABEL_IGNORE_RE = _Object$freeze__default["default"](/[\\/]node_modules[\\/]
131
131
  * @returns A block doc comment string that can be for example prepended to a
132
132
  * bundled JavaScript file.
133
133
  */
134
-
135
134
  function textToComment(string) {
136
135
  var _context, _context2;
137
-
138
136
  if (_includesInstanceProperty__default["default"](string).call(string, "*/")) {
139
137
  throw new Error("Don't include comments in the input string. It will be converted automatically.");
140
138
  }
141
-
142
- return "/**\n" + _mapInstanceProperty__default["default"](_context = _mapInstanceProperty__default["default"](_context2 = string // Remove empty lines from the start.
143
- .replace(/^[\n\r]*/, "") // Remove empty lines from the end.
144
- .replace(/[\n\r\s]*$/, "") // Process each line on it's own from now on.
145
- .split("\n") // Prefix each line with an asterisk.
139
+ return "/**\n" + _mapInstanceProperty__default["default"](_context = _mapInstanceProperty__default["default"](_context2 = string
140
+ // Remove empty lines from the start.
141
+ .replace(/^[\n\r]*/, "")
142
+ // Remove empty lines from the end.
143
+ .replace(/[\n\r\s]*$/, "")
144
+ // Process each line on it's own from now on.
145
+ .split("\n")
146
+ // Prefix each line with an asterisk.
146
147
  ).call(_context2, function (line) {
147
148
  return " * " + line;
148
- }) // Remove trailing white space.
149
+ })
150
+ // Remove trailing white space.
149
151
  ).call(_context, function (line) {
150
152
  return line.replace(/[^\S\r\n]*$/, "");
151
- }) // Join back into a string.
153
+ })
154
+ // Join back into a string.
152
155
  .join("\n") + "\n */\n";
153
156
  }
154
157
  var packageJSON = JSON.parse(fs.readFileSync(findUp.sync("package.json"), "utf8"));
155
-
156
158
  var buildHeader = function buildHeader(_ref) {
157
159
  var _context3, _context4, _context5, _context6, _context7;
158
-
159
160
  var customText = _ref.customText,
160
- date = _ref.date,
161
- description = _ref.description,
162
- homepage = _ref.homepage,
163
- name = _ref.name,
164
- version = _ref.version;
161
+ date = _ref.date,
162
+ description = _ref.description,
163
+ homepage = _ref.homepage,
164
+ name = _ref.name,
165
+ version = _ref.version;
165
166
  return textToComment(_concatInstanceProperty__default["default"](_context3 = _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_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"));
166
167
  };
167
-
168
168
  var defaultDate = new Date().toISOString();
169
169
  var defaultDescription = packageJSON.description;
170
170
  var defaultHomepage = packageJSON.homepage;
@@ -180,22 +180,20 @@ var defaultVersion = packageJSON.version;
180
180
  * @throws If the string already contains a comment.
181
181
  * @returns Ready to use banner text.
182
182
  */
183
-
184
183
  function generateHeader(options) {
185
184
  var _ref2 = options || {},
186
- _ref2$customText = _ref2.customText,
187
- customText = _ref2$customText === void 0 ? "" : _ref2$customText,
188
- _ref2$date = _ref2.date,
189
- date = _ref2$date === void 0 ? defaultDate : _ref2$date,
190
- _ref2$description = _ref2.description,
191
- description = _ref2$description === void 0 ? defaultDescription : _ref2$description,
192
- _ref2$homepage = _ref2.homepage,
193
- homepage = _ref2$homepage === void 0 ? defaultHomepage : _ref2$homepage,
194
- _ref2$name = _ref2.name,
195
- name = _ref2$name === void 0 ? defaultName : _ref2$name,
196
- _ref2$version = _ref2.version,
197
- version = _ref2$version === void 0 ? defaultVersion : _ref2$version;
198
-
185
+ _ref2$customText = _ref2.customText,
186
+ customText = _ref2$customText === void 0 ? "" : _ref2$customText,
187
+ _ref2$date = _ref2.date,
188
+ date = _ref2$date === void 0 ? defaultDate : _ref2$date,
189
+ _ref2$description = _ref2.description,
190
+ description = _ref2$description === void 0 ? defaultDescription : _ref2$description,
191
+ _ref2$homepage = _ref2.homepage,
192
+ homepage = _ref2$homepage === void 0 ? defaultHomepage : _ref2$homepage,
193
+ _ref2$name = _ref2.name,
194
+ name = _ref2$name === void 0 ? defaultName : _ref2$name,
195
+ _ref2$version = _ref2.version,
196
+ version = _ref2$version === void 0 ? defaultVersion : _ref2$version;
199
197
  return buildHeader({
200
198
  customText: customText,
201
199
  date: date,
@@ -207,17 +205,12 @@ function generateHeader(options) {
207
205
  }
208
206
 
209
207
  var _excluded = ["dependencies", "devDependencies", "peerDependencies"];
210
-
211
208
  var _context, _context2;
212
-
213
209
  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; }
214
-
215
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; }
216
211
  chai.config.truncateThreshold = _Number$MAX_SAFE_INTEGER__default["default"];
217
212
  chai.use(chaiFs__default["default"]);
218
-
219
213
  var VIS_DEBUG = _includesInstanceProperty__default["default"](_context = ["1", "true", "y", "yes"]).call(_context, process.env["VIS_DEBUG"] || "false");
220
-
221
214
  var VIS_TEST = _includesInstanceProperty__default["default"](_context2 = ["1", "true", "y", "yes"]).call(_context2, process.env["VIS_TEST"] || "false");
222
215
  /**
223
216
  * Simple glob with workaround for non-posix paths.
@@ -225,8 +218,6 @@ var VIS_TEST = _includesInstanceProperty__default["default"](_context2 = ["1", "
225
218
  * @param pattern - Single glob pattern.
226
219
  * @returns Globbed paths.
227
220
  */
228
-
229
-
230
221
  function glob(pattern) {
231
222
  return globby.sync(path.sep === "\\" ? pattern.replace(/\\/g, "/") : pattern);
232
223
  }
@@ -234,8 +225,6 @@ function glob(pattern) {
234
225
  * These are the dependencies that follow standalone/peer/ESNext export
235
226
  * structure.
236
227
  */
237
-
238
-
239
228
  var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-network", "vis-timeline", "vis-util", "vis-uuid"];
240
229
  /**
241
230
  * This ensures that dependencies on Vis projects point to ESNext builds.
@@ -243,7 +232,6 @@ var dependenciesWithVisExportStructure = ["vis-data", "vis-graph3d", "vis-networ
243
232
  * @param deps - The original dependencies as listed in package.json.
244
233
  * @returns An array of dependencies for Rollup.
245
234
  */
246
-
247
235
  function processDependencies(deps) {
248
236
  var depNames = _Array$isArray__default["default"](deps) ? deps : _Object$keys__default["default"](deps);
249
237
  return _flatMapInstanceProperty__default["default"](depNames).call(depNames, function (key) {
@@ -258,16 +246,12 @@ function processDependencies(deps) {
258
246
  * @param globals - The original globals.
259
247
  * @returns Globals forcing the use of ESNext builds for Vis projects.
260
248
  */
261
-
262
-
263
249
  function processGlobals(globals) {
264
250
  var _context3;
265
-
266
251
  return _reduceInstanceProperty__default["default"](_context3 = _Object$entries__default["default"](globals)).call(_context3, function (acc, _ref) {
267
252
  var _ref2 = _slicedToArray__default["default"](_ref, 2),
268
- key = _ref2[0],
269
- value = _ref2[1];
270
-
253
+ key = _ref2[0],
254
+ value = _ref2[1];
271
255
  acc[_includesInstanceProperty__default["default"](dependenciesWithVisExportStructure).call(dependenciesWithVisExportStructure, key) ? key + "/esnext" : key] = value;
272
256
  return acc;
273
257
  }, _Object$create__default["default"](null));
@@ -275,8 +259,6 @@ function processGlobals(globals) {
275
259
  /**
276
260
  * @param path
277
261
  */
278
-
279
-
280
262
  function isTS(path) {
281
263
  return _endsWithInstanceProperty__default["default"](path).call(path, ".ts");
282
264
  }
@@ -284,8 +266,6 @@ function isTS(path) {
284
266
  * Make sure that Chai doesn't throw and therefore stop execution on failed
285
267
  * validations during debugging.
286
268
  */
287
-
288
-
289
269
  var validate = VIS_DEBUG ? function (callback) {
290
270
  try {
291
271
  callback(chai.expect);
@@ -303,17 +283,14 @@ var validate = VIS_DEBUG ? function (callback) {
303
283
  * @param moduleFormat - What kind of module system to use.
304
284
  * @returns Path overrides for Rollup.
305
285
  */
306
-
307
286
  function getPaths(buildVariant, moduleFormat) {
308
287
  /**
309
288
  * @param lib
310
289
  */
311
290
  function getPath(lib) {
312
291
  var _context4, _context5, _context6;
313
-
314
292
  return _defineProperty__default["default"]({}, "vis-".concat(lib, "/esnext"), _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = _concatInstanceProperty__default["default"](_context6 = "vis-".concat(lib, "/")).call(_context6, buildVariant, "/")).call(_context5, moduleFormat, "/vis-")).call(_context4, lib, ".js"));
315
293
  }
316
-
317
294
  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"));
318
295
  }
319
296
  /**
@@ -322,62 +299,52 @@ function getPaths(buildVariant, moduleFormat) {
322
299
  * @param dirs - The directories there targets should be relative to.
323
300
  * @returns A function that can be directly supplied to Array.map().
324
301
  */
325
-
326
-
327
302
  function scopeCopyTarget() {
328
303
  for (var _len = arguments.length, dirs = new Array(_len), _key = 0; _key < _len; _key++) {
329
304
  dirs[_key] = arguments[_key];
330
305
  }
331
-
332
306
  return function (target) {
333
307
  var dest = _Array$isArray__default["default"](target.dest) ? target.dest : [target.dest];
334
-
335
308
  var bundleDest = _flatMapInstanceProperty__default["default"](dest).call(dest, function (path$1) {
336
309
  return _mapInstanceProperty__default["default"](dirs).call(dirs, function (dir) {
337
310
  return path.join(dir, path$1);
338
311
  });
339
312
  });
340
-
341
313
  return _objectSpread$1(_objectSpread$1({}, target), {}, {
342
314
  dest: bundleDest
343
315
  });
344
316
  };
345
317
  }
346
-
347
318
  var injectCSS = true;
348
319
  var minimize = true;
349
320
  var transpile = true;
350
-
351
321
  var generateRollupPluginArray = function generateRollupPluginArray(libraryFilename, assets, copyTargetsBundle, copyTargetsVariant, tsconfig, mode, bundleType) {
352
322
  var _context7, _context8, _context9, _context10;
353
-
354
323
  var _ref4 = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {},
355
- _ref4$injectCSS = _ref4.injectCSS,
356
- injectCSS = _ref4$injectCSS === void 0 ? false : _ref4$injectCSS,
357
- _ref4$minimize = _ref4.minimize,
358
- minimize = _ref4$minimize === void 0 ? false : _ref4$minimize,
359
- _ref4$strip = _ref4.strip,
360
- strip = _ref4$strip === void 0 ? mode === "production" : _ref4$strip,
361
- _ref4$transpile = _ref4.transpile,
362
- transpile = _ref4$transpile === void 0 ? false : _ref4$transpile,
363
- _ref4$typescript = _ref4.typescript,
364
- typescript = _ref4$typescript === void 0 ? false : _ref4$typescript;
365
-
324
+ _ref4$injectCSS = _ref4.injectCSS,
325
+ injectCSS = _ref4$injectCSS === void 0 ? false : _ref4$injectCSS,
326
+ _ref4$minimize = _ref4.minimize,
327
+ minimize = _ref4$minimize === void 0 ? false : _ref4$minimize,
328
+ _ref4$strip = _ref4.strip,
329
+ strip = _ref4$strip === void 0 ? mode === "production" : _ref4$strip,
330
+ _ref4$transpile = _ref4.transpile,
331
+ transpile = _ref4$transpile === void 0 ? false : _ref4$transpile,
332
+ _ref4$typescript = _ref4.typescript,
333
+ typescript = _ref4$typescript === void 0 ? false : _ref4$typescript;
366
334
  var fullLibraryFilename = _concatInstanceProperty__default["default"](_context7 = "".concat(libraryFilename)).call(_context7, minimize ? ".min" : "");
367
-
368
335
  var bundleDir = bundleType;
369
-
370
336
  var bundleVariantDirs = _mapInstanceProperty__default["default"](_context8 = ["esm", "umd"]).call(_context8, function (variant) {
371
337
  return path.join(bundleDir, variant);
372
338
  });
373
-
374
- return _concatInstanceProperty__default["default"](_context9 = []).call(_context9, _toConsumableArray__default["default"](strip ? [// This should be first because it removes code from source files.
339
+ return _concatInstanceProperty__default["default"](_context9 = []).call(_context9, _toConsumableArray__default["default"](strip ? [
340
+ // This should be first because it removes code from source files.
375
341
  // It's much easier to follow if the removal happens before any
376
342
  // transformations.
377
343
  stripCodePlugin__default["default"]({
378
344
  start_comment: "develblock:start",
379
345
  end_comment: "develblock:end"
380
- })] : [// Remove the comments marking devel blocks as they can cause problems
346
+ })] : [
347
+ // Remove the comments marking devel blocks as they can cause problems
381
348
  // later on because transpilation shuffles things around which may
382
349
  // lead to all kinds of issues including syntax errors.
383
350
  stripCodePlugin__default["default"]({
@@ -387,7 +354,8 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
387
354
  summaryOnly: true
388
355
  }), copyPlugin__default["default"]({
389
356
  verbose: VIS_DEBUG,
390
- targets: _concatInstanceProperty__default["default"](_context10 = [// JavaScript
357
+ targets: _concatInstanceProperty__default["default"](_context10 = [
358
+ // JavaScript
391
359
  {
392
360
  src: path.resolve(__dirname, "assets/bundle-root.js"),
393
361
  dest: bundleDir,
@@ -399,7 +367,8 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
399
367
  transform: function transform(content) {
400
368
  return content.toString().replace("{{filename}}", libraryFilename);
401
369
  }
402
- }, // TypeScript
370
+ },
371
+ // TypeScript
403
372
  {
404
373
  src: path.resolve(__dirname, "assets/bundle-root.d.ts"),
405
374
  dest: bundleDir,
@@ -477,48 +446,41 @@ var generateRollupPluginArray = function generateRollupPluginArray(libraryFilena
477
446
  * @returns Ready to use configuration object that can be just exported from
478
447
  * `rollup.config.js` or mutated in any way if necessary.
479
448
  */
480
-
481
-
482
449
  function generateRollupConfiguration(options) {
483
450
  var _context14, _context16, _context17, _context18, _context19, _context20, _context21;
484
-
485
451
  var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : VIS_TEST ? "test" : VIS_DEBUG ? "development" : "production";
486
-
487
452
  var _ref5 = options || {},
488
- _ref5$assets = _ref5.assets,
489
- assets = _ref5$assets === void 0 ? "." : _ref5$assets,
490
- _ref5$copyTargets = _ref5.copyTargets;
491
-
453
+ _ref5$assets = _ref5.assets,
454
+ assets = _ref5$assets === void 0 ? "." : _ref5$assets,
455
+ _ref5$copyTargets = _ref5.copyTargets;
492
456
  _ref5$copyTargets = _ref5$copyTargets === void 0 ? {} : _ref5$copyTargets;
493
457
  var _ref5$copyTargets$bun = _ref5$copyTargets.bundle,
494
- copyTargetsBundle = _ref5$copyTargets$bun === void 0 ? [] : _ref5$copyTargets$bun,
495
- _ref5$copyTargets$var = _ref5$copyTargets.variant,
496
- copyTargetsVariant = _ref5$copyTargets$var === void 0 ? [] : _ref5$copyTargets$var,
497
- _ref5$externalForPeer = _ref5.externalForPeerBuild,
498
- externalForPeerBuild = _ref5$externalForPeer === void 0 ? [] : _ref5$externalForPeer,
499
- _ref5$globals = _ref5.globals,
500
- globals = _ref5$globals === void 0 ? {} : _ref5$globals,
501
- _ref5$header = _ref5.header,
502
- header = _ref5$header === void 0 ? {
503
- name: "Unknown Library"
504
- } : _ref5$header,
505
- _ref5$libraryFilename = _ref5.libraryFilename,
506
- libraryFilename = _ref5$libraryFilename === void 0 ? "unknown-library" : _ref5$libraryFilename,
507
- _ref5$packageJSON = _ref5.packageJSON;
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;
508
472
  _ref5$packageJSON = _ref5$packageJSON === void 0 ? {} : _ref5$packageJSON;
509
-
510
473
  var _ref5$packageJSON$dep = _ref5$packageJSON.dependencies,
511
- dependencies = _ref5$packageJSON$dep === void 0 ? {} : _ref5$packageJSON$dep,
512
- _ref5$packageJSON$dev = _ref5$packageJSON.devDependencies,
513
- devDependencies = _ref5$packageJSON$dev === void 0 ? {} : _ref5$packageJSON$dev,
514
- _ref5$packageJSON$pee = _ref5$packageJSON.peerDependencies,
515
- peerDependencies = _ref5$packageJSON$pee === void 0 ? {} : _ref5$packageJSON$pee,
516
- packageJSONRest = _objectWithoutProperties__default["default"](_ref5$packageJSON, _excluded),
517
- _ref5$entryPoints = _ref5.entryPoints,
518
- entryPoint = _ref5$entryPoints === void 0 ? "./src" : _ref5$entryPoints,
519
- _ref5$tsconfig = _ref5.tsconfig,
520
- tsconfig = _ref5$tsconfig === void 0 ? "tsconfig.json" : _ref5$tsconfig;
521
-
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;
522
484
  validate(function (expect) {
523
485
  // Note: Every array is a superset of empty array.
524
486
  if (_Object$keys__default["default"](peerDependencies).length > 0) {
@@ -533,7 +495,6 @@ function generateRollupConfiguration(options) {
533
495
  });
534
496
  validate(function (expect) {
535
497
  var _context11, _context12, _context13;
536
-
537
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));
538
499
  });
539
500
  validate(function (expect) {
@@ -542,22 +503,19 @@ function generateRollupConfiguration(options) {
542
503
  validate(function (expect) {
543
504
  expect(entryPoint, "The entry point has to be directory").to.be.a("string").and.a.directory();
544
505
  });
545
-
546
506
  var _map = _mapInstanceProperty__default["default"](_context14 = ["ESNext", "peer", "standalone"]).call(_context14, function (name) {
547
- var filenameGlob = "entry-".concat(name.toLowerCase(), ".{js,ts}");
548
- var files = glob(path.resolve(entryPoint, filenameGlob));
549
- validate(function (expect) {
550
- var _context15;
551
-
552
- 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();
553
- });
554
- return files[0];
555
- }),
556
- _map2 = _slicedToArray__default["default"](_map, 3),
557
- esnextEntry = _map2[0],
558
- peerEntry = _map2[1],
559
- standaloneEntry = _map2[2];
560
-
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];
561
519
  validate(function (expect) {
562
520
  expect(path.resolve("./declarations"), "There has to be a directory with TypeScript declarations").to.be.a("string").and.a.directory();
563
521
  });
@@ -578,8 +536,8 @@ function generateRollupConfiguration(options) {
578
536
  });
579
537
  validate(function (expect) {
580
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"));
581
- }); // Note: .to.not.exist sounds great but doesn't work.
582
-
539
+ });
540
+ // Note: .to.not.exist sounds great but doesn't work.
583
541
  validate(function (expect) {
584
542
  expect(path.resolve("./.babelrc"), "Babelrc is ignored. Use babel.config.js config file instead.").to.not.be.a.path;
585
543
  });
@@ -601,23 +559,18 @@ function generateRollupConfiguration(options) {
601
559
  globals: processGlobals(globals),
602
560
  sourcemap: VIS_TEST ? "inline" : true
603
561
  };
604
-
605
562
  var commonOutputESM = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
606
563
  format: "esm"
607
564
  });
608
-
609
565
  var commonOutputUMD = _objectSpread$1(_objectSpread$1({}, commonOutput), {}, {
610
566
  exports: "named",
611
567
  extend: true,
612
568
  format: "umd",
613
569
  name: "vis",
614
570
  strict: false // Regenerator runtime causes issues with CSP in strict mode.
615
-
616
- }); // Note: Binding more than 4 at a time is not typesafe in TS.
617
-
618
-
571
+ });
572
+ // Note: Binding more than 4 at a time is not typesafe in TS.
619
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);
620
-
621
574
  return [{
622
575
  external: external.standalone,
623
576
  input: standaloneEntry,
@@ -705,7 +658,6 @@ function generateRollupConfiguration(options) {
705
658
  }
706
659
 
707
660
  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; }
708
-
709
661
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context8, _context9; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context8 = ownKeys(Object(source), !0)).call(_context8, 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"](_context9 = ownKeys(Object(source))).call(_context9, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
710
662
  tmpPromise.setGracefulCleanup();
711
663
  var PACK_CMD = ["npm", "pack", "--dry-run"];
@@ -713,7 +665,6 @@ var PACK_CMD = ["npm", "pack", "--dry-run"];
713
665
  * @param textOrLines
714
666
  * @param message
715
667
  */
716
-
717
668
  function logStderr(textOrLines, message) {
718
669
  console.group('"npm pack" output');
719
670
  console.error(_Array$isArray__default["default"](textOrLines) ? textOrLines.join("\n") : textOrLines);
@@ -723,15 +674,12 @@ function logStderr(textOrLines, message) {
723
674
  /**
724
675
  *
725
676
  */
726
-
727
-
728
677
  function runNpmPack() {
729
678
  var _context;
730
-
731
- var tmpFile = tmpPromise.fileSync().name; // There are issues with incomplete output when the stderr is read directly
679
+ var tmpFile = tmpPromise.fileSync().name;
680
+ // There are issues with incomplete output when the stderr is read directly
732
681
  // into Node. Saving it into tmp file using shell redirection and reading it
733
682
  // from there doesn't exhibit those issues.
734
-
735
683
  child_process.execSync(_concatInstanceProperty__default["default"](_context = "".concat(PACK_CMD.join(" "), " 2> ")).call(_context, tmpFile), {
736
684
  encoding: "utf-8",
737
685
  env: _objectSpread(_objectSpread({}, process.env), {}, {
@@ -744,19 +692,13 @@ function runNpmPack() {
744
692
  /**
745
693
  * @param lines
746
694
  */
747
-
748
-
749
695
  function extractFiles(lines) {
750
696
  var _context2, _context3, _context4, _context5, _context6;
751
-
752
697
  var fileListingStart = _indexOfInstanceProperty__default["default"](lines).call(lines, "npm notice === Tarball Contents === ");
753
-
754
698
  var fileListingEnd = _indexOfInstanceProperty__default["default"](lines).call(lines, "npm notice === Tarball Details === ");
755
-
756
699
  if (fileListingStart === -1 || fileListingEnd === -1) {
757
700
  logStderr(lines.join("\n"), 'Couldn\'t find tarball contents in "npm pack" output.');
758
701
  }
759
-
760
702
  var files = _mapInstanceProperty__default["default"](_context2 = _sortInstanceProperty__default["default"](_context3 = _mapInstanceProperty__default["default"](_context4 = _mapInstanceProperty__default["default"](_context5 = _mapInstanceProperty__default["default"](_context6 = _sliceInstanceProperty__default["default"](lines).call(lines, fileListingStart + 1, fileListingEnd)).call(_context6, function (line) {
761
703
  return line.replace(/^npm notice /, "");
762
704
  })).call(_context5, function (line) {
@@ -764,40 +706,31 @@ function extractFiles(lines) {
764
706
  })).call(_context4, function (line) {
765
707
  return line.replace(/^([^ ]+) +(.*)/, function (_, size, path) {
766
708
  var _context7;
767
-
768
709
  return _concatInstanceProperty__default["default"](_context7 = "".concat(path)).call(_context7, size === "0" ? "(empty)" : " ");
769
710
  });
770
711
  })).call(_context3)).call(_context2, function (line) {
771
712
  return line.replace(/^(.*)(.{7})$/, "$2 $1");
772
713
  });
773
-
774
714
  if (files.length === 0) {
775
715
  logStderr(lines, 'No files found in "npm pack" output.');
776
716
  }
777
-
778
717
  return files;
779
718
  }
780
719
  /**
781
720
  * @param lines
782
721
  */
783
-
784
-
785
722
  function extractName(lines) {
786
723
  var nameLine = _findInstanceProperty__default["default"](lines).call(lines, function (line) {
787
724
  return /^npm notice name:/.test(line);
788
725
  });
789
-
790
726
  if (nameLine == null) {
791
727
  logStderr(lines, 'Can\'t find the name of the package in "npm pack" output.');
792
728
  }
793
-
794
729
  return nameLine.replace(/^npm notice name: */, "");
795
730
  }
796
731
  /**
797
732
  *
798
733
  */
799
-
800
-
801
734
  function inspectNpmPack() {
802
735
  var lines = runNpmPack();
803
736
  var files = extractFiles(lines);