@jsenv/core 27.0.0-alpha.3 → 27.0.0-alpha.32
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/main.js +4 -0
- package/package.json +17 -14
- package/readme.md +4 -12
- package/src/build/build.js +690 -429
- package/src/build/build_urls_generator.js +33 -21
- 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 +201 -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 +58 -26
- package/src/execute/execute.js +30 -4
- package/src/execute/run.js +19 -56
- package/src/execute/runtimes/browsers/from_playwright.js +201 -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/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 +409 -286
- package/src/omega/server/file_service.js +9 -11
- package/src/omega/url_graph/url_graph_load.js +14 -7
- package/src/omega/url_graph/url_graph_report.js +17 -15
- package/src/omega/url_graph.js +32 -10
- 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 +41 -0
- package/src/{dev/plugins/autoreload/jsenv_plugin_autoreload.js → plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_server.js} +27 -168
- package/src/plugins/autoreload/jsenv_plugin_autoreload.js +25 -0
- package/src/plugins/autoreload/jsenv_plugin_hmr.js +35 -0
- package/src/plugins/bundling/css/bundle_css.js +21 -0
- package/src/plugins/bundling/js_classic_workers/bundle_js_classic_workers.js +13 -0
- package/src/{build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js → plugins/bundling/js_module/bundle_js_module.js} +120 -79
- package/src/plugins/bundling/jsenv_plugin_bundling.js +51 -0
- package/src/{omega/core_plugins → plugins}/commonjs_globals/jsenv_plugin_commonjs_globals.js +48 -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 +7 -4
- 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/{omega/core_plugins → plugins}/html_supervisor/client/html_supervisor_installer.js +3 -2
- package/src/{omega/core_plugins → plugins}/html_supervisor/client/html_supervisor_setup.js +0 -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 +38 -46
- 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 +98 -0
- package/src/{omega/core_plugins → plugins}/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +26 -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 +37 -31
- package/src/plugins/inject_globals/jsenv_plugin_inject_globals.js +25 -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} +61 -40
- 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 +263 -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/{omega/core_plugins → plugins}/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +15 -15
- package/src/{omega → plugins}/plugin_controller.js +18 -10
- package/src/plugins/plugins.js +73 -0
- package/src/plugins/transpilation/as_js_classic/client/s.js +808 -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 +183 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_script_type_module_as_classic.js +256 -0
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_workers_type_module_as_classic.js +139 -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/babel/babel_helper → plugins/transpilation/babel/helpers}/babel_plugin_babel_helpers_as_jsenv_imports.js +1 -2
- package/src/plugins/transpilation/babel/helpers/babel_plugin_structure.js +161 -0
- 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 +38 -22
- 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/{omega/core_plugins → plugins/transpilation}/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +0 -0
- package/src/plugins/transpilation/import_assertions/jsenv_plugin_import_assertions.js +225 -0
- package/src/plugins/transpilation/jsenv_plugin_top_level_await.js +37 -0
- package/src/plugins/transpilation/jsenv_plugin_transpilation.js +44 -0
- package/src/plugins/url_references/css/css_urls.js +49 -0
- package/src/plugins/url_references/html/html_urls.js +273 -0
- package/src/plugins/url_references/js/js_urls.js +163 -0
- package/src/plugins/url_references/jsenv_plugin_url_references.js +18 -0
- package/src/plugins/url_references/webmanifest/webmanifest_urls.js +17 -0
- package/src/{omega/core_plugins → plugins}/url_resolution/jsenv_plugin_url_resolution.js +12 -5
- package/src/{omega/core_plugins → plugins}/url_version/jsenv_plugin_url_version.js +8 -8
- package/src/test/execute_plan.js +25 -11
- package/src/test/execute_test_plan.js +14 -1
- package/src/test/logs_file_execution.js +8 -7
- 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/sse_service.js +0 -149
- package/src/execute/runtimes/node/controlled_process.js +0 -316
- package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +0 -29
- package/src/omega/core_plugins/babel/babel_helper/client/.eslintrc.cjs +0 -24
- package/src/omega/core_plugins/babel/babel_helper/client/AsyncGenerator/AsyncGenerator.js +0 -81
- package/src/omega/core_plugins/babel/babel_helper/client/AwaitValue/AwaitValue.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -33
- package/src/omega/core_plugins/babel/babel_helper/client/arrayLikeToArray/arrayLikeToArray.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/arrayWithHoles/arrayWithHoles.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/arrayWithoutHoles/arrayWithoutHoles.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/assertThisInitialized/assertThisInitialized.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -40
- package/src/omega/core_plugins/babel/babel_helper/client/asyncIterator/asyncIterator.js +0 -65
- package/src/omega/core_plugins/babel/babel_helper/client/asyncToGenerator/asyncToGenerator.js +0 -34
- package/src/omega/core_plugins/babel/babel_helper/client/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -20
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/classCallCheck/classCallCheck.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classNameTDZError/classNameTDZError.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldGet/classPrivateFieldGet.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateFieldSet/classPrivateFieldSet.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateMethodGet/classPrivateMethodGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classPrivateMethodSet/classPrivateMethodSet.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -9
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -15
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/construct/construct.js +0 -16
- package/src/omega/core_plugins/babel/babel_helper/client/createClass/createClass.js +0 -15
- package/src/omega/core_plugins/babel/babel_helper/client/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -60
- package/src/omega/core_plugins/babel/babel_helper/client/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/createRawReactElement/createRawReactElement.js +0 -50
- package/src/omega/core_plugins/babel/babel_helper/client/createSuper/createSuper.js +0 -22
- package/src/omega/core_plugins/babel/babel_helper/client/decorate/decorate.js +0 -403
- package/src/omega/core_plugins/babel/babel_helper/client/defaults/defaults.js +0 -11
- package/src/omega/core_plugins/babel/babel_helper/client/defineEnumerableProperties/defineEnumerableProperties.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/defineProperty/defineProperty.js +0 -18
- package/src/omega/core_plugins/babel/babel_helper/client/extends/extends.js +0 -14
- package/src/omega/core_plugins/babel/babel_helper/client/get/get.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/getPrototypeOf/getPrototypeOf.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/inherits/inherits.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/inheritsLoose/inheritsLoose.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/initializerDefineProperty/initializerDefineProperty.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/initializerWarningHelper/initializerWarningHelper.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/instanceof/instanceof.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/interopRequireDefault/interopRequireDefault.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/interopRequireWildcard/interopRequireWildcard.js +0 -37
- package/src/omega/core_plugins/babel/babel_helper/client/isNativeFunction/isNativeFunction.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -21
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArray/iterableToArray.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArrayLimit/iterableToArrayLimit.js +0 -36
- package/src/omega/core_plugins/babel/babel_helper/client/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/jsx/jsx.js +0 -50
- package/src/omega/core_plugins/babel/babel_helper/client/maybeArrayLike/maybeArrayLike.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/newArrowCheck/newArrowCheck.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/nonIterableRest/nonIterableRest.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/nonIterableSpread/nonIterableSpread.js +0 -5
- package/src/omega/core_plugins/babel/babel_helper/client/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/objectSpread/objectSpread.js +0 -23
- package/src/omega/core_plugins/babel/babel_helper/client/objectSpread2/objectSpread2.js +0 -41
- package/src/omega/core_plugins/babel/babel_helper/client/objectWithoutProperties/objectWithoutProperties.js +0 -19
- package/src/omega/core_plugins/babel/babel_helper/client/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/possibleConstructorReturn/possibleConstructorReturn.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/readOnlyError/readOnlyError.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/readme.md +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/set/set.js +0 -44
- package/src/omega/core_plugins/babel/babel_helper/client/setPrototypeOf/setPrototypeOf.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/slicedToArray/slicedToArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/slicedToArrayLoose/slicedToArrayLoose.js +0 -13
- package/src/omega/core_plugins/babel/babel_helper/client/superPropBase/superPropBase.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -7
- package/src/omega/core_plugins/babel/babel_helper/client/tdz/tdz.js +0 -4
- package/src/omega/core_plugins/babel/babel_helper/client/temporalRef/temporalRef.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/temporalUndefined/temporalUndefined.js +0 -3
- package/src/omega/core_plugins/babel/babel_helper/client/toArray/toArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toConsumableArray/toConsumableArray.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toPrimitive/toPrimitive.js +0 -10
- package/src/omega/core_plugins/babel/babel_helper/client/toPropertyKey/toPropertyKey.js +0 -6
- package/src/omega/core_plugins/babel/babel_helper/client/typeof/typeof.js +0 -14
- package/src/omega/core_plugins/babel/babel_helper/client/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -12
- package/src/omega/core_plugins/babel/babel_helper/client/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -8
- package/src/omega/core_plugins/babel/babel_helper/client/wrapNativeSuper/wrapNativeSuper.js +0 -30
- package/src/omega/core_plugins/babel/babel_helper/client/wrapRegExp/wrapRegExp.js +0 -63
- package/src/omega/core_plugins/babel/babel_helper/client/writeOnlyError/writeOnlyError.js +0 -4
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +0 -187
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +0 -67
- 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.js +0 -39
- package/src/omega/runtime_support/runtime_support.js +0 -20
- 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
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem"
|
|
2
2
|
import { createLogger } from "@jsenv/logger"
|
|
3
3
|
|
|
4
|
+
import { initProcessAutorestart } from "@jsenv/utils/file_watcher/process_auto_restart.js"
|
|
4
5
|
import { createTaskLog } from "@jsenv/utils/logs/task_log.js"
|
|
6
|
+
import { getCorePlugins } from "@jsenv/core/src/plugins/plugins.js"
|
|
5
7
|
import { createUrlGraph } from "@jsenv/core/src/omega/url_graph.js"
|
|
6
|
-
import { getCorePlugins } from "@jsenv/core/src/omega/core_plugins.js"
|
|
7
8
|
import { createKitchen } from "@jsenv/core/src/omega/kitchen.js"
|
|
8
9
|
import { startOmegaServer } from "@jsenv/core/src/omega/omega_server.js"
|
|
9
10
|
|
|
10
|
-
import { jsenvPluginAutoreload } from "./plugins/autoreload/jsenv_plugin_autoreload.js"
|
|
11
11
|
import { jsenvPluginExplorer } from "./plugins/explorer/jsenv_plugin_explorer.js"
|
|
12
12
|
import { jsenvPluginToolbar } from "./plugins/toolbar/jsenv_plugin_toolbar.js"
|
|
13
13
|
|
|
14
14
|
export const startDevServer = async ({
|
|
15
15
|
signal = new AbortController().signal,
|
|
16
|
+
handleSIGINT,
|
|
16
17
|
logLevel,
|
|
17
|
-
port,
|
|
18
|
-
protocol,
|
|
18
|
+
port = 3456,
|
|
19
|
+
protocol = "http",
|
|
19
20
|
listenAnyIp,
|
|
20
21
|
// it's better to use http1 by default because it allows to get statusText in devtools
|
|
21
22
|
// which gives valuable information when there is errors
|
|
@@ -23,18 +24,16 @@ export const startDevServer = async ({
|
|
|
23
24
|
certificate,
|
|
24
25
|
privateKey,
|
|
25
26
|
keepProcessAlive = true,
|
|
26
|
-
|
|
27
27
|
rootDirectoryUrl,
|
|
28
|
-
plugins = [],
|
|
29
28
|
|
|
30
29
|
sourcemaps = "inline",
|
|
30
|
+
plugins = [],
|
|
31
|
+
htmlSupervisor = true,
|
|
32
|
+
injectedGlobals,
|
|
33
|
+
nodeEsmResolution,
|
|
34
|
+
fileSystemMagicResolution,
|
|
35
|
+
transpilation,
|
|
31
36
|
autoreload = true,
|
|
32
|
-
autoreloadPatterns = {
|
|
33
|
-
"./**": true,
|
|
34
|
-
"./**/.*/": false, // any folder starting with a dot is ignored (includes .git for instance)
|
|
35
|
-
"./dist/": false,
|
|
36
|
-
"./**/node_modules/": false,
|
|
37
|
-
},
|
|
38
37
|
explorerGroups = {
|
|
39
38
|
source: {
|
|
40
39
|
"./*.html": true,
|
|
@@ -45,36 +44,66 @@ export const startDevServer = async ({
|
|
|
45
44
|
},
|
|
46
45
|
},
|
|
47
46
|
toolbar = false,
|
|
47
|
+
autorestart,
|
|
48
48
|
}) => {
|
|
49
|
+
rootDirectoryUrl = assertAndNormalizeDirectoryUrl(rootDirectoryUrl)
|
|
50
|
+
const autorestartProcess = await initProcessAutorestart({
|
|
51
|
+
signal,
|
|
52
|
+
handleSIGINT,
|
|
53
|
+
...(autorestart
|
|
54
|
+
? {
|
|
55
|
+
enabled: true,
|
|
56
|
+
logLevel: autorestart.logLevel,
|
|
57
|
+
urlToRestart: autorestart.url,
|
|
58
|
+
urlsToWatch: [
|
|
59
|
+
...(autorestart.urlsToWatch || []),
|
|
60
|
+
new URL("package.json", rootDirectoryUrl),
|
|
61
|
+
new URL("jsenv.config.mjs", rootDirectoryUrl),
|
|
62
|
+
],
|
|
63
|
+
}
|
|
64
|
+
: {
|
|
65
|
+
enabled: false,
|
|
66
|
+
}),
|
|
67
|
+
})
|
|
68
|
+
if (autorestartProcess.isPrimary) {
|
|
69
|
+
return {
|
|
70
|
+
origin: `${protocol}://127.0.0.1:${port}`,
|
|
71
|
+
stop: () => {
|
|
72
|
+
autorestartProcess.stop()
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
49
77
|
const logger = createLogger({ logLevel })
|
|
50
78
|
const startServerTask = createTaskLog(logger, "start server")
|
|
51
79
|
|
|
52
|
-
rootDirectoryUrl = assertAndNormalizeDirectoryUrl(rootDirectoryUrl)
|
|
53
80
|
const urlGraph = createUrlGraph()
|
|
54
81
|
const kitchen = createKitchen({
|
|
55
82
|
signal,
|
|
56
83
|
logger,
|
|
57
84
|
rootDirectoryUrl,
|
|
58
85
|
urlGraph,
|
|
86
|
+
scenario: "dev",
|
|
87
|
+
sourcemaps,
|
|
59
88
|
plugins: [
|
|
60
89
|
...plugins,
|
|
61
|
-
...getCorePlugins(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
...getCorePlugins({
|
|
91
|
+
rootDirectoryUrl,
|
|
92
|
+
urlGraph,
|
|
93
|
+
scenario: "dev",
|
|
94
|
+
|
|
95
|
+
htmlSupervisor,
|
|
96
|
+
injectedGlobals,
|
|
97
|
+
nodeEsmResolution,
|
|
98
|
+
fileSystemMagicResolution,
|
|
99
|
+
transpilation,
|
|
100
|
+
autoreload,
|
|
101
|
+
}),
|
|
71
102
|
jsenvPluginExplorer({
|
|
72
103
|
groups: explorerGroups,
|
|
73
104
|
}),
|
|
74
105
|
...(toolbar ? [jsenvPluginToolbar(toolbar)] : []),
|
|
75
106
|
],
|
|
76
|
-
scenario: "dev",
|
|
77
|
-
sourcemaps,
|
|
78
107
|
})
|
|
79
108
|
const server = await startOmegaServer({
|
|
80
109
|
logger,
|
|
@@ -101,5 +130,8 @@ export const startDevServer = async ({
|
|
|
101
130
|
kitchen.pluginController.callHooks("destroy")
|
|
102
131
|
}
|
|
103
132
|
})
|
|
104
|
-
return
|
|
133
|
+
return {
|
|
134
|
+
origin: server.origin,
|
|
135
|
+
stop: server.stop,
|
|
136
|
+
}
|
|
105
137
|
}
|
package/src/execute/execute.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
|
|
|
3
3
|
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem"
|
|
4
4
|
import { createLogger } from "@jsenv/logger"
|
|
5
5
|
|
|
6
|
+
import { getCorePlugins } from "@jsenv/core/src/plugins/plugins.js"
|
|
6
7
|
import { createUrlGraph } from "@jsenv/core/src/omega/url_graph.js"
|
|
7
|
-
import { getCorePlugins } from "@jsenv/core/src/omega/core_plugins.js"
|
|
8
8
|
import { createKitchen } from "@jsenv/core/src/omega/kitchen.js"
|
|
9
9
|
import { startOmegaServer } from "@jsenv/core/src/omega/omega_server.js"
|
|
10
10
|
|
|
@@ -23,12 +23,18 @@ export const execute = async ({
|
|
|
23
23
|
collectConsole,
|
|
24
24
|
collectCoverage,
|
|
25
25
|
coverageTempDirectoryUrl,
|
|
26
|
+
collectPerformance = false,
|
|
26
27
|
runtime,
|
|
27
28
|
runtimeParams,
|
|
28
29
|
|
|
29
|
-
plugins = [],
|
|
30
30
|
scenario = "dev",
|
|
31
31
|
sourcemaps = "inline",
|
|
32
|
+
plugins = [],
|
|
33
|
+
nodeEsmResolution,
|
|
34
|
+
fileSystemMagicResolution,
|
|
35
|
+
injectedGlobals,
|
|
36
|
+
transpilation,
|
|
37
|
+
htmlSupervisor = true,
|
|
32
38
|
|
|
33
39
|
port,
|
|
34
40
|
protocol,
|
|
@@ -53,6 +59,7 @@ export const execute = async ({
|
|
|
53
59
|
})
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
let resultTransformer = (result) => result
|
|
56
63
|
runtimeParams = {
|
|
57
64
|
rootDirectoryUrl,
|
|
58
65
|
fileRelativeUrl,
|
|
@@ -65,9 +72,22 @@ export const execute = async ({
|
|
|
65
72
|
logger,
|
|
66
73
|
rootDirectoryUrl,
|
|
67
74
|
urlGraph,
|
|
68
|
-
plugins: [...plugins, ...getCorePlugins()],
|
|
69
75
|
scenario,
|
|
70
76
|
sourcemaps,
|
|
77
|
+
plugins: [
|
|
78
|
+
...plugins,
|
|
79
|
+
...getCorePlugins({
|
|
80
|
+
rootDirectoryUrl,
|
|
81
|
+
urlGraph,
|
|
82
|
+
scenario,
|
|
83
|
+
|
|
84
|
+
htmlSupervisor,
|
|
85
|
+
injectedGlobals,
|
|
86
|
+
nodeEsmResolution,
|
|
87
|
+
fileSystemMagicResolution,
|
|
88
|
+
transpilation,
|
|
89
|
+
}),
|
|
90
|
+
],
|
|
71
91
|
})
|
|
72
92
|
const serverLogger = createLogger({ logLevel: "warn" })
|
|
73
93
|
const server = await startOmegaServer({
|
|
@@ -91,9 +111,13 @@ export const execute = async ({
|
|
|
91
111
|
...runtimeParams,
|
|
92
112
|
server,
|
|
93
113
|
}
|
|
114
|
+
resultTransformer = (result) => {
|
|
115
|
+
result.server = server
|
|
116
|
+
return result
|
|
117
|
+
}
|
|
94
118
|
}
|
|
95
119
|
|
|
96
|
-
|
|
120
|
+
let result = await run({
|
|
97
121
|
signal: executeOperation.signal,
|
|
98
122
|
logger,
|
|
99
123
|
allocatedMs,
|
|
@@ -102,9 +126,11 @@ export const execute = async ({
|
|
|
102
126
|
collectConsole,
|
|
103
127
|
collectCoverage,
|
|
104
128
|
coverageTempDirectoryUrl,
|
|
129
|
+
collectPerformance,
|
|
105
130
|
runtime,
|
|
106
131
|
runtimeParams,
|
|
107
132
|
})
|
|
133
|
+
result = resultTransformer(result)
|
|
108
134
|
|
|
109
135
|
try {
|
|
110
136
|
if (result.status === "errored") {
|
package/src/execute/run.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cuid from "cuid"
|
|
2
2
|
import { Abort, raceCallbacks } from "@jsenv/abort"
|
|
3
3
|
import { resolveUrl, writeFile } from "@jsenv/filesystem"
|
|
4
|
-
import { createDetailedMessage } from "@jsenv/logger"
|
|
5
4
|
|
|
6
5
|
export const run = async ({
|
|
7
6
|
signal = new AbortController().signal,
|
|
@@ -12,15 +11,12 @@ export const run = async ({
|
|
|
12
11
|
collectConsole = false,
|
|
13
12
|
collectCoverage = false,
|
|
14
13
|
coverageTempDirectoryUrl,
|
|
15
|
-
|
|
16
|
-
// collectPerformance = false,
|
|
14
|
+
collectPerformance = false,
|
|
17
15
|
|
|
18
16
|
runtime,
|
|
19
17
|
runtimeParams,
|
|
20
18
|
}) => {
|
|
21
|
-
const onErrorRef = { current: () => {} }
|
|
22
19
|
const onConsoleRef = { current: () => {} }
|
|
23
|
-
const onStopRef = { current: () => {} }
|
|
24
20
|
const stopSignal = { notify: () => {} }
|
|
25
21
|
|
|
26
22
|
let resultTransformer = (result) => result
|
|
@@ -105,7 +101,7 @@ export const run = async ({
|
|
|
105
101
|
try {
|
|
106
102
|
logger.debug(`run() ${runtimeLabel}`)
|
|
107
103
|
runOperation.throwIfAborted()
|
|
108
|
-
const winnerPromise = new Promise((resolve
|
|
104
|
+
const winnerPromise = new Promise((resolve) => {
|
|
109
105
|
raceCallbacks(
|
|
110
106
|
{
|
|
111
107
|
aborted: (cb) => {
|
|
@@ -114,35 +110,23 @@ export const run = async ({
|
|
|
114
110
|
runOperation.signal.removeEventListener("abort", cb)
|
|
115
111
|
}
|
|
116
112
|
},
|
|
117
|
-
errored: (cb) => {
|
|
118
|
-
onErrorRef.current = (error) => {
|
|
119
|
-
logger.debug(
|
|
120
|
-
createDetailedMessage(`error during execution`, {
|
|
121
|
-
["error stack"]: error.stack,
|
|
122
|
-
["runtime"]: runtimeLabel,
|
|
123
|
-
}),
|
|
124
|
-
)
|
|
125
|
-
cb(error)
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
stopped: (cb) => {
|
|
129
|
-
onStopRef.current = cb
|
|
130
|
-
},
|
|
131
113
|
runned: async (cb) => {
|
|
132
114
|
try {
|
|
133
|
-
await runtime.run({
|
|
134
|
-
signal,
|
|
115
|
+
const result = await runtime.run({
|
|
116
|
+
signal: runOperation.signal,
|
|
135
117
|
logger,
|
|
136
118
|
...runtimeParams,
|
|
119
|
+
collectPerformance,
|
|
137
120
|
keepRunning,
|
|
138
121
|
stopSignal,
|
|
139
|
-
onStop: (stopInfo) => onStopRef.current(stopInfo),
|
|
140
|
-
onError: (error) => onErrorRef.current(error),
|
|
141
122
|
onConsole: (log) => onConsoleRef.current(log),
|
|
142
|
-
onResult: cb,
|
|
143
123
|
})
|
|
124
|
+
cb(result)
|
|
144
125
|
} catch (e) {
|
|
145
|
-
|
|
126
|
+
cb({
|
|
127
|
+
status: "errored",
|
|
128
|
+
error: e,
|
|
129
|
+
})
|
|
146
130
|
}
|
|
147
131
|
},
|
|
148
132
|
},
|
|
@@ -153,31 +137,16 @@ export const run = async ({
|
|
|
153
137
|
if (winner.name === "aborted") {
|
|
154
138
|
runOperation.throwIfAborted()
|
|
155
139
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (winner.name === "stopped") {
|
|
164
|
-
return await resultTransformer(
|
|
165
|
-
createErroredExecutionResult({
|
|
166
|
-
error: new Error(`runtime stopped during execution`),
|
|
167
|
-
}),
|
|
168
|
-
)
|
|
169
|
-
}
|
|
170
|
-
onErrorRef.current = (error) => {
|
|
171
|
-
throw error
|
|
140
|
+
let result = winner.data
|
|
141
|
+
result = await resultTransformer(result)
|
|
142
|
+
return result
|
|
143
|
+
} catch (e) {
|
|
144
|
+
let result = {
|
|
145
|
+
status: "errored",
|
|
146
|
+
error: e,
|
|
172
147
|
}
|
|
173
|
-
|
|
174
|
-
return
|
|
175
|
-
} catch (error) {
|
|
176
|
-
return await resultTransformer(
|
|
177
|
-
createErroredExecutionResult({
|
|
178
|
-
error,
|
|
179
|
-
}),
|
|
180
|
-
)
|
|
148
|
+
result = await resultTransformer(result)
|
|
149
|
+
return result
|
|
181
150
|
} finally {
|
|
182
151
|
await runOperation.end()
|
|
183
152
|
}
|
|
@@ -200,9 +169,3 @@ const createTimedoutResult = () => {
|
|
|
200
169
|
status: "timedout",
|
|
201
170
|
}
|
|
202
171
|
}
|
|
203
|
-
const createErroredExecutionResult = ({ error }) => {
|
|
204
|
-
return {
|
|
205
|
-
status: "errored",
|
|
206
|
-
error,
|
|
207
|
-
}
|
|
208
|
-
}
|