@jsenv/core 27.0.0-alpha.6 → 27.0.0-alpha.60
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/dist/event_source_client.js +545 -0
- package/dist/event_source_client.js.map +187 -0
- package/dist/html_supervisor_installer.js +1236 -0
- package/dist/html_supervisor_installer.js.map +337 -0
- package/dist/html_supervisor_setup.js +95 -0
- package/dist/html_supervisor_setup.js.map +57 -0
- package/dist/import_meta_hot.js +86 -0
- package/dist/import_meta_hot.js.map +42 -0
- package/main.js +8 -1
- package/package.json +30 -28
- package/readme.md +6 -14
- package/src/build/build.js +943 -555
- package/src/build/build_urls_generator.js +48 -23
- package/src/build/graph_utils.js +31 -0
- package/src/build/{inject_version_mappings.js → inject_global_version_mappings.js} +33 -15
- package/src/build/inject_service_worker_urls.js +79 -0
- package/src/build/resync_ressource_hints.js +68 -0
- package/src/build/start_build_server.js +192 -0
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +2 -2
- package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +3 -1
- package/src/dev/start_dev_server.js +136 -30
- package/src/execute/execute.js +31 -6
- package/src/execute/run.js +19 -56
- package/src/execute/runtimes/browsers/from_playwright.js +207 -147
- package/src/execute/runtimes/node/controllable_file.mjs +26 -10
- package/src/execute/runtimes/node/node_execution_performance.js +67 -0
- package/src/execute/runtimes/node/node_process.js +280 -39
- package/src/jsenv_root_directory_url.js +1 -0
- package/src/omega/{runtime_support/default_runtime_support.js → compat/default_runtime_compat.js} +3 -5
- package/src/omega/{runtime_support/features_compatibility.js → compat/features_compats.js} +66 -4
- package/src/omega/compat/runtime_compat.js +50 -0
- package/src/omega/errors.js +51 -58
- package/src/omega/fetched_content_compliance.js +24 -0
- package/src/omega/file_url_converter.js +8 -50
- package/src/omega/kitchen.js +482 -304
- package/src/omega/omega_server.js +2 -3
- package/src/omega/server/file_service.js +53 -25
- package/src/omega/server/user_agent.js +4 -2
- package/src/omega/url_graph/url_graph_load.js +22 -7
- package/src/omega/url_graph/url_graph_report.js +98 -48
- package/src/omega/url_graph/url_info_transformations.js +26 -9
- package/src/omega/url_graph.js +80 -16
- package/src/omega/web_workers.js +42 -0
- package/src/{dev/plugins/autoreload → plugins/autoreload/dev_sse}/client/autoreload_preference.js +0 -0
- package/src/{dev/plugins/autoreload → plugins/autoreload/dev_sse}/client/event_source_client.js +2 -2
- package/src/{dev/plugins/autoreload → plugins/autoreload/dev_sse}/client/reload.js +0 -0
- package/src/{dev/plugins/autoreload → plugins/autoreload/dev_sse}/client/url_helpers.js +0 -0
- package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_client.js +46 -0
- package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_server.js +204 -0
- package/src/plugins/autoreload/jsenv_plugin_autoreload.js +27 -0
- package/src/plugins/autoreload/jsenv_plugin_hmr.js +35 -0
- package/src/plugins/bundling/css/bundle_css.js +140 -0
- package/src/plugins/bundling/js_classic_workers/bundle_js_classic_workers.js +13 -0
- package/src/plugins/bundling/js_module/bundle_js_module.js +309 -0
- package/src/plugins/bundling/jsenv_plugin_bundling.js +54 -0
- package/src/plugins/cache_control/jsenv_plugin_cache_control.js +34 -0
- package/src/{omega/core_plugins → plugins}/commonjs_globals/jsenv_plugin_commonjs_globals.js +54 -41
- package/src/plugins/file_urls/jsenv_plugin_file_urls.js +66 -0
- package/src/{omega/core_plugins → plugins}/filesystem_magic/jsenv_plugin_filesystem_magic.js +8 -5
- package/src/{omega/core_plugins → plugins}/html_supervisor/client/error_in_document.js +0 -0
- package/src/{omega/core_plugins → plugins}/html_supervisor/client/error_in_notification.js +0 -0
- package/src/plugins/html_supervisor/client/html_supervisor_installer.js +242 -0
- package/src/plugins/html_supervisor/client/html_supervisor_setup.js +79 -0
- package/src/{omega/core_plugins → plugins}/html_supervisor/client/perf_browser.js +0 -0
- package/src/{omega/core_plugins → plugins}/html_supervisor/client/uneval_exception.js +0 -0
- package/src/{omega/core_plugins → plugins}/html_supervisor/jsenv_plugin_html_supervisor.js +83 -61
- package/src/plugins/http_urls/jsenv_plugin_http_urls.js +12 -0
- package/src/{dev/plugins/autoreload → plugins/import_meta_hot}/babel_plugin_metadata_import_meta_hot.js +4 -5
- package/src/{dev/plugins/autoreload → plugins/import_meta_hot}/client/import_meta_hot.js +3 -1
- package/src/{dev/plugins/autoreload → plugins/import_meta_hot}/html_hot_dependencies.js +2 -2
- package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +105 -0
- package/src/{omega/core_plugins → plugins}/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +33 -8
- package/src/plugins/import_meta_url/client/import_meta_url_browser.js +52 -0
- package/src/plugins/import_meta_url/client/import_meta_url_commonjs.mjs +9 -0
- package/src/{omega/core_plugins → plugins}/importmap/jsenv_plugin_importmap.js +39 -33
- package/src/plugins/inject_globals/jsenv_plugin_inject_globals.js +67 -0
- package/src/{omega/core_plugins → plugins}/inline/client/inline_content.js +0 -0
- package/src/{omega/core_plugins → plugins}/inline/jsenv_plugin_data_urls.js +18 -14
- package/src/{omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js → plugins/inline/jsenv_plugin_html_inline_content.js} +65 -44
- package/src/plugins/inline/jsenv_plugin_inline.js +36 -0
- package/src/{omega/core_plugins → plugins}/inline/jsenv_plugin_inline_query_param.js +6 -6
- package/src/plugins/inline/jsenv_plugin_js_inline_content.js +297 -0
- package/src/plugins/leading_slash/jsenv_plugin_leading_slash.js +13 -0
- package/src/plugins/minification/css/minify_css.js +9 -0
- package/src/plugins/minification/html/minify_html.js +15 -0
- package/src/{build/plugins/minify_js/jsenv_plugin_minify_js.js → plugins/minification/js/minify_js.js} +6 -22
- package/src/plugins/minification/jsenv_plugin_minification.js +78 -0
- package/src/plugins/minification/json/minify_json.js +8 -0
- package/src/plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +146 -0
- package/src/{omega → plugins}/plugin_controller.js +42 -11
- package/src/plugins/plugins.js +92 -0
- package/src/plugins/transpilation/as_js_classic/client/s.js +874 -0
- package/src/plugins/transpilation/as_js_classic/client/s.js.md +1 -0
- package/src/plugins/transpilation/as_js_classic/helpers/babel_plugin_transform_import_meta_url.js +47 -0
- package/src/plugins/transpilation/as_js_classic/helpers/systemjs_old.js +43 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic.js +199 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_script_type_module_as_classic.js +270 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_workers_type_module_as_classic.js +55 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/global_this/client/global_this.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/helpers/babel_plugin_babel_helpers_as_jsenv_imports.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/helpers/babel_plugin_structure.js +12 -19
- package/src/{omega/core_plugins → plugins/transpilation}/babel/helpers/babel_plugins_compatibility.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/jsenv_plugin_babel.js +45 -27
- package/src/{omega/core_plugins → plugins/transpilation}/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +30 -6
- package/src/{omega/core_plugins → plugins/transpilation}/babel/new_stylesheet/client/.eslintrc.cjs +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/new_stylesheet/client/new_stylesheet.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -0
- package/src/{omega/core_plugins → plugins/transpilation}/babel/regenerator_runtime/client/regenerator_runtime.js +0 -0
- package/src/plugins/transpilation/css_parcel/jsenv_plugin_css_parcel.js +18 -0
- package/src/plugins/transpilation/fetch_original_url_info.js +30 -0
- package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +181 -0
- package/src/plugins/transpilation/jsenv_plugin_top_level_await.js +80 -0
- package/src/plugins/transpilation/jsenv_plugin_transpilation.js +44 -0
- package/src/plugins/url_analysis/css/css_urls.js +49 -0
- package/src/plugins/url_analysis/html/html_urls.js +269 -0
- package/src/plugins/url_analysis/js/js_urls.js +67 -0
- package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +18 -0
- package/src/plugins/url_analysis/webmanifest/webmanifest_urls.js +17 -0
- package/src/{omega/core_plugins → plugins}/url_resolution/jsenv_plugin_url_resolution.js +12 -5
- package/src/plugins/url_version/jsenv_plugin_url_version.js +28 -0
- package/src/test/execute_plan.js +30 -18
- package/src/test/execute_test_plan.js +23 -8
- package/src/test/logs_file_execution.js +9 -8
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +0 -225
- package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +0 -30
- package/src/dev/plugins/autoreload/client/event_source_connection.js +0 -195
- package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +0 -374
- package/src/dev/plugins/autoreload/sse_service.js +0 -149
- package/src/execute/runtimes/node/controlled_process.js +0 -316
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +0 -67
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +0 -168
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +0 -77
- package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +0 -98
- package/src/omega/core_plugins/import_assertions/helpers/json_module.js +0 -12
- package/src/omega/core_plugins/import_assertions/helpers/text_module.js +0 -6
- package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +0 -211
- package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +0 -13
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +0 -210
- package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +0 -12
- package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +0 -77
- package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +0 -50
- package/src/omega/core_plugins.js +0 -39
- package/src/omega/runtime_support/runtime_support.js +0 -20
- package/src/omega/url_graph/url_graph_sort.js +0 -29
- package/src/omega/url_mentions/css_url_mentions.js +0 -63
- package/src/omega/url_mentions/html_url_mentions.js +0 -185
- package/src/omega/url_mentions/js_module_url_mentions.js +0 -91
- package/src/omega/url_mentions/parse_url_mentions.js +0 -37
- package/src/omega/url_mentions/worker_classic_url_mentions.js +0 -37
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "html_supervisor_setup.js",
|
|
4
|
+
"sources": [
|
|
5
|
+
"../src/plugins/html_supervisor/client/html_supervisor_setup.js"
|
|
6
|
+
],
|
|
7
|
+
"sourcesContent": [
|
|
8
|
+
"window.__html_supervisor__ = {\n // \"html_supervisor_installer.js\" will implement\n // - \"addScriptToExecute\"\n // - \"superviseScriptTypeModule\"\n // - \"collectScriptResults\"\n // and take all executions in \"scriptsToExecute\" and implement their supervision\n scriptsToExecute: [],\n addScriptToExecute: (scriptToExecute) => {\n window.__html_supervisor__.scriptsToExecute.push(scriptToExecute)\n },\n superviseScript: ({ src, isInline, crossorigin, integrity }) => {\n window.__html_supervisor__.addScriptToExecute({\n src,\n type: \"js_classic\",\n isInline,\n currentScript: document.currentScript,\n execute: () => {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\")\n if (crossorigin) {\n script.crossorigin = crossorigin\n }\n if (integrity) {\n script.integrity = integrity\n }\n script.src = src\n const scriptUrl = new URL(src, window.location).href\n let lastWindowErrorUrl\n let lastWindowError\n const windowErrorCallback = (e) => {\n lastWindowErrorUrl = e.filename\n lastWindowError = e.error\n }\n const cleanup = () => {\n document.body.removeChild(script)\n window.removeEventListener(\"error\", windowErrorCallback)\n }\n window.addEventListener(\"error\", windowErrorCallback)\n script.addEventListener(\"error\", () => {\n cleanup()\n reject(src)\n })\n script.addEventListener(\"load\", () => {\n cleanup()\n if (lastWindowErrorUrl === scriptUrl) {\n reject(lastWindowError)\n } else {\n resolve()\n }\n })\n document.body.appendChild(script)\n })\n },\n })\n },\n superviseScriptTypeModule: () => {\n throw new Error(\"htmlSupervisor not installed\")\n },\n getScriptExecutionResults: () => {\n // wait for page to load before collecting script execution results\n const htmlReadyPromise = new Promise((resolve) => {\n if (document.readyState === \"complete\") {\n resolve()\n return\n }\n const loadCallback = () => {\n window.removeEventListener(\"load\", loadCallback)\n resolve()\n }\n window.addEventListener(\"load\", loadCallback)\n })\n return htmlReadyPromise.then(() => {\n return window.__html_supervisor__.collectScriptResults()\n })\n },\n collectScriptResults: () => {\n throw new Error(\"htmlSupervisor not installed\")\n },\n}\n"
|
|
9
|
+
],
|
|
10
|
+
"names": [
|
|
11
|
+
"window",
|
|
12
|
+
"__html_supervisor__",
|
|
13
|
+
"scriptsToExecute",
|
|
14
|
+
"addScriptToExecute",
|
|
15
|
+
"scriptToExecute",
|
|
16
|
+
"push",
|
|
17
|
+
"superviseScript",
|
|
18
|
+
"src",
|
|
19
|
+
"isInline",
|
|
20
|
+
"crossorigin",
|
|
21
|
+
"integrity",
|
|
22
|
+
"type",
|
|
23
|
+
"currentScript",
|
|
24
|
+
"document",
|
|
25
|
+
"execute",
|
|
26
|
+
"Promise",
|
|
27
|
+
"resolve",
|
|
28
|
+
"reject",
|
|
29
|
+
"script",
|
|
30
|
+
"createElement",
|
|
31
|
+
"scriptUrl",
|
|
32
|
+
"URL",
|
|
33
|
+
"location",
|
|
34
|
+
"href",
|
|
35
|
+
"lastWindowErrorUrl",
|
|
36
|
+
"lastWindowError",
|
|
37
|
+
"windowErrorCallback",
|
|
38
|
+
"e",
|
|
39
|
+
"filename",
|
|
40
|
+
"error",
|
|
41
|
+
"cleanup",
|
|
42
|
+
"body",
|
|
43
|
+
"removeChild",
|
|
44
|
+
"removeEventListener",
|
|
45
|
+
"addEventListener",
|
|
46
|
+
"appendChild",
|
|
47
|
+
"superviseScriptTypeModule",
|
|
48
|
+
"Error",
|
|
49
|
+
"getScriptExecutionResults",
|
|
50
|
+
"htmlReadyPromise",
|
|
51
|
+
"readyState",
|
|
52
|
+
"loadCallback",
|
|
53
|
+
"then",
|
|
54
|
+
"collectScriptResults"
|
|
55
|
+
],
|
|
56
|
+
"mappings": "AAAAA,MAAM,CAACC,mBAAP,GAA6B;AAC3B;AACA;AACA;AACA;AACA;AACAC,EAAAA,gBAAgB,EAAE,EANS;EAO3BC,kBAAkB,EAAGC,eAAD,IAAqB;AACvCJ,IAAAA,MAAM,CAACC,mBAAP,CAA2BC,gBAA3B,CAA4CG,IAA5C,CAAiDD,eAAjD,CAAA,CAAA;GARyB;AAU3BE,EAAAA,eAAe,EAAE,CAAC;IAAEC,GAAF;IAAOC,QAAP;IAAiBC,WAAjB;AAA8BC,IAAAA,SAAAA;AAA9B,GAAD,KAA+C;AAC9DV,IAAAA,MAAM,CAACC,mBAAP,CAA2BE,kBAA3B,CAA8C;MAC5CI,GAD4C;AAE5CI,MAAAA,IAAI,EAAE,YAFsC;MAG5CH,QAH4C;MAI5CI,aAAa,EAAEC,QAAQ,CAACD,aAJoB;AAK5CE,MAAAA,OAAO,EAAE,MAAM;AACb,QAAA,OAAO,IAAIC,OAAJ,CAAY,CAACC,OAAD,EAAUC,MAAV,KAAqB;AACtC,UAAA,MAAMC,MAAM,GAAGL,QAAQ,CAACM,aAAT,CAAuB,QAAvB,CAAf,CAAA;;AACA,UAAA,IAAIV,WAAJ,EAAiB;YACfS,MAAM,CAACT,WAAP,GAAqBA,WAArB,CAAA;AACD,WAAA;;AACD,UAAA,IAAIC,SAAJ,EAAe;YACbQ,MAAM,CAACR,SAAP,GAAmBA,SAAnB,CAAA;AACD,WAAA;;UACDQ,MAAM,CAACX,GAAP,GAAaA,GAAb,CAAA;UACA,MAAMa,SAAS,GAAG,IAAIC,GAAJ,CAAQd,GAAR,EAAaP,MAAM,CAACsB,QAApB,CAAA,CAA8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C,OAAD,IAAa;AAChD,MAAA,IAAIH,QAAQ,CAAC2B,UAAT,KAAwB,UAA5B,EAAwC;QACtCxB,OAAO,EAAA,CAAA;AACP,QAAA,OAAA;AACD,OAAA;;MACD,MAAMyB,YAAY,GAAG,MAAM;AACzBzC,QAAAA,MAAM,CAACiC,mBAAP,CAA2B,MAA3B,EAAmCQ,YAAnC,CAAA,CAAA;QACAzB,OAAO,EAAA,CAAA;OAFT,CAAA;;AAIAhB,MAAAA,MAAM,CAACkC,gBAAP,CAAwB,MAAxB,EAAgCO,YAAhC,CAAA,CAAA;AACD,KAVwB,CAAzB,CAAA;AAWA,IAAA,OAAOF,gBAAgB,CAACG,IAAjB,CAAsB,MAAM;AACjC,MAAA,OAAO1C,MAAM,CAACC,mBAAP,CAA2B0C,oBAA3B,EAAP,CAAA;AACD,KAFM,CAAP,CAAA;GAvEyB;AA2E3BA,EAAAA,oBAAoB,EAAE,MAAM;AAC1B,IAAA,MAAM,IAAIN,KAAJ,CAAU,8BAAV,CAAN,CAAA;AACD,GAAA;AA7E0B,CAA7B"
|
|
57
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* https://vitejs.dev/guide/api-hmr.html#hot-accept-deps-cb
|
|
3
|
+
* https://modern-web.dev/docs/dev-server/plugins/hmr/
|
|
4
|
+
*/
|
|
5
|
+
const urlHotMetas = {};
|
|
6
|
+
const createImportMetaHot = importMetaUrl => {
|
|
7
|
+
const data = {};
|
|
8
|
+
const url = asUrlWithoutHmrQuery(importMetaUrl);
|
|
9
|
+
return {
|
|
10
|
+
data,
|
|
11
|
+
accept: (firstArg, secondArg) => {
|
|
12
|
+
if (!firstArg) {
|
|
13
|
+
addUrlMeta(url, {
|
|
14
|
+
dependencies: [url],
|
|
15
|
+
acceptCallback: () => {}
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (typeof firstArg === "function") {
|
|
21
|
+
addUrlMeta(url, {
|
|
22
|
+
dependencies: [url],
|
|
23
|
+
acceptCallback: firstArg
|
|
24
|
+
});
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof firstArg === "string") {
|
|
29
|
+
addUrlMeta(url, {
|
|
30
|
+
dependencies: [firstArg],
|
|
31
|
+
acceptCallback: secondArg
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (Array.isArray(firstArg)) {
|
|
37
|
+
addUrlMeta(url, {
|
|
38
|
+
dependencies: firstArg,
|
|
39
|
+
acceptCallback: secondArg
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw new Error("invalid call to import.meta.hot.accept(), received ".concat(firstArg));
|
|
45
|
+
},
|
|
46
|
+
dispose: callback => {
|
|
47
|
+
addUrlMeta(url, {
|
|
48
|
+
disposeCallback: () => {
|
|
49
|
+
return callback(data);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
decline: () => {
|
|
54
|
+
addUrlMeta(url, {
|
|
55
|
+
declined: true
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
invalidate: () => {
|
|
59
|
+
addUrlMeta(url, {
|
|
60
|
+
invalidated: true
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const addUrlMeta = (url, meta) => {
|
|
67
|
+
urlHotMetas[url] = { ...urlHotMetas[url],
|
|
68
|
+
...meta
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const asUrlWithoutHmrQuery = url => {
|
|
73
|
+
const urlObject = new URL(url);
|
|
74
|
+
|
|
75
|
+
if (urlObject.searchParams.has("hmr")) {
|
|
76
|
+
urlObject.searchParams.delete("hmr");
|
|
77
|
+
urlObject.searchParams.delete("v");
|
|
78
|
+
return urlObject.href;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return url;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { createImportMetaHot, urlHotMetas };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=import_meta_hot.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "import_meta_hot.js",
|
|
4
|
+
"sources": [
|
|
5
|
+
"../src/plugins/import_meta_hot/client/import_meta_hot.js"
|
|
6
|
+
],
|
|
7
|
+
"sourcesContent": [
|
|
8
|
+
"/*\n * https://vitejs.dev/guide/api-hmr.html#hot-accept-deps-cb\n * https://modern-web.dev/docs/dev-server/plugins/hmr/\n */\n\nexport const urlHotMetas = {}\n\nexport const createImportMetaHot = (importMetaUrl) => {\n const data = {}\n const url = asUrlWithoutHmrQuery(importMetaUrl)\n\n return {\n data,\n accept: (firstArg, secondArg) => {\n if (!firstArg) {\n addUrlMeta(url, {\n dependencies: [url],\n acceptCallback: () => {},\n })\n return\n }\n if (typeof firstArg === \"function\") {\n addUrlMeta(url, {\n dependencies: [url],\n acceptCallback: firstArg,\n })\n return\n }\n if (typeof firstArg === \"string\") {\n addUrlMeta(url, {\n dependencies: [firstArg],\n acceptCallback: secondArg,\n })\n return\n }\n if (Array.isArray(firstArg)) {\n addUrlMeta(url, {\n dependencies: firstArg,\n acceptCallback: secondArg,\n })\n return\n }\n throw new Error(\n `invalid call to import.meta.hot.accept(), received ${firstArg}`,\n )\n },\n dispose: (callback) => {\n addUrlMeta(url, {\n disposeCallback: () => {\n return callback(data)\n },\n })\n },\n decline: () => {\n addUrlMeta(url, {\n declined: true,\n })\n },\n invalidate: () => {\n addUrlMeta(url, {\n invalidated: true,\n })\n },\n }\n}\n\nconst addUrlMeta = (url, meta) => {\n urlHotMetas[url] = {\n ...urlHotMetas[url],\n ...meta,\n }\n}\n\nconst asUrlWithoutHmrQuery = (url) => {\n const urlObject = new URL(url)\n if (urlObject.searchParams.has(\"hmr\")) {\n urlObject.searchParams.delete(\"hmr\")\n urlObject.searchParams.delete(\"v\")\n return urlObject.href\n }\n return url\n}\n"
|
|
9
|
+
],
|
|
10
|
+
"names": [
|
|
11
|
+
"urlHotMetas",
|
|
12
|
+
"createImportMetaHot",
|
|
13
|
+
"importMetaUrl",
|
|
14
|
+
"data",
|
|
15
|
+
"url",
|
|
16
|
+
"asUrlWithoutHmrQuery",
|
|
17
|
+
"accept",
|
|
18
|
+
"firstArg",
|
|
19
|
+
"secondArg",
|
|
20
|
+
"addUrlMeta",
|
|
21
|
+
"dependencies",
|
|
22
|
+
"acceptCallback",
|
|
23
|
+
"Array",
|
|
24
|
+
"isArray",
|
|
25
|
+
"Error",
|
|
26
|
+
"dispose",
|
|
27
|
+
"callback",
|
|
28
|
+
"disposeCallback",
|
|
29
|
+
"decline",
|
|
30
|
+
"declined",
|
|
31
|
+
"invalidate",
|
|
32
|
+
"invalidated",
|
|
33
|
+
"meta",
|
|
34
|
+
"urlObject",
|
|
35
|
+
"URL",
|
|
36
|
+
"searchParams",
|
|
37
|
+
"has",
|
|
38
|
+
"delete",
|
|
39
|
+
"href"
|
|
40
|
+
],
|
|
41
|
+
"mappings": "AAAA;AACA;AACA;AACA;AAEO,MAAMA,WAAW,GAAG,GAApB;AAEMC,MAAAA,mBAAmB,GAAIC,aAAD,IAAmB;EACpD,MAAMC,IAAI,GAAG,EAAb,CAAA;AACA,EAAA,MAAMC,GAAG,GAAGC,oBAAoB,CAACH,aAAD,CAAhC,CAAA;EAEA,OAAO;IACLC,IADK;AAELG,IAAAA,MAAM,EAAE,CAACC,QAAD,EAAWC,SAAX,KAAyB;MAC/B,IAAI,CAACD,QAAL,EAAe;QACbE,UAAU,CAACL,GAAD,EAAM;UACdM,YAAY,EAAE,CAACN,GAAD,CADA;UAEdO,cAAc,EAAE,MAAM,EAAE;AAFV,SAAN,CAAV,CAAA;AAIA,QAAA,OAAA;AACD,OAAA;;AACD,MAAA,IAAI,OAAOJ,QAAP,KAAo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WAAW,CAACI,GAAD,CAAX,GAAmB,EACjB,GAAGJ,WAAW,CAACI,GAAD,CADG;IAEjB,GAAGkB,IAAAA;GAFL,CAAA;AAID,CALD,CAAA;;AAOA,MAAMjB,oBAAoB,GAAID,GAAD,IAAS;AACpC,EAAA,MAAMmB,SAAS,GAAG,IAAIC,GAAJ,CAAQpB,GAAR,CAAlB,CAAA;;EACA,IAAImB,SAAS,CAACE,YAAV,CAAuBC,GAAvB,CAA2B,KAA3B,CAAJ,EAAuC;AACrCH,IAAAA,SAAS,CAACE,YAAV,CAAuBE,MAAvB,CAA8B,KAA9B,CAAA,CAAA;AACAJ,IAAAA,SAAS,CAACE,YAAV,CAAuBE,MAAvB,CAA8B,GAA9B,CAAA,CAAA;IACA,OAAOJ,SAAS,CAACK,IAAjB,CAAA;AACD,GAAA;;AACD,EAAA,OAAOxB,GAAP,CAAA;AACD,CARD;;;;"
|
|
42
|
+
}
|
package/main.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
// dev
|
|
1
2
|
export { startDevServer } from "./src/dev/start_dev_server.js"
|
|
2
|
-
|
|
3
|
+
// test
|
|
4
|
+
export {
|
|
5
|
+
executeTestPlan,
|
|
6
|
+
defaultCoverageConfig,
|
|
7
|
+
} from "./src/test/execute_test_plan.js"
|
|
3
8
|
export {
|
|
4
9
|
chromium,
|
|
5
10
|
chromiumIsolatedTab,
|
|
@@ -13,7 +18,9 @@ export {
|
|
|
13
18
|
webkitIsolatedTab,
|
|
14
19
|
} from "./src/execute/runtimes/browsers/webkit.js"
|
|
15
20
|
export { nodeProcess } from "./src/execute/runtimes/node/node_process.js"
|
|
21
|
+
// build
|
|
16
22
|
export { build } from "./src/build/build.js"
|
|
23
|
+
export { startBuildServer } from "./src/build/start_build_server.js"
|
|
17
24
|
|
|
18
25
|
// advanced
|
|
19
26
|
export { execute } from "./src/execute/execute.js"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "27.0.0-alpha.
|
|
3
|
+
"version": "27.0.0-alpha.60",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"node": ">=16.13.0"
|
|
12
12
|
},
|
|
13
13
|
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
14
|
+
"access": "public",
|
|
15
|
+
"registry": "https://registry.npmjs.org"
|
|
15
16
|
},
|
|
16
17
|
"type": "module",
|
|
17
18
|
"imports": {},
|
|
@@ -32,37 +33,42 @@
|
|
|
32
33
|
],
|
|
33
34
|
"scripts": {
|
|
34
35
|
"eslint": "npx eslint . --ext=.js,.mjs,.cjs,.html",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"test
|
|
38
|
-
"
|
|
39
|
-
"start_file_server": "node ./
|
|
40
|
-
"
|
|
41
|
-
"
|
|
36
|
+
"dev": "node ./scripts/dev/dev.mjs",
|
|
37
|
+
"build": "node ./scripts/build/build.mjs",
|
|
38
|
+
"test": "node ./scripts/test/test.mjs",
|
|
39
|
+
"test-packages": "npm run test --workspaces --if-present",
|
|
40
|
+
"start_file_server": "node ./scripts/dev/start_file_server.mjs",
|
|
41
|
+
"workspace-versions": "node ./scripts/publish/workspace_versions.mjs",
|
|
42
|
+
"workspace-publish": "node ./scripts/publish/workspace_publish.mjs",
|
|
43
|
+
"performances": "node --expose-gc ./scripts/performance/generate_performance_report.mjs --log --once",
|
|
44
|
+
"file-size": "node ./scripts/file_size/file_size.mjs --log",
|
|
42
45
|
"prettier": "prettier --write .",
|
|
43
46
|
"playwright-install": "npx playwright install-deps && npx playwright install",
|
|
44
|
-
"certificate-install": "node ./
|
|
45
|
-
"
|
|
46
|
-
"workspace-publish": "node ./script/publish/workspace_publish.mjs",
|
|
47
|
+
"certificate-install": "node ./scripts/dev/install_certificate_authority.mjs",
|
|
48
|
+
"test-with-coverage": "npm run test -- --coverage",
|
|
47
49
|
"prepublishOnly": "npm run build"
|
|
48
50
|
},
|
|
49
51
|
"optionalDependencies": {
|
|
50
52
|
"playwright": "1.x"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
55
|
+
"@babel/parser": "7.17.9",
|
|
56
|
+
"@babel/plugin-proposal-dynamic-import": "7.16.7",
|
|
57
|
+
"@babel/plugin-transform-modules-systemjs": "7.17.8",
|
|
58
|
+
"@babel/plugin-transform-modules-umd": "7.16.7",
|
|
53
59
|
"@c88/v8-coverage": "0.1.1",
|
|
54
60
|
"@financial-times/polyfill-useragent-normaliser": "2.0.1",
|
|
55
61
|
"@jsenv/abort": "4.1.2",
|
|
56
62
|
"@jsenv/babel-plugins": "1.0.2",
|
|
57
|
-
"@jsenv/filesystem": "3.
|
|
63
|
+
"@jsenv/filesystem": "3.2.2",
|
|
58
64
|
"@jsenv/importmap": "1.2.0",
|
|
59
65
|
"@jsenv/integrity": "0.0.1",
|
|
60
|
-
"@jsenv/log": "1.5.
|
|
66
|
+
"@jsenv/log": "1.5.2",
|
|
61
67
|
"@jsenv/logger": "4.0.1",
|
|
62
|
-
"@jsenv/node-esm-resolution": "0.0.
|
|
63
|
-
"@jsenv/server": "12.6.
|
|
68
|
+
"@jsenv/node-esm-resolution": "0.0.6",
|
|
69
|
+
"@jsenv/server": "12.6.2",
|
|
64
70
|
"@jsenv/uneval": "1.6.0",
|
|
65
|
-
"@jsenv/utils": "1.
|
|
71
|
+
"@jsenv/utils": "1.7.5",
|
|
66
72
|
"construct-style-sheets-polyfill": "3.1.0",
|
|
67
73
|
"cssnano": "5.1.7",
|
|
68
74
|
"cssnano-preset-default": "5.2.7",
|
|
@@ -76,6 +82,7 @@
|
|
|
76
82
|
"pidtree": "0.5.0",
|
|
77
83
|
"regenerator-runtime": "0.13.9",
|
|
78
84
|
"strip-ansi": "7.0.1",
|
|
85
|
+
"systemjs": "6.12.1",
|
|
79
86
|
"terser": "5.12.1",
|
|
80
87
|
"v8-to-istanbul": "8.1.1",
|
|
81
88
|
"wrap-ansi": "8.0.1"
|
|
@@ -83,27 +90,22 @@
|
|
|
83
90
|
"devDependencies": {
|
|
84
91
|
"@babel/eslint-parser": "7.17.0",
|
|
85
92
|
"@babel/plugin-syntax-import-assertions": "7.16.7",
|
|
86
|
-
"@jsenv/assert": "2.5.
|
|
93
|
+
"@jsenv/assert": "2.5.4",
|
|
87
94
|
"@jsenv/eslint-config": "16.0.9",
|
|
88
|
-
"@jsenv/file-size-impact": "12.1.
|
|
89
|
-
"@jsenv/github-release-package": "1.3.5",
|
|
95
|
+
"@jsenv/file-size-impact": "12.1.11",
|
|
90
96
|
"@jsenv/https-local": "1.0.8",
|
|
91
97
|
"@jsenv/importmap-node-module": "5.1.3",
|
|
92
|
-
"@jsenv/package-
|
|
93
|
-
"@jsenv/
|
|
94
|
-
"@jsenv/
|
|
95
|
-
"@jsenv/pwa": "4.0.1",
|
|
98
|
+
"@jsenv/package-workspace": "0.1.1",
|
|
99
|
+
"@jsenv/performance-impact": "2.2.10",
|
|
100
|
+
"@jsenv/pwa": "5.0.0",
|
|
96
101
|
"eslint": "8.13.0",
|
|
97
102
|
"eslint-plugin-html": "6.2.0",
|
|
98
103
|
"eslint-plugin-import": "2.26.0",
|
|
99
104
|
"eslint-plugin-react": "7.29.4",
|
|
100
105
|
"playwright": "1.20.2",
|
|
101
106
|
"postcss-import": "14.1.0",
|
|
102
|
-
"preact": "10.7.1",
|
|
103
107
|
"prettier": "2.6.2",
|
|
104
|
-
"react": "17.0.2",
|
|
105
|
-
"react-dom": "17.0.2",
|
|
106
108
|
"redux": "4.1.2",
|
|
107
109
|
"rollup": "2.70.1"
|
|
108
110
|
}
|
|
109
|
-
}
|
|
111
|
+
}
|
package/readme.md
CHANGED
|
@@ -175,7 +175,6 @@ Only the content of html files is shown below because the content of non-html fi
|
|
|
175
175
|
<meta charset="utf-8" />
|
|
176
176
|
<link rel="modulepreload" href="./main.js" />
|
|
177
177
|
<link rel="icon" href="./favicon.ico" />
|
|
178
|
-
<script type="importmap" src="./project.importmap"></script>
|
|
179
178
|
<link rel="stylesheet" type="text/css" href="./main.css" />
|
|
180
179
|
</head>
|
|
181
180
|
|
|
@@ -233,20 +232,13 @@ build duration: 0.14 seconds
|
|
|
233
232
|
<head>
|
|
234
233
|
<title>Title</title>
|
|
235
234
|
<meta charset="utf-8" />
|
|
236
|
-
<link rel="modulepreload" href="
|
|
237
|
-
<link rel="icon" href="
|
|
238
|
-
<
|
|
239
|
-
{
|
|
240
|
-
"imports": {
|
|
241
|
-
"./main.js": "./main_c588dd03.js"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
</script>
|
|
245
|
-
<link rel="stylesheet" type="text/css" href="assets/main_cd3a5025.css" />
|
|
235
|
+
<link rel="modulepreload" href="/js/main.js?v=c588dd03" />
|
|
236
|
+
<link rel="icon" href="/other/favicon.ico?v=25e95a00" />
|
|
237
|
+
<link rel="stylesheet" type="text/css" href="/css/main.css?vcd3a5025" />
|
|
246
238
|
</head>
|
|
247
239
|
|
|
248
240
|
<body>
|
|
249
|
-
<script type="module" src="
|
|
241
|
+
<script type="module" src="/js/main?v=c588dd03.js"></script>
|
|
250
242
|
</body>
|
|
251
243
|
</html>
|
|
252
244
|
```
|
|
@@ -271,8 +263,8 @@ The presence of a jsenv configuration file is **optional**.
|
|
|
271
263
|
/*
|
|
272
264
|
* This file exports configuration reused by other files such as
|
|
273
265
|
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
266
|
+
* scripts/test/test.mjs
|
|
267
|
+
* scripts/build/build.mjs
|
|
276
268
|
*
|
|
277
269
|
* Read more at https://github.com/jsenv/jsenv-core#configuration
|
|
278
270
|
*/
|