@jsenv/core 25.6.2 → 27.0.0-alpha.0
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 +18 -20
- package/package.json +38 -73
- package/readme.md +32 -44
- 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/animation/toolbar.animation.js → 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/focus/toolbar.focus.js → dev/plugins/toolbar/client/focus/toolbar_focus.js} +0 -0
- package/src/{internal/dev_server/toolbar/jsenv-logo.svg → dev/plugins/toolbar/client/jsenv_logo.svg} +1 -1
- package/src/{internal/dev_server/toolbar/notification/toolbar.notification.js → dev/plugins/toolbar/client/notification/toolbar_notification.js} +0 -0
- package/src/{internal/dev_server/toolbar/responsive/overflow-menu.css → dev/plugins/toolbar/client/responsive/overflow_menu.css} +0 -0
- package/src/{internal/dev_server/toolbar/responsive/toolbar.responsive.js → 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/settings/toolbar.settings.js → dev/plugins/toolbar/client/settings/toolbar_settings.js} +1 -0
- package/src/{internal/dev_server/toolbar/theme/jsenv-theme.css → dev/plugins/toolbar/client/theme/jsenv_theme.css} +1 -15
- package/src/{internal/dev_server/toolbar/theme/light-theme.css → dev/plugins/toolbar/client/theme/light_theme.css} +0 -17
- package/src/{internal/dev_server/toolbar/theme/toolbar.theme.js → dev/plugins/toolbar/client/theme/toolbar_theme.js} +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +42 -201
- package/src/{internal/dev_server/toolbar/toolbar.injector.js → dev/plugins/toolbar/client/toolbar_injector.js} +10 -29
- package/src/{internal/dev_server/toolbar/toolbar.main.css → dev/plugins/toolbar/client/toolbar_main.css} +2 -26
- package/src/{internal/dev_server/toolbar/toolbar.main.js → dev/plugins/toolbar/client/toolbar_main.js} +18 -64
- 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/fetchUsingXHR.js → dev/plugins/toolbar/client/util/fetch_using_xhr.js} +0 -2
- 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/util/jsenvLogger.js → 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/execute/runtimes/browsers/webkit.js +24 -0
- package/src/{internal/node_launcher/createChildProcessOptions.js → execute/runtimes/node/child_exec_options.js} +25 -36
- package/src/{internal/node_runtime/nodeControllableFile.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
- package/src/{internal/node_launcher/createControllableNodeProcess.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 +4 -2
- 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/compiling/js-compilation-service → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +16 -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_runtime/displayErrorInDocument.js → omega/core_plugins/html_supervisor/client/error_in_document.js} +10 -18
- package/src/{internal/browser_runtime/displayErrorNotification.js → omega/core_plugins/html_supervisor/client/error_in_notification.js} +0 -1
- 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 → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -2
- package/src/{internal/unevalException.js → omega/core_plugins/html_supervisor/client/uneval_exception.js} +1 -1
- 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 → 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/executePlan.js → test/execute_plan.js} +159 -213
- package/src/{executeTestPlan.js → test/execute_test_plan.js} +36 -84
- package/src/{internal/executing → test}/execution_colors.js +0 -0
- package/src/{internal/executing/generateFileExecutionSteps.js → test/execution_steps.js} +25 -4
- package/src/{internal/executing → test}/gc.js +0 -0
- package/src/test/logs_file_execution.js +223 -0
- package/dist/browser_runtime/asset-manifest.json +0 -4
- package/dist/browser_runtime/browser_runtime_c81cd9af.js +0 -5300
- package/dist/browser_runtime/browser_runtime_c81cd9af.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_c05fdc30.js.map +0 -343
- package/dist/compile_proxy/compile_proxy_93ec4247.html +0 -2247
- 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_20421b23.js.map +0 -349
- package/dist/redirector/redirector_ddc79416.html +0 -2292
- 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_72a60fa3.map +0 -12
- package/dist/toolbar/assets/overflow-menu.css_2859d519.map +0 -12
- package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
- package/dist/toolbar/assets/toolbar.main.css_b7d8bec1.map +0 -28
- package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
- package/dist/toolbar/toolbar.main_7d7783d3.js.map +0 -776
- package/dist/toolbar/toolbar_d6045dd0.html +0 -4978
- package/dist/toolbar_injector/asset-manifest.json +0 -5
- package/dist/toolbar_injector/assets/jsenv-logo_188b9ca6.svg +0 -95
- package/dist/toolbar_injector/toolbar_injector_c8c214dd.js +0 -977
- package/dist/toolbar_injector/toolbar_injector_c8c214dd.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/buildProject.js +0 -336
- package/src/commonJsToJavaScriptModule.js +0 -180
- package/src/dev_server.js +0 -295
- package/src/execute.js +0 -184
- package/src/importUsingChildProcess.js +0 -68
- package/src/internal/argUtils.js +0 -12
- package/src/internal/babel_plugin_replace_expressions.js +0 -101
- package/src/internal/browser_detection/browser_detection.js +0 -68
- package/src/internal/browser_detection/detectAndroid.js +0 -13
- package/src/internal/browser_detection/detectChrome.js +0 -28
- package/src/internal/browser_detection/detectEdge.js +0 -13
- package/src/internal/browser_detection/detectElectron.js +0 -1
- package/src/internal/browser_detection/detectFirefox.js +0 -17
- package/src/internal/browser_detection/detectIOS.js +0 -19
- package/src/internal/browser_detection/detectInternetExplorer.js +0 -14
- package/src/internal/browser_detection/detectOpera.js +0 -27
- package/src/internal/browser_detection/detectSafari.js +0 -13
- package/src/internal/browser_detection/user_agent_data.js +0 -26
- 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/executeHtmlFile.js +0 -354
- package/src/internal/browser_launcher/from_playwright.js +0 -320
- package/src/internal/browser_launcher/trackPageToNotify.js +0 -77
- package/src/internal/browser_runtime/browser_runtime.js +0 -224
- package/src/internal/browser_runtime/browser_system.js +0 -218
- package/src/internal/browser_runtime/createBrowserRuntime.js +0 -146
- package/src/internal/browser_runtime/evalSource.js +0 -11
- package/src/internal/browser_runtime/makeNamespaceTransferable.js +0 -90
- package/src/internal/browser_utils/fetchAndEvalUsingFetch.js +0 -29
- package/src/internal/browser_utils/fetchAndEvalUsingScript.js +0 -49
- package/src/internal/browser_utils/fetchJson.js +0 -7
- package/src/internal/browser_utils/fetch_browser.js +0 -34
- package/src/internal/building/buildToCompilationResult.js +0 -183
- package/src/internal/building/buildUsingRollup.js +0 -359
- package/src/internal/building/build_logs.js +0 -133
- package/src/internal/building/build_stats.js +0 -100
- package/src/internal/building/build_url_generator.js +0 -153
- package/src/internal/building/css/applyPostCss.js +0 -55
- package/src/internal/building/css/moveCssUrls.js +0 -44
- package/src/internal/building/css/parseCssRessource.js +0 -259
- package/src/internal/building/css/parseCssUrls.js +0 -38
- package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -244
- package/src/internal/building/css/replaceCssUrls.js +0 -67
- package/src/internal/building/css_module.js +0 -43
- package/src/internal/building/es_to_system.js +0 -34
- package/src/internal/building/html/htmlScan.js +0 -70
- package/src/internal/building/html/minifyHtml.js +0 -7
- package/src/internal/building/html/parseHtmlRessource.js +0 -814
- package/src/internal/building/import_references.js +0 -80
- package/src/internal/building/importmap/parseImportmapRessource.js +0 -28
- package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
- package/src/internal/building/js/minifyJs.js +0 -33
- package/src/internal/building/js/parseJsRessource.js +0 -121
- package/src/internal/building/js/transform_worker.js +0 -55
- package/src/internal/building/json/parseJsonRessource.js +0 -11
- package/src/internal/building/parseRessource.js +0 -207
- package/src/internal/building/parsing.utils.js +0 -29
- package/src/internal/building/resolve_import_url_helper.js +0 -12
- package/src/internal/building/ressource_builder.js +0 -1097
- package/src/internal/building/ressource_builder_util.js +0 -194
- package/src/internal/building/rollup_plugin_jsenv.js +0 -1963
- package/src/internal/building/sortObjectByPathnames.js +0 -10
- package/src/internal/building/sourcemap_loader.js +0 -73
- package/src/internal/building/svg/parseSvgRessource.js +0 -111
- 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.js +0 -65
- package/src/internal/building/webmanifest/parseWebmanifestRessource.js +0 -48
- package/src/internal/compiling/babel_parse_error.js +0 -9
- package/src/internal/compiling/babel_plugin_global_this_as_jsenv_import.js +0 -34
- package/src/internal/compiling/babel_plugin_import_assertions.js +0 -120
- package/src/internal/compiling/babel_plugin_import_metadata.js +0 -18
- package/src/internal/compiling/babel_plugin_import_visitor.js +0 -84
- package/src/internal/compiling/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
- package/src/internal/compiling/babel_plugin_proxy_external_imports.js +0 -31
- package/src/internal/compiling/babel_plugin_transform_import_meta.js +0 -134
- package/src/internal/compiling/babel_plugins.js +0 -37
- package/src/internal/compiling/compileFile.js +0 -271
- package/src/internal/compiling/compileHtml.js +0 -544
- package/src/internal/compiling/createCompiledFileService.js +0 -263
- package/src/internal/compiling/html_source_file_service.js +0 -453
- package/src/internal/compiling/js-compilation-service/ansiToHTML.js +0 -9
- package/src/internal/compiling/js-compilation-service/babelHelper.js +0 -145
- package/src/internal/compiling/js-compilation-service/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
- package/src/internal/compiling/js-compilation-service/babel_plugin_systemjs_prepend.js +0 -23
- package/src/internal/compiling/js-compilation-service/generateBabelHelper.js +0 -36
- package/src/internal/compiling/js-compilation-service/transformJs.js +0 -196
- package/src/internal/compiling/jsenvCompilerForHtml.js +0 -674
- package/src/internal/compiling/jsenvCompilerForImportmap.js +0 -28
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +0 -61
- package/src/internal/compiling/jsenv_directory/comparison_utils.js +0 -27
- package/src/internal/compiling/jsenv_directory/compile_asset.js +0 -24
- package/src/internal/compiling/jsenv_directory/compile_context.js +0 -60
- package/src/internal/compiling/jsenv_directory/compile_profile.js +0 -217
- package/src/internal/compiling/jsenv_directory/file_lock_registry.js +0 -24
- package/src/internal/compiling/jsenv_directory/file_lock_registry.test.js +0 -47
- package/src/internal/compiling/jsenv_directory/fs-optimized-for-cache.js +0 -57
- package/src/internal/compiling/jsenv_directory/getOrGenerateCompiledFile.js +0 -269
- package/src/internal/compiling/jsenv_directory/jsenv_directory.js +0 -174
- package/src/internal/compiling/jsenv_directory/updateMeta.js +0 -150
- package/src/internal/compiling/jsenv_directory/validateCache.js +0 -264
- package/src/internal/compiling/load_babel_plugin_map_from_file.js +0 -49
- package/src/internal/compiling/rollup_plugin_commonjs_named_exports.js +0 -187
- package/src/internal/compiling/sse_service/sse_service.js +0 -369
- package/src/internal/compiling/startCompileServer.js +0 -518
- package/src/internal/compiling/transformResultToCompilationResult.js +0 -242
- package/src/internal/dataUrl.utils.js +0 -55
- 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/fetchExploringJson.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 -201
- 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-remapping/getOriginalCallsites.js +0 -217
- package/src/internal/error-stack-remapping/installBrowserErrorStackRemapping.js +0 -45
- package/src/internal/error-stack-remapping/installErrorStackRemapping.js +0 -141
- package/src/internal/error-stack-remapping/installNodeErrorStackRemapping.js +0 -20
- package/src/internal/error-stack-remapping/remapCallSite.js +0 -314
- package/src/internal/error-stack-remapping/stackToString.js +0 -9
- package/src/internal/escapeRegexpSpecialCharacters.js +0 -34
- package/src/internal/escapeTemplateStringSpecialCharacters.js +0 -20
- package/src/internal/executing/coverage/babel_plugin_instrument.js +0 -90
- package/src/internal/executing/coverage/reportToCoverage.js +0 -198
- package/src/internal/executing/coverage_missing/createEmptyCoverage.js +0 -6
- package/src/internal/executing/coverage_missing/list_files_not_covered.js +0 -20
- package/src/internal/executing/coverage_missing/missing_coverage.js +0 -46
- package/src/internal/executing/coverage_missing/relativeUrlToEmptyCoverage.js +0 -63
- package/src/internal/executing/coverage_reporter/coverage_reporter_html_directory.js +0 -36
- package/src/internal/executing/coverage_reporter/coverage_reporter_json_file.js +0 -22
- package/src/internal/executing/coverage_reporter/coverage_reporter_text_log.js +0 -19
- package/src/internal/executing/coverage_reporter/istanbulCoverageMapFromCoverage.js +0 -16
- package/src/internal/executing/coverage_utils/file_by_file_coverage.js +0 -28
- package/src/internal/executing/coverage_utils/istanbul_coverage_composition.js +0 -28
- package/src/internal/executing/coverage_utils/v8_and_istanbul.js +0 -38
- package/src/internal/executing/coverage_utils/v8_coverage_composition.js +0 -23
- package/src/internal/executing/coverage_utils/v8_coverage_from_directory.js +0 -86
- package/src/internal/executing/coverage_utils/v8_coverage_to_istanbul.js +0 -100
- package/src/internal/executing/createSummaryLog.js +0 -143
- package/src/internal/executing/executionIsPassed.js +0 -2
- package/src/internal/executing/executionLogs.js +0 -159
- package/src/internal/executing/generateExecutionSteps.js +0 -29
- package/src/internal/executing/launchAndExecute.js +0 -458
- 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/fetchUrl.js +0 -28
- package/src/internal/filePathUtils.js +0 -19
- 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/jsenvCoreDirectoryUrl.js +0 -11
- package/src/internal/jsenvInternalFiles.js +0 -36
- package/src/internal/jsenv_builds.js +0 -19
- package/src/internal/jsenv_remote_directory.js +0 -156
- package/src/internal/logs/byte.js +0 -10
- package/src/internal/logs/byteAsFileSize.js +0 -9
- package/src/internal/logs/msAsDuration.js +0 -12
- package/src/internal/memoize.js +0 -24
- package/src/internal/node_launcher/node_runtime_report.js +0 -77
- package/src/internal/node_launcher/processOptions.js +0 -46
- package/src/internal/node_runtime/evalSource.js +0 -6
- package/src/internal/node_runtime/fetchSource.js +0 -8
- package/src/internal/node_runtime/node_execution_dynamic_import.js +0 -74
- package/src/internal/node_runtime/node_execution_performance.js +0 -67
- package/src/internal/node_runtime/node_execution_systemjs.js +0 -125
- package/src/internal/node_runtime/node_system.js +0 -191
- package/src/internal/origin_directory_converter.js +0 -62
- package/src/internal/perf_node.js +0 -13
- package/src/internal/promise_race.js +0 -19
- package/src/internal/redirector/redirector.html +0 -40
- package/src/internal/require.js +0 -3
- package/src/internal/response_validation.js +0 -130
- package/src/internal/runtime/module-registration.js +0 -207
- package/src/internal/runtime/s.js +0 -864
- package/src/internal/runtime/s.js.md +0 -1
- package/src/internal/runtime/valueInstall.js +0 -14
- 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/findHighestVersion.js +0 -12
- package/src/internal/semantic_versioning/findLowestVersion.js +0 -12
- package/src/internal/semantic_versioning/index.js +0 -5
- package/src/internal/semantic_versioning/valueToVersion.js +0 -44
- package/src/internal/semantic_versioning/versionCompare.js +0 -32
- package/src/internal/semantic_versioning/versionIsAbove.js +0 -5
- package/src/internal/semantic_versioning/versionIsBelow.js +0 -5
- package/src/internal/semantic_versioning/versionIsEqual.js +0 -3
- package/src/internal/sourceMappingURLUtils.js +0 -112
- 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/jsenvCoverageConfig.js +0 -7
- package/src/jsenvExplorableConfig.js +0 -9
- package/src/jsenvRuntimeSupportDuringDev.js +0 -12
- package/src/jsenvServiceWorkerFinalizer.js +0 -55
- package/src/jsonToJavaScriptModule.js +0 -12
- package/src/launchBrowser.js +0 -43
- package/src/launchNode.js +0 -227
- package/src/playwright_browser_versions.js +0 -5
- package/src/requireUsingChildProcess.js +0 -67
- package/src/textToJavaScriptModule.js +0 -14
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Exploring</title>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<meta charset="utf-8" />
|
|
7
|
-
<link rel="icon" href="../../jsenv.png" />
|
|
8
|
-
<link rel="stylesheet" type="text/css" href="./exploring.css" />
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body>
|
|
12
|
-
<main></main>
|
|
13
|
-
<div style="display: none">
|
|
14
|
-
<article data-page="file-list">
|
|
15
|
-
<!--
|
|
16
|
-
<section id="main_html_file">
|
|
17
|
-
<h2>
|
|
18
|
-
<svg id="main_file_icon" viewBox="0 0 16 16" width="25px" height="25px">
|
|
19
|
-
<path
|
|
20
|
-
d="M15.45,7L14,5.551V2c0-0.55-0.45-1-1-1h-1c-0.55,0-1,0.45-1,1v0.553L9,0.555C8.727,0.297,8.477,0,8,0S7.273,0.297,7,0.555 L0.55,7C0.238,7.325,0,7.562,0,8c0,0.563,0.432,1,1,1h1v6c0,0.55,0.45,1,1,1h3v-5c0-0.55,0.45-1,1-1h2c0.55,0,1,0.45,1,1v5h3 c0.55,0,1-0.45,1-1V9h1c0.568,0,1-0.437,1-1C16,7.562,15.762,7.325,15.45,7z"
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
23
|
-
<span
|
|
24
|
-
>Main html file:
|
|
25
|
-
<a id="main_file_link" href="javascript:void(0)">${mainFileRelativeUrl}</a></span
|
|
26
|
-
>
|
|
27
|
-
</h2>
|
|
28
|
-
<div>
|
|
29
|
-
<iframe id="main_file_iframe" src="about:blank"></iframe>
|
|
30
|
-
</div>
|
|
31
|
-
</section>
|
|
32
|
-
<hr />
|
|
33
|
-
!-->
|
|
34
|
-
<section id="explorables">
|
|
35
|
-
<div id="explorables-header">
|
|
36
|
-
<div id="explorables_header_and_menu">
|
|
37
|
-
<h2 style="white-space: nowrap">
|
|
38
|
-
<svg
|
|
39
|
-
id="fileIconSvgConfig"
|
|
40
|
-
viewBox="0 0 24 24"
|
|
41
|
-
width="32"
|
|
42
|
-
height="32"
|
|
43
|
-
>
|
|
44
|
-
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
45
|
-
<path
|
|
46
|
-
d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"
|
|
47
|
-
/>
|
|
48
|
-
</svg>
|
|
49
|
-
<span
|
|
50
|
-
>File(s) to explore in
|
|
51
|
-
<span id="directory_relative_url" title="${directoryUrl}"
|
|
52
|
-
>${directoryName}</span
|
|
53
|
-
></span
|
|
54
|
-
>
|
|
55
|
-
</h2>
|
|
56
|
-
<div class="menu-wrapper">
|
|
57
|
-
<fieldset id="filter-group-set" class="menu"></fieldset>
|
|
58
|
-
</div>
|
|
59
|
-
<div class="paddles">
|
|
60
|
-
<button class="left-paddle paddle hidden"><</button>
|
|
61
|
-
<button class="right-paddle paddle">></button>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
<div id="explorables_header_bottom_spacing"></div>
|
|
65
|
-
</div>
|
|
66
|
-
<div>
|
|
67
|
-
<div id="explorables-message">
|
|
68
|
-
<h4 style="margin-top: 0">${message}</h4>
|
|
69
|
-
</div>
|
|
70
|
-
<nav>
|
|
71
|
-
<ul></ul>
|
|
72
|
-
</nav>
|
|
73
|
-
</div>
|
|
74
|
-
</section>
|
|
75
|
-
</article>
|
|
76
|
-
</div>
|
|
77
|
-
<script type="module" src="./exploring.js"></script>
|
|
78
|
-
</body>
|
|
79
|
-
</html>
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { fetchUrl } from "../toolbar/util/fetching.js"
|
|
2
|
-
import { createPreference } from "../toolbar/util/preferences.js"
|
|
3
|
-
import { startJavaScriptAnimation } from "../toolbar/util/animation.js"
|
|
4
|
-
import { fetchExploringJson } from "./fetchExploringJson.js"
|
|
5
|
-
|
|
6
|
-
const fetchJSON = async (url, options) => {
|
|
7
|
-
const response = await fetchUrl(url, options)
|
|
8
|
-
const json = await response.json()
|
|
9
|
-
return json
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const groupPreference = createPreference("group")
|
|
13
|
-
|
|
14
|
-
const run = async () => {
|
|
15
|
-
const { projectDirectoryUrl, explorableConfig, jsenvDirectoryRelativeUrl } =
|
|
16
|
-
await fetchExploringJson()
|
|
17
|
-
|
|
18
|
-
const files = await fetchJSON(`/.jsenv/explorables.json`, {
|
|
19
|
-
method: "GET",
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const compileServerOrigin = document.location.origin
|
|
23
|
-
const jsenvDirectoryServerUrl = String(
|
|
24
|
-
new URL(jsenvDirectoryRelativeUrl, compileServerOrigin),
|
|
25
|
-
)
|
|
26
|
-
const documentUrl = document.location.href
|
|
27
|
-
let compileId
|
|
28
|
-
|
|
29
|
-
const jsenvDirectoryIndex = documentUrl.indexOf(jsenvDirectoryServerUrl)
|
|
30
|
-
if (jsenvDirectoryIndex === 0) {
|
|
31
|
-
const afterJsenvDirectory = documentUrl.slice(
|
|
32
|
-
jsenvDirectoryServerUrl.length,
|
|
33
|
-
)
|
|
34
|
-
compileId = afterJsenvDirectory.split("/")[0]
|
|
35
|
-
} else {
|
|
36
|
-
compileId = null
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const renderHtml = () => {
|
|
40
|
-
// const mainHtmlFileRelativeUrl = "index.html"
|
|
41
|
-
// const mainFileLink = document.querySelector("#main_file_link")
|
|
42
|
-
// const mainFileUrl = urlToVisitFromRelativeUrl(mainHtmlFileRelativeUrl)
|
|
43
|
-
// mainFileLink.href = mainFileUrl
|
|
44
|
-
// mainFileLink.textContent = `${mainHtmlFileRelativeUrl}`
|
|
45
|
-
// const mainFileIframe = document.querySelector(`#main_file_iframe`)
|
|
46
|
-
// mainFileIframe.src = mainFileUrl
|
|
47
|
-
|
|
48
|
-
const fileListElement = document
|
|
49
|
-
.querySelector(`[data-page="file-list"]`)
|
|
50
|
-
.cloneNode(true)
|
|
51
|
-
const directoryName = directoryUrlToDirectoryName(projectDirectoryUrl)
|
|
52
|
-
const span = fileListElement.querySelector("#directory_relative_url")
|
|
53
|
-
span.title = projectDirectoryUrl
|
|
54
|
-
span.textContent = directoryName
|
|
55
|
-
|
|
56
|
-
const h4 = fileListElement.querySelector("h4")
|
|
57
|
-
|
|
58
|
-
const ul = fileListElement.querySelector("ul")
|
|
59
|
-
ul.innerHTML = files
|
|
60
|
-
.map(
|
|
61
|
-
(file) =>
|
|
62
|
-
`<li>
|
|
63
|
-
<a
|
|
64
|
-
class="execution-link"
|
|
65
|
-
data-relative-url=${file.relativeUrl}
|
|
66
|
-
href=${urlToVisitFromRelativeUrl(file.relativeUrl)}
|
|
67
|
-
>
|
|
68
|
-
${file.relativeUrl}
|
|
69
|
-
</a>
|
|
70
|
-
</li>`,
|
|
71
|
-
)
|
|
72
|
-
.join("")
|
|
73
|
-
|
|
74
|
-
const groupFieldset = fileListElement.querySelector("#filter-group-set")
|
|
75
|
-
const groupNames = Object.keys(explorableConfig)
|
|
76
|
-
groupFieldset.innerHTML = groupNames
|
|
77
|
-
.map(
|
|
78
|
-
(key) => `<label data-contains-hidden-input class="item">
|
|
79
|
-
<input type="radio" name="filter-group" value="${key}"/>
|
|
80
|
-
<span>${key}</span>
|
|
81
|
-
</label>`,
|
|
82
|
-
)
|
|
83
|
-
.join("")
|
|
84
|
-
|
|
85
|
-
const currentGroup = groupPreference.has()
|
|
86
|
-
? groupPreference.get()
|
|
87
|
-
: groupNames[0]
|
|
88
|
-
Array.from(groupFieldset.querySelectorAll("input")).forEach(
|
|
89
|
-
(inputRadio) => {
|
|
90
|
-
inputRadio.checked = inputRadio.value === currentGroup
|
|
91
|
-
inputRadio.onchange = () => {
|
|
92
|
-
if (inputRadio.checked) {
|
|
93
|
-
groupPreference.set(inputRadio.value)
|
|
94
|
-
enableGroup(inputRadio.value)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
const enableGroup = (groupName) => {
|
|
101
|
-
const arrayOfElementToShow = []
|
|
102
|
-
const arrayOfElementToHide = []
|
|
103
|
-
files.forEach((file) => {
|
|
104
|
-
const fileLink = fileListElement.querySelector(
|
|
105
|
-
`a[data-relative-url="${file.relativeUrl}"]`,
|
|
106
|
-
)
|
|
107
|
-
const fileLi = fileLink.parentNode
|
|
108
|
-
if (file.meta[groupName]) {
|
|
109
|
-
arrayOfElementToShow.push(fileLi)
|
|
110
|
-
} else {
|
|
111
|
-
arrayOfElementToHide.push(fileLi)
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
arrayOfElementToShow.forEach((element) => {
|
|
115
|
-
element.removeAttribute("data-force-hide")
|
|
116
|
-
})
|
|
117
|
-
arrayOfElementToHide.forEach((element) => {
|
|
118
|
-
element.setAttribute("data-force-hide", "")
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
h4.innerHTML =
|
|
122
|
-
arrayOfElementToShow.length === 0
|
|
123
|
-
? `No file found.
|
|
124
|
-
Config for this section: <pre>${JSON.stringify(
|
|
125
|
-
explorableConfig[groupName],
|
|
126
|
-
null,
|
|
127
|
-
" ",
|
|
128
|
-
)}</pre>`
|
|
129
|
-
: `${arrayOfElementToShow.length} files found. Click on the one you want to execute`
|
|
130
|
-
}
|
|
131
|
-
enableGroup(currentGroup)
|
|
132
|
-
|
|
133
|
-
document.querySelector("main").appendChild(fileListElement)
|
|
134
|
-
makeMenuScrollable()
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const urlToVisitFromRelativeUrl = (relativeUrl) => {
|
|
138
|
-
if (compileId) {
|
|
139
|
-
return `${compileServerOrigin}/${jsenvDirectoryRelativeUrl}${compileId}/${relativeUrl}`
|
|
140
|
-
}
|
|
141
|
-
return `${compileServerOrigin}/${relativeUrl}`
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const makeMenuScrollable = () => {
|
|
145
|
-
const getMenuWrapperSize = () => {
|
|
146
|
-
return document.querySelector(".menu-wrapper").getBoundingClientRect()
|
|
147
|
-
.width
|
|
148
|
-
}
|
|
149
|
-
let menuWrapperSize = getMenuWrapperSize()
|
|
150
|
-
|
|
151
|
-
const getMenuSize = () => {
|
|
152
|
-
return document.querySelector(".menu").getBoundingClientRect().width
|
|
153
|
-
}
|
|
154
|
-
let menuSize = getMenuSize()
|
|
155
|
-
|
|
156
|
-
const menuVisibleSize = menuWrapperSize
|
|
157
|
-
let menuInvisibleSize = menuSize - menuVisibleSize
|
|
158
|
-
|
|
159
|
-
const getMenuPosition = () => {
|
|
160
|
-
return document.querySelector(".menu-wrapper").scrollLeft
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const scrollDuration = 300
|
|
164
|
-
const leftPaddle = document.querySelector(".left-paddle")
|
|
165
|
-
const rightPaddle = document.querySelector(".right-paddle")
|
|
166
|
-
|
|
167
|
-
const handleMenuScroll = () => {
|
|
168
|
-
menuInvisibleSize = menuSize - menuWrapperSize
|
|
169
|
-
const menuPosition = getMenuPosition()
|
|
170
|
-
const menuEndOffset = menuInvisibleSize
|
|
171
|
-
|
|
172
|
-
// show & hide the paddles, depending on scroll position
|
|
173
|
-
if (menuPosition <= 0 && menuEndOffset <= 0) {
|
|
174
|
-
// hide both paddles if the window is large enough to display all tabs
|
|
175
|
-
leftPaddle.classList.add("hidden")
|
|
176
|
-
rightPaddle.classList.add("hidden")
|
|
177
|
-
} else if (menuPosition <= 0) {
|
|
178
|
-
leftPaddle.classList.add("hidden")
|
|
179
|
-
rightPaddle.classList.remove("hidden")
|
|
180
|
-
} else if (menuPosition < Math.floor(menuEndOffset)) {
|
|
181
|
-
// show both paddles in the middle
|
|
182
|
-
leftPaddle.classList.remove("hidden")
|
|
183
|
-
rightPaddle.classList.remove("hidden")
|
|
184
|
-
} else if (menuPosition >= Math.floor(menuEndOffset)) {
|
|
185
|
-
leftPaddle.classList.remove("hidden")
|
|
186
|
-
rightPaddle.classList.add("hidden")
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
handleMenuScroll()
|
|
190
|
-
|
|
191
|
-
window.onresize = () => {
|
|
192
|
-
menuWrapperSize = getMenuWrapperSize()
|
|
193
|
-
menuSize = getMenuSize()
|
|
194
|
-
handleMenuScroll()
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// finally, what happens when we are actually scrolling the menu
|
|
198
|
-
document.querySelector(".menu-wrapper").onscroll = () => {
|
|
199
|
-
handleMenuScroll()
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// scroll to left
|
|
203
|
-
rightPaddle.onclick = () => {
|
|
204
|
-
const scrollStart = document.querySelector(".menu-wrapper").scrollLeft
|
|
205
|
-
const scrollEnd = scrollStart + menuWrapperSize
|
|
206
|
-
startJavaScriptAnimation({
|
|
207
|
-
duration: scrollDuration,
|
|
208
|
-
onProgress: ({ progress }) => {
|
|
209
|
-
document.querySelector(".menu-wrapper").scrollLeft =
|
|
210
|
-
scrollStart + (scrollEnd - scrollStart) * progress
|
|
211
|
-
},
|
|
212
|
-
})
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// scroll to right
|
|
216
|
-
leftPaddle.onclick = () => {
|
|
217
|
-
const scrollStart = document.querySelector(".menu-wrapper").scrollLeft
|
|
218
|
-
const scrollEnd = scrollStart - menuWrapperSize
|
|
219
|
-
startJavaScriptAnimation({
|
|
220
|
-
duration: scrollDuration,
|
|
221
|
-
onProgress: ({ progress }) => {
|
|
222
|
-
document.querySelector(".menu-wrapper").scrollLeft =
|
|
223
|
-
scrollStart + (scrollEnd - scrollStart) * progress
|
|
224
|
-
},
|
|
225
|
-
})
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const directoryUrlToDirectoryName = (directoryUrl) => {
|
|
230
|
-
const slashLastIndex = directoryUrl.lastIndexOf(
|
|
231
|
-
"/",
|
|
232
|
-
// ignore last slash
|
|
233
|
-
directoryUrl.length - 2,
|
|
234
|
-
)
|
|
235
|
-
if (slashLastIndex === -1) return ""
|
|
236
|
-
|
|
237
|
-
return directoryUrl.slice(slashLastIndex + 1)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
renderHtml()
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
run()
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { fetchJson } from "../../browser_utils/fetchJson.js"
|
|
2
|
-
|
|
3
|
-
export const fetchExploringJson = async ({ signal } = {}) => {
|
|
4
|
-
try {
|
|
5
|
-
const exploringInfo = await fetchJson("/.jsenv/exploring.json", {
|
|
6
|
-
signal,
|
|
7
|
-
})
|
|
8
|
-
return exploringInfo
|
|
9
|
-
} catch (e) {
|
|
10
|
-
if (signal && signal.aborted && e.name === "AbortError") {
|
|
11
|
-
throw e
|
|
12
|
-
}
|
|
13
|
-
throw new Error(
|
|
14
|
-
`Cannot communicate with exploring server due to a network error
|
|
15
|
-
--- error stack ---
|
|
16
|
-
${e.stack}`,
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#file_info_svg {
|
|
2
|
-
width: 20px;
|
|
3
|
-
height: 20px;
|
|
4
|
-
margin: 10px;
|
|
5
|
-
color: #cecece;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
#file_info ul {
|
|
9
|
-
margin: 0;
|
|
10
|
-
margin-bottom: 0.7em;
|
|
11
|
-
padding-left: 1em;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
#file_info ul li {
|
|
15
|
-
text-align: left;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.browser_support_text[data-warning],
|
|
19
|
-
.files_compilation_text[data-warning] {
|
|
20
|
-
color: #cb5909;
|
|
21
|
-
margin-bottom: 5px;
|
|
22
|
-
display: block;
|
|
23
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { scanBrowserRuntimeFeatures } from "../../../features/browser_feature_detection/browser_feature_detection.js"
|
|
2
|
-
import { setLinkHrefForParentWindow } from "../util/iframe_to_parent_href.js"
|
|
3
|
-
import { removeForceHideElement } from "../util/dom.js"
|
|
4
|
-
import { enableVariant } from "../variant/variant.js"
|
|
5
|
-
import {
|
|
6
|
-
enableWarningStyle,
|
|
7
|
-
disableWarningStyle,
|
|
8
|
-
} from "../settings/toolbar.settings.js"
|
|
9
|
-
|
|
10
|
-
export const renderCompilationInToolbar = ({ compileGroup }) => {
|
|
11
|
-
const browserSupportRootNode = document.querySelector("#browser_support")
|
|
12
|
-
const filesCompilationRootNode = document.querySelector("#files_compilation")
|
|
13
|
-
|
|
14
|
-
removeForceHideElement(browserSupportRootNode)
|
|
15
|
-
removeForceHideElement(filesCompilationRootNode)
|
|
16
|
-
|
|
17
|
-
scanBrowserRuntimeFeatures().then(
|
|
18
|
-
({
|
|
19
|
-
jsenvDirectoryRelativeUrl,
|
|
20
|
-
inlineImportMapIntoHTML,
|
|
21
|
-
compileProfile,
|
|
22
|
-
compileId,
|
|
23
|
-
runtimeReport,
|
|
24
|
-
}) => {
|
|
25
|
-
const browserSupport = compileId
|
|
26
|
-
? "no"
|
|
27
|
-
: inlineImportMapIntoHTML
|
|
28
|
-
? "partial"
|
|
29
|
-
: "full"
|
|
30
|
-
enableVariant(browserSupportRootNode, {
|
|
31
|
-
browserSupport,
|
|
32
|
-
})
|
|
33
|
-
if (browserSupport === "no") {
|
|
34
|
-
browserSupportRootNode.querySelector(
|
|
35
|
-
`a.browser_support_read_more_link`,
|
|
36
|
-
).onclick = () => {
|
|
37
|
-
// eslint-disable-next-line no-alert
|
|
38
|
-
window.alert(
|
|
39
|
-
`Source files needs to be compiled to be executable in this browser because: ${listWhatIsMissing(
|
|
40
|
-
{
|
|
41
|
-
compileProfile,
|
|
42
|
-
},
|
|
43
|
-
)}`,
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
} else if (browserSupport === "partial") {
|
|
47
|
-
browserSupportRootNode.querySelector(
|
|
48
|
-
`a.browser_support_read_more_link`,
|
|
49
|
-
).onclick = () => {
|
|
50
|
-
// eslint-disable-next-line no-alert
|
|
51
|
-
window.alert(
|
|
52
|
-
`Source files (except html) can be executed directly in this browser because: ${listWhatIsSupported(
|
|
53
|
-
{
|
|
54
|
-
inlineImportMapIntoHTML,
|
|
55
|
-
},
|
|
56
|
-
)}`,
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
} else if (browserSupport === "full") {
|
|
60
|
-
browserSupportRootNode.querySelector(
|
|
61
|
-
`a.browser_support_read_more_link`,
|
|
62
|
-
).onclick = () => {
|
|
63
|
-
// eslint-disable-next-line no-alert
|
|
64
|
-
window.alert(
|
|
65
|
-
`Source files can be executed directly in this browser because: ${listWhatIsSupported(
|
|
66
|
-
{
|
|
67
|
-
inlineImportMapIntoHTML,
|
|
68
|
-
},
|
|
69
|
-
)}`,
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const actualCompileId = compileGroup.compileId
|
|
75
|
-
const expectedCompiledId = compileId
|
|
76
|
-
const shouldSwitchCompileId =
|
|
77
|
-
expectedCompiledId &&
|
|
78
|
-
actualCompileId &&
|
|
79
|
-
actualCompileId !== expectedCompiledId
|
|
80
|
-
const shouldCompile = !actualCompileId && browserSupport === "no"
|
|
81
|
-
const filesCompilation = shouldSwitchCompileId
|
|
82
|
-
? "mismatch"
|
|
83
|
-
: actualCompileId
|
|
84
|
-
? "yes"
|
|
85
|
-
: inlineImportMapIntoHTML
|
|
86
|
-
? "html_only"
|
|
87
|
-
: "no"
|
|
88
|
-
const hasWarning = shouldCompile || shouldSwitchCompileId
|
|
89
|
-
|
|
90
|
-
enableVariant(filesCompilationRootNode, {
|
|
91
|
-
filesCompilation,
|
|
92
|
-
compilation_link: shouldSwitchCompileId
|
|
93
|
-
? "mismatch"
|
|
94
|
-
: actualCompileId
|
|
95
|
-
? "source"
|
|
96
|
-
: expectedCompiledId
|
|
97
|
-
? "compiled"
|
|
98
|
-
: "force",
|
|
99
|
-
})
|
|
100
|
-
if (filesCompilation === "yes") {
|
|
101
|
-
document.querySelector(
|
|
102
|
-
".files_compilation_text",
|
|
103
|
-
).innerHTML = `Files shown are compiled for ${runtimeReport.name}@${runtimeReport.version}`
|
|
104
|
-
}
|
|
105
|
-
setLinkHrefForParentWindow(
|
|
106
|
-
filesCompilationRootNode.querySelector("a.link_to_source_files"),
|
|
107
|
-
`/${compileGroup.fileRelativeUrl}`,
|
|
108
|
-
)
|
|
109
|
-
setLinkHrefForParentWindow(
|
|
110
|
-
filesCompilationRootNode.querySelector("a.link_to_compiled_files"),
|
|
111
|
-
`/${jsenvDirectoryRelativeUrl}${expectedCompiledId}/${compileGroup.fileRelativeUrl}`,
|
|
112
|
-
)
|
|
113
|
-
setLinkHrefForParentWindow(
|
|
114
|
-
filesCompilationRootNode.querySelector(
|
|
115
|
-
"a.link_to_compilation_forced_files",
|
|
116
|
-
),
|
|
117
|
-
`/${jsenvDirectoryRelativeUrl}force/${compileGroup.fileRelativeUrl}`,
|
|
118
|
-
)
|
|
119
|
-
setLinkHrefForParentWindow(
|
|
120
|
-
filesCompilationRootNode.querySelector("a.link_to_appropriate_files"),
|
|
121
|
-
`/${jsenvDirectoryRelativeUrl}${expectedCompiledId}/${compileGroup.fileRelativeUrl}`,
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
if (hasWarning) {
|
|
125
|
-
enableWarningStyle()
|
|
126
|
-
document
|
|
127
|
-
.querySelector(".files_compilation_text")
|
|
128
|
-
.setAttribute("data-warning", "")
|
|
129
|
-
document
|
|
130
|
-
.querySelector(".browser_support_text")
|
|
131
|
-
.setAttribute("data-warning", "")
|
|
132
|
-
document
|
|
133
|
-
.querySelector("#settings-button")
|
|
134
|
-
.setAttribute("data-warning", "")
|
|
135
|
-
} else {
|
|
136
|
-
disableWarningStyle()
|
|
137
|
-
document
|
|
138
|
-
.querySelector(".files_compilation_text")
|
|
139
|
-
.removeAttribute("data-warning")
|
|
140
|
-
document
|
|
141
|
-
.querySelector(".browser_support_text")
|
|
142
|
-
.removeAttribute("data-warning")
|
|
143
|
-
document
|
|
144
|
-
.querySelector("#settings-button")
|
|
145
|
-
.removeAttribute("data-warning")
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const listWhatIsSupported = ({ inlineImportMapIntoHTML }) => {
|
|
152
|
-
const parts = []
|
|
153
|
-
if (inlineImportMapIntoHTML) {
|
|
154
|
-
parts.push(`importmaps are supported (only when inlined in html files)`)
|
|
155
|
-
} else {
|
|
156
|
-
parts.push(`importmaps are supported`)
|
|
157
|
-
}
|
|
158
|
-
parts.push(`dynamic imports are supported`)
|
|
159
|
-
parts.push(`top level await is supported`)
|
|
160
|
-
parts.push(`all features are natively supported`)
|
|
161
|
-
return `
|
|
162
|
-
- ${parts.join(`
|
|
163
|
-
- `)}`
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const listWhatIsMissing = ({ compileProfile }) => {
|
|
167
|
-
const parts = []
|
|
168
|
-
const { missingFeatures } = compileProfile
|
|
169
|
-
if (missingFeatures.importmap) {
|
|
170
|
-
parts.push(`importmaps are not supported`)
|
|
171
|
-
}
|
|
172
|
-
if (missingFeatures.dynamicImport) {
|
|
173
|
-
parts.push(`dynamic imports are not supported`)
|
|
174
|
-
}
|
|
175
|
-
if (missingFeatures.topLevelAwait) {
|
|
176
|
-
parts.push(`top level await is not supported`)
|
|
177
|
-
}
|
|
178
|
-
const missingFeatureNames = Object.keys(missingFeatures).filter((name) => {
|
|
179
|
-
return (
|
|
180
|
-
name !== "importmap" &&
|
|
181
|
-
name !== "dynamicImport" &&
|
|
182
|
-
name !== "topLevelAwait" &&
|
|
183
|
-
name !== "custom_compiler_patterns"
|
|
184
|
-
)
|
|
185
|
-
})
|
|
186
|
-
const missingFeatureCount = missingFeatureNames.length
|
|
187
|
-
if (missingFeatureCount > 0) {
|
|
188
|
-
parts.push(
|
|
189
|
-
`${missingFeatureCount} features are missing: ${missingFeatureNames}`,
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
const { custom_compiler_patterns } = missingFeatures
|
|
193
|
-
if (custom_compiler_patterns) {
|
|
194
|
-
parts.push(
|
|
195
|
-
`${custom_compiler_patterns.length} custom compilers enabled: ${custom_compiler_patterns}`,
|
|
196
|
-
)
|
|
197
|
-
}
|
|
198
|
-
return `
|
|
199
|
-
- ${parts.join(`
|
|
200
|
-
- `)}`
|
|
201
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { removeForceHideElement } from "../util/dom.js"
|
|
2
|
-
import { enableVariant } from "../variant/variant.js"
|
|
3
|
-
import {
|
|
4
|
-
toggleTooltip,
|
|
5
|
-
removeAutoShowTooltip,
|
|
6
|
-
autoShowTooltip,
|
|
7
|
-
} from "../tooltip/tooltip.js"
|
|
8
|
-
|
|
9
|
-
let livereloadingAvailableOnServer = false
|
|
10
|
-
const parentEventSourceClient = window.parent.__jsenv_event_source_client__
|
|
11
|
-
|
|
12
|
-
export const initToolbarEventSource = ({ livereloading }) => {
|
|
13
|
-
removeForceHideElement(document.querySelector("#eventsource-indicator"))
|
|
14
|
-
livereloadingAvailableOnServer = livereloading
|
|
15
|
-
if (!livereloadingAvailableOnServer) {
|
|
16
|
-
disableLivereloadSetting()
|
|
17
|
-
}
|
|
18
|
-
parentEventSourceClient.setConnectionStatusChangeCallback(() => {
|
|
19
|
-
updateEventSourceIndicator()
|
|
20
|
-
})
|
|
21
|
-
const livereloadCheckbox = document.querySelector("#toggle-livereload")
|
|
22
|
-
livereloadCheckbox.checked = parentEventSourceClient.isLivereloadEnabled()
|
|
23
|
-
livereloadCheckbox.onchange = () => {
|
|
24
|
-
parentEventSourceClient.setLivereloadPreference(livereloadCheckbox.checked)
|
|
25
|
-
updateEventSourceIndicator()
|
|
26
|
-
}
|
|
27
|
-
updateEventSourceIndicator()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const updateEventSourceIndicator = () => {
|
|
31
|
-
const eventSourceIndicator = document.querySelector("#eventsource-indicator")
|
|
32
|
-
const fileChanges = parentEventSourceClient.getFileChanges()
|
|
33
|
-
const changeCount = Object.keys(fileChanges).length
|
|
34
|
-
const eventSourceConnectionState =
|
|
35
|
-
parentEventSourceClient.getConnectionStatus()
|
|
36
|
-
enableVariant(eventSourceIndicator, {
|
|
37
|
-
eventsource: eventSourceConnectionState,
|
|
38
|
-
livereload: parentEventSourceClient.isLivereloadEnabled() ? "on" : "off",
|
|
39
|
-
changes: changeCount > 0 ? "yes" : "no",
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const variantNode = document.querySelector(
|
|
43
|
-
"#eventsource-indicator > [data-when-active]",
|
|
44
|
-
)
|
|
45
|
-
variantNode.querySelector("button").onclick = () => {
|
|
46
|
-
toggleTooltip(eventSourceIndicator)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (eventSourceConnectionState === "connecting") {
|
|
50
|
-
variantNode.querySelector("a").onclick = () => {
|
|
51
|
-
parentEventSourceClient.disconnect()
|
|
52
|
-
}
|
|
53
|
-
} else if (eventSourceConnectionState === "connected") {
|
|
54
|
-
removeAutoShowTooltip(eventSourceIndicator)
|
|
55
|
-
if (changeCount) {
|
|
56
|
-
const changeLink = variantNode.querySelector(".eventsource-changes-link")
|
|
57
|
-
changeLink.innerHTML = changeCount
|
|
58
|
-
changeLink.onclick = () => {
|
|
59
|
-
console.log(JSON.stringify(fileChanges, null, " "), fileChanges)
|
|
60
|
-
// eslint-disable-next-line no-alert
|
|
61
|
-
window.parent.alert(JSON.stringify(fileChanges, null, " "))
|
|
62
|
-
}
|
|
63
|
-
variantNode.querySelector(".eventsource-reload-link").onclick = () => {
|
|
64
|
-
parentEventSourceClient.reloadIfNeeded()
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
} else if (eventSourceConnectionState === "disconnected") {
|
|
68
|
-
autoShowTooltip(eventSourceIndicator)
|
|
69
|
-
variantNode.querySelector("a").onclick = () => {
|
|
70
|
-
parentEventSourceClient.connect()
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const disableLivereloadSetting = () => {
|
|
76
|
-
document
|
|
77
|
-
.querySelector(".settings-livereload")
|
|
78
|
-
.setAttribute("data-disabled", "true")
|
|
79
|
-
document
|
|
80
|
-
.querySelector(".settings-livereload")
|
|
81
|
-
.setAttribute("title", `Livereload not available: disabled by server`)
|
|
82
|
-
document.querySelector("#toggle-livereload").disabled = true
|
|
83
|
-
}
|