@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.
- package/dist/browser_client/asset-manifest.json +4 -0
- package/dist/browser_client/browser_client_fb33eaa4.js +5320 -0
- package/dist/browser_client/browser_client_fb33eaa4.js.map +1089 -0
- package/dist/build_manifest.js +6 -6
- package/dist/compile_proxy/asset-manifest.json +2 -2
- package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +343 -0
- package/dist/compile_proxy/{compile_proxy_ab528227.html → compile_proxy_62f952c4.html} +7 -6
- package/dist/event_source_client/asset-manifest.json +2 -2
- package/dist/event_source_client/event_source_client_69f48287.js +354 -0
- package/dist/event_source_client/{event_source_client_80644aee.js.map → event_source_client_69f48287.js.map} +2 -2
- package/dist/redirector/asset-manifest.json +2 -2
- package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +349 -0
- package/dist/redirector/{redirector_6df2620a.html → redirector_8117ec92.html} +7 -6
- package/dist/toolbar/asset-manifest.json +5 -5
- package/dist/toolbar/assets/{light-theme.css_72a60fa3.map → light_theme.css_5bff0336.map} +2 -2
- package/dist/toolbar/assets/{overflow-menu.css_2859d519.map → overflow_menu.css_9a0fc3d8.map} +2 -2
- package/dist/toolbar/assets/{toolbar.main.css_b7d8bec1.map → toolbar_main.css_b1c67dd7.map} +7 -7
- package/dist/toolbar/{toolbar_9a52325b.html → toolbar_b0c9100c.html} +8 -7
- package/dist/toolbar/{toolbar.main_2c56a4e0.js.map → toolbar_main_f54c1bb0.js.map} +32 -32
- package/dist/toolbar_injector/asset-manifest.json +3 -3
- package/dist/toolbar_injector/assets/{jsenv-logo_188b9ca6.svg → jsenv_logo_192011c2.svg} +1 -1
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js +976 -0
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +294 -0
- package/helpers/babel/asyncIterator/asyncIterator.js +61 -8
- package/helpers/babel/createClass/createClass.js +12 -12
- package/helpers/babel/inherits/inherits.js +10 -6
- package/helpers/babel/jsx/jsx.js +27 -22
- package/helpers/babel/objectSpread2/objectSpread2.js +22 -14
- package/helpers/babel/readme.md +3 -8
- package/helpers/babel/wrapRegExp/wrapRegExp.js +29 -29
- package/main.js +19 -14
- package/package.json +42 -43
- package/readme.md +23 -25
- package/src/{launchBrowser.js → browser_runtimes.js} +3 -8
- package/src/{buildProject.js → build_project.js} +6 -17
- package/src/{commonJsToJavaScriptModule.js → commonjs_to_js_module.js} +5 -5
- package/src/dev_server.js +19 -10
- package/src/execute.js +3 -3
- package/src/{executeTestPlan.js → execute_test_plan.js} +16 -9
- package/src/{importUsingChildProcess.js → import_using_child_process.js} +2 -2
- package/src/internal/{browser_runtime/browser_runtime.js → browser_client/browser_client.js} +13 -17
- package/src/internal/{browser_runtime/createBrowserRuntime.js → browser_client/browser_client_factory.js} +7 -9
- package/src/internal/{error-stack-remapping/installBrowserErrorStackRemapping.js → browser_client/browser_error_stack_remap.js} +1 -3
- package/src/internal/{browser_runtime → browser_client}/browser_system.js +2 -4
- package/src/internal/{browser_runtime/displayErrorInDocument.js → browser_client/error_in_document.js} +0 -2
- package/src/internal/{browser_runtime/displayErrorNotification.js → browser_client/error_in_notification.js} +0 -1
- package/src/internal/{browser_runtime/makeNamespaceTransferable.js → browser_client/module_namespace_transfer.js} +1 -1
- package/src/internal/{perf_browser.js → browser_client/perf_browser.js} +0 -2
- package/src/internal/browser_detection/browser_detection.js +9 -12
- package/src/internal/browser_detection/{detectAndroid.js → detect_android.js} +0 -0
- package/src/internal/browser_detection/{detectChrome.js → detect_chrome.js} +0 -0
- package/src/internal/browser_detection/{detectEdge.js → detect_edge.js} +0 -0
- package/src/internal/browser_detection/{detectElectron.js → detect_electron.js} +0 -0
- package/src/internal/browser_detection/{detectFirefox.js → detect_firefox.js} +0 -0
- package/src/internal/browser_detection/{detectInternetExplorer.js → detect_internet_explorer.js} +0 -0
- package/src/internal/browser_detection/{detectIOS.js → detect_ios.js} +0 -0
- package/src/internal/browser_detection/{detectOpera.js → detect_opera.js} +0 -0
- package/src/internal/browser_detection/{detectSafari.js → detect_safari.js} +0 -0
- package/src/internal/browser_detection/user_agent_data.js +0 -1
- package/src/internal/browser_launcher/{executeHtmlFile.js → execute_html_file.js} +5 -4
- package/src/internal/browser_launcher/from_playwright.js +3 -3
- package/src/internal/browser_launcher/{trackPageToNotify.js → page_errors_and_logs.js} +1 -1
- package/src/internal/browser_utils/{fetchAndEvalUsingFetch.js → fetch_and_eval.js} +1 -3
- package/src/internal/browser_utils/{fetchAndEvalUsingScript.js → fetch_and_eval_using_script.js} +0 -2
- package/src/internal/browser_utils/fetch_browser.js +1 -1
- package/src/internal/browser_utils/{fetchJson.js → fetch_json.js} +0 -0
- package/src/internal/browser_utils/{fetchUsingXHR.js → fetch_using_xhr.js} +0 -2
- package/src/internal/building/build_logs.js +37 -40
- package/src/internal/building/build_stats.js +2 -1
- package/src/internal/building/build_url_generator.js +1 -1
- package/src/internal/building/{buildUsingRollup.js → build_using_rollup.js} +6 -21
- package/src/internal/building/css/{applyPostCss.js → apply_post_css.js} +0 -0
- package/src/internal/building/css/{parseCssRessource.js → jsenv_parse_css.js} +5 -4
- package/src/internal/building/css/{moveCssUrls.js → move_css_urls.js} +1 -1
- package/src/internal/building/css/{parseCssUrls.js → parse_css_urls.js} +1 -1
- package/src/internal/building/css/postcss_plugin_url_visitor.js +1 -0
- package/src/internal/building/css/{replaceCssUrls.js → replace_css_urls.js} +2 -1
- package/src/internal/building/global_format/es_to_system.js +34 -0
- package/src/internal/building/{parsing.utils.js → html/html_node_mutations.js} +0 -0
- package/src/internal/building/html/{htmlScan.js → html_scan.js} +1 -1
- package/src/internal/building/html/{parseHtmlRessource.js → jsenv_parse_html.js} +5 -6
- package/src/internal/building/html/{minifyHtml.js → minify_html.js} +0 -0
- package/src/internal/building/{css_module.js → import_assertions/css_module.js} +3 -3
- package/src/internal/building/{json_module.js → import_assertions/json_module.js} +0 -0
- package/src/internal/building/import_references.js +0 -1
- package/src/internal/building/importmap/{parseImportmapRessource.js → jsenv_parse_importmap.js} +0 -0
- package/src/internal/building/js/{parseJsRessource.js → jsenv_parse_js.js} +2 -1
- package/src/internal/building/js/{minifyJs.js → minify_js.js} +0 -0
- package/src/internal/building/js/transform_worker.js +1 -1
- package/src/internal/building/json/{parseJsonRessource.js → jsenv_parse_json.js} +0 -0
- package/src/internal/building/{parseRessource.js → parse_ressource.js} +13 -13
- package/src/internal/building/ressource_builder.js +4 -3
- package/src/internal/building/ressource_builder_util.js +2 -2
- package/src/internal/building/rollup_plugin_jsenv.js +166 -61
- package/src/internal/building/{sortObjectByPathnames.js → sort_pathnames.js} +0 -0
- package/src/internal/building/{sourcemap_loader.js → sourcemap/sourcemap_loader.js} +3 -6
- package/src/internal/building/svg/{parseSvgRessource.js → jsenv_parse_svg.js} +4 -3
- package/src/internal/building/url_fetcher.js +1 -1
- package/src/internal/building/url_loader.js +3 -3
- package/src/internal/building/{resolve_import_url_helper.js → url_versioning/resolve_import_url_helper.js} +0 -0
- package/src/internal/building/{url_versioning.js → url_versioning/url_versioning.js} +1 -1
- package/src/internal/building/webmanifest/{parseWebmanifestRessource.js → jsenv_parse_webmanifest.js} +0 -0
- package/src/internal/{compiling → compile_server/commonjs}/rollup_plugin_commonjs_named_exports.js +0 -0
- package/src/internal/{compiling/compileFile.js → compile_server/compile_file.js} +6 -4
- package/src/internal/{compiling/startCompileServer.js → compile_server/compile_server.js} +11 -24
- package/src/internal/{compiling/createCompiledFileService.js → compile_server/compiled_file_service.js} +5 -8
- package/src/internal/{compiling/compileHtml.js → compile_server/html/html_ast.js} +2 -12
- package/src/internal/{compiling → compile_server/html}/html_source_file_service.js +10 -10
- package/src/internal/{compiling/jsenvCompilerForHtml.js → compile_server/html/jsenv_compile_html.js} +12 -12
- package/src/internal/{compiling/jsenvCompilerForImportmap.js → compile_server/importmap/jsenv_compile_importmap.js} +1 -1
- package/src/internal/{compiling/js-compilation-service/ansiToHTML.js → compile_server/js/ansi_to_html.js} +1 -1
- package/src/internal/{compiling/js-compilation-service → compile_server/js}/babelHelper.js +1 -1
- package/src/internal/{compiling → compile_server/js}/babel_parse_error.js +0 -0
- package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_babel_helpers_as_jsenv_imports.js +2 -1
- package/src/internal/{compiling → compile_server/js}/babel_plugin_global_this_as_jsenv_import.js +1 -1
- package/src/internal/{compiling → compile_server/js}/babel_plugin_import_assertions.js +1 -0
- package/src/internal/{compiling → compile_server/js}/babel_plugin_import_metadata.js +0 -0
- package/src/internal/{compiling → compile_server/js}/babel_plugin_import_visitor.js +0 -0
- package/src/internal/{compiling → compile_server/js}/babel_plugin_new_stylesheet_as_jsenv_import.js +1 -1
- package/src/internal/{compiling → compile_server/js}/babel_plugin_proxy_external_imports.js +0 -0
- package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_regenerator_runtime_as_jsenv_import.js +1 -1
- package/src/internal/{babel_plugin_replace_expressions.js → compile_server/js/babel_plugin_replace_expressions.js} +0 -0
- package/src/internal/{compiling/js-compilation-service → compile_server/js}/babel_plugin_systemjs_prepend.js +2 -2
- package/src/internal/{compiling → compile_server/js}/babel_plugin_transform_import_meta.js +0 -0
- package/src/internal/{compiling → compile_server/js}/babel_plugins.js +0 -0
- package/src/internal/{compiling/js-compilation-service → compile_server/js}/generateBabelHelper.js +1 -1
- package/src/internal/{compiling/js-compilation-service/transformJs.js → compile_server/js/js_transformer.js} +8 -9
- package/src/internal/{compiling/jsenvCompilerForJavaScript.js → compile_server/js/jsenv_compile_js.js} +7 -7
- package/src/internal/{compiling → compile_server/js}/load_babel_plugin_map_from_file.js +0 -0
- package/src/internal/{compiling → compile_server}/jsenv_directory/comparison_utils.js +0 -0
- package/src/internal/{compiling/transformResultToCompilationResult.js → compile_server/jsenv_directory/compilation_result.js} +6 -5
- package/src/internal/{building/buildToCompilationResult.js → compile_server/jsenv_directory/compilation_result_from_build.js} +4 -3
- package/src/internal/{compiling → compile_server}/jsenv_directory/compile_asset.js +0 -0
- package/src/internal/{compiling → compile_server}/jsenv_directory/compile_context.js +4 -13
- package/src/internal/{compiling → compile_server}/jsenv_directory/compile_profile.js +1 -2
- package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.js +0 -0
- package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.test.js +0 -0
- package/src/internal/{compiling/jsenv_directory/fs-optimized-for-cache.js → compile_server/jsenv_directory/fs_optimized_for_cache.js} +0 -0
- package/src/internal/{compiling → compile_server}/jsenv_directory/jsenv_directory.js +17 -8
- package/src/internal/{compiling/jsenv_directory/getOrGenerateCompiledFile.js → compile_server/jsenv_directory/reuse_or_create_compiled_file.js} +3 -3
- package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +131 -0
- package/src/internal/{compiling/jsenv_directory/validateCache.js → compile_server/jsenv_directory/validate_compile_cache.js} +1 -1
- package/src/internal/{compiling → compile_server}/sse_service/sse_service.js +1 -1
- package/src/internal/{executing/coverage → coverage}/babel_plugin_instrument.js +1 -1
- package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_html_directory.js +3 -2
- package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_json_file.js +1 -1
- package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_text_log.js +3 -2
- package/src/internal/{executing/coverage_missing/relativeUrlToEmptyCoverage.js → coverage/empty_coverage_factory.js} +10 -3
- package/src/internal/{executing/coverage_utils → coverage}/file_by_file_coverage.js +0 -0
- package/src/internal/{executing/coverage_utils → coverage}/istanbul_coverage_composition.js +1 -1
- package/src/internal/{executing/coverage_reporter/istanbulCoverageMapFromCoverage.js → coverage/istanbul_coverage_map_from_coverage.js} +1 -1
- package/src/internal/{executing/coverage_missing → coverage}/list_files_not_covered.js +0 -0
- package/src/internal/{executing/coverage_missing → coverage}/missing_coverage.js +1 -1
- package/src/internal/{executing/coverage/reportToCoverage.js → coverage/report_to_coverage.js} +8 -7
- package/src/internal/{executing/coverage_utils → coverage}/v8_and_istanbul.js +0 -0
- package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_composition.js +0 -0
- package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_from_directory.js +2 -1
- package/src/internal/{executing/coverage_utils → coverage}/v8_coverage_to_istanbul.js +0 -0
- package/src/internal/data_url.js +54 -0
- package/src/internal/dev_server/exploring/exploring.js +1 -1
- package/src/internal/dev_server/exploring/{fetchExploringJson.js → fetch_exploring_json.js} +1 -1
- package/src/internal/dev_server/toolbar/animation/{toolbar.animation.js → toolbar_animation.js} +0 -0
- package/src/internal/dev_server/toolbar/compilation/{toolbar.compilation.js → toolbar_compilation.js} +3 -2
- package/src/internal/dev_server/toolbar/eventsource/{toolbar.eventsource.js → toolbar_eventsource.js} +0 -0
- package/src/internal/dev_server/toolbar/execution/{toolbar.execution.js → toolbar_execution.js} +1 -1
- package/src/internal/dev_server/toolbar/focus/{toolbar.focus.js → toolbar_focus.js} +0 -0
- package/src/internal/dev_server/toolbar/{jsenv-logo.svg → jsenv_logo.svg} +1 -1
- package/src/internal/dev_server/toolbar/notification/{toolbar.notification.js → toolbar_notification.js} +0 -0
- package/src/internal/dev_server/toolbar/responsive/{overflow-menu.css → overflow_menu.css} +0 -0
- package/src/internal/dev_server/toolbar/responsive/{toolbar.responsive.js → toolbar_responsive.js} +0 -0
- package/src/internal/dev_server/toolbar/settings/{toolbar.settings.js → toolbar_settings.js} +0 -0
- package/src/internal/dev_server/toolbar/theme/{jsenv-theme.css → jsenv_theme.css} +0 -0
- package/src/internal/dev_server/toolbar/theme/{light-theme.css → light_theme.css} +0 -0
- package/src/internal/dev_server/toolbar/theme/{toolbar.theme.js → toolbar_theme.js} +0 -0
- package/src/internal/dev_server/toolbar/toolbar.html +2 -2
- package/src/internal/dev_server/toolbar/{toolbar.injector.js → toolbar_injector.js} +4 -3
- package/src/internal/dev_server/toolbar/{toolbar.main.css → toolbar_main.css} +2 -2
- package/src/internal/dev_server/toolbar/{toolbar.main.js → toolbar_main.js} +9 -9
- package/src/internal/dev_server/toolbar/util/fetching.js +1 -1
- package/src/internal/dev_server/toolbar/util/{jsenvLogger.js → jsenv_logger.js} +0 -0
- package/src/internal/{error-stack-remapping/installErrorStackRemapping.js → error_stack_remap/install_error_stack_remapping.js} +6 -5
- package/src/internal/{error-stack-remapping/remapCallSite.js → error_stack_remap/remap_call_site.js} +2 -1
- package/src/internal/{error-stack-remapping/getOriginalCallsites.js → error_stack_remap/remap_stack.js} +7 -6
- package/src/internal/{error-stack-remapping/stackToString.js → error_stack_remap/stringify_stack.js} +1 -1
- package/src/internal/executing/{executePlan.js → execute_plan.js} +11 -8
- package/src/internal/executing/{generateFileExecutionSteps.js → execution_steps.js} +27 -0
- package/src/internal/executing/{launchAndExecute.js → launch_and_execute.js} +2 -2
- package/src/internal/executing/{executionLogs.js → logs_file_execution.js} +3 -2
- package/src/internal/executing/{createSummaryLog.js → logs_plan_summary.js} +3 -2
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +1 -1
- package/src/internal/features/features_compat_from_runtime.js +1 -1
- package/src/internal/features/node_feature_detection/node_feature_detection.js +1 -1
- package/src/internal/{fetchUrl.js → fetching.js} +0 -0
- package/src/internal/{import-resolution/default-extension.js → import_resolution/default_extension.js} +0 -0
- package/src/internal/{import-resolution/import-resolver-importmap.js → import_resolution/import_resolver_importmap.js} +2 -2
- package/src/internal/{import-resolution/import-resolver-node.js → import_resolution/import_resolver_node.js} +2 -2
- package/src/internal/{import-resolution → import_resolution}/importmap_default.js +1 -1
- package/src/internal/jsenv_builds.js +1 -1
- package/src/internal/{argUtils.js → jsenv_params_assertions.js} +0 -0
- package/src/internal/jsenv_remote_directory.js +1 -1
- package/src/internal/logs/{byteAsFileSize.js → byte_as_file_size.js} +1 -1
- package/src/internal/logs/{msAsDuration.js → ms_as_duration.js} +1 -1
- package/src/internal/node_launcher/{createChildProcessOptions.js → child_process_options.js} +1 -1
- package/src/internal/{node_runtime/evalSource.js → node_launcher/eval_source.js} +0 -0
- package/src/internal/{node_runtime/fetchSource.js → node_launcher/fetch_source.js} +1 -1
- package/src/internal/node_launcher/kill_process_tree.js +2 -2
- package/src/internal/{node_runtime/nodeControllableFile.mjs → node_launcher/node_controllable_file.mjs} +0 -0
- package/src/internal/node_launcher/{createControllableNodeProcess.js → node_controllable_process.js} +3 -3
- package/src/internal/{error-stack-remapping/installNodeErrorStackRemapping.js → node_launcher/node_error_stack_remap.js} +5 -3
- package/src/internal/{node_runtime → node_launcher}/node_execution_dynamic_import.js +3 -2
- package/src/internal/{node_runtime → node_launcher}/node_execution_performance.js +0 -0
- package/src/internal/{node_runtime → node_launcher}/node_execution_systemjs.js +6 -6
- package/src/internal/{node_runtime → node_launcher}/node_system.js +7 -6
- package/src/internal/{perf_node.js → node_launcher/perf_node.js} +1 -1
- package/src/internal/node_launcher/{processOptions.js → process_options.js} +0 -0
- package/src/internal/{runtime/valueInstall.js → node_launcher/value_install.js} +0 -0
- package/src/internal/{escapeRegexpSpecialCharacters.js → regexp_escape.js} +0 -0
- package/src/internal/{runtime/module-registration.js → runtime_client/module_registration.js} +0 -0
- package/src/internal/{runtime → runtime_client}/s.js +3 -2
- package/src/internal/{runtime → runtime_client}/s.js.md +0 -0
- package/src/internal/{unevalException.js → runtime_client/uneval_exception.js} +0 -0
- package/src/internal/runtime_support/runtime_support.js +1 -1
- package/src/internal/semantic_versioning/{versionCompare.js → compare_versions.js} +4 -8
- package/src/internal/semantic_versioning/{findHighestVersion.js → highest_version.js} +1 -2
- package/src/internal/semantic_versioning/is_above.js +5 -0
- package/src/internal/semantic_versioning/is_below.js +5 -0
- package/src/internal/semantic_versioning/{versionIsEqual.js → is_equal.js} +0 -0
- package/src/internal/semantic_versioning/{findLowestVersion.js → lowest_version.js} +1 -2
- package/src/internal/semantic_versioning/{valueToVersion.js → version_from_value.js} +1 -3
- package/src/internal/{sourceMappingURLUtils.js → sourcemap_utils.js} +0 -0
- package/src/internal/{escapeTemplateStringSpecialCharacters.js → template_string_escape.js} +0 -0
- package/src/internal/{filePathUtils.js → windows_file_path_utils.js} +0 -3
- package/src/jsenv_file_urls.js +35 -0
- package/src/{jsenvServiceWorkerFinalizer.js → jsenv_service_worker_finalizer.js} +1 -1
- package/src/{textToJavaScriptModule.js → json_to_js_module.js} +1 -2
- package/src/{launchNode.js → node_runtime.js} +3 -3
- package/src/{requireUsingChildProcess.js → require_using_child_process.js} +2 -2
- package/src/{jsonToJavaScriptModule.js → text_to_js_module.js} +3 -2
- package/dist/browser_runtime/asset-manifest.json +0 -4
- package/dist/browser_runtime/browser_runtime_0e3396a1.js +0 -5298
- package/dist/browser_runtime/browser_runtime_0e3396a1.js.map +0 -1089
- package/dist/compile_proxy/compile_proxy.html__inline__20_f4285042.js.map +0 -343
- package/dist/event_source_client/event_source_client_80644aee.js +0 -356
- package/dist/redirector/redirector.html__inline__12_404b8295.js.map +0 -349
- package/dist/toolbar_injector/toolbar_injector_1e193101.js +0 -976
- package/dist/toolbar_injector/toolbar_injector_1e193101.js.map +0 -294
- package/src/internal/browser_runtime/evalSource.js +0 -11
- package/src/internal/compiling/jsenv_directory/updateMeta.js +0 -150
- package/src/internal/dataUrl.utils.js +0 -55
- package/src/internal/executing/coverage_missing/createEmptyCoverage.js +0 -6
- package/src/internal/executing/executionIsPassed.js +0 -2
- package/src/internal/executing/generateExecutionSteps.js +0 -29
- package/src/internal/jsenvCoreDirectoryUrl.js +0 -22
- package/src/internal/jsenvInternalFiles.js +0 -36
- package/src/internal/semantic_versioning/index.js +0 -5
- package/src/internal/semantic_versioning/versionIsAbove.js +0 -5
- package/src/internal/semantic_versioning/versionIsBelow.js +0 -5
- package/src/jsenvCoverageConfig.js +0 -7
- package/src/jsenvExplorableConfig.js +0 -9
- package/src/jsenvRuntimeSupportDuringDev.js +0 -12
- package/src/playwright_browser_versions.js +0 -5
package/src/internal/{browser_runtime/browser_runtime.js → browser_client/browser_client.js}
RENAMED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
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
|
|
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 =
|
|
208
|
-
|
|
203
|
+
const executeFile = browserClient.executeFile
|
|
204
|
+
browserClient.executeFile = (file, options = {}) => {
|
|
209
205
|
return executeFile(file, { errorTransform, ...options })
|
|
210
206
|
}
|
|
211
207
|
}
|
|
212
|
-
return
|
|
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 "
|
|
7
|
-
import { createImportResolverForImportmap } from "
|
|
8
|
-
import { memoize } from "
|
|
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 {
|
|
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
|
|
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 =
|
|
104
|
+
namespace = makeModuleNamespaceTransferable(namespace)
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
return {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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,
|
|
@@ -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 "./
|
|
6
|
-
import { detectInternetExplorer } from "./
|
|
7
|
-
import { detectOpera } from "./
|
|
8
|
-
import { detectEdge } from "./
|
|
9
|
-
import { detectFirefox } from "./
|
|
10
|
-
import { detectChrome } from "./
|
|
11
|
-
import { detectSafari } from "./
|
|
12
|
-
import { detectElectron } from "./
|
|
13
|
-
import { detectIOS } from "./
|
|
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
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/internal/browser_detection/{detectInternetExplorer.js → detect_internet_explorer.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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/
|
|
10
|
-
import { composeTwoFileByFileIstanbulCoverages } from "@jsenv/core/src/internal/
|
|
11
|
-
import { evalSource } from "
|
|
12
|
-
import { escapeRegexpSpecialCharacters } from "
|
|
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 {
|
|
13
|
-
import { executeHtmlFile } from "./
|
|
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 =
|
|
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
|
|
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
|
|
5
|
+
export const fetchAndEval = async (url) => {
|
|
8
6
|
const response = await fetchUrl(url)
|
|
9
7
|
|
|
10
8
|
if (response.status >= 200 && response.status <= 299) {
|
|
File without changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ANSI, UNICODE } from "@jsenv/log"
|
|
2
2
|
|
|
3
|
-
import { getHtmlNodeLocation } from "@jsenv/core/src/internal/
|
|
4
|
-
|
|
5
|
-
import {
|
|
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
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)
|
|
71
|
-
})
|
|
72
|
-
|
|
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
|
-
|
|
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
|
-
${
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
)}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
22
|
+
buildFileTotalSize: buildFileSizeInfo.totalSize,
|
|
23
23
|
buildSourcemapFileSizes: sourcemapFileSizeInfo.fileSizes,
|
|
24
|
+
buildSourcemapFileTotalSize: sourcemapFileSizeInfo.totalSize,
|
|
24
25
|
buildDuration,
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -33,13 +33,9 @@ export const buildUsingRollup = async ({
|
|
|
33
33
|
|
|
34
34
|
format,
|
|
35
35
|
systemJsUrl,
|
|
36
|
-
globalName,
|
|
37
36
|
globals,
|
|
38
|
-
|
|
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 "
|
|
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}":
|
|
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
|
}
|
|
File without changes
|
|
@@ -9,11 +9,12 @@ import {
|
|
|
9
9
|
generateSourcemapUrl,
|
|
10
10
|
getCssSourceMappingUrl,
|
|
11
11
|
setCssSourceMappingUrl,
|
|
12
|
-
} from "@jsenv/core/src/internal/
|
|
12
|
+
} from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
13
|
+
|
|
13
14
|
import { getRessourceAsBase64Url } from "../ressource_builder_util.js"
|
|
14
|
-
import { parseCssUrls } from "./
|
|
15
|
-
import { replaceCssUrls } from "./
|
|
16
|
-
import { moveCssUrls } from "./
|
|
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 "./
|
|
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 ({
|
|
@@ -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
|
-
|
|
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
|
+
}
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
visitHtmlAst,
|
|
4
4
|
getHtmlNodeAttributeByName,
|
|
5
5
|
getHtmlNodeTextNode,
|
|
6
|
-
} from "@jsenv/core/src/internal/
|
|
6
|
+
} from "@jsenv/core/src/internal/compile_server/html/html_ast.js"
|
|
7
7
|
|
|
8
8
|
export const importMapsFromHtml = (htmlSource) => {
|
|
9
9
|
const importmaps = []
|