@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.
Files changed (465) hide show
  1. package/main.js +17 -24
  2. package/package.json +35 -71
  3. package/readme.md +30 -37
  4. package/src/build/build.js +737 -0
  5. package/src/build/build_urls_generator.js +64 -0
  6. package/src/build/inject_version_mappings.js +62 -0
  7. package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -0
  8. package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
  9. package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
  10. package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
  11. package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
  12. package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
  13. package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
  14. package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
  15. package/src/dev/plugins/autoreload/client/reload.js +101 -0
  16. package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
  17. package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
  18. package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
  19. package/src/dev/plugins/autoreload/sse_service.js +149 -0
  20. package/src/dev/plugins/explorer/client/explorer.html +607 -0
  21. package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
  22. package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
  23. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/animation/toolbar_animation.js +0 -0
  24. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
  25. package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
  26. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
  27. package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
  28. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
  29. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/toolbar_focus.js +0 -0
  30. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/jsenv_logo.svg +0 -0
  31. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/notification/toolbar_notification.js +0 -0
  32. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/overflow_menu.css +0 -0
  33. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/toolbar_responsive.js +0 -0
  34. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
  35. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/toolbar_settings.js +1 -0
  36. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/jsenv_theme.css +1 -15
  37. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/light_theme.css +0 -17
  38. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/toolbar_theme.js +0 -0
  39. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +40 -199
  40. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_injector.js +8 -28
  41. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.css +0 -24
  42. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.js +10 -56
  43. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
  44. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
  45. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
  46. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
  47. package/src/{internal/browser_utils → dev/plugins/toolbar/client/util}/fetch_using_xhr.js +0 -0
  48. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
  49. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
  50. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/jsenv_logger.js +0 -0
  51. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
  52. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
  53. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
  54. package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
  55. package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
  56. package/src/dev/start_dev_server.js +105 -0
  57. package/src/execute/execute.js +132 -0
  58. package/src/execute/run.js +208 -0
  59. package/src/execute/runtimes/browsers/chromium.js +8 -0
  60. package/src/execute/runtimes/browsers/firefox.js +7 -0
  61. package/src/execute/runtimes/browsers/from_playwright.js +464 -0
  62. package/src/{browser_runtimes.js → execute/runtimes/browsers/webkit.js} +4 -18
  63. package/src/{internal/node_launcher/child_process_options.js → execute/runtimes/node/child_exec_options.js} +25 -36
  64. package/src/{internal/node_launcher/node_controllable_file.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
  65. package/src/{internal/node_launcher/node_controllable_process.js → execute/runtimes/node/controlled_process.js} +128 -150
  66. package/src/execute/runtimes/node/exec_options.js +44 -0
  67. package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +3 -1
  68. package/src/execute/runtimes/node/node_process.js +92 -0
  69. package/src/execute/runtimes/node/node_worker_thread.js +28 -0
  70. package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +29 -0
  71. package/src/{internal/compile_server/js → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -19
  72. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
  73. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
  74. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
  75. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
  76. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
  77. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
  78. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
  79. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
  80. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
  81. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
  82. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
  83. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
  84. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
  85. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
  86. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
  87. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
  88. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
  89. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
  90. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
  91. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
  92. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
  93. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
  94. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
  95. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
  96. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
  97. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
  98. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
  99. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
  100. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
  101. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
  102. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
  103. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
  104. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
  105. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
  106. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
  107. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
  108. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
  109. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
  110. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
  111. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
  112. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
  113. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
  114. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
  115. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
  116. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
  117. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
  118. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
  119. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
  120. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
  121. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
  122. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
  123. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
  124. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
  125. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
  126. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
  127. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
  128. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
  129. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
  130. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
  131. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
  132. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
  133. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
  134. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
  135. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
  136. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
  137. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
  138. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
  139. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
  140. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
  141. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
  142. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
  143. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
  144. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
  145. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
  146. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
  147. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
  148. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
  149. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
  150. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
  151. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
  152. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
  153. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
  154. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
  155. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
  156. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
  157. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
  158. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
  159. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
  160. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
  161. package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -0
  162. package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
  163. package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
  164. package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -0
  165. package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
  166. package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +97 -0
  167. package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
  168. package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
  169. package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
  170. package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
  171. package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
  172. package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
  173. package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
  174. package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
  175. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_document.js +10 -16
  176. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_notification.js +0 -0
  177. package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
  178. package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
  179. package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -0
  180. package/src/{internal/runtime_client → omega/core_plugins/html_supervisor/client}/uneval_exception.js +0 -0
  181. package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
  182. package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
  183. package/src/{internal/building/import_assertions → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
  184. package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
  185. package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
  186. package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +80 -0
  187. package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
  188. package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
  189. package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
  190. package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
  191. package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
  192. package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
  193. package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +210 -0
  194. package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
  195. package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
  196. package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
  197. package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
  198. package/src/omega/core_plugins.js +39 -0
  199. package/src/omega/errors.js +168 -0
  200. package/src/omega/file_url_converter.js +63 -0
  201. package/src/omega/kitchen.js +777 -0
  202. package/src/omega/omega_server.js +129 -0
  203. package/src/omega/plugin_controller.js +240 -0
  204. package/src/omega/runtime_support/default_runtime_support.js +13 -0
  205. package/src/omega/runtime_support/features_compatibility.js +91 -0
  206. package/src/omega/runtime_support/runtime_support.js +20 -0
  207. package/src/omega/server/file_service.js +155 -0
  208. package/src/omega/server/user_agent.js +22 -0
  209. package/src/omega/url_graph/url_graph_load.js +68 -0
  210. package/src/omega/url_graph/url_graph_report.js +151 -0
  211. package/src/omega/url_graph/url_graph_sort.js +29 -0
  212. package/src/omega/url_graph/url_info_transformations.js +161 -0
  213. package/src/omega/url_graph.js +132 -0
  214. package/src/omega/url_mentions/css_url_mentions.js +63 -0
  215. package/src/omega/url_mentions/html_url_mentions.js +185 -0
  216. package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
  217. package/src/omega/url_mentions/parse_url_mentions.js +37 -0
  218. package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
  219. package/src/{internal/executing → test}/execute_plan.js +154 -211
  220. package/src/{execute_test_plan.js → test/execute_test_plan.js} +26 -81
  221. package/src/{internal/executing → test}/execution_colors.js +0 -0
  222. package/src/{internal/executing → test}/execution_steps.js +2 -8
  223. package/src/{internal/executing → test}/gc.js +0 -0
  224. package/src/test/logs_file_execution.js +223 -0
  225. package/dist/browser_client/asset-manifest.json +0 -4
  226. package/dist/browser_client/browser_client_fb33eaa4.js +0 -5320
  227. package/dist/browser_client/browser_client_fb33eaa4.js.map +0 -1089
  228. package/dist/build_manifest.js +0 -12
  229. package/dist/compile_proxy/asset-manifest.json +0 -4
  230. package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +0 -343
  231. package/dist/compile_proxy/compile_proxy_62f952c4.html +0 -2245
  232. package/dist/event_source_client/asset-manifest.json +0 -4
  233. package/dist/event_source_client/event_source_client_69f48287.js +0 -354
  234. package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
  235. package/dist/redirector/asset-manifest.json +0 -4
  236. package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +0 -349
  237. package/dist/redirector/redirector_8117ec92.html +0 -2290
  238. package/dist/toolbar/asset-manifest.json +0 -13
  239. package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
  240. package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
  241. package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
  242. package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
  243. package/dist/toolbar/assets/light_theme.css_5bff0336.map +0 -12
  244. package/dist/toolbar/assets/overflow_menu.css_9a0fc3d8.map +0 -12
  245. package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
  246. package/dist/toolbar/assets/toolbar_main.css_b1c67dd7.map +0 -28
  247. package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
  248. package/dist/toolbar/toolbar_b0c9100c.html +0 -4976
  249. package/dist/toolbar/toolbar_main_f54c1bb0.js.map +0 -776
  250. package/dist/toolbar_injector/asset-manifest.json +0 -5
  251. package/dist/toolbar_injector/assets/jsenv_logo_192011c2.svg +0 -95
  252. package/dist/toolbar_injector/toolbar_injector_65b501eb.js +0 -976
  253. package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +0 -294
  254. package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
  255. package/helpers/import-meta/import-meta-url-global.js +0 -54
  256. package/src/build_project.js +0 -336
  257. package/src/commonjs_to_js_module.js +0 -180
  258. package/src/dev_server.js +0 -302
  259. package/src/execute.js +0 -184
  260. package/src/import_using_child_process.js +0 -68
  261. package/src/internal/browser_client/browser_client.js +0 -220
  262. package/src/internal/browser_client/browser_client_factory.js +0 -144
  263. package/src/internal/browser_client/browser_error_stack_remap.js +0 -43
  264. package/src/internal/browser_client/browser_system.js +0 -216
  265. package/src/internal/browser_client/module_namespace_transfer.js +0 -90
  266. package/src/internal/browser_detection/browser_detection.js +0 -65
  267. package/src/internal/browser_detection/detect_android.js +0 -13
  268. package/src/internal/browser_detection/detect_chrome.js +0 -28
  269. package/src/internal/browser_detection/detect_edge.js +0 -13
  270. package/src/internal/browser_detection/detect_electron.js +0 -1
  271. package/src/internal/browser_detection/detect_firefox.js +0 -17
  272. package/src/internal/browser_detection/detect_internet_explorer.js +0 -14
  273. package/src/internal/browser_detection/detect_ios.js +0 -19
  274. package/src/internal/browser_detection/detect_opera.js +0 -27
  275. package/src/internal/browser_detection/detect_safari.js +0 -13
  276. package/src/internal/browser_detection/user_agent_data.js +0 -25
  277. package/src/internal/browser_detection/util.js +0 -13
  278. package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
  279. package/src/internal/browser_launcher/execute_html_file.js +0 -355
  280. package/src/internal/browser_launcher/from_playwright.js +0 -320
  281. package/src/internal/browser_launcher/page_errors_and_logs.js +0 -77
  282. package/src/internal/browser_utils/fetch_and_eval.js +0 -27
  283. package/src/internal/browser_utils/fetch_and_eval_using_script.js +0 -47
  284. package/src/internal/browser_utils/fetch_browser.js +0 -34
  285. package/src/internal/browser_utils/fetch_json.js +0 -7
  286. package/src/internal/building/build_logs.js +0 -134
  287. package/src/internal/building/build_stats.js +0 -100
  288. package/src/internal/building/build_url_generator.js +0 -153
  289. package/src/internal/building/build_using_rollup.js +0 -359
  290. package/src/internal/building/css/apply_post_css.js +0 -55
  291. package/src/internal/building/css/jsenv_parse_css.js +0 -260
  292. package/src/internal/building/css/move_css_urls.js +0 -44
  293. package/src/internal/building/css/parse_css_urls.js +0 -38
  294. package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -245
  295. package/src/internal/building/css/replace_css_urls.js +0 -68
  296. package/src/internal/building/global_format/es_to_system.js +0 -34
  297. package/src/internal/building/html/html_node_mutations.js +0 -29
  298. package/src/internal/building/html/html_scan.js +0 -70
  299. package/src/internal/building/html/jsenv_parse_html.js +0 -813
  300. package/src/internal/building/html/minify_html.js +0 -7
  301. package/src/internal/building/import_assertions/css_module.js +0 -43
  302. package/src/internal/building/import_references.js +0 -80
  303. package/src/internal/building/importmap/jsenv_parse_importmap.js +0 -28
  304. package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
  305. package/src/internal/building/js/jsenv_parse_js.js +0 -122
  306. package/src/internal/building/js/minify_js.js +0 -33
  307. package/src/internal/building/js/transform_worker.js +0 -55
  308. package/src/internal/building/json/jsenv_parse_json.js +0 -11
  309. package/src/internal/building/parse_ressource.js +0 -207
  310. package/src/internal/building/ressource_builder.js +0 -1098
  311. package/src/internal/building/ressource_builder_util.js +0 -194
  312. package/src/internal/building/rollup_plugin_jsenv.js +0 -1965
  313. package/src/internal/building/sort_pathnames.js +0 -10
  314. package/src/internal/building/sourcemap/sourcemap_loader.js +0 -70
  315. package/src/internal/building/svg/jsenv_parse_svg.js +0 -112
  316. package/src/internal/building/url_fetcher.js +0 -85
  317. package/src/internal/building/url_loader.js +0 -127
  318. package/src/internal/building/url_trace.js +0 -229
  319. package/src/internal/building/url_versioning/resolve_import_url_helper.js +0 -12
  320. package/src/internal/building/url_versioning/url_versioning.js +0 -65
  321. package/src/internal/building/webmanifest/jsenv_parse_webmanifest.js +0 -48
  322. package/src/internal/compile_server/commonjs/rollup_plugin_commonjs_named_exports.js +0 -187
  323. package/src/internal/compile_server/compile_file.js +0 -273
  324. package/src/internal/compile_server/compile_server.js +0 -519
  325. package/src/internal/compile_server/compiled_file_service.js +0 -264
  326. package/src/internal/compile_server/html/html_ast.js +0 -534
  327. package/src/internal/compile_server/html/html_source_file_service.js +0 -453
  328. package/src/internal/compile_server/html/jsenv_compile_html.js +0 -674
  329. package/src/internal/compile_server/importmap/jsenv_compile_importmap.js +0 -28
  330. package/src/internal/compile_server/js/ansi_to_html.js +0 -9
  331. package/src/internal/compile_server/js/babelHelper.js +0 -145
  332. package/src/internal/compile_server/js/babel_parse_error.js +0 -9
  333. package/src/internal/compile_server/js/babel_plugin_global_this_as_jsenv_import.js +0 -34
  334. package/src/internal/compile_server/js/babel_plugin_import_assertions.js +0 -121
  335. package/src/internal/compile_server/js/babel_plugin_import_metadata.js +0 -18
  336. package/src/internal/compile_server/js/babel_plugin_import_visitor.js +0 -84
  337. package/src/internal/compile_server/js/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
  338. package/src/internal/compile_server/js/babel_plugin_proxy_external_imports.js +0 -31
  339. package/src/internal/compile_server/js/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
  340. package/src/internal/compile_server/js/babel_plugin_replace_expressions.js +0 -101
  341. package/src/internal/compile_server/js/babel_plugin_systemjs_prepend.js +0 -23
  342. package/src/internal/compile_server/js/babel_plugin_transform_import_meta.js +0 -134
  343. package/src/internal/compile_server/js/babel_plugins.js +0 -37
  344. package/src/internal/compile_server/js/generateBabelHelper.js +0 -36
  345. package/src/internal/compile_server/js/js_transformer.js +0 -195
  346. package/src/internal/compile_server/js/jsenv_compile_js.js +0 -62
  347. package/src/internal/compile_server/js/load_babel_plugin_map_from_file.js +0 -49
  348. package/src/internal/compile_server/jsenv_directory/comparison_utils.js +0 -27
  349. package/src/internal/compile_server/jsenv_directory/compilation_result.js +0 -243
  350. package/src/internal/compile_server/jsenv_directory/compilation_result_from_build.js +0 -184
  351. package/src/internal/compile_server/jsenv_directory/compile_asset.js +0 -24
  352. package/src/internal/compile_server/jsenv_directory/compile_context.js +0 -60
  353. package/src/internal/compile_server/jsenv_directory/compile_profile.js +0 -217
  354. package/src/internal/compile_server/jsenv_directory/file_lock_registry.js +0 -24
  355. package/src/internal/compile_server/jsenv_directory/file_lock_registry.test.js +0 -47
  356. package/src/internal/compile_server/jsenv_directory/fs_optimized_for_cache.js +0 -57
  357. package/src/internal/compile_server/jsenv_directory/jsenv_directory.js +0 -183
  358. package/src/internal/compile_server/jsenv_directory/reuse_or_create_compiled_file.js +0 -269
  359. package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +0 -131
  360. package/src/internal/compile_server/jsenv_directory/validate_compile_cache.js +0 -264
  361. package/src/internal/compile_server/sse_service/sse_service.js +0 -369
  362. package/src/internal/coverage/babel_plugin_instrument.js +0 -90
  363. package/src/internal/coverage/coverage_reporter_html_directory.js +0 -37
  364. package/src/internal/coverage/coverage_reporter_json_file.js +0 -22
  365. package/src/internal/coverage/coverage_reporter_text_log.js +0 -20
  366. package/src/internal/coverage/empty_coverage_factory.js +0 -70
  367. package/src/internal/coverage/file_by_file_coverage.js +0 -28
  368. package/src/internal/coverage/istanbul_coverage_composition.js +0 -28
  369. package/src/internal/coverage/istanbul_coverage_map_from_coverage.js +0 -16
  370. package/src/internal/coverage/list_files_not_covered.js +0 -20
  371. package/src/internal/coverage/missing_coverage.js +0 -46
  372. package/src/internal/coverage/report_to_coverage.js +0 -198
  373. package/src/internal/coverage/v8_and_istanbul.js +0 -38
  374. package/src/internal/coverage/v8_coverage_composition.js +0 -23
  375. package/src/internal/coverage/v8_coverage_from_directory.js +0 -86
  376. package/src/internal/coverage/v8_coverage_to_istanbul.js +0 -100
  377. package/src/internal/data_url.js +0 -54
  378. package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
  379. package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
  380. package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
  381. package/src/internal/dev_server/exploring/exploring.css +0 -237
  382. package/src/internal/dev_server/exploring/exploring.html +0 -79
  383. package/src/internal/dev_server/exploring/exploring.js +0 -243
  384. package/src/internal/dev_server/exploring/fetch_exploring_json.js +0 -19
  385. package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
  386. package/src/internal/dev_server/toolbar/compilation/toolbar_compilation.js +0 -202
  387. package/src/internal/dev_server/toolbar/eventsource/toolbar_eventsource.js +0 -83
  388. package/src/internal/dev_server/toolbar/execution/toolbar_execution.js +0 -91
  389. package/src/internal/error_stack_remap/install_error_stack_remapping.js +0 -142
  390. package/src/internal/error_stack_remap/remap_call_site.js +0 -315
  391. package/src/internal/error_stack_remap/remap_stack.js +0 -218
  392. package/src/internal/error_stack_remap/stringify_stack.js +0 -9
  393. package/src/internal/executing/launch_and_execute.js +0 -458
  394. package/src/internal/executing/logs_file_execution.js +0 -160
  395. package/src/internal/executing/logs_plan_summary.js +0 -144
  396. package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
  397. package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
  398. package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
  399. package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
  400. package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
  401. package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
  402. package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
  403. package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
  404. package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
  405. package/src/internal/features/features_compat_from_runtime.js +0 -38
  406. package/src/internal/features/features_compat_from_runtime_support.js +0 -31
  407. package/src/internal/features/features_compatibility.js +0 -37
  408. package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
  409. package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
  410. package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
  411. package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
  412. package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
  413. package/src/internal/fetching.js +0 -28
  414. package/src/internal/import_resolution/default_extension.js +0 -40
  415. package/src/internal/import_resolution/import_resolver_importmap.js +0 -64
  416. package/src/internal/import_resolution/import_resolver_node.js +0 -254
  417. package/src/internal/import_resolution/importmap_default.js +0 -37
  418. package/src/internal/jsenv_builds.js +0 -19
  419. package/src/internal/jsenv_params_assertions.js +0 -12
  420. package/src/internal/jsenv_remote_directory.js +0 -156
  421. package/src/internal/logs/byte.js +0 -10
  422. package/src/internal/logs/byte_as_file_size.js +0 -9
  423. package/src/internal/logs/ms_as_duration.js +0 -12
  424. package/src/internal/memoize.js +0 -24
  425. package/src/internal/node_launcher/eval_source.js +0 -6
  426. package/src/internal/node_launcher/fetch_source.js +0 -8
  427. package/src/internal/node_launcher/node_error_stack_remap.js +0 -22
  428. package/src/internal/node_launcher/node_execution_dynamic_import.js +0 -75
  429. package/src/internal/node_launcher/node_execution_performance.js +0 -67
  430. package/src/internal/node_launcher/node_execution_systemjs.js +0 -125
  431. package/src/internal/node_launcher/node_runtime_report.js +0 -77
  432. package/src/internal/node_launcher/node_system.js +0 -192
  433. package/src/internal/node_launcher/perf_node.js +0 -13
  434. package/src/internal/node_launcher/process_options.js +0 -46
  435. package/src/internal/node_launcher/value_install.js +0 -14
  436. package/src/internal/origin_directory_converter.js +0 -62
  437. package/src/internal/promise_race.js +0 -19
  438. package/src/internal/redirector/redirector.html +0 -40
  439. package/src/internal/regexp_escape.js +0 -34
  440. package/src/internal/require.js +0 -3
  441. package/src/internal/response_validation.js +0 -130
  442. package/src/internal/runtime_client/module_registration.js +0 -207
  443. package/src/internal/runtime_client/s.js +0 -864
  444. package/src/internal/runtime_client/s.js.md +0 -1
  445. package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
  446. package/src/internal/runtime_support/runtime_support.js +0 -70
  447. package/src/internal/semantic_versioning/compare_versions.js +0 -28
  448. package/src/internal/semantic_versioning/highest_version.js +0 -11
  449. package/src/internal/semantic_versioning/is_above.js +0 -5
  450. package/src/internal/semantic_versioning/is_below.js +0 -5
  451. package/src/internal/semantic_versioning/is_equal.js +0 -3
  452. package/src/internal/semantic_versioning/lowest_version.js +0 -11
  453. package/src/internal/semantic_versioning/version_from_value.js +0 -42
  454. package/src/internal/sourcemap_utils.js +0 -112
  455. package/src/internal/template_string_escape.js +0 -20
  456. package/src/internal/url_conversion.js +0 -313
  457. package/src/internal/url_utils.js +0 -33
  458. package/src/internal/url_utils.test.js +0 -39
  459. package/src/internal/windows_file_path_utils.js +0 -16
  460. package/src/jsenv_file_urls.js +0 -35
  461. package/src/jsenv_service_worker_finalizer.js +0 -55
  462. package/src/json_to_js_module.js +0 -13
  463. package/src/node_runtime.js +0 -227
  464. package/src/require_using_child_process.js +0 -67
  465. package/src/text_to_js_module.js +0 -13
@@ -0,0 +1,57 @@
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
+ const parentEventSourceClient = window.parent.__jsenv_event_source_client__
10
+
11
+ export const initToolbarEventSource = () => {
12
+ removeForceHideElement(document.querySelector("#eventsource-indicator"))
13
+ if (!parentEventSourceClient) {
14
+ disableAutoreloadSetting()
15
+ return
16
+ }
17
+ parentEventSourceClient.status.onchange = () => {
18
+ updateEventSourceIndicator()
19
+ }
20
+ updateEventSourceIndicator()
21
+ }
22
+
23
+ const updateEventSourceIndicator = () => {
24
+ const eventSourceIndicator = document.querySelector("#eventsource-indicator")
25
+ const eventSourceConnectionState = parentEventSourceClient.status.value
26
+ enableVariant(eventSourceIndicator, {
27
+ eventsource: eventSourceConnectionState,
28
+ })
29
+ const variantNode = document.querySelector(
30
+ "#eventsource-indicator > [data-when-active]",
31
+ )
32
+ variantNode.querySelector("button").onclick = () => {
33
+ toggleTooltip(eventSourceIndicator)
34
+ }
35
+ if (eventSourceConnectionState === "connecting") {
36
+ variantNode.querySelector("a").onclick = () => {
37
+ parentEventSourceClient.disconnect()
38
+ }
39
+ } else if (eventSourceConnectionState === "connected") {
40
+ removeAutoShowTooltip(eventSourceIndicator)
41
+ } else if (eventSourceConnectionState === "disconnected") {
42
+ autoShowTooltip(eventSourceIndicator)
43
+ variantNode.querySelector("a").onclick = () => {
44
+ parentEventSourceClient.connect()
45
+ }
46
+ }
47
+ }
48
+
49
+ const disableAutoreloadSetting = () => {
50
+ document
51
+ .querySelector(".settings-autoreload")
52
+ .setAttribute("data-disabled", "true")
53
+ document
54
+ .querySelector(".settings-autoreload")
55
+ .setAttribute("title", `Autoreload not available: disabled by server`)
56
+ document.querySelector("#toggle-autoreload").disabled = true
57
+ }
@@ -0,0 +1,88 @@
1
+ import { removeForceHideElement } from "../util/dom.js"
2
+ import { enableVariant } from "../variant/variant.js"
3
+ import { toggleTooltip } from "../tooltip/tooltip.js"
4
+ import { notifyExecutionResult } from "../notification/toolbar_notification.js"
5
+
6
+ export const renderExecutionInToolbar = async () => {
7
+ // reset file execution indicator ui
8
+ applyExecutionIndicator()
9
+ removeForceHideElement(document.querySelector("#execution-indicator"))
10
+
11
+ const { status, startTime, endTime } =
12
+ await window.parent.__html_supervisor__.getScriptExecutionResults()
13
+ const execution = { status, startTime, endTime }
14
+ applyExecutionIndicator(execution)
15
+ const executionStorageKey = window.location.href
16
+ const previousExecution = sessionStorage.hasOwnProperty(executionStorageKey)
17
+ ? JSON.parse(sessionStorage.getItem(executionStorageKey))
18
+ : undefined
19
+ notifyExecutionResult(executionStorageKey, execution, previousExecution)
20
+ sessionStorage.setItem(executionStorageKey, JSON.stringify(execution))
21
+ }
22
+
23
+ // const changeLink = variantNode.querySelector(".eventsource-changes-link")
24
+ // changeLink.innerHTML = reloadMessageCount
25
+ // changeLink.onclick = () => {
26
+ // console.log(reloadMessages)
27
+ // // eslint-disable-next-line no-alert
28
+ // window.parent.alert(JSON.stringify(reloadMessages, null, " "))
29
+ // }
30
+
31
+ // const someFailed = reloadMessages.some((m) => m.status === "failed")
32
+ // const somePending = reloadMessages.some((m) => m.status === "pending")
33
+ // const applyLink = variantNode.querySelector(".eventsource-reload-link")
34
+ // applyLink.innerHTML = someFailed
35
+ // ? "failed"
36
+ // : somePending
37
+ // ? "applying..."
38
+ // : "apply changes"
39
+ // applyLink.onclick = someFailed
40
+ // ? () => {
41
+ // parentEventSourceClient.applyReloadMessageEffects()
42
+ // }
43
+ // : somePending
44
+ // ? () => {}
45
+ // : () => {
46
+ // parentEventSourceClient.applyReloadMessageEffects()
47
+ // }
48
+
49
+ // parentEventSourceClient.reloadMessagesSignal.onchange = () => {
50
+ // updateEventSourceIndicator()
51
+ // }
52
+ // const autoreloadCheckbox = document.querySelector("#toggle-autoreload")
53
+ // autoreloadCheckbox.checked = parentEventSourceClient.isAutoreloadEnabled()
54
+ // autoreloadCheckbox.onchange = () => {
55
+ // parentEventSourceClient.setAutoreloadPreference(autoreloadCheckbox.checked)
56
+ // updateEventSourceIndicator()
57
+ // }
58
+
59
+ const applyExecutionIndicator = ({
60
+ status = "running",
61
+ startTime,
62
+ endTime,
63
+ } = {}) => {
64
+ const executionIndicator = document.querySelector("#execution-indicator")
65
+ enableVariant(executionIndicator, { execution: status })
66
+ const variantNode = executionIndicator.querySelector("[data-when-active]")
67
+ variantNode.querySelector("button").onclick = () =>
68
+ toggleTooltip(executionIndicator)
69
+ variantNode.querySelector(".tooltip").textContent = computeText({
70
+ status,
71
+ startTime,
72
+ endTime,
73
+ })
74
+ }
75
+
76
+ // relative time: https://github.com/tc39/proposal-intl-relative-time/issues/118
77
+ const computeText = ({ status, startTime, endTime }) => {
78
+ if (status === "completed") {
79
+ return `Execution completed in ${endTime - startTime}ms`
80
+ }
81
+ if (status === "errored") {
82
+ return `Execution failed in ${endTime - startTime}ms`
83
+ }
84
+ if (status === "running") {
85
+ return "Executing..."
86
+ }
87
+ return ""
88
+ }
@@ -9,6 +9,7 @@ import { enableVariant } from "../variant/variant.js"
9
9
  export const renderToolbarSettings = () => {
10
10
  document.querySelector("#settings-button").onclick = toggleSettings
11
11
  document.querySelector("#button-close-settings").onclick = toggleSettings
12
+ disableWarningStyle()
12
13
  }
13
14
 
14
15
  const toggleSettings = () => {
@@ -10,15 +10,6 @@ html[data-theme="jsenv"] .iconToolbar:hover {
10
10
  html[data-theme="jsenv"] #loader-icon {
11
11
  color: #404040;
12
12
  }
13
- html[data-theme="jsenv"] .livereload-circle[data-variant="off"] {
14
- fill: #757575;
15
- }
16
- html[data-theme="jsenv"] .livereload-circle[data-variant="connecting"] {
17
- fill: #717171;
18
- }
19
- html[data-theme="jsenv"] .livereload-ring {
20
- stroke: rgba(138, 136, 136, 0.46);
21
- }
22
13
 
23
14
  /* settings */
24
15
  html[data-theme="jsenv"] #settings-box,
@@ -56,11 +47,6 @@ html[data-theme="jsenv"] .switch .slider:before {
56
47
  background-color: grey;
57
48
  }
58
49
 
59
- /* file input */
60
- html[data-theme="jsenv"] #file[data-active] {
61
- background: rgba(222, 86, 0, 0.7);
62
- }
63
-
64
50
  /* tooltips */
65
51
  html[data-theme="jsenv"] .tooltip {
66
52
  background-color: #ffd390;
@@ -79,7 +65,7 @@ html[data-theme="jsenv"] .tooltip::after {
79
65
  border-color: #ffd390 transparent transparent transparent;
80
66
  }
81
67
 
82
- /* page file list */
68
+ /* page file list */
83
69
  html[data-theme="jsenv"] h2 {
84
70
  color: orange;
85
71
  }
@@ -15,15 +15,6 @@ html[data-theme="light"] .iconToolbar:hover {
15
15
  html[data-theme="light"] #loader-icon {
16
16
  color: #404040;
17
17
  }
18
- html[data-theme="light"] .livereload-circle[data-variant="off"] {
19
- fill: #757575;
20
- }
21
- html[data-theme="light"] .livereload-circle[data-variant="connecting"] {
22
- fill: #717171;
23
- }
24
- html[data-theme="light"] .livereload-ring {
25
- stroke: rgba(138, 136, 136, 0.46);
26
- }
27
18
 
28
19
  /* settings */
29
20
  html[data-theme="light"] #settings-box,
@@ -61,14 +52,6 @@ html[data-theme="light"] .switch input:checked + * .square {
61
52
  background-color: #076570;
62
53
  }
63
54
 
64
- /* file input */
65
- html[data-theme="light"] #file[data-active] {
66
- background: rgba(129, 177, 214, 0.34);
67
- }
68
- html[data-theme="light"] #file-input {
69
- color: #076570;
70
- }
71
-
72
55
  /* tooltips */
73
56
  html[data-theme="light"] .tooltip {
74
57
  background-color: rgb(138, 145, 154);
@@ -34,17 +34,6 @@
34
34
  </a>
35
35
  </section>
36
36
 
37
- <section id="file">
38
- <input
39
- type="text"
40
- id="file-input"
41
- value=""
42
- dir="rtl"
43
- tabindex="-1"
44
- readonly
45
- />
46
- </section>
47
-
48
37
  <section id="execution-indicator">
49
38
  <div data-when="execution:default">
50
39
  <div class="tooltip">Unknown state</div>
@@ -90,6 +79,19 @@
90
79
  </div>
91
80
  </section>
92
81
 
82
+ <section id="changes-indicator" data-when="autoreload:off">
83
+ <div data-when="changes:no"></div>
84
+ <div data-when="changes:yes">
85
+ <div class="tooltip">There is X changes to apply</div>
86
+ <button>
87
+ <svg>
88
+ <circle class="eventsource-circle" cx="20" cy="20" r="5" />
89
+ </svg>
90
+ <span>X</span>
91
+ </button>
92
+ </div>
93
+ </section>
94
+
93
95
  <div style="width: 100%"></div>
94
96
 
95
97
  <section id="eventsource-indicator" data-responsive-toolbar-element>
@@ -169,49 +171,14 @@
169
171
  </button>
170
172
  </div>
171
173
  <div data-when="eventsource:connected">
172
- <div class="tooltip">
173
- Connected to server
174
- <br />
175
- Livereload:
176
- <span data-when="livereload:on" style="color: green">ON</span
177
- ><span data-when="livereload:off" style="color: grey">OFF</span>
178
- <br />
179
- Changes:
180
- <span data-when="changes:yes"
181
- ><a
182
- class="eventsource-changes-link"
183
- style="color: inherit"
184
- href="javascript:void(0);"
185
- >X</a
186
- ></span
187
- ><span data-when="changes:no">none</span>
188
- <div data-when="changes:yes">
189
- <br />
190
- <a
191
- class="eventsource-reload-link"
192
- style="color: inherit"
193
- href="javascript:void(0);"
194
- >reload</a
195
- >
196
- </div>
197
- </div>
174
+ <div class="tooltip">Connected to server</div>
198
175
  <button>
199
- <div data-when="livereload:on">
200
- <svg
201
- class="event-source-livereload iconToolbar"
202
- data-variant="enabled"
203
- >
204
- <use xlink:href="#loading_svg"></use>
205
- </svg>
206
- </div>
207
- <div data-when="changes:yes">
208
- <svg
209
- class="event-source-livereload iconToolbar"
210
- data-variant="disabled"
211
- >
212
- <use xlink:href="#loading_svg"></use>
213
- </svg>
214
- </div>
176
+ <svg
177
+ class="event-source-autoreload iconToolbar"
178
+ data-variant="enabled"
179
+ >
180
+ <use xlink:href="#loading_svg"></use>
181
+ </svg>
215
182
  <svg class="event-source-icon">
216
183
  <circle
217
184
  class="eventsource-circle"
@@ -256,6 +223,24 @@
256
223
  </div>
257
224
  <div id="settings-box-body">
258
225
  <div class="settings-box-items-wrapper">
226
+ <div class="settings-box-item settings-autoreload">
227
+ <div class="category-title">
228
+ <svg width="20px" height="20px">
229
+ <use xlink:href="#loading_svg"></use>
230
+ </svg>
231
+ <span>Autoreload</span>
232
+ </div>
233
+ <label class="switch" data-contains-hidden-input>
234
+ <input id="toggle-autoreload" type="checkbox" />
235
+ <div>
236
+ <div class="slider"></div>
237
+ <div class="square"></div>
238
+ </div>
239
+ </label>
240
+ <div class="category-subtitle">
241
+ Auto reload when a file is modified, deleted or created.
242
+ </div>
243
+ </div>
259
244
  <div class="settings-box-item settings-notification">
260
245
  <div class="category-title">
261
246
  <svg
@@ -289,24 +274,7 @@
289
274
  </div>
290
275
  </div>
291
276
  </div>
292
- <div class="settings-box-item settings-livereload">
293
- <div class="category-title">
294
- <svg width="20px" height="20px">
295
- <use xlink:href="#loading_svg"></use>
296
- </svg>
297
- <span>Livereload</span>
298
- </div>
299
- <label class="switch" data-contains-hidden-input>
300
- <input id="toggle-livereload" type="checkbox" />
301
- <div>
302
- <div class="slider"></div>
303
- <div class="square"></div>
304
- </div>
305
- </label>
306
- <div class="category-subtitle">
307
- Reload page when a file is modified, deleted or created.
308
- </div>
309
- </div>
277
+
310
278
  <div class="settings-box-item">
311
279
  <div class="category-title">
312
280
  <svg
@@ -360,114 +328,6 @@
360
328
  Choose between light and dark theme for jsenv toolbar.
361
329
  </div>
362
330
  </div>
363
- <div class="settings-box-item" id="browser_support">
364
- <div class="category-title">
365
- <svg
366
- xmlns="http://www.w3.org/2000/svg"
367
- viewBox="0 0 512 512"
368
- width="20px"
369
- height="20px"
370
- style="enable-background: new 0 0 512 512"
371
- id="browser_support_svg"
372
- >
373
- <path
374
- d="M497.938,430.063l-126.914-126.91C389.287,272.988,400,237.762,400,200C400,89.719,310.281,0,200,0
375
- C89.719,0,0,89.719,0,200c0,110.281,89.719,200,200,200c37.762,0,72.984-10.711,103.148-28.973l126.914,126.91
376
- C439.438,507.313,451.719,512,464,512c12.281,0,24.563-4.688,33.938-14.063C516.688,479.195,516.688,448.805,497.938,430.063z
377
- M64,200c0-74.992,61.016-136,136-136s136,61.008,136,136s-61.016,136-136,136S64,274.992,64,200z"
378
- />
379
- </svg>
380
- Browser support
381
- </div>
382
- <div class="category-subtitle">
383
- <div>
384
- <span
385
- class="browser_support_text"
386
- data-when="browserSupport:no"
387
- >No browser support</span
388
- >
389
- <span
390
- class="browser_support_text"
391
- data-when="browserSupport:partial"
392
- >Excellent browser support
393
- <span class="emoji">❤️</span></span
394
- >
395
- <span
396
- class="browser_support_text"
397
- data-when="browserSupport:full"
398
- >Perfect browser support
399
- <span class="emoji">❤️</span></span
400
- >
401
- </div>
402
- <a
403
- class="browser_support_read_more_link"
404
- href="javascript:void(0);"
405
- >Read more</a
406
- >
407
- </div>
408
- </div>
409
- <div class="settings-box-item" id="files_compilation">
410
- <div class="category-title">
411
- <svg
412
- xmlns="http://www.w3.org/2000/svg"
413
- viewBox="-74 0 512 512"
414
- width="20px"
415
- height="20px"
416
- id="browser_support_svg"
417
- >
418
- <path
419
- d="m361.414062 443.589844-108.269531-263.902344c-6.003906-14.640625-9.050781-30.085938-9.050781-45.910156v-69.757813c0-7.511719 2.925781-14.574219 8.238281-19.886719 6.476563-6.476562 10.046875-15.089843 10.046875-24.25v-9.882812c0-5.523438-4.480468-10-10-10h-139.621094c-5.523437 0-10 4.476562-10 10v9.882812c0 9.160157 3.566407 17.773438 10.042969 24.25 5.3125 5.3125 8.238281 12.375 8.238281 19.890626v69.753906c0 15.824218-3.042968 31.269531-9.050781 45.910156l-29.75 72.515625c-.011719.027344-.023437.054687-.035156.082031l-78.484375 191.304688c-6.285156 15.324218-4.53125 32.6875 4.695312 46.441406 9.226563 13.757812 24.621094 21.96875 41.183594 21.96875h265.9375c16.5625 0 31.960938-8.210938 41.1875-21.96875 9.222656-13.757812 10.976563-31.117188 4.691406-46.441406zm-230.921874-256.3125c7-17.058594 10.546874-35.058594 10.546874-53.5v-69.757813c0-12.851562-5.003906-24.9375-14.09375-34.027343-2.671874-2.671876-4.15625-6.21875-4.1875-9.992188h119.621094c-.03125 3.773438-1.515625 7.316406-4.191406 9.992188-9.085938 9.089843-14.09375 21.171874-14.09375 34.027343v69.753907c0 18.441406 3.550781 36.441406 10.546875 53.5l24.144531 58.851562h-152.4375zm209.617187 291.613281c-5.585937 8.332031-14.542969 13.109375-24.574219 13.109375h-265.9375c-10.027344 0-18.984375-4.777344-24.574218-13.109375-4.214844-6.285156-5.824219-13.574219-4.730469-20.761719h16.476562c5.519531 0 10-4.480468 10-10 0-5.523437-4.480469-10-10-10h-9.1875l11.484375-28h16.867188c5.523437 0 10-4.480468 10-10 0-5.523437-4.476563-10-10-10h-8.660156l11.484374-28h17.34375c5.523438 0 10-4.480468 10-10 0-5.523437-4.476562-10-10-10h-9.136718l11.488281-28h17.8125c5.523437 0 10-4.480468 10-10 0-5.523437-4.476563-10-10-10h-9.609375l11.488281-28h168.84375l75.921875 185.054688c3.804688 9.277344 2.785156 19.378906-2.800781 27.707031zm0 0"
420
- />
421
- <path
422
- d="m312.03125 444.214844c-2.09375-5.113282-7.929688-7.558594-13.042969-5.46875-5.109375 2.09375-7.558593 7.929687-5.46875 13.042968l.054688.125c1.585937 3.871094 5.316406 6.214844 9.257812 6.214844 1.261719 0 2.542969-.238281 3.785157-.746094 5.109374-2.09375 7.558593-7.933593 5.464843-13.042968zm0 0"
423
- />
424
- <path
425
- d="m297.898438 409.761719-35.8125-87.289063c-2.09375-5.109375-7.933594-7.554687-13.046876-5.457031-5.109374 2.09375-7.550781 7.9375-5.457031 13.046875l35.8125 87.289062c1.585938 3.871094 5.316407 6.207032 9.257813 6.207032 1.261718 0 2.546875-.238282 3.789062-.75 5.109375-2.09375 7.554688-7.9375 5.457032-13.046875zm0 0"
426
- />
427
- </svg>
428
- Files compilation
429
- </div>
430
- <div class="category-subtitle">
431
- <div class="files_compilation_text">
432
- <span data-when="filesCompilation:no"
433
- >Files shown are source files</span
434
- >
435
- <span data-when="filesCompilation:html_only"
436
- >Files shown are source files, except html</span
437
- >
438
- <span data-when="filesCompilation:yes"
439
- >Files shown are compiled for {runtime}</span
440
- >
441
- <span data-when="filesCompilation:mismatch"
442
- >Files shown are compiled for an other runtime</span
443
- >
444
- </div>
445
- <a
446
- data-when="compilation_link:source"
447
- class="link_to_source_files"
448
- href="javascript:void(0);"
449
- >Switch to source files</a
450
- >
451
- <a
452
- data-when="compilation_link:mismatch"
453
- class="link_to_appropriate_files"
454
- href="javascript:void(0);"
455
- >Switch to appropriate files</a
456
- >
457
- <a
458
- data-when="compilation_link:compiled"
459
- class="link_to_compiled_files"
460
- href="javascript:void(0);"
461
- >Switch to compiled files</a
462
- >
463
- <a
464
- data-when="compilation_link:force"
465
- class="link_to_compilation_forced_files"
466
- href="javascript:void(0);"
467
- >Force compilation</a
468
- >
469
- </div>
470
- </div>
471
331
  </div>
472
332
  </div>
473
333
  </div>
@@ -587,30 +447,11 @@
587
447
  <circle fill="currentColor" cx="362.721" cy="309.694" r="36.012" />
588
448
  </svg>
589
449
  </div>
590
-
591
- <!--
592
- <script type="module" src="./toolbar.main.js"></script>
593
- The script type module approach works too but
594
- is slower than having a prebuilt file.
595
- Because this will impact every page using jsenv let's
596
- use the fatest solution for now.
597
- The day browser support import maps the script
598
- module approach wil be faster because
599
- no compilation will be necessary
600
- -->
601
- <script
602
- type="importmap"
603
- src="../../../../node_resolution.importmap"
604
- ></script>
605
- <script>
606
- // here we should create something like window.toolbar = {}
607
- // and a promise the toolbar injector can listen to act on the toolbar
608
- // or we could just consider all communication should pass by postmessage
609
- </script>
610
450
  <script
611
451
  type="module"
612
452
  src="./toolbar_main.js"
613
453
  data-jsenv-force-inline
454
+ no-html-supervisor
614
455
  ></script>
615
456
  </body>
616
457
  </html>
@@ -1,12 +1,13 @@
1
- import { fetchExploringJson } from "@jsenv/core/src/internal/dev_server/exploring/fetch_exploring_json.js"
2
-
3
1
  import { setAttributes, setStyles } from "./util/dom.js"
4
2
 
5
- // eslint-disable-next-line no-undef
6
- const TOOLBAR_BUILD_RELATIVE_URL = __TOOLBAR_BUILD_RELATIVE_URL_
7
3
  const jsenvLogoSvgUrl = new URL("./jsenv_logo.svg", import.meta.url)
8
4
 
9
- const injectToolbar = async () => {
5
+ export const injectToolbar = async ({ toolbarUrl, logs = false }) => {
6
+ if (document.readyState !== "complete") {
7
+ await new Promise((resolve) => {
8
+ window.addEventListener("load", resolve)
9
+ })
10
+ }
10
11
  await new Promise((resolve) => {
11
12
  if (window.requestIdleCallback) {
12
13
  window.requestIdleCallback(resolve, { timeout: 400 })
@@ -14,7 +15,6 @@ const injectToolbar = async () => {
14
15
  window.requestAnimationFrame(resolve)
15
16
  }
16
17
  })
17
- const exploringJSON = await fetchExploringJson()
18
18
  const placeholder = getToolbarPlaceholder()
19
19
 
20
20
  const iframe = document.createElement("iframe")
@@ -38,20 +38,12 @@ const injectToolbar = async () => {
38
38
  "border": "none",
39
39
  })
40
40
  const iframeLoadedPromise = iframeToLoadedPromise(iframe)
41
- const jsenvCoreDirectoryServerUrl = new URL(
42
- exploringJSON.jsenvCoreDirectoryRelativeUrl,
43
- document.location.origin,
44
- ).href
45
- const jsenvToolbarHtmlServerUrl = new URL(
46
- TOOLBAR_BUILD_RELATIVE_URL,
47
- jsenvCoreDirectoryServerUrl,
48
- )
49
41
  // set iframe src BEFORE putting it into the DOM (prevent firefox adding an history entry)
50
- iframe.setAttribute("src", jsenvToolbarHtmlServerUrl)
42
+ iframe.setAttribute("src", toolbarUrl)
51
43
  placeholder.parentNode.replaceChild(iframe, placeholder)
52
44
 
53
45
  addToolbarEventCallback(iframe, "toolbar_ready", () => {
54
- sendCommandToToolbar(iframe, "renderToolbar", { exploringJSON })
46
+ sendCommandToToolbar(iframe, "renderToolbar", { logs })
55
47
  })
56
48
 
57
49
  await iframeLoadedPromise
@@ -172,7 +164,6 @@ const addToolbarEventCallback = (iframe, eventName, callback) => {
172
164
  }
173
165
  callback(__jsenv__.data)
174
166
  }
175
-
176
167
  window.addEventListener("message", messageEventCallback, false)
177
168
  return () => {
178
169
  window.removeEventListener("message", messageEventCallback, false)
@@ -225,14 +216,3 @@ const iframeToLoadedPromise = (iframe) => {
225
216
  iframe.addEventListener("load", onload, true)
226
217
  })
227
218
  }
228
-
229
- if (document.readyState === "complete") {
230
- injectToolbar()
231
- } else {
232
- window.addEventListener("load", injectToolbar)
233
- // document.addEventListener("readystatechange", () => {
234
- // if (document.readyState === "complete") {
235
- // injectToolbar()
236
- // }
237
- // })
238
- }
@@ -1,5 +1,4 @@
1
1
  @import "./execution/execution.css";
2
- @import "./compilation/compilation.css";
3
2
  @import "./focus/focus.css";
4
3
  @import "./eventsource/eventsource.css";
5
4
  @import "./responsive/overflow_menu.css";
@@ -80,29 +79,6 @@ html {
80
79
  cursor: pointer;
81
80
  }
82
81
 
83
- /* file name input & indicators */
84
- #file {
85
- max-width: 40%;
86
- padding: 0 1.2em;
87
- }
88
-
89
- #file-input {
90
- width: 100%;
91
- padding: 0px;
92
- font-family: monospace;
93
- font-size: 15px;
94
- color: #cecece;
95
- background: transparent;
96
- border: transparent;
97
- display: inline-block;
98
- overflow: hidden;
99
- text-overflow: ellipsis;
100
- }
101
-
102
- #file-input:focus {
103
- border-bottom: 1px solid grey;
104
- }
105
-
106
82
  /* file and settings icons */
107
83
  #fileIconSvg,
108
84
  .settings-icon {