@jsenv/core 25.5.0 → 26.0.1

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 (261) hide show
  1. package/dist/browser_client/asset-manifest.json +4 -0
  2. package/dist/browser_client/browser_client_fb33eaa4.js +5320 -0
  3. package/dist/browser_client/browser_client_fb33eaa4.js.map +1089 -0
  4. package/dist/build_manifest.js +6 -6
  5. package/dist/compile_proxy/asset-manifest.json +2 -2
  6. package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +343 -0
  7. package/dist/compile_proxy/{compile_proxy_ab528227.html → compile_proxy_62f952c4.html} +7 -6
  8. package/dist/event_source_client/asset-manifest.json +2 -2
  9. package/dist/event_source_client/event_source_client_69f48287.js +354 -0
  10. package/dist/event_source_client/{event_source_client_80644aee.js.map → event_source_client_69f48287.js.map} +2 -2
  11. package/dist/redirector/asset-manifest.json +2 -2
  12. package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +349 -0
  13. package/dist/redirector/{redirector_6df2620a.html → redirector_8117ec92.html} +7 -6
  14. package/dist/toolbar/asset-manifest.json +5 -5
  15. package/dist/toolbar/assets/{light-theme.css_72a60fa3.map → light_theme.css_5bff0336.map} +2 -2
  16. package/dist/toolbar/assets/{overflow-menu.css_2859d519.map → overflow_menu.css_9a0fc3d8.map} +2 -2
  17. package/dist/toolbar/assets/{toolbar.main.css_b7d8bec1.map → toolbar_main.css_b1c67dd7.map} +7 -7
  18. package/dist/toolbar/{toolbar_9a52325b.html → toolbar_b0c9100c.html} +8 -7
  19. package/dist/toolbar/{toolbar.main_2c56a4e0.js.map → toolbar_main_f54c1bb0.js.map} +32 -32
  20. package/dist/toolbar_injector/asset-manifest.json +3 -3
  21. package/dist/toolbar_injector/assets/{jsenv-logo_188b9ca6.svg → jsenv_logo_192011c2.svg} +1 -1
  22. package/dist/toolbar_injector/toolbar_injector_65b501eb.js +976 -0
  23. package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +294 -0
  24. package/helpers/babel/asyncIterator/asyncIterator.js +61 -8
  25. package/helpers/babel/createClass/createClass.js +12 -12
  26. package/helpers/babel/inherits/inherits.js +10 -6
  27. package/helpers/babel/jsx/jsx.js +27 -22
  28. package/helpers/babel/objectSpread2/objectSpread2.js +22 -14
  29. package/helpers/babel/readme.md +3 -8
  30. package/helpers/babel/wrapRegExp/wrapRegExp.js +29 -29
  31. package/main.js +19 -14
  32. package/package.json +42 -43
  33. package/readme.md +23 -25
  34. package/src/{launchBrowser.js → browser_runtimes.js} +3 -8
  35. package/src/{buildProject.js → build_project.js} +6 -17
  36. package/src/{commonJsToJavaScriptModule.js → commonjs_to_js_module.js} +5 -5
  37. package/src/dev_server.js +19 -10
  38. package/src/execute.js +3 -3
  39. package/src/{executeTestPlan.js → execute_test_plan.js} +16 -9
  40. package/src/{importUsingChildProcess.js → import_using_child_process.js} +2 -2
  41. package/src/internal/{browser_runtime/browser_runtime.js → browser_client/browser_client.js} +13 -17
  42. package/src/internal/{browser_runtime/createBrowserRuntime.js → browser_client/browser_client_factory.js} +7 -9
  43. package/src/internal/{error-stack-remapping/installBrowserErrorStackRemapping.js → browser_client/browser_error_stack_remap.js} +1 -3
  44. package/src/internal/{browser_runtime → browser_client}/browser_system.js +2 -4
  45. package/src/internal/{browser_runtime/displayErrorInDocument.js → browser_client/error_in_document.js} +0 -2
  46. package/src/internal/{browser_runtime/displayErrorNotification.js → browser_client/error_in_notification.js} +0 -1
  47. package/src/internal/{browser_runtime/makeNamespaceTransferable.js → browser_client/module_namespace_transfer.js} +1 -1
  48. package/src/internal/{perf_browser.js → browser_client/perf_browser.js} +0 -2
  49. package/src/internal/browser_detection/browser_detection.js +9 -12
  50. package/src/internal/browser_detection/{detectAndroid.js → detect_android.js} +0 -0
  51. package/src/internal/browser_detection/{detectChrome.js → detect_chrome.js} +0 -0
  52. package/src/internal/browser_detection/{detectEdge.js → detect_edge.js} +0 -0
  53. package/src/internal/browser_detection/{detectElectron.js → detect_electron.js} +0 -0
  54. package/src/internal/browser_detection/{detectFirefox.js → detect_firefox.js} +0 -0
  55. package/src/internal/browser_detection/{detectInternetExplorer.js → detect_internet_explorer.js} +0 -0
  56. package/src/internal/browser_detection/{detectIOS.js → detect_ios.js} +0 -0
  57. package/src/internal/browser_detection/{detectOpera.js → detect_opera.js} +0 -0
  58. package/src/internal/browser_detection/{detectSafari.js → detect_safari.js} +0 -0
  59. package/src/internal/browser_detection/user_agent_data.js +0 -1
  60. package/src/internal/browser_launcher/{executeHtmlFile.js → execute_html_file.js} +5 -4
  61. package/src/internal/browser_launcher/from_playwright.js +3 -3
  62. package/src/internal/browser_launcher/{trackPageToNotify.js → page_errors_and_logs.js} +1 -1
  63. package/src/internal/browser_utils/{fetchAndEvalUsingFetch.js → fetch_and_eval.js} +1 -3
  64. package/src/internal/browser_utils/{fetchAndEvalUsingScript.js → fetch_and_eval_using_script.js} +0 -2
  65. package/src/internal/browser_utils/fetch_browser.js +1 -1
  66. package/src/internal/browser_utils/{fetchJson.js → fetch_json.js} +0 -0
  67. package/src/internal/browser_utils/{fetchUsingXHR.js → fetch_using_xhr.js} +0 -2
  68. package/src/internal/building/build_logs.js +37 -40
  69. package/src/internal/building/build_stats.js +2 -1
  70. package/src/internal/building/build_url_generator.js +1 -1
  71. package/src/internal/building/{buildUsingRollup.js → build_using_rollup.js} +6 -21
  72. package/src/internal/building/css/{applyPostCss.js → apply_post_css.js} +0 -0
  73. package/src/internal/building/css/{parseCssRessource.js → jsenv_parse_css.js} +5 -4
  74. package/src/internal/building/css/{moveCssUrls.js → move_css_urls.js} +1 -1
  75. package/src/internal/building/css/{parseCssUrls.js → parse_css_urls.js} +1 -1
  76. package/src/internal/building/css/postcss_plugin_url_visitor.js +1 -0
  77. package/src/internal/building/css/{replaceCssUrls.js → replace_css_urls.js} +2 -1
  78. package/src/internal/building/global_format/es_to_system.js +34 -0
  79. package/src/internal/building/{parsing.utils.js → html/html_node_mutations.js} +0 -0
  80. package/src/internal/building/html/{htmlScan.js → html_scan.js} +1 -1
  81. package/src/internal/building/html/{parseHtmlRessource.js → jsenv_parse_html.js} +5 -6
  82. package/src/internal/building/html/{minifyHtml.js → minify_html.js} +0 -0
  83. package/src/internal/building/{css_module.js → import_assertions/css_module.js} +3 -3
  84. package/src/internal/building/{json_module.js → import_assertions/json_module.js} +0 -0
  85. package/src/internal/building/import_references.js +0 -1
  86. package/src/internal/building/importmap/{parseImportmapRessource.js → jsenv_parse_importmap.js} +0 -0
  87. package/src/internal/building/js/{parseJsRessource.js → jsenv_parse_js.js} +2 -1
  88. package/src/internal/building/js/{minifyJs.js → minify_js.js} +0 -0
  89. package/src/internal/building/js/transform_worker.js +1 -1
  90. package/src/internal/building/json/{parseJsonRessource.js → jsenv_parse_json.js} +0 -0
  91. package/src/internal/building/{parseRessource.js → parse_ressource.js} +13 -13
  92. package/src/internal/building/ressource_builder.js +4 -3
  93. package/src/internal/building/ressource_builder_util.js +2 -2
  94. package/src/internal/building/rollup_plugin_jsenv.js +166 -61
  95. package/src/internal/building/{sortObjectByPathnames.js → sort_pathnames.js} +0 -0
  96. package/src/internal/building/{sourcemap_loader.js → sourcemap/sourcemap_loader.js} +3 -6
  97. package/src/internal/building/svg/{parseSvgRessource.js → jsenv_parse_svg.js} +4 -3
  98. package/src/internal/building/url_fetcher.js +1 -1
  99. package/src/internal/building/url_loader.js +3 -3
  100. package/src/internal/building/{resolve_import_url_helper.js → url_versioning/resolve_import_url_helper.js} +0 -0
  101. package/src/internal/building/{url_versioning.js → url_versioning/url_versioning.js} +1 -1
  102. package/src/internal/building/webmanifest/{parseWebmanifestRessource.js → jsenv_parse_webmanifest.js} +0 -0
  103. package/src/internal/{compiling → compile_server/commonjs}/rollup_plugin_commonjs_named_exports.js +0 -0
  104. package/src/internal/{compiling/compileFile.js → compile_server/compile_file.js} +6 -4
  105. package/src/internal/{compiling/startCompileServer.js → compile_server/compile_server.js} +11 -24
  106. package/src/internal/{compiling/createCompiledFileService.js → compile_server/compiled_file_service.js} +5 -8
  107. package/src/internal/{compiling/compileHtml.js → compile_server/html/html_ast.js} +2 -12
  108. package/src/internal/{compiling → compile_server/html}/html_source_file_service.js +10 -10
  109. package/src/internal/{compiling/jsenvCompilerForHtml.js → compile_server/html/jsenv_compile_html.js} +12 -12
  110. package/src/internal/{compiling/jsenvCompilerForImportmap.js → compile_server/importmap/jsenv_compile_importmap.js} +1 -1
  111. package/src/internal/{compiling/js-compilation-service/ansiToHTML.js → compile_server/js/ansi_to_html.js} +1 -1
  112. package/src/internal/{compiling/js-compilation-service → compile_server/js}/babelHelper.js +1 -1
  113. package/src/internal/{compiling → compile_server/js}/babel_parse_error.js +0 -0
  114. package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_babel_helpers_as_jsenv_imports.js +2 -1
  115. package/src/internal/{compiling → compile_server/js}/babel_plugin_global_this_as_jsenv_import.js +1 -1
  116. package/src/internal/{compiling → compile_server/js}/babel_plugin_import_assertions.js +1 -0
  117. package/src/internal/{compiling → compile_server/js}/babel_plugin_import_metadata.js +0 -0
  118. package/src/internal/{compiling → compile_server/js}/babel_plugin_import_visitor.js +0 -0
  119. package/src/internal/{compiling → compile_server/js}/babel_plugin_new_stylesheet_as_jsenv_import.js +1 -1
  120. package/src/internal/{compiling → compile_server/js}/babel_plugin_proxy_external_imports.js +0 -0
  121. package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_regenerator_runtime_as_jsenv_import.js +1 -1
  122. package/src/internal/{babel_plugin_replace_expressions.js → compile_server/js/babel_plugin_replace_expressions.js} +0 -0
  123. package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_systemjs_prepend.js +2 -2
  124. package/src/internal/{compiling → compile_server/js}/babel_plugin_transform_import_meta.js +0 -0
  125. package/src/internal/{compiling → compile_server/js}/babel_plugins.js +0 -0
  126. package/src/internal/{compiling/js-compilation-service → compile_server/js}/generateBabelHelper.js +1 -1
  127. package/src/internal/{compiling/js-compilation-service/transformJs.js → compile_server/js/js_transformer.js} +8 -9
  128. package/src/internal/{compiling/jsenvCompilerForJavaScript.js → compile_server/js/jsenv_compile_js.js} +7 -7
  129. package/src/internal/{compiling → compile_server/js}/load_babel_plugin_map_from_file.js +0 -0
  130. package/src/internal/{compiling → compile_server}/jsenv_directory/comparison_utils.js +0 -0
  131. package/src/internal/{compiling/transformResultToCompilationResult.js → compile_server/jsenv_directory/compilation_result.js} +6 -5
  132. package/src/internal/{building/buildToCompilationResult.js → compile_server/jsenv_directory/compilation_result_from_build.js} +4 -3
  133. package/src/internal/{compiling → compile_server}/jsenv_directory/compile_asset.js +0 -0
  134. package/src/internal/{compiling → compile_server}/jsenv_directory/compile_context.js +4 -13
  135. package/src/internal/{compiling → compile_server}/jsenv_directory/compile_profile.js +1 -2
  136. package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.js +0 -0
  137. package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.test.js +0 -0
  138. package/src/internal/{compiling/jsenv_directory/fs-optimized-for-cache.js → compile_server/jsenv_directory/fs_optimized_for_cache.js} +0 -0
  139. package/src/internal/{compiling → compile_server}/jsenv_directory/jsenv_directory.js +17 -8
  140. package/src/internal/{compiling/jsenv_directory/getOrGenerateCompiledFile.js → compile_server/jsenv_directory/reuse_or_create_compiled_file.js} +3 -3
  141. package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +131 -0
  142. package/src/internal/{compiling/jsenv_directory/validateCache.js → compile_server/jsenv_directory/validate_compile_cache.js} +1 -1
  143. package/src/internal/{compiling → compile_server}/sse_service/sse_service.js +1 -1
  144. package/src/internal/{executing/coverage → coverage}/babel_plugin_instrument.js +1 -1
  145. package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_html_directory.js +3 -2
  146. package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_json_file.js +1 -1
  147. package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_text_log.js +3 -2
  148. package/src/internal/{executing/coverage_missing/relativeUrlToEmptyCoverage.js → coverage/empty_coverage_factory.js} +10 -3
  149. package/src/internal/{executing/coverage_utils → coverage}/file_by_file_coverage.js +0 -0
  150. package/src/internal/{executing/coverage_utils → coverage}/istanbul_coverage_composition.js +1 -1
  151. package/src/internal/{executing/coverage_reporter/istanbulCoverageMapFromCoverage.js → coverage/istanbul_coverage_map_from_coverage.js} +1 -1
  152. package/src/internal/{executing/coverage_missing → coverage}/list_files_not_covered.js +0 -0
  153. package/src/internal/{executing/coverage_missing → coverage}/missing_coverage.js +1 -1
  154. package/src/internal/{executing/coverage/reportToCoverage.js → coverage/report_to_coverage.js} +8 -7
  155. package/src/internal/{executing/coverage_utils → coverage}/v8_and_istanbul.js +0 -0
  156. package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_composition.js +0 -0
  157. package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_from_directory.js +2 -1
  158. package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_to_istanbul.js +0 -0
  159. package/src/internal/data_url.js +54 -0
  160. package/src/internal/dev_server/exploring/exploring.js +1 -1
  161. package/src/internal/dev_server/exploring/{fetchExploringJson.js → fetch_exploring_json.js} +1 -1
  162. package/src/internal/dev_server/toolbar/animation/{toolbar.animation.js → toolbar_animation.js} +0 -0
  163. package/src/internal/dev_server/toolbar/compilation/{toolbar.compilation.js → toolbar_compilation.js} +3 -2
  164. package/src/internal/dev_server/toolbar/eventsource/{toolbar.eventsource.js → toolbar_eventsource.js} +0 -0
  165. package/src/internal/dev_server/toolbar/execution/{toolbar.execution.js → toolbar_execution.js} +1 -1
  166. package/src/internal/dev_server/toolbar/focus/{toolbar.focus.js → toolbar_focus.js} +0 -0
  167. package/src/internal/dev_server/toolbar/{jsenv-logo.svg → jsenv_logo.svg} +1 -1
  168. package/src/internal/dev_server/toolbar/notification/{toolbar.notification.js → toolbar_notification.js} +0 -0
  169. package/src/internal/dev_server/toolbar/responsive/{overflow-menu.css → overflow_menu.css} +0 -0
  170. package/src/internal/dev_server/toolbar/responsive/{toolbar.responsive.js → toolbar_responsive.js} +0 -0
  171. package/src/internal/dev_server/toolbar/settings/{toolbar.settings.js → toolbar_settings.js} +0 -0
  172. package/src/internal/dev_server/toolbar/theme/{jsenv-theme.css → jsenv_theme.css} +0 -0
  173. package/src/internal/dev_server/toolbar/theme/{light-theme.css → light_theme.css} +0 -0
  174. package/src/internal/dev_server/toolbar/theme/{toolbar.theme.js → toolbar_theme.js} +0 -0
  175. package/src/internal/dev_server/toolbar/toolbar.html +2 -2
  176. package/src/internal/dev_server/toolbar/{toolbar.injector.js → toolbar_injector.js} +4 -3
  177. package/src/internal/dev_server/toolbar/{toolbar.main.css → toolbar_main.css} +2 -2
  178. package/src/internal/dev_server/toolbar/{toolbar.main.js → toolbar_main.js} +9 -9
  179. package/src/internal/dev_server/toolbar/util/fetching.js +1 -1
  180. package/src/internal/dev_server/toolbar/util/{jsenvLogger.js → jsenv_logger.js} +0 -0
  181. package/src/internal/{error-stack-remapping/installErrorStackRemapping.js → error_stack_remap/install_error_stack_remapping.js} +6 -5
  182. package/src/internal/{error-stack-remapping/remapCallSite.js → error_stack_remap/remap_call_site.js} +2 -1
  183. package/src/internal/{error-stack-remapping/getOriginalCallsites.js → error_stack_remap/remap_stack.js} +7 -6
  184. package/src/internal/{error-stack-remapping/stackToString.js → error_stack_remap/stringify_stack.js} +1 -1
  185. package/src/internal/executing/{executePlan.js → execute_plan.js} +11 -8
  186. package/src/internal/executing/{generateFileExecutionSteps.js → execution_steps.js} +27 -0
  187. package/src/internal/executing/{launchAndExecute.js → launch_and_execute.js} +2 -2
  188. package/src/internal/executing/{executionLogs.js → logs_file_execution.js} +3 -2
  189. package/src/internal/executing/{createSummaryLog.js → logs_plan_summary.js} +3 -2
  190. package/src/internal/features/browser_feature_detection/browser_feature_detection.js +1 -1
  191. package/src/internal/features/features_compat_from_runtime.js +1 -1
  192. package/src/internal/features/node_feature_detection/node_feature_detection.js +1 -1
  193. package/src/internal/{fetchUrl.js → fetching.js} +0 -0
  194. package/src/internal/{import-resolution/default-extension.js → import_resolution/default_extension.js} +0 -0
  195. package/src/internal/{import-resolution/import-resolver-importmap.js → import_resolution/import_resolver_importmap.js} +2 -2
  196. package/src/internal/{import-resolution/import-resolver-node.js → import_resolution/import_resolver_node.js} +2 -2
  197. package/src/internal/{import-resolution → import_resolution}/importmap_default.js +1 -1
  198. package/src/internal/jsenv_builds.js +1 -1
  199. package/src/internal/{argUtils.js → jsenv_params_assertions.js} +0 -0
  200. package/src/internal/jsenv_remote_directory.js +1 -1
  201. package/src/internal/logs/{byteAsFileSize.js → byte_as_file_size.js} +1 -1
  202. package/src/internal/logs/{msAsDuration.js → ms_as_duration.js} +1 -1
  203. package/src/internal/node_launcher/{createChildProcessOptions.js → child_process_options.js} +1 -1
  204. package/src/internal/{node_runtime/evalSource.js → node_launcher/eval_source.js} +0 -0
  205. package/src/internal/{node_runtime/fetchSource.js → node_launcher/fetch_source.js} +1 -1
  206. package/src/internal/node_launcher/kill_process_tree.js +2 -2
  207. package/src/internal/{node_runtime/nodeControllableFile.mjs → node_launcher/node_controllable_file.mjs} +0 -0
  208. package/src/internal/node_launcher/{createControllableNodeProcess.js → node_controllable_process.js} +3 -3
  209. package/src/internal/{error-stack-remapping/installNodeErrorStackRemapping.js → node_launcher/node_error_stack_remap.js} +5 -3
  210. package/src/internal/{node_runtime → node_launcher}/node_execution_dynamic_import.js +3 -2
  211. package/src/internal/{node_runtime → node_launcher}/node_execution_performance.js +0 -0
  212. package/src/internal/{node_runtime → node_launcher}/node_execution_systemjs.js +6 -6
  213. package/src/internal/{node_runtime → node_launcher}/node_system.js +7 -6
  214. package/src/internal/{perf_node.js → node_launcher/perf_node.js} +1 -1
  215. package/src/internal/node_launcher/{processOptions.js → process_options.js} +0 -0
  216. package/src/internal/{runtime/valueInstall.js → node_launcher/value_install.js} +0 -0
  217. package/src/internal/{escapeRegexpSpecialCharacters.js → regexp_escape.js} +0 -0
  218. package/src/internal/{runtime/module-registration.js → runtime_client/module_registration.js} +0 -0
  219. package/src/internal/{runtime → runtime_client}/s.js +3 -2
  220. package/src/internal/{runtime → runtime_client}/s.js.md +0 -0
  221. package/src/internal/{unevalException.js → runtime_client/uneval_exception.js} +0 -0
  222. package/src/internal/runtime_support/runtime_support.js +1 -1
  223. package/src/internal/semantic_versioning/{versionCompare.js → compare_versions.js} +4 -8
  224. package/src/internal/semantic_versioning/{findHighestVersion.js → highest_version.js} +1 -2
  225. package/src/internal/semantic_versioning/is_above.js +5 -0
  226. package/src/internal/semantic_versioning/is_below.js +5 -0
  227. package/src/internal/semantic_versioning/{versionIsEqual.js → is_equal.js} +0 -0
  228. package/src/internal/semantic_versioning/{findLowestVersion.js → lowest_version.js} +1 -2
  229. package/src/internal/semantic_versioning/{valueToVersion.js → version_from_value.js} +1 -3
  230. package/src/internal/{sourceMappingURLUtils.js → sourcemap_utils.js} +0 -0
  231. package/src/internal/{escapeTemplateStringSpecialCharacters.js → template_string_escape.js} +0 -0
  232. package/src/internal/{filePathUtils.js → windows_file_path_utils.js} +0 -3
  233. package/src/jsenv_file_urls.js +35 -0
  234. package/src/{jsenvServiceWorkerFinalizer.js → jsenv_service_worker_finalizer.js} +1 -1
  235. package/src/{textToJavaScriptModule.js → json_to_js_module.js} +1 -2
  236. package/src/{launchNode.js → node_runtime.js} +3 -3
  237. package/src/{requireUsingChildProcess.js → require_using_child_process.js} +2 -2
  238. package/src/{jsonToJavaScriptModule.js → text_to_js_module.js} +3 -2
  239. package/dist/browser_runtime/asset-manifest.json +0 -4
  240. package/dist/browser_runtime/browser_runtime_0e3396a1.js +0 -5298
  241. package/dist/browser_runtime/browser_runtime_0e3396a1.js.map +0 -1089
  242. package/dist/compile_proxy/compile_proxy.html__inline__20_f4285042.js.map +0 -343
  243. package/dist/event_source_client/event_source_client_80644aee.js +0 -356
  244. package/dist/redirector/redirector.html__inline__12_404b8295.js.map +0 -349
  245. package/dist/toolbar_injector/toolbar_injector_1e193101.js +0 -976
  246. package/dist/toolbar_injector/toolbar_injector_1e193101.js.map +0 -294
  247. package/src/internal/browser_runtime/evalSource.js +0 -11
  248. package/src/internal/compiling/jsenv_directory/updateMeta.js +0 -150
  249. package/src/internal/dataUrl.utils.js +0 -55
  250. package/src/internal/executing/coverage_missing/createEmptyCoverage.js +0 -6
  251. package/src/internal/executing/executionIsPassed.js +0 -2
  252. package/src/internal/executing/generateExecutionSteps.js +0 -29
  253. package/src/internal/jsenvCoreDirectoryUrl.js +0 -22
  254. package/src/internal/jsenvInternalFiles.js +0 -36
  255. package/src/internal/semantic_versioning/index.js +0 -5
  256. package/src/internal/semantic_versioning/versionIsAbove.js +0 -5
  257. package/src/internal/semantic_versioning/versionIsBelow.js +0 -5
  258. package/src/jsenvCoverageConfig.js +0 -7
  259. package/src/jsenvExplorableConfig.js +0 -9
  260. package/src/jsenvRuntimeSupportDuringDev.js +0 -12
  261. package/src/playwright_browser_versions.js +0 -5
@@ -1,14 +1,12 @@
1
- /* eslint-env browser */
1
+ import { fetchUrl } from "@jsenv/core/src/internal/browser_utils/fetch_browser.js"
2
+ import { fetchAndEval } from "@jsenv/core/src/internal/browser_utils/fetch_and_eval.js"
3
+ import { unevalException } from "@jsenv/core/src/internal/runtime_client/uneval_exception.js"
4
+ import { memoize } from "@jsenv/core/src/internal/memoize.js"
2
5
 
3
- import { installBrowserErrorStackRemapping } from "../error-stack-remapping/installBrowserErrorStackRemapping.js"
4
- import { fetchUrl } from "../browser_utils/fetch_browser.js"
5
- import { fetchAndEvalUsingFetch } from "../browser_utils/fetchAndEvalUsingFetch.js"
6
- import { unevalException } from "../unevalException.js"
7
- import { memoize } from "../memoize.js"
8
-
9
- import { displayErrorInDocument } from "./displayErrorInDocument.js"
10
- import { displayErrorNotification } from "./displayErrorNotification.js"
11
- import { createBrowserRuntime } from "./createBrowserRuntime.js"
6
+ import { createBrowserClient } from "./browser_client_factory.js"
7
+ import { installBrowserErrorStackRemapping } from "./browser_error_stack_remap.js"
8
+ import { displayErrorInDocument } from "./error_in_document.js"
9
+ import { displayErrorNotification } from "./error_in_notification.js"
12
10
 
13
11
  const getNavigationStartTime = () => {
14
12
  try {
@@ -177,7 +175,7 @@ const getBrowserRuntime = memoize(async () => {
177
175
  const parts = afterJsenvDirectory.split("/")
178
176
  const compileId = parts[0]
179
177
 
180
- const browserRuntime = await createBrowserRuntime({
178
+ const browserClient = await createBrowserClient({
181
179
  compileServerOrigin,
182
180
  jsenvDirectoryRelativeUrl,
183
181
  compileId,
@@ -186,9 +184,7 @@ const getBrowserRuntime = memoize(async () => {
186
184
  if (errorStackRemapping && Error.captureStackTrace) {
187
185
  const { sourcemapMainFileRelativeUrl, sourcemapMappingFileRelativeUrl } =
188
186
  compileServerMeta
189
- await fetchAndEvalUsingFetch(
190
- `${compileServerOrigin}/${sourcemapMainFileRelativeUrl}`,
191
- )
187
+ await fetchAndEval(`${compileServerOrigin}/${sourcemapMainFileRelativeUrl}`)
192
188
  const { SourceMapConsumer } = window.sourceMap
193
189
  SourceMapConsumer.initialize({
194
190
  "lib/mappings.wasm": `${compileServerOrigin}/${sourcemapMappingFileRelativeUrl}`,
@@ -204,12 +200,12 @@ const getBrowserRuntime = memoize(async () => {
204
200
  error.stack = originalStack
205
201
  return error
206
202
  }
207
- const executeFile = browserRuntime.executeFile
208
- browserRuntime.executeFile = (file, options = {}) => {
203
+ const executeFile = browserClient.executeFile
204
+ browserClient.executeFile = (file, options = {}) => {
209
205
  return executeFile(file, { errorTransform, ...options })
210
206
  }
211
207
  }
212
- return browserRuntime
208
+ return browserClient
213
209
  })
214
210
 
215
211
  const livereloadingCallbacks = {}
@@ -1,19 +1,17 @@
1
- /* eslint-env browser */
2
-
3
1
  import { normalizeImportMap } from "@jsenv/importmap/src/normalizeImportMap.js"
4
2
 
5
3
  // do not use memoize from @jsenv/filesystem to avoid pulling @jsenv/filesystem code into the browser build
6
- import { fetchUrl } from "../browser_utils/fetch_browser.js"
7
- import { createImportResolverForImportmap } from "../import-resolution/import-resolver-importmap.js"
8
- import { memoize } from "../memoize.js"
9
- import { measureAsyncFnPerf } from "../perf_browser.js"
4
+ import { fetchUrl } from "@jsenv/core/src/internal/browser_utils/fetch_browser.js"
5
+ import { createImportResolverForImportmap } from "@jsenv/core/src/internal/import_resolution/import_resolver_importmap.js"
6
+ import { memoize } from "@jsenv/core/src/internal/memoize.js"
10
7
 
11
8
  import { createBrowserSystem } from "./browser_system.js"
12
- import { makeNamespaceTransferable } from "./makeNamespaceTransferable.js"
9
+ import { measureAsyncFnPerf } from "./perf_browser.js"
10
+ import { makeModuleNamespaceTransferable } from "./module_namespace_transfer.js"
13
11
 
14
12
  const memoizedCreateBrowserSystem = memoize(createBrowserSystem)
15
13
 
16
- export const createBrowserRuntime = async ({
14
+ export const createBrowserClient = async ({
17
15
  compileServerOrigin,
18
16
  jsenvDirectoryRelativeUrl,
19
17
  compileId,
@@ -103,7 +101,7 @@ export const createBrowserRuntime = async ({
103
101
  let namespace = await browserSystem.import(specifier)
104
102
 
105
103
  if (transferableNamespace) {
106
- namespace = makeNamespaceTransferable(namespace)
104
+ namespace = makeModuleNamespaceTransferable(namespace)
107
105
  }
108
106
 
109
107
  return {
@@ -1,6 +1,4 @@
1
- /* eslint-env browser */
2
-
3
- import { installErrorStackRemapping } from "./installErrorStackRemapping.js"
1
+ import { installErrorStackRemapping } from "@jsenv/core/src/internal/error_stack_remap/install_error_stack_remapping.js"
4
2
 
5
3
  export const installBrowserErrorStackRemapping = (options = {}) =>
6
4
  installErrorStackRemapping({
@@ -1,7 +1,5 @@
1
- /* eslint-env browser */
2
-
3
- import { getJavaScriptModuleResponseError } from "../runtime/module-registration.js"
4
- import "../runtime/s.js"
1
+ import { getJavaScriptModuleResponseError } from "@jsenv/core/src/internal/runtime_client/module_registration.js"
2
+ import "@jsenv/core/src/internal/runtime_client/s.js"
5
3
 
6
4
  export const createBrowserSystem = ({
7
5
  compileServerOrigin,
@@ -1,5 +1,3 @@
1
- /* eslint-env browser */
2
-
3
1
  export const displayErrorInDocument = (error) => {
4
2
  const title = "An error occured"
5
3
  let theme
@@ -1,4 +1,3 @@
1
- /* eslint-env browser */
2
1
  const { Notification } = window
3
2
 
4
3
  const displayErrorNotificationNotAvailable = () => {}
@@ -1,4 +1,4 @@
1
- export const makeNamespaceTransferable = (namespace) => {
1
+ export const makeModuleNamespaceTransferable = (namespace) => {
2
2
  const transferableNamespace = {}
3
3
  Object.keys(namespace).forEach((key) => {
4
4
  const value = namespace[key]
@@ -1,5 +1,3 @@
1
- /* eslint-env browser */
2
-
3
1
  const { performance } = window
4
2
 
5
3
  export const measureAsyncFnPerf = performance
@@ -2,15 +2,15 @@
2
2
  // https://github.com/lancedikson/bowser/blob/master/src/parser-browsers.js#L1
3
3
 
4
4
  import { detectFromUserAgentData } from "./user_agent_data.js"
5
- import { detectAndroid } from "./detectAndroid.js"
6
- import { detectInternetExplorer } from "./detectInternetExplorer.js"
7
- import { detectOpera } from "./detectOpera.js"
8
- import { detectEdge } from "./detectEdge.js"
9
- import { detectFirefox } from "./detectFirefox.js"
10
- import { detectChrome } from "./detectChrome.js"
11
- import { detectSafari } from "./detectSafari.js"
12
- import { detectElectron } from "./detectElectron.js"
13
- import { detectIOS } from "./detectIOS.js"
5
+ import { detectAndroid } from "./detect_android.js"
6
+ import { detectInternetExplorer } from "./detect_internet_explorer.js"
7
+ import { detectOpera } from "./detect_opera.js"
8
+ import { detectEdge } from "./detect_edge.js"
9
+ import { detectFirefox } from "./detect_firefox.js"
10
+ import { detectChrome } from "./detect_chrome.js"
11
+ import { detectSafari } from "./detect_safari.js"
12
+ import { detectElectron } from "./detect_electron.js"
13
+ import { detectIOS } from "./detect_ios.js"
14
14
 
15
15
  const detectorCompose = (detectors) => () => {
16
16
  let i = 0
@@ -40,7 +40,6 @@ const detector = detectorCompose([
40
40
 
41
41
  export const detectBrowser = () => {
42
42
  const { name = "other", version = "unknown" } = detector() || {}
43
-
44
43
  return {
45
44
  name: normalizeName(name),
46
45
  version: normalizeVersion(version),
@@ -57,12 +56,10 @@ const normalizeVersion = (version) => {
57
56
  // remove extraneous .
58
57
  return parts.slice(0, 3).join(".")
59
58
  }
60
-
61
59
  if (version.indexOf("_") > -1) {
62
60
  const parts = version.split("_")
63
61
  // remove extraneous _
64
62
  return parts.slice(0, 3).join("_")
65
63
  }
66
-
67
64
  return version
68
65
  }
@@ -9,7 +9,6 @@ export const detectFromUserAgentData = () => {
9
9
  if (!userAgentData) {
10
10
  return null
11
11
  }
12
-
13
12
  const { brands } = userAgentData
14
13
  let i = 0
15
14
  while (i < brands.length) {
@@ -6,10 +6,11 @@ import {
6
6
  } from "@jsenv/filesystem"
7
7
 
8
8
  import { COMPILE_PROXY_BUILD_URL } from "@jsenv/core/dist/build_manifest.js"
9
- import { filterV8Coverage } from "@jsenv/core/src/internal/executing/coverage_utils/v8_coverage_from_directory.js"
10
- import { composeTwoFileByFileIstanbulCoverages } from "@jsenv/core/src/internal/executing/coverage_utils/istanbul_coverage_composition.js"
11
- import { evalSource } from "../node_runtime/evalSource.js"
12
- import { escapeRegexpSpecialCharacters } from "../escapeRegexpSpecialCharacters.js"
9
+ import { filterV8Coverage } from "@jsenv/core/src/internal/coverage/v8_coverage_from_directory.js"
10
+ import { composeTwoFileByFileIstanbulCoverages } from "@jsenv/core/src/internal/coverage/istanbul_coverage_composition.js"
11
+ import { evalSource } from "@jsenv/core/src/internal/node_launcher/eval_source.js"
12
+ import { escapeRegexpSpecialCharacters } from "@jsenv/core/src/internal/regexp_escape.js"
13
+
13
14
  import { getBrowserRuntimeProfile } from "./browser_runtime_profile.js"
14
15
 
15
16
  export const executeHtmlFile = async (
@@ -9,8 +9,8 @@ import {
9
9
  } from "@jsenv/abort"
10
10
  import { memoize } from "@jsenv/filesystem"
11
11
 
12
- import { trackPageToNotify } from "./trackPageToNotify.js"
13
- import { executeHtmlFile } from "./executeHtmlFile.js"
12
+ import { trackPageErrorsAndLogs } from "./page_errors_and_logs.js"
13
+ import { executeHtmlFile } from "./execute_html_file.js"
14
14
 
15
15
  export const createRuntimeFromPlaywright = ({
16
16
  browserName,
@@ -113,7 +113,7 @@ export const createRuntimeFromPlaywright = ({
113
113
  throw e
114
114
  }
115
115
  })
116
- const stopTrackingToNotify = trackPageToNotify(page, {
116
+ const stopTrackingToNotify = trackPageErrorsAndLogs(page, {
117
117
  onError: (error) => {
118
118
  error = transformErrorHook(error)
119
119
  if (!ignoreErrorHook(error)) {
@@ -1,4 +1,4 @@
1
- export const trackPageToNotify = (page, { onError, onConsole }) => {
1
+ export const trackPageErrorsAndLogs = (page, { onError, onConsole }) => {
2
2
  // https://github.com/GoogleChrome/puppeteer/blob/v1.4.0/docs/api.md#event-error
3
3
  const removeErrorListener = registerEvent({
4
4
  object: page,
@@ -1,10 +1,8 @@
1
- /* eslint-env browser */
2
-
3
1
  import { createDetailedMessage } from "@jsenv/logger"
4
2
 
5
3
  import { fetchUrl } from "./fetch_browser.js"
6
4
 
7
- export const fetchAndEvalUsingFetch = async (url) => {
5
+ export const fetchAndEval = async (url) => {
8
6
  const response = await fetchUrl(url)
9
7
 
10
8
  if (response.status >= 200 && response.status <= 299) {
@@ -1,5 +1,3 @@
1
- /* eslint-env browser */
2
-
3
1
  export const fetchAndEvalUsingScript = async (src) => {
4
2
  return new Promise((resolve, reject) => {
5
3
  const script = document.createElement("script")
@@ -1,4 +1,4 @@
1
- import { fetchUsingXHR } from "./fetchUsingXHR.js"
1
+ import { fetchUsingXHR } from "./fetch_using_xhr.js"
2
2
 
3
3
  const fetchNative = async (url, { mode = "cors", ...options } = {}) => {
4
4
  const response = await window.fetch(url, {
@@ -1,5 +1,3 @@
1
- /* eslint-env browser */
2
-
3
1
  export const fetchUsingXHR = async (
4
2
  url,
5
3
  {
@@ -1,8 +1,9 @@
1
1
  import { ANSI, UNICODE } from "@jsenv/log"
2
2
 
3
- import { getHtmlNodeLocation } from "@jsenv/core/src/internal/compiling/compileHtml.js"
4
- import { byteAsFileSize } from "../logs/byteAsFileSize.js"
5
- import { msAsDuration } from "../logs/msAsDuration.js"
3
+ import { getHtmlNodeLocation } from "@jsenv/core/src/internal/compile_server/html/html_ast.js"
4
+
5
+ import { byteAsFileSize } from "../logs/byte_as_file_size.js"
6
+ import { msAsDuration } from "../logs/ms_as_duration.js"
6
7
  import { stringifyUrlSite } from "./url_trace.js"
7
8
 
8
9
  export const formatBuildStartLog = ({ entryPoints }) => {
@@ -61,37 +62,17 @@ const formatBuildDoneDetails = ({ buildStats, buildDirectoryRelativeUrl }) => {
61
62
  )})`
62
63
  })
63
64
  const buildFileCount = buildFiles.length
64
-
65
65
  const { buildSourcemapFileSizes } = buildStats
66
- const sourcemapFiles = Object.keys(buildSourcemapFileSizes).map((key) => {
67
- const buildSourcemapFileSize = buildSourcemapFileSizes[key]
68
- return `${buildDirectoryRelativeUrl}${key} (${byteAsFileSize(
69
- buildSourcemapFileSize,
70
- )})`
71
- })
72
- const sourcemapFileCount = sourcemapFiles.length
73
-
74
- const buildFilesDescription =
75
- buildFileCount === 1
76
- ? "file in the build: 1"
77
- : `files in the build: ${buildFileCount}`
78
-
79
- const buildSourcemapFilesDescription =
80
- sourcemapFileCount === 0
81
- ? ""
82
- : sourcemapFileCount === 1
83
- ? "sourcemap file in the build: 1"
84
- : `sourcemap files in the build: ${sourcemapFileCount}`
85
-
66
+ const sourcemapFileCount = Object.keys(buildSourcemapFileSizes).length
67
+ let buildFilesDescription =
68
+ buildFileCount === 1 ? "build file" : `build files`
69
+ if (sourcemapFileCount === 1) {
70
+ buildFilesDescription += ` (excluding sourcemap file)`
71
+ } else if (sourcemapFileCount > 1) {
72
+ buildFilesDescription += ` (excluding sourcemap files)`
73
+ }
86
74
  let message = `--- ${buildFilesDescription} ---
87
75
  ${buildFiles.join("\n")}`
88
-
89
- if (buildSourcemapFilesDescription) {
90
- message += `
91
- --- ${buildSourcemapFilesDescription} ---
92
- ${sourcemapFiles.join("\n")}`
93
- }
94
-
95
76
  return message
96
77
  }
97
78
 
@@ -101,24 +82,40 @@ const formatBuildSummary = ({ buildStats }) => {
101
82
  projectFileSizes,
102
83
  projectTotalFileSize,
103
84
  buildFileSizes,
104
- buildTotalFileSize,
85
+ buildFileTotalSize,
86
+ buildSourcemapFileSizes,
87
+ buildSourcemapFileTotalSize,
105
88
  } = buildStats
106
89
 
107
90
  const projectFileCount = Object.keys(projectFileSizes).length
108
91
  const buildFileCount = Object.keys(buildFileSizes).length
92
+ const buildSourcemapFileCount = Object.keys(buildSourcemapFileSizes).length
109
93
 
110
94
  return `------- build summary -------
111
- ${ANSI.color(
112
- `project files:`,
113
- ANSI.GREY,
114
- )} ${projectFileCount} (${byteAsFileSize(projectTotalFileSize)})
115
- ${ANSI.color(`build files:`, ANSI.GREY)} ${buildFileCount} (${byteAsFileSize(
116
- buildTotalFileSize,
117
- )})
118
- ${ANSI.color(`build duration:`, ANSI.GREY)} ${msAsDuration(buildDuration)}
95
+ ${formatSummaryContent({
96
+ "project files": `${projectFileCount} (${byteAsFileSize(
97
+ projectTotalFileSize,
98
+ )})`,
99
+ "build files": `${buildFileCount} (${byteAsFileSize(buildFileTotalSize)})`,
100
+ ...(buildSourcemapFileCount === 0
101
+ ? {}
102
+ : {
103
+ "build sourcemap files": `${buildSourcemapFileCount} (${byteAsFileSize(
104
+ buildSourcemapFileTotalSize,
105
+ )})`,
106
+ }),
107
+ "build duration": msAsDuration(buildDuration),
108
+ })}
119
109
  ------------------------------`
120
110
  }
121
111
 
112
+ const formatSummaryContent = (summaryData) => {
113
+ return Object.keys(summaryData).map((key) => {
114
+ return `${ANSI.color(`${key}:`, ANSI.GREY)} ${summaryData[key]}`
115
+ }).join(`
116
+ `)
117
+ }
118
+
122
119
  const showHtmlSourceLocation = ({
123
120
  htmlNode,
124
121
  htmlUrl,
@@ -19,8 +19,9 @@ export const createBuildStats = ({
19
19
  projectFileSizes: projectFileSizeInfo.fileSizes,
20
20
  projectTotalFileSize: projectFileSizeInfo.totalSize,
21
21
  buildFileSizes: buildFileSizeInfo.fileSizes,
22
- buildTotalFileSize: buildFileSizeInfo.totalSize,
22
+ buildFileTotalSize: buildFileSizeInfo.totalSize,
23
23
  buildSourcemapFileSizes: sourcemapFileSizeInfo.fileSizes,
24
+ buildSourcemapFileTotalSize: sourcemapFileSizeInfo.totalSize,
24
25
  buildDuration,
25
26
  }
26
27
  }
@@ -1,6 +1,6 @@
1
1
  import { urlToBasename, urlToExtension } from "@jsenv/filesystem"
2
2
 
3
- import { generateContentHash } from "./url_versioning.js"
3
+ import { generateContentHash } from "./url_versioning/url_versioning.js"
4
4
 
5
5
  export const createBuildUrlGenerator = ({
6
6
  entryPointUrls,
@@ -33,13 +33,9 @@ export const buildUsingRollup = async ({
33
33
 
34
34
  format,
35
35
  systemJsUrl,
36
- globalName,
37
36
  globals,
38
- workers,
39
- serviceWorkers,
37
+ preservedDynamicImports,
40
38
  serviceWorkerFinalizer,
41
- classicWorkers,
42
- classicServiceWorkers,
43
39
 
44
40
  node,
45
41
  browser,
@@ -79,6 +75,9 @@ export const buildUsingRollup = async ({
79
75
 
80
76
  format,
81
77
  systemJsUrl,
78
+ globals,
79
+ preservedDynamicImports,
80
+
82
81
  urlMappings,
83
82
  importResolutionMethod,
84
83
  importMapFileRelativeUrl,
@@ -86,11 +85,7 @@ export const buildUsingRollup = async ({
86
85
  externalImportSpecifiers,
87
86
  importPaths,
88
87
  preservedUrls,
89
- workers,
90
- serviceWorkers,
91
88
  serviceWorkerFinalizer,
92
- classicWorkers,
93
- classicServiceWorkers,
94
89
 
95
90
  node,
96
91
  browser,
@@ -118,8 +113,6 @@ export const buildUsingRollup = async ({
118
113
  rollupPlugins,
119
114
  compileProfile,
120
115
  format,
121
- globals,
122
- globalName,
123
116
  sourcemapExcludeSources,
124
117
  preserveEntrySignatures,
125
118
  treeshake,
@@ -224,8 +217,6 @@ const useRollup = async ({
224
217
  rollupPlugins,
225
218
  compileProfile,
226
219
  format,
227
- globals,
228
- globalName,
229
220
  sourcemapExcludeSources,
230
221
  preserveEntrySignatures,
231
222
  treeshake,
@@ -316,12 +307,6 @@ const useRollup = async ({
316
307
  sourcemap: true,
317
308
  sourcemapExcludeSources,
318
309
  // preserveModules: !jsConcatenation,
319
- ...(format === "global"
320
- ? {
321
- globals,
322
- name: globalName,
323
- }
324
- : {}),
325
310
  }
326
311
 
327
312
  buildOperation.throwIfAborted()
@@ -336,7 +321,7 @@ const useRollup = async ({
336
321
  }
337
322
 
338
323
  const formatToRollupFormat = (format) => {
339
- if (format === "global") return "iife"
324
+ if (format === "global") return "esm" // will be handled by rollup_plugin_iife
340
325
  if (format === "commonjs") return "cjs"
341
326
  if (format === "systemjs") return "system"
342
327
  if (format === "esmodule") return "esm"
@@ -367,7 +352,7 @@ const getConvertSuggestion = async ({
367
352
  return {
368
353
  suggestion: `The file seems written in commonjs, you should use "customCompiler" to convert it to js module
369
354
  {
370
- "./${importedFileOriginalRelativeUrl}": commonJsToJavaScriptModule
355
+ "./${importedFileOriginalRelativeUrl}": commonJsToJsModule
371
356
  }
372
357
  As documented in https://github.com/jsenv/jsenv-core/blob/master/docs/shared-parameters.md#customcompilers`,
373
358
  }
@@ -9,11 +9,12 @@ import {
9
9
  generateSourcemapUrl,
10
10
  getCssSourceMappingUrl,
11
11
  setCssSourceMappingUrl,
12
- } from "@jsenv/core/src/internal/sourceMappingURLUtils.js"
12
+ } from "@jsenv/core/src/internal/sourcemap_utils.js"
13
+
13
14
  import { getRessourceAsBase64Url } from "../ressource_builder_util.js"
14
- import { parseCssUrls } from "./parseCssUrls.js"
15
- import { replaceCssUrls } from "./replaceCssUrls.js"
16
- import { moveCssUrls } from "./moveCssUrls.js"
15
+ import { parseCssUrls } from "./parse_css_urls.js"
16
+ import { replaceCssUrls } from "./replace_css_urls.js"
17
+ import { moveCssUrls } from "./move_css_urls.js"
17
18
 
18
19
  export const parseCssRessource = async (
19
20
  cssRessource,
@@ -1,6 +1,6 @@
1
1
  import { urlToRelativeUrl } from "@jsenv/filesystem"
2
2
 
3
- import { applyPostCss } from "./applyPostCss.js"
3
+ import { applyPostCss } from "./apply_post_css.js"
4
4
  import { postCssPluginUrlVisitor } from "./postcss_plugin_url_visitor.js"
5
5
 
6
6
  export const moveCssUrls = async ({
@@ -1,4 +1,4 @@
1
- import { applyPostCss } from "./applyPostCss.js"
1
+ import { applyPostCss } from "./apply_post_css.js"
2
2
  import { postCssPluginUrlVisitor } from "./postcss_plugin_url_visitor.js"
3
3
 
4
4
  export const parseCssUrls = async ({ code, url = "file:///file.css" }) => {
@@ -12,6 +12,7 @@ hence sourcemap cannot point the original source location
12
12
  */
13
13
 
14
14
  import { fileSystemPathToUrl, resolveUrl } from "@jsenv/filesystem"
15
+
15
16
  import { require } from "@jsenv/core/src/internal/require.js"
16
17
 
17
18
  export const postCssPluginUrlVisitor = ({ urlVisitor = () => null }) => {
@@ -4,7 +4,8 @@ import {
4
4
  } from "@jsenv/filesystem"
5
5
 
6
6
  import { require } from "@jsenv/core/src/internal/require.js"
7
- import { applyPostCss } from "./applyPostCss.js"
7
+
8
+ import { applyPostCss } from "./apply_post_css.js"
8
9
  import { postCssPluginUrlVisitor } from "./postcss_plugin_url_visitor.js"
9
10
 
10
11
  export const replaceCssUrls = async ({
@@ -0,0 +1,34 @@
1
+ export const esToSystem = async ({ code, url, map }) => {
2
+ const { rollup } = await import("rollup")
3
+ const rollupBuild = await rollup({
4
+ input: url,
5
+ plugins: [
6
+ {
7
+ name: "es-to-system",
8
+ resolveId: (id) => {
9
+ if (id === url) {
10
+ return id
11
+ }
12
+ return { external: true }
13
+ },
14
+ load: (id) => {
15
+ if (id === url) {
16
+ return code
17
+ }
18
+ return null
19
+ },
20
+ },
21
+ ],
22
+ })
23
+ const { output } = await rollupBuild.generate({
24
+ format: "system",
25
+ sourcemap: true,
26
+ })
27
+ const firstChunk = output[0]
28
+ code = firstChunk.code
29
+ map = firstChunk.map
30
+ return {
31
+ code,
32
+ map,
33
+ }
34
+ }
@@ -3,7 +3,7 @@ import {
3
3
  visitHtmlAst,
4
4
  getHtmlNodeAttributeByName,
5
5
  getHtmlNodeTextNode,
6
- } from "@jsenv/core/src/internal/compiling/compileHtml.js"
6
+ } from "@jsenv/core/src/internal/compile_server/html/html_ast.js"
7
7
 
8
8
  export const importMapsFromHtml = (htmlSource) => {
9
9
  const importmaps = []