@jsenv/core 26.0.1 → 27.0.0-alpha.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.
- package/main.js +17 -24
- package/package.json +35 -71
- package/readme.md +30 -37
- package/src/build/build.js +737 -0
- package/src/build/build_urls_generator.js +64 -0
- package/src/build/inject_version_mappings.js +62 -0
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -0
- package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
- package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
- package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
- package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
- package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
- package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
- package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
- package/src/dev/plugins/autoreload/client/reload.js +101 -0
- package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
- package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
- package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
- package/src/dev/plugins/autoreload/sse_service.js +149 -0
- package/src/dev/plugins/explorer/client/explorer.html +607 -0
- package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/animation/toolbar_animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
- package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
- package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/toolbar_focus.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/jsenv_logo.svg +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/notification/toolbar_notification.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/overflow_menu.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/toolbar_responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/toolbar_settings.js +1 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/jsenv_theme.css +1 -15
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/light_theme.css +0 -17
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/toolbar_theme.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +40 -199
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_injector.js +8 -28
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.css +0 -24
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.js +10 -56
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
- package/src/{internal/browser_utils → dev/plugins/toolbar/client/util}/fetch_using_xhr.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/jsenv_logger.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
- package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
- package/src/dev/start_dev_server.js +105 -0
- package/src/execute/execute.js +132 -0
- package/src/execute/run.js +208 -0
- package/src/execute/runtimes/browsers/chromium.js +8 -0
- package/src/execute/runtimes/browsers/firefox.js +7 -0
- package/src/execute/runtimes/browsers/from_playwright.js +464 -0
- package/src/{browser_runtimes.js → execute/runtimes/browsers/webkit.js} +4 -18
- package/src/{internal/node_launcher/child_process_options.js → execute/runtimes/node/child_exec_options.js} +25 -36
- package/src/{internal/node_launcher/node_controllable_file.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
- package/src/{internal/node_launcher/node_controllable_process.js → execute/runtimes/node/controlled_process.js} +128 -150
- package/src/execute/runtimes/node/exec_options.js +44 -0
- package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +3 -1
- package/src/execute/runtimes/node/node_process.js +92 -0
- package/src/execute/runtimes/node/node_worker_thread.js +28 -0
- package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +29 -0
- package/src/{internal/compile_server/js → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -19
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -0
- package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
- package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -0
- package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
- package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +97 -0
- package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
- package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
- package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
- package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
- package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
- package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
- package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_document.js +10 -16
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_notification.js +0 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -0
- package/src/{internal/runtime_client → omega/core_plugins/html_supervisor/client}/uneval_exception.js +0 -0
- package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
- package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
- package/src/{internal/building/import_assertions → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
- package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
- package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
- package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +80 -0
- package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
- package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +210 -0
- package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
- package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
- package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
- package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
- package/src/omega/core_plugins.js +39 -0
- package/src/omega/errors.js +168 -0
- package/src/omega/file_url_converter.js +63 -0
- package/src/omega/kitchen.js +777 -0
- package/src/omega/omega_server.js +129 -0
- package/src/omega/plugin_controller.js +240 -0
- package/src/omega/runtime_support/default_runtime_support.js +13 -0
- package/src/omega/runtime_support/features_compatibility.js +91 -0
- package/src/omega/runtime_support/runtime_support.js +20 -0
- package/src/omega/server/file_service.js +155 -0
- package/src/omega/server/user_agent.js +22 -0
- package/src/omega/url_graph/url_graph_load.js +68 -0
- package/src/omega/url_graph/url_graph_report.js +151 -0
- package/src/omega/url_graph/url_graph_sort.js +29 -0
- package/src/omega/url_graph/url_info_transformations.js +161 -0
- package/src/omega/url_graph.js +132 -0
- package/src/omega/url_mentions/css_url_mentions.js +63 -0
- package/src/omega/url_mentions/html_url_mentions.js +185 -0
- package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
- package/src/omega/url_mentions/parse_url_mentions.js +37 -0
- package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
- package/src/{internal/executing → test}/execute_plan.js +154 -211
- package/src/{execute_test_plan.js → test/execute_test_plan.js} +26 -81
- package/src/{internal/executing → test}/execution_colors.js +0 -0
- package/src/{internal/executing → test}/execution_steps.js +2 -8
- package/src/{internal/executing → test}/gc.js +0 -0
- package/src/test/logs_file_execution.js +223 -0
- package/dist/browser_client/asset-manifest.json +0 -4
- package/dist/browser_client/browser_client_fb33eaa4.js +0 -5320
- package/dist/browser_client/browser_client_fb33eaa4.js.map +0 -1089
- package/dist/build_manifest.js +0 -12
- package/dist/compile_proxy/asset-manifest.json +0 -4
- package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +0 -343
- package/dist/compile_proxy/compile_proxy_62f952c4.html +0 -2245
- package/dist/event_source_client/asset-manifest.json +0 -4
- package/dist/event_source_client/event_source_client_69f48287.js +0 -354
- package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
- package/dist/redirector/asset-manifest.json +0 -4
- package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +0 -349
- package/dist/redirector/redirector_8117ec92.html +0 -2290
- package/dist/toolbar/asset-manifest.json +0 -13
- package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
- package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
- package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
- package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
- package/dist/toolbar/assets/light_theme.css_5bff0336.map +0 -12
- package/dist/toolbar/assets/overflow_menu.css_9a0fc3d8.map +0 -12
- package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
- package/dist/toolbar/assets/toolbar_main.css_b1c67dd7.map +0 -28
- package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
- package/dist/toolbar/toolbar_b0c9100c.html +0 -4976
- package/dist/toolbar/toolbar_main_f54c1bb0.js.map +0 -776
- package/dist/toolbar_injector/asset-manifest.json +0 -5
- package/dist/toolbar_injector/assets/jsenv_logo_192011c2.svg +0 -95
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js +0 -976
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +0 -294
- package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
- package/helpers/import-meta/import-meta-url-global.js +0 -54
- package/src/build_project.js +0 -336
- package/src/commonjs_to_js_module.js +0 -180
- package/src/dev_server.js +0 -302
- package/src/execute.js +0 -184
- package/src/import_using_child_process.js +0 -68
- package/src/internal/browser_client/browser_client.js +0 -220
- package/src/internal/browser_client/browser_client_factory.js +0 -144
- package/src/internal/browser_client/browser_error_stack_remap.js +0 -43
- package/src/internal/browser_client/browser_system.js +0 -216
- package/src/internal/browser_client/module_namespace_transfer.js +0 -90
- package/src/internal/browser_detection/browser_detection.js +0 -65
- package/src/internal/browser_detection/detect_android.js +0 -13
- package/src/internal/browser_detection/detect_chrome.js +0 -28
- package/src/internal/browser_detection/detect_edge.js +0 -13
- package/src/internal/browser_detection/detect_electron.js +0 -1
- package/src/internal/browser_detection/detect_firefox.js +0 -17
- package/src/internal/browser_detection/detect_internet_explorer.js +0 -14
- package/src/internal/browser_detection/detect_ios.js +0 -19
- package/src/internal/browser_detection/detect_opera.js +0 -27
- package/src/internal/browser_detection/detect_safari.js +0 -13
- package/src/internal/browser_detection/user_agent_data.js +0 -25
- package/src/internal/browser_detection/util.js +0 -13
- package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
- package/src/internal/browser_launcher/execute_html_file.js +0 -355
- package/src/internal/browser_launcher/from_playwright.js +0 -320
- package/src/internal/browser_launcher/page_errors_and_logs.js +0 -77
- package/src/internal/browser_utils/fetch_and_eval.js +0 -27
- package/src/internal/browser_utils/fetch_and_eval_using_script.js +0 -47
- package/src/internal/browser_utils/fetch_browser.js +0 -34
- package/src/internal/browser_utils/fetch_json.js +0 -7
- package/src/internal/building/build_logs.js +0 -134
- package/src/internal/building/build_stats.js +0 -100
- package/src/internal/building/build_url_generator.js +0 -153
- package/src/internal/building/build_using_rollup.js +0 -359
- package/src/internal/building/css/apply_post_css.js +0 -55
- package/src/internal/building/css/jsenv_parse_css.js +0 -260
- package/src/internal/building/css/move_css_urls.js +0 -44
- package/src/internal/building/css/parse_css_urls.js +0 -38
- package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -245
- package/src/internal/building/css/replace_css_urls.js +0 -68
- package/src/internal/building/global_format/es_to_system.js +0 -34
- package/src/internal/building/html/html_node_mutations.js +0 -29
- package/src/internal/building/html/html_scan.js +0 -70
- package/src/internal/building/html/jsenv_parse_html.js +0 -813
- package/src/internal/building/html/minify_html.js +0 -7
- package/src/internal/building/import_assertions/css_module.js +0 -43
- package/src/internal/building/import_references.js +0 -80
- package/src/internal/building/importmap/jsenv_parse_importmap.js +0 -28
- package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
- package/src/internal/building/js/jsenv_parse_js.js +0 -122
- package/src/internal/building/js/minify_js.js +0 -33
- package/src/internal/building/js/transform_worker.js +0 -55
- package/src/internal/building/json/jsenv_parse_json.js +0 -11
- package/src/internal/building/parse_ressource.js +0 -207
- package/src/internal/building/ressource_builder.js +0 -1098
- package/src/internal/building/ressource_builder_util.js +0 -194
- package/src/internal/building/rollup_plugin_jsenv.js +0 -1965
- package/src/internal/building/sort_pathnames.js +0 -10
- package/src/internal/building/sourcemap/sourcemap_loader.js +0 -70
- package/src/internal/building/svg/jsenv_parse_svg.js +0 -112
- package/src/internal/building/url_fetcher.js +0 -85
- package/src/internal/building/url_loader.js +0 -127
- package/src/internal/building/url_trace.js +0 -229
- package/src/internal/building/url_versioning/resolve_import_url_helper.js +0 -12
- package/src/internal/building/url_versioning/url_versioning.js +0 -65
- package/src/internal/building/webmanifest/jsenv_parse_webmanifest.js +0 -48
- package/src/internal/compile_server/commonjs/rollup_plugin_commonjs_named_exports.js +0 -187
- package/src/internal/compile_server/compile_file.js +0 -273
- package/src/internal/compile_server/compile_server.js +0 -519
- package/src/internal/compile_server/compiled_file_service.js +0 -264
- package/src/internal/compile_server/html/html_ast.js +0 -534
- package/src/internal/compile_server/html/html_source_file_service.js +0 -453
- package/src/internal/compile_server/html/jsenv_compile_html.js +0 -674
- package/src/internal/compile_server/importmap/jsenv_compile_importmap.js +0 -28
- package/src/internal/compile_server/js/ansi_to_html.js +0 -9
- package/src/internal/compile_server/js/babelHelper.js +0 -145
- package/src/internal/compile_server/js/babel_parse_error.js +0 -9
- package/src/internal/compile_server/js/babel_plugin_global_this_as_jsenv_import.js +0 -34
- package/src/internal/compile_server/js/babel_plugin_import_assertions.js +0 -121
- package/src/internal/compile_server/js/babel_plugin_import_metadata.js +0 -18
- package/src/internal/compile_server/js/babel_plugin_import_visitor.js +0 -84
- package/src/internal/compile_server/js/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
- package/src/internal/compile_server/js/babel_plugin_proxy_external_imports.js +0 -31
- package/src/internal/compile_server/js/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
- package/src/internal/compile_server/js/babel_plugin_replace_expressions.js +0 -101
- package/src/internal/compile_server/js/babel_plugin_systemjs_prepend.js +0 -23
- package/src/internal/compile_server/js/babel_plugin_transform_import_meta.js +0 -134
- package/src/internal/compile_server/js/babel_plugins.js +0 -37
- package/src/internal/compile_server/js/generateBabelHelper.js +0 -36
- package/src/internal/compile_server/js/js_transformer.js +0 -195
- package/src/internal/compile_server/js/jsenv_compile_js.js +0 -62
- package/src/internal/compile_server/js/load_babel_plugin_map_from_file.js +0 -49
- package/src/internal/compile_server/jsenv_directory/comparison_utils.js +0 -27
- package/src/internal/compile_server/jsenv_directory/compilation_result.js +0 -243
- package/src/internal/compile_server/jsenv_directory/compilation_result_from_build.js +0 -184
- package/src/internal/compile_server/jsenv_directory/compile_asset.js +0 -24
- package/src/internal/compile_server/jsenv_directory/compile_context.js +0 -60
- package/src/internal/compile_server/jsenv_directory/compile_profile.js +0 -217
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.js +0 -24
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.test.js +0 -47
- package/src/internal/compile_server/jsenv_directory/fs_optimized_for_cache.js +0 -57
- package/src/internal/compile_server/jsenv_directory/jsenv_directory.js +0 -183
- package/src/internal/compile_server/jsenv_directory/reuse_or_create_compiled_file.js +0 -269
- package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +0 -131
- package/src/internal/compile_server/jsenv_directory/validate_compile_cache.js +0 -264
- package/src/internal/compile_server/sse_service/sse_service.js +0 -369
- package/src/internal/coverage/babel_plugin_instrument.js +0 -90
- package/src/internal/coverage/coverage_reporter_html_directory.js +0 -37
- package/src/internal/coverage/coverage_reporter_json_file.js +0 -22
- package/src/internal/coverage/coverage_reporter_text_log.js +0 -20
- package/src/internal/coverage/empty_coverage_factory.js +0 -70
- package/src/internal/coverage/file_by_file_coverage.js +0 -28
- package/src/internal/coverage/istanbul_coverage_composition.js +0 -28
- package/src/internal/coverage/istanbul_coverage_map_from_coverage.js +0 -16
- package/src/internal/coverage/list_files_not_covered.js +0 -20
- package/src/internal/coverage/missing_coverage.js +0 -46
- package/src/internal/coverage/report_to_coverage.js +0 -198
- package/src/internal/coverage/v8_and_istanbul.js +0 -38
- package/src/internal/coverage/v8_coverage_composition.js +0 -23
- package/src/internal/coverage/v8_coverage_from_directory.js +0 -86
- package/src/internal/coverage/v8_coverage_to_istanbul.js +0 -100
- package/src/internal/data_url.js +0 -54
- package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
- package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
- package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
- package/src/internal/dev_server/exploring/exploring.css +0 -237
- package/src/internal/dev_server/exploring/exploring.html +0 -79
- package/src/internal/dev_server/exploring/exploring.js +0 -243
- package/src/internal/dev_server/exploring/fetch_exploring_json.js +0 -19
- package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
- package/src/internal/dev_server/toolbar/compilation/toolbar_compilation.js +0 -202
- package/src/internal/dev_server/toolbar/eventsource/toolbar_eventsource.js +0 -83
- package/src/internal/dev_server/toolbar/execution/toolbar_execution.js +0 -91
- package/src/internal/error_stack_remap/install_error_stack_remapping.js +0 -142
- package/src/internal/error_stack_remap/remap_call_site.js +0 -315
- package/src/internal/error_stack_remap/remap_stack.js +0 -218
- package/src/internal/error_stack_remap/stringify_stack.js +0 -9
- package/src/internal/executing/launch_and_execute.js +0 -458
- package/src/internal/executing/logs_file_execution.js +0 -160
- package/src/internal/executing/logs_plan_summary.js +0 -144
- package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
- package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
- package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
- package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
- package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
- package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
- package/src/internal/features/features_compat_from_runtime.js +0 -38
- package/src/internal/features/features_compat_from_runtime_support.js +0 -31
- package/src/internal/features/features_compatibility.js +0 -37
- package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
- package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
- package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
- package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
- package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
- package/src/internal/fetching.js +0 -28
- package/src/internal/import_resolution/default_extension.js +0 -40
- package/src/internal/import_resolution/import_resolver_importmap.js +0 -64
- package/src/internal/import_resolution/import_resolver_node.js +0 -254
- package/src/internal/import_resolution/importmap_default.js +0 -37
- package/src/internal/jsenv_builds.js +0 -19
- package/src/internal/jsenv_params_assertions.js +0 -12
- package/src/internal/jsenv_remote_directory.js +0 -156
- package/src/internal/logs/byte.js +0 -10
- package/src/internal/logs/byte_as_file_size.js +0 -9
- package/src/internal/logs/ms_as_duration.js +0 -12
- package/src/internal/memoize.js +0 -24
- package/src/internal/node_launcher/eval_source.js +0 -6
- package/src/internal/node_launcher/fetch_source.js +0 -8
- package/src/internal/node_launcher/node_error_stack_remap.js +0 -22
- package/src/internal/node_launcher/node_execution_dynamic_import.js +0 -75
- package/src/internal/node_launcher/node_execution_performance.js +0 -67
- package/src/internal/node_launcher/node_execution_systemjs.js +0 -125
- package/src/internal/node_launcher/node_runtime_report.js +0 -77
- package/src/internal/node_launcher/node_system.js +0 -192
- package/src/internal/node_launcher/perf_node.js +0 -13
- package/src/internal/node_launcher/process_options.js +0 -46
- package/src/internal/node_launcher/value_install.js +0 -14
- package/src/internal/origin_directory_converter.js +0 -62
- package/src/internal/promise_race.js +0 -19
- package/src/internal/redirector/redirector.html +0 -40
- package/src/internal/regexp_escape.js +0 -34
- package/src/internal/require.js +0 -3
- package/src/internal/response_validation.js +0 -130
- package/src/internal/runtime_client/module_registration.js +0 -207
- package/src/internal/runtime_client/s.js +0 -864
- package/src/internal/runtime_client/s.js.md +0 -1
- package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
- package/src/internal/runtime_support/runtime_support.js +0 -70
- package/src/internal/semantic_versioning/compare_versions.js +0 -28
- package/src/internal/semantic_versioning/highest_version.js +0 -11
- package/src/internal/semantic_versioning/is_above.js +0 -5
- package/src/internal/semantic_versioning/is_below.js +0 -5
- package/src/internal/semantic_versioning/is_equal.js +0 -3
- package/src/internal/semantic_versioning/lowest_version.js +0 -11
- package/src/internal/semantic_versioning/version_from_value.js +0 -42
- package/src/internal/sourcemap_utils.js +0 -112
- package/src/internal/template_string_escape.js +0 -20
- package/src/internal/url_conversion.js +0 -313
- package/src/internal/url_utils.js +0 -33
- package/src/internal/url_utils.test.js +0 -39
- package/src/internal/windows_file_path_utils.js +0 -16
- package/src/jsenv_file_urls.js +0 -35
- package/src/jsenv_service_worker_finalizer.js +0 -55
- package/src/json_to_js_module.js +0 -13
- package/src/node_runtime.js +0 -227
- package/src/require_using_child_process.js +0 -67
- package/src/text_to_js_module.js +0 -13
|
@@ -1,46 +1,33 @@
|
|
|
1
1
|
import { fork } from "node:child_process"
|
|
2
|
-
import { urlToFileSystemPath
|
|
3
|
-
import {
|
|
2
|
+
import { urlToFileSystemPath } from "@jsenv/filesystem"
|
|
3
|
+
import { createDetailedMessage } from "@jsenv/logger"
|
|
4
4
|
import {
|
|
5
5
|
Abort,
|
|
6
6
|
raceCallbacks,
|
|
7
|
-
createCallbackList,
|
|
8
7
|
createCallbackListNotifiedOnce,
|
|
9
8
|
} from "@jsenv/abort"
|
|
10
9
|
import { uneval } from "@jsenv/uneval"
|
|
11
10
|
|
|
12
|
-
import {
|
|
11
|
+
import { memoize } from "@jsenv/utils/memoize/memoize.js"
|
|
13
12
|
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
processOptionsFromExecArgv,
|
|
17
|
-
execArgvFromProcessOptions,
|
|
18
|
-
} from "./process_options.js"
|
|
13
|
+
import { createChildExecOptions } from "./child_exec_options.js"
|
|
14
|
+
import { ExecOptions } from "./exec_options.js"
|
|
19
15
|
import { killProcessTree } from "./kill_process_tree.js"
|
|
20
16
|
|
|
21
17
|
const NODE_CONTROLLABLE_FILE_URL = new URL(
|
|
22
|
-
"./
|
|
18
|
+
"./controllable_file.mjs",
|
|
23
19
|
import.meta.url,
|
|
24
20
|
).href
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
const SIGINT_SIGNAL_NUMBER = 2
|
|
28
|
-
const SIGABORT_SIGNAL_NUMBER = 6
|
|
29
|
-
const SIGTERM_SIGNAL_NUMBER = 15
|
|
30
|
-
const SIGINT_EXIT_CODE = 128 + SIGINT_SIGNAL_NUMBER
|
|
31
|
-
const SIGABORT_EXIT_CODE = 128 + SIGABORT_SIGNAL_NUMBER
|
|
32
|
-
const SIGTERM_EXIT_CODE = 128 + SIGTERM_SIGNAL_NUMBER
|
|
33
|
-
// http://man7.org/linux/man-pages/man7/signal.7.html
|
|
34
|
-
// https:// github.com/nodejs/node/blob/1d9511127c419ec116b3ddf5fc7a59e8f0f1c1e4/lib/internal/child_process.js#L472
|
|
35
|
-
const GRACEFUL_STOP_SIGNAL = "SIGTERM"
|
|
36
|
-
const STOP_SIGNAL = "SIGKILL"
|
|
37
|
-
// it would be more correct if GRACEFUL_STOP_FAILED_SIGNAL was SIGHUP instead of SIGKILL.
|
|
38
|
-
// but I'm not sure and it changes nothing so just use SIGKILL
|
|
39
|
-
const GRACEFUL_STOP_FAILED_SIGNAL = "SIGKILL"
|
|
40
|
-
|
|
41
|
-
export const createControllableNodeProcess = async ({
|
|
22
|
+
export const createControlledProcess = async ({
|
|
42
23
|
signal = new AbortController().signal,
|
|
43
|
-
|
|
24
|
+
logger,
|
|
25
|
+
logProcessCommand = false,
|
|
26
|
+
|
|
27
|
+
onStop,
|
|
28
|
+
onError,
|
|
29
|
+
onConsole,
|
|
30
|
+
|
|
44
31
|
debugPort,
|
|
45
32
|
debugMode,
|
|
46
33
|
debugModeInheritBreak,
|
|
@@ -51,50 +38,47 @@ export const createControllableNodeProcess = async ({
|
|
|
51
38
|
stdin = "pipe",
|
|
52
39
|
stdout = "pipe",
|
|
53
40
|
stderr = "pipe",
|
|
54
|
-
logProcessCommand = false,
|
|
55
41
|
}) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
if (env !== undefined && typeof env !== "object") {
|
|
43
|
+
throw new TypeError(`env must be an object, got ${env}`)
|
|
44
|
+
}
|
|
45
|
+
const cleanupCallbackList = createCallbackListNotifiedOnce()
|
|
46
|
+
const cleanup = async (reason) => {
|
|
47
|
+
await cleanupCallbackList.notify({ reason })
|
|
60
48
|
}
|
|
61
49
|
|
|
62
|
-
const
|
|
50
|
+
const childExecOptions = await createChildExecOptions({
|
|
63
51
|
signal,
|
|
64
52
|
debugPort,
|
|
65
53
|
debugMode,
|
|
66
54
|
debugModeInheritBreak,
|
|
67
55
|
})
|
|
68
|
-
const
|
|
69
|
-
...
|
|
70
|
-
...
|
|
71
|
-
}
|
|
72
|
-
const execArgv = execArgvFromProcessOptions(processOptions)
|
|
73
|
-
|
|
74
|
-
if (env !== undefined && typeof env !== "object") {
|
|
75
|
-
throw new TypeError(`env must be an object, got ${env}`)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
await assertFilePresence(NODE_CONTROLLABLE_FILE_URL)
|
|
56
|
+
const execArgv = ExecOptions.toExecArgv({
|
|
57
|
+
...childExecOptions,
|
|
58
|
+
...ExecOptions.fromExecArgv(commandLineOptions),
|
|
59
|
+
})
|
|
79
60
|
const envForChildProcess = {
|
|
80
61
|
...(inheritProcessEnv ? process.env : {}),
|
|
81
62
|
...env,
|
|
82
63
|
}
|
|
64
|
+
logger[logProcessCommand ? "info" : "debug"](
|
|
65
|
+
`${process.argv[0]} ${execArgv.join(" ")} ${urlToFileSystemPath(
|
|
66
|
+
NODE_CONTROLLABLE_FILE_URL,
|
|
67
|
+
)}`,
|
|
68
|
+
)
|
|
83
69
|
const childProcess = fork(urlToFileSystemPath(NODE_CONTROLLABLE_FILE_URL), {
|
|
84
70
|
execArgv,
|
|
85
71
|
// silent: true
|
|
86
72
|
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
87
73
|
env: envForChildProcess,
|
|
88
74
|
})
|
|
89
|
-
|
|
90
75
|
logger.debug(
|
|
91
|
-
createDetailedMessage(`
|
|
76
|
+
createDetailedMessage(`child process forked (pid ${childProcess.pid})`, {
|
|
92
77
|
"execArgv": execArgv.join(`\n`),
|
|
93
78
|
"custom env": JSON.stringify(env, null, " "),
|
|
94
79
|
}),
|
|
95
80
|
)
|
|
96
|
-
|
|
97
|
-
// if we passe stream, pipe them https://github.com/sindresorhus/execa/issues/81
|
|
81
|
+
// if we pass stream, pipe them https://github.com/sindresorhus/execa/issues/81
|
|
98
82
|
if (typeof stdin === "object") {
|
|
99
83
|
stdin.pipe(childProcess.stdin)
|
|
100
84
|
}
|
|
@@ -104,30 +88,49 @@ export const createControllableNodeProcess = async ({
|
|
|
104
88
|
if (typeof stderr === "object") {
|
|
105
89
|
childProcess.stderr.pipe(stderr)
|
|
106
90
|
}
|
|
107
|
-
if (logProcessCommand) {
|
|
108
|
-
console.log(
|
|
109
|
-
`${process.argv[0]} ${execArgv.join(" ")} ${urlToFileSystemPath(
|
|
110
|
-
NODE_CONTROLLABLE_FILE_URL,
|
|
111
|
-
)}`,
|
|
112
|
-
)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
91
|
const childProcessReadyPromise = new Promise((resolve) => {
|
|
116
92
|
onceProcessMessage(childProcess, "ready", resolve)
|
|
117
93
|
})
|
|
118
|
-
|
|
119
|
-
const outputCallbackList = createCallbackList()
|
|
120
94
|
const removeOutputListener = installProcessOutputListener(
|
|
121
95
|
childProcess,
|
|
122
96
|
({ type, text }) => {
|
|
123
|
-
|
|
97
|
+
onConsole({ type, text })
|
|
124
98
|
},
|
|
125
99
|
)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
100
|
+
const stop = memoize(async ({ gracefulStopAllocatedMs } = {}) => {
|
|
101
|
+
// all libraries are facing problem on windows when trying
|
|
102
|
+
// to kill a process spawning other processes.
|
|
103
|
+
// "killProcessTree" is theorically correct but sometimes keep process handing forever.
|
|
104
|
+
// Inside GitHub workflow the whole Virtual machine gets unresponsive and ends up being killed
|
|
105
|
+
// There is no satisfying solution to this problem so we stick to the basic
|
|
106
|
+
// childProcess.kill()
|
|
107
|
+
if (process.platform === "win32") {
|
|
108
|
+
childProcess.kill()
|
|
109
|
+
return
|
|
110
|
+
}
|
|
111
|
+
if (gracefulStopAllocatedMs) {
|
|
112
|
+
try {
|
|
113
|
+
await killProcessTree(childProcess.pid, {
|
|
114
|
+
signal: GRACEFUL_STOP_SIGNAL,
|
|
115
|
+
timeout: gracefulStopAllocatedMs,
|
|
116
|
+
})
|
|
117
|
+
return
|
|
118
|
+
} catch (e) {
|
|
119
|
+
if (e.code === "TIMEOUT") {
|
|
120
|
+
logger.debug(
|
|
121
|
+
`kill with SIGTERM because gracefulStop still pending after ${gracefulStopAllocatedMs}ms`,
|
|
122
|
+
)
|
|
123
|
+
await killProcessTree(childProcess.pid, {
|
|
124
|
+
signal: GRACEFUL_STOP_FAILED_SIGNAL,
|
|
125
|
+
})
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
throw e
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
await killProcessTree(childProcess.pid, { signal: STOP_SIGNAL })
|
|
132
|
+
return
|
|
133
|
+
})
|
|
131
134
|
raceCallbacks(
|
|
132
135
|
{
|
|
133
136
|
// https://nodejs.org/api/child_process.html#child_process_event_disconnect
|
|
@@ -157,9 +160,9 @@ export const createControllableNodeProcess = async ({
|
|
|
157
160
|
) {
|
|
158
161
|
return
|
|
159
162
|
}
|
|
160
|
-
|
|
163
|
+
onError(error)
|
|
161
164
|
},
|
|
162
|
-
exit: ({ code, signal }) => {
|
|
165
|
+
exit: async ({ code, signal }) => {
|
|
163
166
|
// process.exit(1) in child process or process.exitCode = 1 + process.exit()
|
|
164
167
|
// means there was an error even if we don't know exactly what.
|
|
165
168
|
if (
|
|
@@ -169,112 +172,88 @@ export const createControllableNodeProcess = async ({
|
|
|
169
172
|
code !== SIGTERM_EXIT_CODE &&
|
|
170
173
|
code !== SIGABORT_EXIT_CODE
|
|
171
174
|
) {
|
|
172
|
-
|
|
175
|
+
onError(createExitWithFailureCodeError(code))
|
|
173
176
|
}
|
|
174
|
-
|
|
177
|
+
await cleanup("process exit")
|
|
178
|
+
onStop({ code, signal })
|
|
175
179
|
},
|
|
176
180
|
}
|
|
177
181
|
raceEffects[winner.name](winner.data)
|
|
178
182
|
},
|
|
179
183
|
)
|
|
180
|
-
|
|
181
|
-
const stop = async ({ gracefulStopAllocatedMs } = {}) => {
|
|
182
|
-
if (stoppedCallbackList.notified) {
|
|
183
|
-
return {}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const createStoppedPromise = async () => {
|
|
187
|
-
if (stoppedCallbackList.notified) {
|
|
188
|
-
return
|
|
189
|
-
}
|
|
190
|
-
await new Promise((resolve) => stoppedCallbackList.add(resolve))
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (gracefulStopAllocatedMs) {
|
|
194
|
-
try {
|
|
195
|
-
await killProcessTree(childProcess.pid, {
|
|
196
|
-
signal: GRACEFUL_STOP_SIGNAL,
|
|
197
|
-
timeout: gracefulStopAllocatedMs,
|
|
198
|
-
})
|
|
199
|
-
await createStoppedPromise()
|
|
200
|
-
return { graceful: true }
|
|
201
|
-
} catch (e) {
|
|
202
|
-
if (e.code === "TIMEOUT") {
|
|
203
|
-
logger.debug(
|
|
204
|
-
`kill with SIGTERM because gracefulStop still pending after ${gracefulStopAllocatedMs}ms`,
|
|
205
|
-
)
|
|
206
|
-
await killProcessTree(childProcess.pid, {
|
|
207
|
-
signal: GRACEFUL_STOP_FAILED_SIGNAL,
|
|
208
|
-
})
|
|
209
|
-
await createStoppedPromise()
|
|
210
|
-
return { graceful: false }
|
|
211
|
-
}
|
|
212
|
-
throw e
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
await killProcessTree(childProcess.pid, { signal: STOP_SIGNAL })
|
|
217
|
-
await createStoppedPromise()
|
|
218
|
-
return { graceful: false }
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const requestActionOnChildProcess = ({
|
|
184
|
+
const requestActionOnChildProcess = async ({
|
|
222
185
|
signal,
|
|
223
186
|
actionType,
|
|
224
187
|
actionParams,
|
|
225
188
|
}) => {
|
|
226
189
|
const actionOperation = Abort.startOperation()
|
|
227
190
|
actionOperation.addAbortSignal(signal)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
actionOperation.throwIfAborted()
|
|
231
|
-
await childProcessReadyPromise
|
|
232
|
-
|
|
233
|
-
onceProcessMessage(childProcess, "action-result", ({ status, value }) => {
|
|
234
|
-
if (status === "action-completed") {
|
|
235
|
-
resolve(value)
|
|
236
|
-
} else {
|
|
237
|
-
reject(value)
|
|
238
|
-
}
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
logger.debug(
|
|
242
|
-
createDetailedMessage(`ask child process to perform an action`, {
|
|
243
|
-
actionType,
|
|
244
|
-
actionParams: JSON.stringify(actionParams, null, " "),
|
|
245
|
-
}),
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
try {
|
|
191
|
+
try {
|
|
192
|
+
const result = await new Promise(async (resolve, reject) => {
|
|
249
193
|
actionOperation.throwIfAborted()
|
|
250
|
-
await
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
194
|
+
await childProcessReadyPromise
|
|
195
|
+
onceProcessMessage(
|
|
196
|
+
childProcess,
|
|
197
|
+
"action-result",
|
|
198
|
+
({ status, value }) => {
|
|
199
|
+
if (status === "action-completed") {
|
|
200
|
+
resolve(value)
|
|
201
|
+
} else {
|
|
202
|
+
reject(value)
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
)
|
|
206
|
+
logger.debug(
|
|
207
|
+
createDetailedMessage(`ask child process to perform an action`, {
|
|
208
|
+
actionType,
|
|
209
|
+
actionParams: JSON.stringify(actionParams, null, " "),
|
|
261
210
|
}),
|
|
262
211
|
)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
212
|
+
try {
|
|
213
|
+
actionOperation.throwIfAborted()
|
|
214
|
+
await sendToProcess(childProcess, "action", {
|
|
215
|
+
actionType,
|
|
216
|
+
actionParams,
|
|
217
|
+
})
|
|
218
|
+
} catch (e) {
|
|
219
|
+
if (Abort.isAbortError(e) && actionOperation.signal.aborted) {
|
|
220
|
+
throw e
|
|
221
|
+
}
|
|
222
|
+
logger.error(
|
|
223
|
+
createDetailedMessage(`error while sending message to child`, {
|
|
224
|
+
["error stack"]: e.stack,
|
|
225
|
+
}),
|
|
226
|
+
)
|
|
227
|
+
throw e
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
return result
|
|
231
|
+
} finally {
|
|
232
|
+
await actionOperation.end()
|
|
233
|
+
}
|
|
266
234
|
}
|
|
267
|
-
|
|
268
235
|
return {
|
|
269
236
|
execArgv,
|
|
270
|
-
stoppedCallbackList,
|
|
271
|
-
errorCallbackList,
|
|
272
|
-
outputCallbackList,
|
|
273
237
|
stop,
|
|
274
238
|
requestActionOnChildProcess,
|
|
275
239
|
}
|
|
276
240
|
}
|
|
277
241
|
|
|
242
|
+
// https://nodejs.org/api/process.html#process_signal_events
|
|
243
|
+
const SIGINT_SIGNAL_NUMBER = 2
|
|
244
|
+
const SIGABORT_SIGNAL_NUMBER = 6
|
|
245
|
+
const SIGTERM_SIGNAL_NUMBER = 15
|
|
246
|
+
const SIGINT_EXIT_CODE = 128 + SIGINT_SIGNAL_NUMBER
|
|
247
|
+
const SIGABORT_EXIT_CODE = 128 + SIGABORT_SIGNAL_NUMBER
|
|
248
|
+
const SIGTERM_EXIT_CODE = 128 + SIGTERM_SIGNAL_NUMBER
|
|
249
|
+
// http://man7.org/linux/man-pages/man7/signal.7.html
|
|
250
|
+
// https:// github.com/nodejs/node/blob/1d9511127c419ec116b3ddf5fc7a59e8f0f1c1e4/lib/internal/child_process.js#L472
|
|
251
|
+
const GRACEFUL_STOP_SIGNAL = "SIGTERM"
|
|
252
|
+
const STOP_SIGNAL = "SIGKILL"
|
|
253
|
+
// it would be more correct if GRACEFUL_STOP_FAILED_SIGNAL was SIGHUP instead of SIGKILL.
|
|
254
|
+
// but I'm not sure and it changes nothing so just use SIGKILL
|
|
255
|
+
const GRACEFUL_STOP_FAILED_SIGNAL = "SIGKILL"
|
|
256
|
+
|
|
278
257
|
const sendToProcess = async (childProcess, type, data) => {
|
|
279
258
|
const source = uneval(data, { functionAllowed: true })
|
|
280
259
|
return new Promise((resolve, reject) => {
|
|
@@ -331,7 +310,6 @@ const onceProcessMessage = (childProcess, type, callback) => {
|
|
|
331
310
|
|
|
332
311
|
const onceProcessEvent = (childProcess, type, callback) => {
|
|
333
312
|
childProcess.once(type, callback)
|
|
334
|
-
|
|
335
313
|
return () => {
|
|
336
314
|
childProcess.removeListener(type, callback)
|
|
337
315
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const ExecOptions = {
|
|
2
|
+
fromExecArgv: (execArgv) => {
|
|
3
|
+
const execOptions = {}
|
|
4
|
+
let i = 0
|
|
5
|
+
while (i < execArgv.length) {
|
|
6
|
+
const execArg = execArgv[i]
|
|
7
|
+
const option = execOptionFromExecArg(execArg)
|
|
8
|
+
execOptions[option.name] = option.value
|
|
9
|
+
i++
|
|
10
|
+
}
|
|
11
|
+
return execOptions
|
|
12
|
+
},
|
|
13
|
+
toExecArgv: (execOptions) => {
|
|
14
|
+
const execArgv = []
|
|
15
|
+
Object.keys(execOptions).forEach((optionName) => {
|
|
16
|
+
const optionValue = execOptions[optionName]
|
|
17
|
+
if (optionValue === "unset") {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
if (optionValue === "") {
|
|
21
|
+
execArgv.push(optionName)
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
execArgv.push(`${optionName}=${optionValue}`)
|
|
25
|
+
})
|
|
26
|
+
return execArgv
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const execOptionFromExecArg = (execArg) => {
|
|
31
|
+
const equalCharIndex = execArg.indexOf("=")
|
|
32
|
+
if (equalCharIndex === -1) {
|
|
33
|
+
return {
|
|
34
|
+
name: execArg,
|
|
35
|
+
value: "",
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const name = execArg.slice(0, equalCharIndex)
|
|
39
|
+
const value = execArg.slice(equalCharIndex + 1)
|
|
40
|
+
return {
|
|
41
|
+
name,
|
|
42
|
+
value,
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { createControlledProcess } from "./controlled_process.js"
|
|
2
|
+
|
|
3
|
+
export const nodeProcess = {
|
|
4
|
+
name: "node",
|
|
5
|
+
version: process.version.slice(1),
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
nodeProcess.run = async ({
|
|
9
|
+
signal = new AbortController().signal,
|
|
10
|
+
logger,
|
|
11
|
+
logProcessCommand,
|
|
12
|
+
rootDirectoryUrl,
|
|
13
|
+
fileRelativeUrl,
|
|
14
|
+
|
|
15
|
+
keepRunning,
|
|
16
|
+
gracefulStopAllocatedMs = 4000,
|
|
17
|
+
stopSignal,
|
|
18
|
+
onStop,
|
|
19
|
+
onError,
|
|
20
|
+
onConsole,
|
|
21
|
+
onResult,
|
|
22
|
+
|
|
23
|
+
measurePerformance,
|
|
24
|
+
collectPerformance,
|
|
25
|
+
collectCoverage = false,
|
|
26
|
+
coverageForceIstanbul,
|
|
27
|
+
|
|
28
|
+
debugPort,
|
|
29
|
+
debugMode,
|
|
30
|
+
debugModeInheritBreak,
|
|
31
|
+
env,
|
|
32
|
+
inheritProcessEnv,
|
|
33
|
+
commandLineOptions = [],
|
|
34
|
+
stdin,
|
|
35
|
+
stdout,
|
|
36
|
+
stderr,
|
|
37
|
+
}) => {
|
|
38
|
+
env = {
|
|
39
|
+
...env,
|
|
40
|
+
COVERAGE_ENABLED: collectCoverage,
|
|
41
|
+
JSENV: true,
|
|
42
|
+
}
|
|
43
|
+
if (coverageForceIstanbul) {
|
|
44
|
+
// if we want to force istanbul, we will set process.env.NODE_V8_COVERAGE = ''
|
|
45
|
+
// into the child_process
|
|
46
|
+
env.NODE_V8_COVERAGE = ""
|
|
47
|
+
}
|
|
48
|
+
commandLineOptions = [
|
|
49
|
+
"--experimental-import-meta-resolve",
|
|
50
|
+
...commandLineOptions,
|
|
51
|
+
]
|
|
52
|
+
const { stop, requestActionOnChildProcess } = await createControlledProcess({
|
|
53
|
+
signal,
|
|
54
|
+
logger,
|
|
55
|
+
debugPort,
|
|
56
|
+
debugMode,
|
|
57
|
+
debugModeInheritBreak,
|
|
58
|
+
env,
|
|
59
|
+
inheritProcessEnv,
|
|
60
|
+
commandLineOptions,
|
|
61
|
+
stdin,
|
|
62
|
+
stdout,
|
|
63
|
+
stderr,
|
|
64
|
+
logProcessCommand,
|
|
65
|
+
|
|
66
|
+
stopSignal,
|
|
67
|
+
onStop,
|
|
68
|
+
onError,
|
|
69
|
+
onConsole,
|
|
70
|
+
})
|
|
71
|
+
const namespace = await requestActionOnChildProcess({
|
|
72
|
+
signal,
|
|
73
|
+
actionType: "execute-using-dynamic-import",
|
|
74
|
+
actionParams: {
|
|
75
|
+
fileUrl: new URL(fileRelativeUrl, rootDirectoryUrl).href,
|
|
76
|
+
measurePerformance,
|
|
77
|
+
collectPerformance,
|
|
78
|
+
collectCoverage,
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
onResult({
|
|
82
|
+
status: "completed",
|
|
83
|
+
namespace,
|
|
84
|
+
})
|
|
85
|
+
if (keepRunning) {
|
|
86
|
+
stopSignal.notify = stop
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
await stop({
|
|
90
|
+
gracefulStopAllocatedMs,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// https://github.com/avajs/ava/blob/576f534b345259055c95fa0c2b33bef10847a2af/lib/fork.js#L23
|
|
2
|
+
// https://nodejs.org/api/worker_threads.html
|
|
3
|
+
// https://github.com/avajs/ava/blob/576f534b345259055c95fa0c2b33bef10847a2af/lib/worker/base.js
|
|
4
|
+
// import { Worker } from "node:worker_threads"
|
|
5
|
+
|
|
6
|
+
// export const nodeWorkerThread = {
|
|
7
|
+
// name: "node_worker",
|
|
8
|
+
// version: process.version.slice(1),
|
|
9
|
+
// launch: async ({ env }) => {
|
|
10
|
+
// // https://nodejs.org/api/worker_threads.html#new-workerfilename-options
|
|
11
|
+
// const worker = new Worker(workerPath, {
|
|
12
|
+
// argv: options.workerArgv,
|
|
13
|
+
// env: {
|
|
14
|
+
// NODE_ENV: "test",
|
|
15
|
+
// JSENV: true,
|
|
16
|
+
// ...process.env,
|
|
17
|
+
// },
|
|
18
|
+
// execArgv: [...execArgv, ...additionalExecArgv],
|
|
19
|
+
// workerData: {
|
|
20
|
+
// options,
|
|
21
|
+
// },
|
|
22
|
+
// trackUnmanagedFds: true,
|
|
23
|
+
// stdin: true,
|
|
24
|
+
// stdout: true,
|
|
25
|
+
// stderr: true,
|
|
26
|
+
// })
|
|
27
|
+
// },
|
|
28
|
+
// }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-core/src/tools/build-external-helpers.js
|
|
2
|
+
// the list of possible helpers:
|
|
3
|
+
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-helpers/src/helpers.js#L13
|
|
4
|
+
|
|
5
|
+
const babelHelperClientDirectoryUrl = new URL("./client/", import.meta.url).href
|
|
6
|
+
|
|
7
|
+
// we cannot use "@jsenv/core/src/*" because babel helper might be injected
|
|
8
|
+
// into node_modules not depending on "@jsenv/core"
|
|
9
|
+
export const getBabelHelperFileUrl = (babelHelperName) => {
|
|
10
|
+
const babelHelperFileUrl = new URL(
|
|
11
|
+
`./${babelHelperName}/${babelHelperName}.js`,
|
|
12
|
+
babelHelperClientDirectoryUrl,
|
|
13
|
+
).href
|
|
14
|
+
return babelHelperFileUrl
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const babelHelperNameFromUrl = (url) => {
|
|
18
|
+
if (!url.startsWith(babelHelperClientDirectoryUrl)) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
const afterBabelHelperDirectory = url.slice(
|
|
22
|
+
babelHelperClientDirectoryUrl.length,
|
|
23
|
+
)
|
|
24
|
+
const babelHelperName = afterBabelHelperDirectory.slice(
|
|
25
|
+
0,
|
|
26
|
+
afterBabelHelperDirectory.indexOf("/"),
|
|
27
|
+
)
|
|
28
|
+
return babelHelperName
|
|
29
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { pathToFileURL } from "node:url"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { injectImport } from "@jsenv/utils/js_ast/babel_utils.js"
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
getBabelHelperFileUrl,
|
|
6
7
|
babelHelperNameFromUrl,
|
|
7
|
-
|
|
8
|
-
} from "./babelHelper.js"
|
|
8
|
+
} from "./babel_helper_directory.js"
|
|
9
9
|
|
|
10
10
|
// named import approach found here:
|
|
11
11
|
// https://github.com/rollup/rollup-plugin-babel/blob/18e4232a450f320f44c651aa8c495f21c74d59ac/src/helperPlugin.js#L1
|
|
@@ -15,36 +15,32 @@ import {
|
|
|
15
15
|
// a named import
|
|
16
16
|
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-plugin-external-helpers/src/index.js
|
|
17
17
|
|
|
18
|
-
export const babelPluginBabelHelpersAsJsenvImports = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
api.assertVersion(7)
|
|
23
|
-
|
|
18
|
+
export const babelPluginBabelHelpersAsJsenvImports = (
|
|
19
|
+
babel,
|
|
20
|
+
{ getImportSpecifier },
|
|
21
|
+
) => {
|
|
24
22
|
return {
|
|
23
|
+
name: "babel-helper-as-jsenv-import",
|
|
25
24
|
pre: (file) => {
|
|
26
25
|
const cachedHelpers = {}
|
|
27
26
|
file.set("helperGenerator", (name) => {
|
|
28
27
|
// the list of possible helpers name
|
|
29
28
|
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-helpers/src/helpers.js#L13
|
|
30
|
-
|
|
31
29
|
if (!file.availableHelper(name)) {
|
|
32
30
|
return undefined
|
|
33
31
|
}
|
|
34
|
-
|
|
35
32
|
if (cachedHelpers[name]) {
|
|
36
33
|
return cachedHelpers[name]
|
|
37
34
|
}
|
|
38
|
-
|
|
39
35
|
const filePath = file.opts.filename
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (babelHelperNameFromUrl(fileSystemPathToUrl(filePath)) === name) {
|
|
36
|
+
const fileUrl = pathToFileURL(filePath).href
|
|
37
|
+
if (babelHelperNameFromUrl(fileUrl) === name) {
|
|
44
38
|
return undefined
|
|
45
39
|
}
|
|
46
|
-
|
|
47
|
-
const helper =
|
|
40
|
+
const babelHelperImportSpecifier = getBabelHelperFileUrl(name)
|
|
41
|
+
const helper = injectImport({
|
|
42
|
+
programPath: file.path,
|
|
43
|
+
from: getImportSpecifier(babelHelperImportSpecifier),
|
|
48
44
|
nameHint: `_${name}`,
|
|
49
45
|
// disable interop, useless as we work only with js modules
|
|
50
46
|
importedType: "es6",
|
|
File without changes
|
|
File without changes
|
package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|