@jsenv/core 23.1.3 → 23.2.2

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.
Files changed (82) hide show
  1. package/dist/jsenv_browser_system.js +36 -99
  2. package/dist/jsenv_browser_system.js.map +12 -21
  3. package/dist/jsenv_compile_proxy.js +18 -82
  4. package/dist/jsenv_compile_proxy.js.map +11 -21
  5. package/dist/jsenv_exploring_index.js +127 -274
  6. package/dist/jsenv_exploring_index.js.map +76 -90
  7. package/dist/jsenv_exploring_redirector.js +21 -89
  8. package/dist/jsenv_exploring_redirector.js.map +13 -25
  9. package/dist/jsenv_toolbar.js +81 -149
  10. package/dist/jsenv_toolbar.js.map +50 -61
  11. package/dist/jsenv_toolbar_injector.js +185 -231
  12. package/dist/jsenv_toolbar_injector.js.map +30 -42
  13. package/package.json +8 -9
  14. package/src/abort/abortable.js +172 -0
  15. package/src/abort/callback_list.js +64 -0
  16. package/src/abort/callback_race.js +34 -0
  17. package/src/abort/cleaner.js +22 -0
  18. package/src/abort/main.js +32 -0
  19. package/src/abort/process_teardown_events.js +59 -0
  20. package/src/buildProject.js +132 -123
  21. package/src/execute.js +108 -107
  22. package/src/executeTestPlan.js +107 -125
  23. package/src/importUsingChildProcess.js +2 -1
  24. package/src/internal/browser-launcher/executeHtmlFile.js +33 -12
  25. package/src/internal/browser-utils/fetch-browser.js +4 -29
  26. package/src/internal/browser-utils/fetchUsingXHR.js +5 -7
  27. package/src/internal/building/buildUsingRollup.js +60 -24
  28. package/src/internal/building/createJsenvRollupPlugin.js +13 -31
  29. package/src/internal/building/ressource_builder.js +3 -6
  30. package/src/internal/building/sourcemap_loader.js +4 -5
  31. package/src/internal/building/url_fetcher.js +2 -5
  32. package/src/internal/building/url_loader.js +3 -6
  33. package/src/internal/compiling/compileFile.js +1 -2
  34. package/src/internal/compiling/createCompiledFileService.js +8 -9
  35. package/src/internal/compiling/startCompileServer.js +74 -135
  36. package/src/internal/executing/coverage/generateCoverageJsonFile.js +20 -3
  37. package/src/internal/executing/coverage/relativeUrlToEmptyCoverage.js +19 -30
  38. package/src/internal/executing/coverage/reportToCoverage.js +44 -24
  39. package/src/internal/executing/coverage/v8CoverageFromNodeV8Directory.js +2 -15
  40. package/src/internal/executing/createSummaryLog.js +50 -37
  41. package/src/internal/executing/executeConcurrently.js +89 -47
  42. package/src/internal/executing/executePlan.js +33 -7
  43. package/src/internal/executing/executionLogs.js +25 -28
  44. package/src/internal/executing/execution_colors.js +15 -0
  45. package/src/internal/executing/generateExecutionSteps.js +3 -2
  46. package/src/internal/executing/launchAndExecute.js +217 -261
  47. package/src/internal/exploring/fetchExploringJson.js +3 -4
  48. package/src/internal/fetchUrl.js +6 -2
  49. package/src/internal/logs/log_style.js +16 -28
  50. package/src/internal/logs/msAsDuration.js +1 -1
  51. package/src/internal/node-launcher/createChildProcessOptions.js +4 -5
  52. package/src/internal/node-launcher/createControllableNodeProcess.js +117 -229
  53. package/src/internal/node-launcher/kill_process_tree.js +76 -0
  54. package/src/internal/node-launcher/nodeControllableFile.mjs +16 -10
  55. package/src/internal/{promise_track_race.js → promise_race.js} +2 -2
  56. package/src/internal/runtime/s.js +25 -24
  57. package/src/internal/toolbar/toolbar.html +157 -61
  58. package/src/internal/toolbar/toolbar.injector.js +8 -0
  59. package/src/internal/toolbar/util/animation.js +3 -7
  60. package/src/internal/toolbar/util/fetching.js +1 -30
  61. package/src/jsenvServiceWorkerFinalizer.js +1 -2
  62. package/src/launchBrowser.js +131 -127
  63. package/src/launchNode.js +29 -17
  64. package/src/playwright_browser_versions.js +3 -3
  65. package/src/requireUsingChildProcess.js +2 -1
  66. package/src/signal/signal.js +65 -0
  67. package/src/startExploring.js +70 -72
  68. package/src/internal/executeJsenvAsyncFunction.js +0 -34
  69. package/src/internal/toolbar/animation/toolbar-movie-icon.svg +0 -15
  70. package/src/internal/toolbar/compilation/flask.svg +0 -7
  71. package/src/internal/toolbar/compilation/info.svg +0 -9
  72. package/src/internal/toolbar/compilation/loupe.svg +0 -11
  73. package/src/internal/toolbar/compilation/toolbar_compilation.svg +0 -11
  74. package/src/internal/toolbar/eventsource/toolbar-power-icon.svg +0 -10
  75. package/src/internal/toolbar/eventsource/toolbar-power-off-icon.svg +0 -10
  76. package/src/internal/toolbar/responsive/toolbar-dots-icon.svg +0 -10
  77. package/src/internal/toolbar/settings/toolbar-settings-icon.svg +0 -9
  78. package/src/internal/toolbar/theme/toolbar-palette-icon.svg +0 -10
  79. package/src/internal/toolbar/toolbar-cross-icon.svg +0 -10
  80. package/src/internal/toolbar/toolbar-loading-icon.svg +0 -102
  81. package/src/internal/toolbar/toolbar-notif-icon.svg +0 -9
  82. package/src/internal/trackRessources.js +0 -23
@@ -1310,29 +1310,6 @@
1310
1310
  return target;
1311
1311
  });
1312
1312
 
1313
- var createCancellationToken = function createCancellationToken() {
1314
- var register = function register(callback) {
1315
- if (typeof callback !== "function") {
1316
- throw new Error("callback must be a function, got ".concat(callback));
1317
- }
1318
-
1319
- return {
1320
- callback: callback,
1321
- unregister: function unregister() {}
1322
- };
1323
- };
1324
-
1325
- var throwIfRequested = function throwIfRequested() {
1326
- return undefined;
1327
- };
1328
-
1329
- return {
1330
- register: register,
1331
- cancellationRequested: false,
1332
- throwIfRequested: throwIfRequested
1333
- };
1334
- };
1335
-
1336
1313
  var createDetailedMessage = function createDetailedMessage(message) {
1337
1314
  var details = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1338
1315
  var string = "".concat(message);
@@ -1343,9 +1320,6 @@
1343
1320
  return string;
1344
1321
  };
1345
1322
 
1346
- // fallback to this polyfill (or even use an existing polyfill would be better)
1347
- // https://github.com/github/fetch/blob/master/fetch.js
1348
-
1349
1323
  function _await$c(value, then, direct) {
1350
1324
  if (direct) {
1351
1325
  return then ? then(value) : value;
@@ -1387,8 +1361,7 @@
1387
1361
 
1388
1362
  var fetchUsingXHR = _async$c(function (url) {
1389
1363
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1390
- _ref$cancellationToke = _ref.cancellationToken,
1391
- cancellationToken = _ref$cancellationToke === void 0 ? createCancellationToken() : _ref$cancellationToke,
1364
+ signal = _ref.signal,
1392
1365
  _ref$method = _ref.method,
1393
1366
  method = _ref$method === void 0 ? "GET" : _ref$method,
1394
1367
  _ref$credentials = _ref.credentials,
@@ -1437,9 +1410,11 @@
1437
1410
  bodyPromise.resolve();
1438
1411
  };
1439
1412
 
1440
- cancellationToken.register(function (cancelError) {
1413
+ signal.addEventListener("abort", function () {
1441
1414
  xhr.abort();
1442
- failure(cancelError);
1415
+ var abortError = new Error("aborted");
1416
+ abortError.name = "AbortError";
1417
+ failure(abortError);
1443
1418
  });
1444
1419
 
1445
1420
  xhr.onreadystatechange = function () {
@@ -1779,7 +1754,7 @@
1779
1754
  return view.buffer;
1780
1755
  };
1781
1756
 
1782
- var _excluded = ["cancellationToken", "mode"];
1757
+ var _excluded = ["mode"];
1783
1758
 
1784
1759
  function _await$b(value, then, direct) {
1785
1760
  if (direct) {
@@ -1794,36 +1769,15 @@
1794
1769
  }
1795
1770
 
1796
1771
  var fetchNative = _async$b(function (url) {
1797
-
1798
1772
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1799
1773
 
1800
- var _ref$cancellationToke = _ref.cancellationToken,
1801
- cancellationToken = _ref$cancellationToke === void 0 ? createCancellationToken() : _ref$cancellationToke,
1802
- _ref$mode = _ref.mode,
1774
+ var _ref$mode = _ref.mode,
1803
1775
  mode = _ref$mode === void 0 ? "cors" : _ref$mode,
1804
1776
  options = _objectWithoutProperties(_ref, _excluded);
1805
1777
 
1806
- var abortController = new AbortController();
1807
- var cancelError;
1808
- cancellationToken.register(function (reason) {
1809
- cancelError = reason;
1810
- abortController.abort(reason);
1811
- });
1812
- var response;
1813
- return _continue$3(_catch$5(function () {
1814
- return _await$b(window.fetch(url, _objectSpread2({
1815
- signal: abortController.signal,
1816
- mode: mode
1817
- }, options)), function (_window$fetch) {
1818
- response = _window$fetch;
1819
- });
1820
- }, function (e) {
1821
- if (cancelError && e.name === "AbortError") {
1822
- throw cancelError;
1823
- }
1824
-
1825
- throw e;
1826
- }), function (_result) {
1778
+ return _await$b(window.fetch(url, _objectSpread2({
1779
+ mode: mode
1780
+ }, options)), function (response) {
1827
1781
  return {
1828
1782
  url: response.url,
1829
1783
  status: response.status,
@@ -1848,32 +1802,6 @@
1848
1802
  });
1849
1803
  });
1850
1804
 
1851
- function _catch$5(body, recover) {
1852
- try {
1853
- var result = body();
1854
- } catch (e) {
1855
- return recover(e);
1856
- }
1857
-
1858
- if (result && result.then) {
1859
- return result.then(void 0, recover);
1860
- }
1861
-
1862
- return result;
1863
- }
1864
-
1865
- var responseToHeaders$1 = function responseToHeaders(response) {
1866
- var headers = {};
1867
- response.headers.forEach(function (value, name) {
1868
- headers[name] = value;
1869
- });
1870
- return headers;
1871
- };
1872
-
1873
- function _continue$3(value, then) {
1874
- return value && value.then ? value.then(then) : then(value);
1875
- }
1876
-
1877
1805
  function _async$b(f) {
1878
1806
  return function () {
1879
1807
  for (var args = [], i = 0; i < arguments.length; i++) {
@@ -1888,6 +1816,14 @@
1888
1816
  };
1889
1817
  }
1890
1818
 
1819
+ var responseToHeaders$1 = function responseToHeaders(response) {
1820
+ var headers = {};
1821
+ response.headers.forEach(function (value, name) {
1822
+ headers[name] = value;
1823
+ });
1824
+ return headers;
1825
+ };
1826
+
1891
1827
  var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
1892
1828
 
1893
1829
  var pathnameToExtension$1 = function pathnameToExtension(pathname) {
@@ -2386,7 +2322,7 @@
2386
2322
  });
2387
2323
 
2388
2324
  /*
2389
- * SJS 6.10.3
2325
+ * SJS 6.11.0
2390
2326
  * Minimal SystemJS Build
2391
2327
  */
2392
2328
  (function () {
@@ -2984,25 +2920,26 @@
2984
2920
  }
2985
2921
 
2986
2922
  var loader = this;
2987
- return new Promise(function (resolve, reject) {
2988
- var script = systemJSPrototype.createScript(url);
2989
- script.addEventListener('error', function () {
2990
- reject(Error(errMsg(3, [url, firstParentUrl].join(', '))));
2991
- });
2992
- script.addEventListener('load', function () {
2993
- document.head.removeChild(script); // Note that if an error occurs that isn't caught by this if statement,
2994
- // that getRegister will return null and a "did not instantiate" error will be thrown.
2923
+ return Promise.resolve(systemJSPrototype.createScript(url)).then(function (script) {
2924
+ return new Promise(function (resolve, reject) {
2925
+ script.addEventListener('error', function () {
2926
+ reject(Error(errMsg(3, [url, firstParentUrl].join(', '))));
2927
+ });
2928
+ script.addEventListener('load', function () {
2929
+ document.head.removeChild(script); // Note that if an error occurs that isn't caught by this if statement,
2930
+ // that getRegister will return null and a "did not instantiate" error will be thrown.
2995
2931
 
2996
- if (lastWindowErrorUrl === url) {
2997
- reject(lastWindowError);
2998
- } else {
2999
- var register = loader.getRegister(url); // Clear any auto import registration for dynamic import scripts during load
2932
+ if (lastWindowErrorUrl === url) {
2933
+ reject(lastWindowError);
2934
+ } else {
2935
+ var register = loader.getRegister(url); // Clear any auto import registration for dynamic import scripts during load
3000
2936
 
3001
- if (register && register[0] === lastAutoImportDeps) clearTimeout(lastAutoImportTimeout);
3002
- resolve(register);
3003
- }
2937
+ if (register && register[0] === lastAutoImportDeps) clearTimeout(lastAutoImportTimeout);
2938
+ resolve(register);
2939
+ }
2940
+ });
2941
+ document.head.appendChild(script);
3004
2942
  });
3005
- document.head.appendChild(script);
3006
2943
  });
3007
2944
  };
3008
2945
  /*