vis-dev-utils 2.9.82 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel-register/index.js +2 -2
- package/babel-register/index.js.map +1 -1
- package/bin/ci-utils.js +3 -2
- package/bin/ci-utils.js.map +1 -1
- package/bin/generate-examples-index.js +152 -121
- package/bin/generate-examples-index.js.map +1 -1
- package/bin/test-e2e-interop.js +411 -259
- package/bin/test-e2e-interop.js.map +1 -1
- package/declarations/generate-rollup-configuration/index.d.ts +0 -2
- package/declarations/generate-rollup-configuration/index.d.ts.map +1 -1
- package/declarations/header.d.ts +0 -4
- package/declarations/header.d.ts.map +1 -1
- package/dist/interop/base-config.json +1 -1
- package/dist/vis-dev-utils.cjs.js +6 -17
- package/dist/vis-dev-utils.cjs.js.map +1 -1
- package/dist/vis-dev-utils.esm.js +6 -17
- package/dist/vis-dev-utils.esm.js.map +1 -1
- package/eslint-shareable-config/index.js +1 -5
- package/lib/header.d.ts +0 -4
- package/lib/header.d.ts.map +1 -1
- package/lib/header.js +0 -4
- package/lib/header.js.map +1 -1
- package/package.json +32 -37
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Development utilities for the Vis family projects.
|
|
8
8
|
*
|
|
9
|
-
* @version
|
|
10
|
-
* @date
|
|
9
|
+
* @version 3.0.1
|
|
10
|
+
* @date 2022-03-07T20:39:45.311Z
|
|
11
11
|
*
|
|
12
12
|
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
|
13
13
|
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
|
@@ -366,7 +366,6 @@ var writeFile$1 = util.promisify(fs__default['default'].writeFile);
|
|
|
366
366
|
* though may yield some false positives.
|
|
367
367
|
*
|
|
368
368
|
* @param screenshot - The binary data of the screenshot.
|
|
369
|
-
*
|
|
370
369
|
* @returns True for valid and false for invalid.
|
|
371
370
|
*/
|
|
372
371
|
|
|
@@ -379,7 +378,6 @@ function isScreenshotValid(_x) {
|
|
|
379
378
|
*
|
|
380
379
|
* @param browser - Puppeteer's browser instance.
|
|
381
380
|
* @param config - See the type's docs for detail.
|
|
382
|
-
*
|
|
383
381
|
* @returns Whether or not the screenshot passed validation check.
|
|
384
382
|
*/
|
|
385
383
|
|
|
@@ -559,75 +557,92 @@ function _generateScreenshot() {
|
|
|
559
557
|
|
|
560
558
|
case 39:
|
|
561
559
|
screenshot = _context4.sent;
|
|
562
|
-
|
|
560
|
+
|
|
561
|
+
if (!(screenshot == null)) {
|
|
562
|
+
_context4.next = 44;
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
throw new Error("Failed to take screenshot of \u201C".concat(example.paths.page, "\u201D"));
|
|
567
|
+
|
|
568
|
+
case 44:
|
|
569
|
+
if (!(typeof screenshot === "string")) {
|
|
570
|
+
_context4.next = 46;
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
throw new Error("Failed to get the binary data of the screenshot of \u201C".concat(example.paths.page, "\u201D"));
|
|
575
|
+
|
|
576
|
+
case 46:
|
|
577
|
+
_context4.next = 48;
|
|
563
578
|
return writeFile$1(example.paths.screenshot.local, screenshot);
|
|
564
579
|
|
|
565
|
-
case
|
|
580
|
+
case 48:
|
|
566
581
|
return _context4.abrupt("return", isScreenshotValid(screenshot));
|
|
567
582
|
|
|
568
|
-
case
|
|
569
|
-
_context4.prev =
|
|
583
|
+
case 51:
|
|
584
|
+
_context4.prev = 51;
|
|
570
585
|
_context4.t0 = _context4["catch"](2);
|
|
571
586
|
console.error(_context4.t0);
|
|
572
587
|
return _context4.abrupt("return", false);
|
|
573
588
|
|
|
574
|
-
case
|
|
575
|
-
_context4.prev =
|
|
589
|
+
case 55:
|
|
590
|
+
_context4.prev = 55;
|
|
576
591
|
_iterator = _createForOfIteratorHelper$3(_reverseInstanceProperty__default['default'](_context3 = _spliceInstanceProperty__default['default'](cleanup).call(cleanup, 0)).call(_context3));
|
|
577
|
-
_context4.prev =
|
|
592
|
+
_context4.prev = 57;
|
|
578
593
|
|
|
579
594
|
_iterator.s();
|
|
580
595
|
|
|
581
|
-
case
|
|
596
|
+
case 59:
|
|
582
597
|
if ((_step = _iterator.n()).done) {
|
|
583
|
-
_context4.next =
|
|
598
|
+
_context4.next = 71;
|
|
584
599
|
break;
|
|
585
600
|
}
|
|
586
601
|
|
|
587
602
|
callback = _step.value;
|
|
588
|
-
_context4.prev =
|
|
589
|
-
_context4.next =
|
|
603
|
+
_context4.prev = 61;
|
|
604
|
+
_context4.next = 64;
|
|
590
605
|
return callback();
|
|
591
606
|
|
|
592
|
-
case
|
|
593
|
-
_context4.next =
|
|
607
|
+
case 64:
|
|
608
|
+
_context4.next = 69;
|
|
594
609
|
break;
|
|
595
610
|
|
|
596
|
-
case
|
|
597
|
-
_context4.prev =
|
|
598
|
-
_context4.t1 = _context4["catch"](
|
|
611
|
+
case 66:
|
|
612
|
+
_context4.prev = 66;
|
|
613
|
+
_context4.t1 = _context4["catch"](61);
|
|
599
614
|
console.error(_context4.t1);
|
|
600
615
|
|
|
601
|
-
case
|
|
602
|
-
_context4.next =
|
|
616
|
+
case 69:
|
|
617
|
+
_context4.next = 59;
|
|
603
618
|
break;
|
|
604
619
|
|
|
605
|
-
case
|
|
606
|
-
_context4.next =
|
|
620
|
+
case 71:
|
|
621
|
+
_context4.next = 76;
|
|
607
622
|
break;
|
|
608
623
|
|
|
609
|
-
case
|
|
610
|
-
_context4.prev =
|
|
611
|
-
_context4.t2 = _context4["catch"](
|
|
624
|
+
case 73:
|
|
625
|
+
_context4.prev = 73;
|
|
626
|
+
_context4.t2 = _context4["catch"](57);
|
|
612
627
|
|
|
613
628
|
_iterator.e(_context4.t2);
|
|
614
629
|
|
|
615
|
-
case
|
|
616
|
-
_context4.prev =
|
|
630
|
+
case 76:
|
|
631
|
+
_context4.prev = 76;
|
|
617
632
|
|
|
618
633
|
_iterator.f();
|
|
619
634
|
|
|
620
|
-
return _context4.finish(
|
|
635
|
+
return _context4.finish(76);
|
|
621
636
|
|
|
622
|
-
case
|
|
623
|
-
return _context4.finish(
|
|
637
|
+
case 79:
|
|
638
|
+
return _context4.finish(55);
|
|
624
639
|
|
|
625
|
-
case
|
|
640
|
+
case 80:
|
|
626
641
|
case "end":
|
|
627
642
|
return _context4.stop();
|
|
628
643
|
}
|
|
629
644
|
}
|
|
630
|
-
}, _callee2, null, [[2,
|
|
645
|
+
}, _callee2, null, [[2, 51, 55, 80], [57, 73, 76, 79], [61, 66]]);
|
|
631
646
|
}));
|
|
632
647
|
return _generateScreenshot.apply(this, arguments);
|
|
633
648
|
}
|
|
@@ -638,9 +653,9 @@ function _unsupportedIterableToArray$2(o, minLen) { var _context24; if (!o) retu
|
|
|
638
653
|
|
|
639
654
|
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
640
655
|
|
|
641
|
-
function ownKeys$1(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object);
|
|
656
|
+
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; }
|
|
642
657
|
|
|
643
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
658
|
+
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; }
|
|
644
659
|
var collator = new Intl.Collator("US");
|
|
645
660
|
var writeFile = util.promisify(fs__default['default'].writeFile);
|
|
646
661
|
var ContentBuilder = /*#__PURE__*/function () {
|
|
@@ -1133,9 +1148,9 @@ var htmlRenderer = {
|
|
|
1133
1148
|
}
|
|
1134
1149
|
};
|
|
1135
1150
|
|
|
1136
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default['default'](object); if (_Object$getOwnPropertySymbols__default['default']) { var symbols = _Object$getOwnPropertySymbols__default['default'](object);
|
|
1151
|
+
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; }
|
|
1137
1152
|
|
|
1138
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
1153
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context14, _context15; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default['default'](_context14 = ownKeys(Object(source), !0)).call(_context14, 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'](_context15 = ownKeys(Object(source))).call(_context15, function (key) { _Object$defineProperty__default['default'](target, key, _Object$getOwnPropertyDescriptor__default['default'](source, key)); }); } return target; }
|
|
1139
1154
|
|
|
1140
1155
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol__default['default'] !== "undefined" && _getIteratorMethod__default['default'](o) || o["@@iterator"]; if (!it) { if (_Array$isArray__default['default'](o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
1141
1156
|
|
|
@@ -1349,7 +1364,7 @@ var y = yargs__default['default'].strict(true).usage("generate-example-index [op
|
|
|
1349
1364
|
function parseArguments() {
|
|
1350
1365
|
return y.parserConfiguration({
|
|
1351
1366
|
"camel-case-expansion": false
|
|
1352
|
-
}).
|
|
1367
|
+
}).parseSync();
|
|
1353
1368
|
}
|
|
1354
1369
|
|
|
1355
1370
|
/**
|
|
@@ -1433,7 +1448,6 @@ var readFile = util__default['default'].promisify(fs__default['default'].readFil
|
|
|
1433
1448
|
* @param page - The page to be queried.
|
|
1434
1449
|
* @param name - The name of the meta tag.
|
|
1435
1450
|
* @param fallback - The value to be used if the meta tag is not present.
|
|
1436
|
-
*
|
|
1437
1451
|
* @returns The value “smartly” coerced or the fallback if conversion isn't
|
|
1438
1452
|
* possible or the value is not present in the page.
|
|
1439
1453
|
*/
|
|
@@ -1460,7 +1474,6 @@ function getMeta(page, name, fallback) {
|
|
|
1460
1474
|
*
|
|
1461
1475
|
* @param path - The path to the example (used for identification in logs).
|
|
1462
1476
|
* @param page - The HTML to be linted.
|
|
1463
|
-
*
|
|
1464
1477
|
* @returns True if everything's okay, false otherwise.
|
|
1465
1478
|
*/
|
|
1466
1479
|
|
|
@@ -1499,38 +1512,56 @@ function lintExample(path, page) {
|
|
|
1499
1512
|
return valid;
|
|
1500
1513
|
}
|
|
1501
1514
|
|
|
1502
|
-
_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
1503
|
-
var _context4,
|
|
1515
|
+
_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3() {
|
|
1516
|
+
var _context4, _context6;
|
|
1504
1517
|
|
|
1505
|
-
var code, baseURL, pathsConfig, examples, selector, stats, skipped,
|
|
1518
|
+
var code, baseURL, pathsConfig, examples, selector, stats, skipped, _context11, screenshotScript, builtData, _context12, _context13, cummulativeReport, _context14, _context15, _cummulativeReport, _context16, _context17, _cummulativeReport2, checks, _context18, _context23, _context19, _context20, _context21, _context22;
|
|
1506
1519
|
|
|
1507
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
1520
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context24) {
|
|
1508
1521
|
while (1) {
|
|
1509
|
-
switch (
|
|
1522
|
+
switch (_context24.prev = _context24.next) {
|
|
1510
1523
|
case 0:
|
|
1511
1524
|
code = 0;
|
|
1512
1525
|
|
|
1513
1526
|
if (!(!argv.index && !argv.screenshots && !argv.lint)) {
|
|
1514
|
-
|
|
1527
|
+
_context24.next = 4;
|
|
1515
1528
|
break;
|
|
1516
1529
|
}
|
|
1517
1530
|
|
|
1518
1531
|
yargs__default['default'].parse("--help");
|
|
1519
|
-
return
|
|
1532
|
+
return _context24.abrupt("return");
|
|
1520
1533
|
|
|
1521
1534
|
case 4:
|
|
1522
|
-
|
|
1523
|
-
return _Promise__default['default'].all(_mapInstanceProperty__default['default'](_context4 = [argv["assets-local-directory"], argv["examples-local-directory"], argv["output-directory"], argv["pages-local-directory"]]).call(_context4, function (
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1535
|
+
_context24.next = 6;
|
|
1536
|
+
return _Promise__default['default'].all(_mapInstanceProperty__default['default'](_context4 = [argv["assets-local-directory"], argv["examples-local-directory"], argv["output-directory"], argv["pages-local-directory"]]).call(_context4, /*#__PURE__*/function () {
|
|
1537
|
+
var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(path) {
|
|
1538
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context5) {
|
|
1539
|
+
while (1) {
|
|
1540
|
+
switch (_context5.prev = _context5.next) {
|
|
1541
|
+
case 0:
|
|
1542
|
+
_context5.next = 2;
|
|
1543
|
+
return mkdir(path, {
|
|
1544
|
+
recursive: true
|
|
1545
|
+
});
|
|
1546
|
+
|
|
1547
|
+
case 2:
|
|
1548
|
+
case "end":
|
|
1549
|
+
return _context5.stop();
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}, _callee);
|
|
1553
|
+
}));
|
|
1554
|
+
|
|
1555
|
+
return function (_x) {
|
|
1556
|
+
return _ref2.apply(this, arguments);
|
|
1557
|
+
};
|
|
1558
|
+
}()));
|
|
1528
1559
|
|
|
1529
1560
|
case 6:
|
|
1530
1561
|
baseURL = argv["base-url"];
|
|
1531
1562
|
|
|
1532
1563
|
if (_endsWithInstanceProperty__default['default'](baseURL).call(baseURL, "/")) {
|
|
1533
|
-
|
|
1564
|
+
_context24.next = 9;
|
|
1534
1565
|
break;
|
|
1535
1566
|
}
|
|
1536
1567
|
|
|
@@ -1562,40 +1593,40 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1562
1593
|
examples: 0
|
|
1563
1594
|
};
|
|
1564
1595
|
skipped = [];
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1596
|
+
_context24.t0 = _Promise__default['default'];
|
|
1597
|
+
_context24.t1 = _mapInstanceProperty__default['default'];
|
|
1598
|
+
_context24.next = 18;
|
|
1568
1599
|
return globby__default['default'](path.join(pathsConfig.page.local, "**/*.html"));
|
|
1569
1600
|
|
|
1570
1601
|
case 18:
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
var
|
|
1574
|
-
var
|
|
1602
|
+
_context24.t2 = _context6 = _context24.sent;
|
|
1603
|
+
_context24.t3 = (0, _context24.t1)(_context24.t2).call(_context6, /*#__PURE__*/function () {
|
|
1604
|
+
var _ref3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(pagePath) {
|
|
1605
|
+
var _context7;
|
|
1575
1606
|
|
|
1576
|
-
var html, $page, pageDelay, pageTimeout, pageSelector, titles,
|
|
1607
|
+
var html, $page, pageDelay, pageTimeout, pageSelector, titles, _context9;
|
|
1577
1608
|
|
|
1578
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
1609
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context10) {
|
|
1579
1610
|
while (1) {
|
|
1580
|
-
switch (
|
|
1611
|
+
switch (_context10.prev = _context10.next) {
|
|
1581
1612
|
case 0:
|
|
1582
|
-
|
|
1613
|
+
_context10.next = 2;
|
|
1583
1614
|
return readFile(pagePath, "utf-8");
|
|
1584
1615
|
|
|
1585
1616
|
case 2:
|
|
1586
|
-
html =
|
|
1617
|
+
html = _context10.sent;
|
|
1587
1618
|
$page = $__default['default'].load(html);
|
|
1588
1619
|
pageDelay = getMeta($page, "example-screenshot-delay", 6);
|
|
1589
1620
|
pageTimeout = getMeta($page, "example-screenshot-timeout", 60);
|
|
1590
1621
|
pageSelector = getMeta($page, "example-screenshot-selector", selector); // Is this an examples?
|
|
1591
1622
|
|
|
1592
1623
|
if (!($page(pageSelector).length === 0)) {
|
|
1593
|
-
|
|
1624
|
+
_context10.next = 10;
|
|
1594
1625
|
break;
|
|
1595
1626
|
}
|
|
1596
1627
|
|
|
1597
1628
|
skipped.push(pagePath);
|
|
1598
|
-
return
|
|
1629
|
+
return _context10.abrupt("return");
|
|
1599
1630
|
|
|
1600
1631
|
case 10:
|
|
1601
1632
|
// Lint if requested.
|
|
@@ -1604,14 +1635,14 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1604
1635
|
} // Body titles.
|
|
1605
1636
|
|
|
1606
1637
|
|
|
1607
|
-
titles = _mapInstanceProperty__default['default'](
|
|
1608
|
-
var
|
|
1638
|
+
titles = _mapInstanceProperty__default['default'](_context7 = $page("#title > *").get()).call(_context7, function (elem) {
|
|
1639
|
+
var _context8;
|
|
1609
1640
|
|
|
1610
|
-
return _trimInstanceProperty__default['default'](
|
|
1641
|
+
return _trimInstanceProperty__default['default'](_context8 = $page(elem).text()).call(_context8);
|
|
1611
1642
|
}); // Head title fallback.
|
|
1612
1643
|
|
|
1613
1644
|
if (titles.length < 2) {
|
|
1614
|
-
titles = _mapInstanceProperty__default['default'](
|
|
1645
|
+
titles = _mapInstanceProperty__default['default'](_context9 = $page("head > title").text().split("|")).call(_context9, function (title) {
|
|
1615
1646
|
return _trimInstanceProperty__default['default'](title).call(title);
|
|
1616
1647
|
});
|
|
1617
1648
|
} // File path fallback.
|
|
@@ -1623,12 +1654,12 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1623
1654
|
|
|
1624
1655
|
|
|
1625
1656
|
if (!(titles.length < 2)) {
|
|
1626
|
-
|
|
1657
|
+
_context10.next = 17;
|
|
1627
1658
|
break;
|
|
1628
1659
|
}
|
|
1629
1660
|
|
|
1630
1661
|
console.error("Title resolution failed. Skipping.");
|
|
1631
|
-
return
|
|
1662
|
+
return _context10.abrupt("return");
|
|
1632
1663
|
|
|
1633
1664
|
case 17:
|
|
1634
1665
|
// Put this example into the structure while creating any missing groups in the process.
|
|
@@ -1664,70 +1695,70 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1664
1695
|
|
|
1665
1696
|
case 18:
|
|
1666
1697
|
case "end":
|
|
1667
|
-
return
|
|
1698
|
+
return _context10.stop();
|
|
1668
1699
|
}
|
|
1669
1700
|
}
|
|
1670
|
-
},
|
|
1701
|
+
}, _callee2);
|
|
1671
1702
|
}));
|
|
1672
1703
|
|
|
1673
|
-
return function (
|
|
1674
|
-
return
|
|
1704
|
+
return function (_x2) {
|
|
1705
|
+
return _ref3.apply(this, arguments);
|
|
1675
1706
|
};
|
|
1676
1707
|
}());
|
|
1677
|
-
|
|
1678
|
-
return
|
|
1708
|
+
_context24.next = 22;
|
|
1709
|
+
return _context24.t0.all.call(_context24.t0, _context24.t3);
|
|
1679
1710
|
|
|
1680
1711
|
case 22:
|
|
1681
1712
|
if (skipped.length) {
|
|
1682
1713
|
process.stdout.write("\n");
|
|
1683
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1714
|
+
console.info(_concatInstanceProperty__default['default'](_context11 = ["The following files don't look like examples (there is nothing to take a screenshot of):"]).call(_context11, _toConsumableArray__default['default'](_sortInstanceProperty__default['default'](skipped).call(skipped))).join("\n "));
|
|
1684
1715
|
}
|
|
1685
1716
|
|
|
1686
1717
|
if (!(stats.examples === 0)) {
|
|
1687
|
-
|
|
1718
|
+
_context24.next = 27;
|
|
1688
1719
|
break;
|
|
1689
1720
|
}
|
|
1690
1721
|
|
|
1691
1722
|
console.info("No usable example files were found.");
|
|
1692
|
-
|
|
1723
|
+
_context24.next = 67;
|
|
1693
1724
|
break;
|
|
1694
1725
|
|
|
1695
1726
|
case 27:
|
|
1696
1727
|
if (!(argv.index || argv.playgrounds || argv.screenshots)) {
|
|
1697
|
-
|
|
1728
|
+
_context24.next = 67;
|
|
1698
1729
|
break;
|
|
1699
1730
|
}
|
|
1700
1731
|
|
|
1701
1732
|
process.stdout.write("\n");
|
|
1702
1733
|
|
|
1703
1734
|
if (!(screenshotScriptPath != null)) {
|
|
1704
|
-
|
|
1735
|
+
_context24.next = 38;
|
|
1705
1736
|
break;
|
|
1706
1737
|
}
|
|
1707
1738
|
|
|
1708
|
-
|
|
1739
|
+
_context24.next = 32;
|
|
1709
1740
|
return readFile(screenshotScriptPath, "utf-8");
|
|
1710
1741
|
|
|
1711
1742
|
case 32:
|
|
1712
|
-
|
|
1743
|
+
_context24.t5 = _context24.sent;
|
|
1713
1744
|
|
|
1714
|
-
if (
|
|
1715
|
-
|
|
1745
|
+
if (_context24.t5) {
|
|
1746
|
+
_context24.next = 35;
|
|
1716
1747
|
break;
|
|
1717
1748
|
}
|
|
1718
1749
|
|
|
1719
|
-
|
|
1750
|
+
_context24.t5 = "";
|
|
1720
1751
|
|
|
1721
1752
|
case 35:
|
|
1722
|
-
|
|
1723
|
-
|
|
1753
|
+
_context24.t4 = _context24.t5;
|
|
1754
|
+
_context24.next = 39;
|
|
1724
1755
|
break;
|
|
1725
1756
|
|
|
1726
1757
|
case 38:
|
|
1727
|
-
|
|
1758
|
+
_context24.t4 = "";
|
|
1728
1759
|
|
|
1729
1760
|
case 39:
|
|
1730
|
-
screenshotScript =
|
|
1761
|
+
screenshotScript = _context24.t4;
|
|
1731
1762
|
builtData = new ContentBuilder({
|
|
1732
1763
|
examples: examples,
|
|
1733
1764
|
output: path.resolve(argv["output-directory"]),
|
|
@@ -1742,68 +1773,68 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1742
1773
|
}); // Create and write the page.
|
|
1743
1774
|
|
|
1744
1775
|
if (!argv.index) {
|
|
1745
|
-
|
|
1776
|
+
_context24.next = 48;
|
|
1746
1777
|
break;
|
|
1747
1778
|
}
|
|
1748
1779
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1780
|
+
_context24.t6 = reduceReports;
|
|
1781
|
+
_context24.next = 45;
|
|
1751
1782
|
return builtData.index;
|
|
1752
1783
|
|
|
1753
1784
|
case 45:
|
|
1754
|
-
|
|
1755
|
-
cummulativeReport = (0,
|
|
1756
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1785
|
+
_context24.t7 = _context24.sent;
|
|
1786
|
+
cummulativeReport = (0, _context24.t6)(_context24.t7);
|
|
1787
|
+
console.info(_concatInstanceProperty__default['default'](_context12 = _concatInstanceProperty__default['default'](_context13 = "Index with ".concat(stats.examples, " examples written (")).call(_context13, cummulativeReport.count, " files in ")).call(_context12, formatStartStopMs(cummulativeReport), ")."));
|
|
1757
1788
|
|
|
1758
1789
|
case 48:
|
|
1759
1790
|
if (!argv.index) {
|
|
1760
|
-
|
|
1791
|
+
_context24.next = 55;
|
|
1761
1792
|
break;
|
|
1762
1793
|
}
|
|
1763
1794
|
|
|
1764
|
-
|
|
1765
|
-
|
|
1795
|
+
_context24.t8 = reduceReports;
|
|
1796
|
+
_context24.next = 52;
|
|
1766
1797
|
return builtData.playgrounds;
|
|
1767
1798
|
|
|
1768
1799
|
case 52:
|
|
1769
|
-
|
|
1770
|
-
_cummulativeReport = (0,
|
|
1771
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1800
|
+
_context24.t9 = _context24.sent;
|
|
1801
|
+
_cummulativeReport = (0, _context24.t8)(_context24.t9);
|
|
1802
|
+
console.info(_concatInstanceProperty__default['default'](_context14 = _concatInstanceProperty__default['default'](_context15 = "Playground opener files for ".concat(stats.examples, " examples written (")).call(_context15, _cummulativeReport.count, " files in ")).call(_context14, formatStartStopMs(_cummulativeReport), ")."));
|
|
1772
1803
|
|
|
1773
1804
|
case 55:
|
|
1774
1805
|
if (!argv.screenshots) {
|
|
1775
|
-
|
|
1806
|
+
_context24.next = 62;
|
|
1776
1807
|
break;
|
|
1777
1808
|
}
|
|
1778
1809
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1810
|
+
_context24.t10 = reduceReports;
|
|
1811
|
+
_context24.next = 59;
|
|
1781
1812
|
return builtData.screenshots;
|
|
1782
1813
|
|
|
1783
1814
|
case 59:
|
|
1784
|
-
|
|
1785
|
-
_cummulativeReport2 = (0,
|
|
1786
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1815
|
+
_context24.t11 = _context24.sent;
|
|
1816
|
+
_cummulativeReport2 = (0, _context24.t10)(_context24.t11);
|
|
1817
|
+
console.info(_concatInstanceProperty__default['default'](_context16 = _concatInstanceProperty__default['default'](_context17 = "Screenshot files for ".concat(stats.examples, " written (")).call(_context17, _cummulativeReport2.count, " files in ")).call(_context16, formatStartStopMs(_cummulativeReport2), ")."));
|
|
1787
1818
|
|
|
1788
1819
|
case 62:
|
|
1789
|
-
|
|
1820
|
+
_context24.next = 64;
|
|
1790
1821
|
return builtData.checks;
|
|
1791
1822
|
|
|
1792
1823
|
case 64:
|
|
1793
|
-
checks =
|
|
1824
|
+
checks = _context24.sent;
|
|
1794
1825
|
process.stdout.write("\n");
|
|
1795
1826
|
|
|
1796
1827
|
if (checks.fail === 0) {
|
|
1797
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1828
|
+
console.info(_concatInstanceProperty__default['default'](_context18 = "Verification: ".concat(checks.okay, " passed (")).call(_context18, Math.round(checks.percentage), " %) passed."));
|
|
1798
1829
|
} else {
|
|
1799
1830
|
if (checks.percentage >= argv.verify) {
|
|
1800
|
-
console.info(_concatInstanceProperty__default['default'](
|
|
1831
|
+
console.info(_concatInstanceProperty__default['default'](_context19 = _concatInstanceProperty__default['default'](_context20 = "Verification: ".concat(checks.okay, " passed (")).call(_context20, Math.round(checks.percentage), " %), ")).call(_context19, checks.fail, " failed.\n") + "This is within the threshold set by --verify.");
|
|
1801
1832
|
} else {
|
|
1802
|
-
console.error(_concatInstanceProperty__default['default'](
|
|
1833
|
+
console.error(_concatInstanceProperty__default['default'](_context21 = _concatInstanceProperty__default['default'](_context22 = "Verification: Only ".concat(checks.okay, " passed (")).call(_context22, Math.round(checks.percentage), " %), ")).call(_context21, checks.fail, " failed.\n") + "This is not within the threshold set by --verify. Exiting with an error.");
|
|
1803
1834
|
code = 3;
|
|
1804
1835
|
}
|
|
1805
1836
|
|
|
1806
|
-
_forEachInstanceProperty__default['default'](
|
|
1837
|
+
_forEachInstanceProperty__default['default'](_context23 = checks.failPaths).call(_context23, function (path) {
|
|
1807
1838
|
console.error(path);
|
|
1808
1839
|
});
|
|
1809
1840
|
}
|
|
@@ -1813,10 +1844,10 @@ _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default
|
|
|
1813
1844
|
|
|
1814
1845
|
case 68:
|
|
1815
1846
|
case "end":
|
|
1816
|
-
return
|
|
1847
|
+
return _context24.stop();
|
|
1817
1848
|
}
|
|
1818
1849
|
}
|
|
1819
|
-
},
|
|
1850
|
+
}, _callee3);
|
|
1820
1851
|
}))().catch(function (error) {
|
|
1821
1852
|
process.exitCode = 1;
|
|
1822
1853
|
console.error(error);
|