@jsenv/core 25.6.2 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser_client/asset-manifest.json +4 -0
- package/dist/{browser_runtime/browser_runtime_c81cd9af.js → browser_client/browser_client_fb33eaa4.js} +3863 -3843
- package/dist/browser_client/browser_client_fb33eaa4.js.map +1089 -0
- package/dist/build_manifest.js +5 -5
- 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_93ec4247.html → compile_proxy_62f952c4.html} +1 -3
- package/dist/redirector/asset-manifest.json +2 -2
- package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +349 -0
- package/dist/redirector/{redirector_ddc79416.html → redirector_8117ec92.html} +1 -3
- 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_d6045dd0.html → toolbar_b0c9100c.html} +2 -4
- package/dist/toolbar/{toolbar.main_7d7783d3.js.map → toolbar_main_f54c1bb0.js.map} +31 -31
- 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_c8c214dd.js → toolbar_injector_65b501eb.js} +4 -5
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +294 -0
- package/main.js +19 -14
- package/package.json +8 -8
- package/src/{launchBrowser.js → browser_runtimes.js} +3 -8
- package/src/{buildProject.js → build_project.js} +3 -3
- package/src/{commonJsToJavaScriptModule.js → commonjs_to_js_module.js} +5 -5
- package/src/dev_server.js +13 -6
- 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 +4 -3
- package/src/internal/building/build_url_generator.js +1 -1
- package/src/internal/building/{buildUsingRollup.js → build_using_rollup.js} +1 -1
- 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/{es_to_system.js → global_format/es_to_system.js} +0 -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/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 +22 -20
- 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} +4 -4
- package/src/internal/{compiling/startCompileServer.js → compile_server/compile_server.js} +11 -10
- package/src/internal/{compiling/createCompiledFileService.js → compile_server/compiled_file_service.js} +4 -4
- 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} +5 -4
- 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 +3 -3
- package/src/internal/{compiling → compile_server}/jsenv_directory/compile_profile.js +0 -0
- 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 +0 -0
- package/src/internal/{compiling/jsenv_directory/getOrGenerateCompiledFile.js → compile_server/jsenv_directory/reuse_or_create_compiled_file.js} +3 -3
- package/src/internal/{compiling/jsenv_directory/updateMeta.js → compile_server/jsenv_directory/update_compile_cache.js} +2 -2
- 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} +7 -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 +0 -0
- 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 +0 -0
- 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_c81cd9af.js.map +0 -1089
- package/dist/compile_proxy/compile_proxy.html__inline__20_c05fdc30.js.map +0 -343
- package/dist/redirector/redirector.html__inline__12_20421b23.js.map +0 -349
- package/dist/toolbar_injector/toolbar_injector_c8c214dd.js.map +0 -294
- package/src/internal/browser_runtime/evalSource.js +0 -11
- 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 -11
- 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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { readFile, urlToRelativeUrl } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
jsenvSystemJsFileInfo,
|
|
5
|
+
jsenvResolveImportUrlHelper,
|
|
6
|
+
} from "@jsenv/core/src/jsenv_file_urls.js"
|
|
3
7
|
import {
|
|
4
8
|
parseHtmlString,
|
|
5
9
|
findHtmlNode,
|
|
@@ -8,19 +12,15 @@ import {
|
|
|
8
12
|
getHtmlNodeTextNode,
|
|
9
13
|
manipulateHtmlAst,
|
|
10
14
|
findFirstImportMapNode,
|
|
11
|
-
} from "@jsenv/core/src/internal/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { parseCssRessource } from "./css/parseCssRessource.js"
|
|
21
|
-
import { parseJsRessource } from "./js/parseJsRessource.js"
|
|
22
|
-
import { parseJsonRessource } from "./json/parseJsonRessource.js"
|
|
23
|
-
import { parseWebmanifestRessource } from "./webmanifest/parseWebmanifestRessource.js"
|
|
15
|
+
} from "@jsenv/core/src/internal/compile_server/html/html_ast.js"
|
|
16
|
+
|
|
17
|
+
import { parseHtmlRessource } from "./html/jsenv_parse_html.js"
|
|
18
|
+
import { parseImportmapRessource } from "./importmap/jsenv_parse_importmap.js"
|
|
19
|
+
import { parseSvgRessource } from "./svg/jsenv_parse_svg.js"
|
|
20
|
+
import { parseCssRessource } from "./css/jsenv_parse_css.js"
|
|
21
|
+
import { parseJsRessource } from "./js/jsenv_parse_js.js"
|
|
22
|
+
import { parseJsonRessource } from "./json/jsenv_parse_json.js"
|
|
23
|
+
import { parseWebmanifestRessource } from "./webmanifest/jsenv_parse_webmanifest.js"
|
|
24
24
|
|
|
25
25
|
export const parseRessource = async (
|
|
26
26
|
ressource,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { resolveUrl, urlToRelativeUrl } from "@jsenv/filesystem"
|
|
2
2
|
import { createLogger, loggerToLevels } from "@jsenv/logger"
|
|
3
3
|
|
|
4
|
-
import { setJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/
|
|
4
|
+
import { setJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
5
|
+
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
5
6
|
|
|
6
7
|
import { racePromises } from "../promise_race.js"
|
|
7
|
-
|
|
8
|
+
|
|
8
9
|
import {
|
|
9
10
|
getRessourceAsBase64Url,
|
|
10
11
|
memoize,
|
|
@@ -276,7 +277,7 @@ export const createRessourceBuilder = (
|
|
|
276
277
|
if (ressourceUrl.startsWith("data:")) {
|
|
277
278
|
isExternal = false
|
|
278
279
|
isInline = true
|
|
279
|
-
const { mediaType, base64Flag, data } =
|
|
280
|
+
const { mediaType, base64Flag, data } = DataUrl.parse(ressourceUrl)
|
|
280
281
|
contentTypeExpected = mediaType
|
|
281
282
|
contentType = mediaType
|
|
282
283
|
bufferBeforeBuild = base64Flag
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isFileSystemPath, fileSystemPathToUrl } from "@jsenv/filesystem"
|
|
2
2
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
5
5
|
|
|
6
6
|
export const getRessourceAsBase64Url = ({ bufferAfterBuild, contentType }) => {
|
|
7
|
-
return
|
|
7
|
+
return DataUrl.stringify({
|
|
8
8
|
data: bufferAfterBuild,
|
|
9
9
|
base64Flag: true,
|
|
10
10
|
mediaType: contentType,
|
|
@@ -19,23 +19,24 @@ import {
|
|
|
19
19
|
} from "@jsenv/filesystem"
|
|
20
20
|
import { UNICODE } from "@jsenv/log"
|
|
21
21
|
|
|
22
|
+
import { jsenvHelpersDirectoryInfo } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
22
23
|
import { require } from "@jsenv/core/src/internal/require.js"
|
|
23
|
-
import {
|
|
24
|
-
import { convertCssTextToJavascriptModule } from "@jsenv/core/src/internal/building/css_module.js"
|
|
25
|
-
import { transformJs } from "@jsenv/core/src/internal/compiling/js-compilation-service/transformJs.js"
|
|
24
|
+
import { transformJs } from "@jsenv/core/src/internal/compile_server/js/js_transformer.js"
|
|
26
25
|
import { createUrlConverter } from "@jsenv/core/src/internal/url_conversion.js"
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { sortObjectByPathnames } from "@jsenv/core/src/internal/building/sortObjectByPathnames.js"
|
|
31
|
-
import { jsenvHelpersDirectoryInfo } from "@jsenv/core/src/internal/jsenvInternalFiles.js"
|
|
32
|
-
import { createImportResolverForNode } from "@jsenv/core/src/internal/import-resolution/import-resolver-node.js"
|
|
33
|
-
import { createImportResolverForImportmap } from "@jsenv/core/src/internal/import-resolution/import-resolver-importmap.js"
|
|
34
|
-
import { getDefaultImportmap } from "@jsenv/core/src/internal/import-resolution/importmap_default.js"
|
|
26
|
+
import { createImportResolverForNode } from "@jsenv/core/src/internal/import_resolution/import_resolver_node.js"
|
|
27
|
+
import { createImportResolverForImportmap } from "@jsenv/core/src/internal/import_resolution/import_resolver_importmap.js"
|
|
28
|
+
import { getDefaultImportmap } from "@jsenv/core/src/internal/import_resolution/importmap_default.js"
|
|
35
29
|
import { createJsenvRemoteDirectory } from "@jsenv/core/src/internal/jsenv_remote_directory.js"
|
|
36
30
|
import { setUrlSearchParamsDescriptor } from "@jsenv/core/src/internal/url_utils.js"
|
|
37
|
-
import { shakeBabelPluginMap } from "@jsenv/core/src/internal/
|
|
38
|
-
|
|
31
|
+
import { shakeBabelPluginMap } from "@jsenv/core/src/internal/compile_server/jsenv_directory/compile_profile.js"
|
|
32
|
+
|
|
33
|
+
import { convertJsonTextToJavascriptModule } from "./import_assertions/json_module.js"
|
|
34
|
+
import { convertCssTextToJavascriptModule } from "./import_assertions/css_module.js"
|
|
35
|
+
import { importMapsFromHtml } from "./html/html_scan.js"
|
|
36
|
+
import { esToSystem } from "./global_format/es_to_system.js"
|
|
37
|
+
import { createUrlFetcher } from "./url_fetcher.js"
|
|
38
|
+
import { createUrlLoader } from "./url_loader.js"
|
|
39
|
+
import { stringifyUrlTrace } from "./url_trace.js"
|
|
39
40
|
import {
|
|
40
41
|
formatBuildStartLog,
|
|
41
42
|
formatUseImportMapFromHtml,
|
|
@@ -43,15 +44,14 @@ import {
|
|
|
43
44
|
formatRessourceHintNeverUsedWarning,
|
|
44
45
|
formatBuildDoneInfo,
|
|
45
46
|
} from "./build_logs.js"
|
|
46
|
-
import {
|
|
47
|
-
import { parseRessource } from "./parseRessource.js"
|
|
47
|
+
import { parseRessource } from "./parse_ressource.js"
|
|
48
48
|
import {
|
|
49
49
|
createRessourceBuilder,
|
|
50
50
|
referenceToCodeForRollup,
|
|
51
51
|
} from "./ressource_builder.js"
|
|
52
52
|
import { createBuildUrlGenerator } from "./build_url_generator.js"
|
|
53
53
|
import { visitImportReferences } from "./import_references.js"
|
|
54
|
-
import {
|
|
54
|
+
import { sortObjectByPathnames } from "./sort_pathnames.js"
|
|
55
55
|
import { createBuildStats } from "./build_stats.js"
|
|
56
56
|
|
|
57
57
|
export const createRollupPlugins = async ({
|
|
@@ -360,7 +360,9 @@ export const createRollupPlugins = async ({
|
|
|
360
360
|
return null
|
|
361
361
|
}
|
|
362
362
|
const magicString = new MagicString(code)
|
|
363
|
-
magicString.prepend(
|
|
363
|
+
magicString.prepend(
|
|
364
|
+
`import "@jsenv/core/src/internal/runtime_client/s.js";`,
|
|
365
|
+
)
|
|
364
366
|
code = magicString.toString()
|
|
365
367
|
map = magicString.generateMap({ hires: true })
|
|
366
368
|
return { code, map }
|
|
@@ -423,11 +425,11 @@ export const createRollupPlugins = async ({
|
|
|
423
425
|
if (minify) {
|
|
424
426
|
const methodHooks = {
|
|
425
427
|
minifyJs: async (...args) => {
|
|
426
|
-
const { minifyJs } = await import("./js/
|
|
428
|
+
const { minifyJs } = await import("./js/minify_js.js")
|
|
427
429
|
return minifyJs(...args)
|
|
428
430
|
},
|
|
429
431
|
minifyHtml: async (...args) => {
|
|
430
|
-
const { minifyHtml } = await import("./html/
|
|
432
|
+
const { minifyHtml } = await import("./html/minify_html.js")
|
|
431
433
|
return minifyHtml(...args)
|
|
432
434
|
},
|
|
433
435
|
}
|
|
@@ -1484,7 +1486,7 @@ export const createRollupPlugins = async ({
|
|
|
1484
1486
|
) {
|
|
1485
1487
|
const magicString = new MagicString(code)
|
|
1486
1488
|
const systemjsCode = await readFile(
|
|
1487
|
-
new URL("../
|
|
1489
|
+
new URL("../runtime_client/s.js", import.meta.url),
|
|
1488
1490
|
)
|
|
1489
1491
|
magicString.prepend(systemjsCode)
|
|
1490
1492
|
code = magicString.toString()
|
|
File without changes
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { resolveUrl } from "@jsenv/filesystem"
|
|
2
2
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
parseDataUrl,
|
|
7
|
-
} from "@jsenv/core/src/internal/dataUrl.utils.js"
|
|
8
|
-
import { fetchUrl } from "@jsenv/core/src/internal/fetchUrl.js"
|
|
4
|
+
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
5
|
+
import { fetchUrl } from "@jsenv/core/src/internal/fetching.js"
|
|
9
6
|
import { validateResponse } from "@jsenv/core/src/internal/response_validation.js"
|
|
10
7
|
|
|
11
8
|
export const loadSourcemap = async ({
|
|
@@ -23,7 +20,7 @@ export const loadSourcemap = async ({
|
|
|
23
20
|
|
|
24
21
|
const sourcemapUrl = resolveUrl(sourcemapSpecifier, url)
|
|
25
22
|
if (sourcemapUrl.startsWith("data:")) {
|
|
26
|
-
const sourcemapString =
|
|
23
|
+
const sourcemapString = DataUrl.parse(sourcemapUrl, { as: "string" })
|
|
27
24
|
return parseSourcemapString(
|
|
28
25
|
sourcemapString,
|
|
29
26
|
sourcemapUrl,
|
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
getHtmlNodeAttributeByName,
|
|
5
5
|
stringifyHtmlAst,
|
|
6
6
|
getHtmlNodeLocation,
|
|
7
|
-
} from "@jsenv/core/src/internal/
|
|
8
|
-
|
|
7
|
+
} from "@jsenv/core/src/internal/compile_server/html/html_ast.js"
|
|
8
|
+
|
|
9
9
|
import { getRessourceAsBase64Url } from "../ressource_builder_util.js"
|
|
10
|
-
import {
|
|
10
|
+
import { collectNodesMutations } from "../html/html_node_mutations.js"
|
|
11
|
+
import { minifyHtml } from "../html/minify_html.js"
|
|
11
12
|
|
|
12
13
|
export const parseSvgRessource = async (
|
|
13
14
|
svgRessource,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
2
2
|
import { urlToExtension, urlToRelativeUrl } from "@jsenv/filesystem"
|
|
3
3
|
|
|
4
|
-
import { fetchUrl as jsenvFetchUrl } from "@jsenv/core/src/internal/
|
|
4
|
+
import { fetchUrl as jsenvFetchUrl } from "@jsenv/core/src/internal/fetching.js"
|
|
5
5
|
import { validateResponse } from "@jsenv/core/src/internal/response_validation.js"
|
|
6
6
|
|
|
7
7
|
export const createUrlFetcher = ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourceMappingURLUtils.js"
|
|
1
|
+
import { getJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { convertJsonTextToJavascriptModule } from "./import_assertions/json_module.js"
|
|
4
|
+
import { loadSourcemap } from "./sourcemap/sourcemap_loader.js"
|
|
5
5
|
|
|
6
6
|
export const createUrlLoader = ({
|
|
7
7
|
urlCustomLoaders,
|
|
File without changes
|
|
File without changes
|
package/src/internal/{compiling → compile_server/commonjs}/rollup_plugin_commonjs_named_exports.js
RENAMED
|
File without changes
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from "@jsenv/filesystem"
|
|
8
8
|
import { convertFileSystemErrorToResponseProperties } from "@jsenv/server/src/internal/convertFileSystemErrorToResponseProperties.js"
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { reuseOrCreateCompiledFile } from "./jsenv_directory/reuse_or_create_compiled_file.js"
|
|
11
|
+
import { updateCompileCache } from "./jsenv_directory/update_compile_cache.js"
|
|
12
12
|
|
|
13
13
|
export const compileFile = async ({
|
|
14
14
|
logger,
|
|
@@ -47,7 +47,7 @@ export const compileFile = async ({
|
|
|
47
47
|
|
|
48
48
|
try {
|
|
49
49
|
const { meta, compileResult, compileResultStatus, timing } =
|
|
50
|
-
await
|
|
50
|
+
await reuseOrCreateCompiledFile({
|
|
51
51
|
logger,
|
|
52
52
|
projectDirectoryUrl,
|
|
53
53
|
originalFileUrl,
|
|
@@ -101,7 +101,7 @@ export const compileFile = async ({
|
|
|
101
101
|
if (compileResultStatus !== "cached" && compileCacheStrategy !== "none") {
|
|
102
102
|
// we MUST await updateMeta otherwise we might get 404
|
|
103
103
|
// when serving sourcemap files
|
|
104
|
-
await
|
|
104
|
+
await updateCompileCache({
|
|
105
105
|
logger,
|
|
106
106
|
meta,
|
|
107
107
|
compileResult,
|
|
@@ -17,24 +17,25 @@ import { createLogger, createDetailedMessage } from "@jsenv/logger"
|
|
|
17
17
|
import { createCallbackListNotifiedOnce } from "@jsenv/abort"
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
|
+
jsenvDistDirectoryUrl,
|
|
20
21
|
sourcemapMainFileInfo,
|
|
21
22
|
sourcemapMappingFileInfo,
|
|
22
|
-
} from "@jsenv/core/src/
|
|
23
|
+
} from "@jsenv/core/src/jsenv_file_urls.js"
|
|
23
24
|
import { createJsenvRemoteDirectory } from "../jsenv_remote_directory.js"
|
|
24
|
-
|
|
25
|
-
import { jsenvDistDirectoryUrl } from "../jsenvCoreDirectoryUrl.js"
|
|
25
|
+
|
|
26
26
|
import { createCompileContext } from "./jsenv_directory/compile_context.js"
|
|
27
27
|
import { createCompileProfile } from "./jsenv_directory/compile_profile.js"
|
|
28
28
|
import { setupJsenvDirectory } from "./jsenv_directory/jsenv_directory.js"
|
|
29
29
|
import { urlIsCompilationAsset } from "./jsenv_directory/compile_asset.js"
|
|
30
30
|
import { createSSEService } from "./sse_service/sse_service.js"
|
|
31
|
-
import { loadBabelPluginMapFromFile } from "./load_babel_plugin_map_from_file.js"
|
|
32
|
-
import { extractSyntaxBabelPluginMap } from "./babel_plugins.js"
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
31
|
+
import { loadBabelPluginMapFromFile } from "./js/load_babel_plugin_map_from_file.js"
|
|
32
|
+
import { extractSyntaxBabelPluginMap } from "./js/babel_plugins.js"
|
|
33
|
+
import { babelPluginReplaceExpressions } from "./js/babel_plugin_replace_expressions.js"
|
|
34
|
+
import { babelPluginGlobalThisAsJsenvImport } from "./js/babel_plugin_global_this_as_jsenv_import.js"
|
|
35
|
+
import { babelPluginNewStylesheetAsJsenvImport } from "./js/babel_plugin_new_stylesheet_as_jsenv_import.js"
|
|
36
|
+
import { babelPluginImportAssertions } from "./js/babel_plugin_import_assertions.js"
|
|
37
|
+
import { createCompiledFileService } from "./compiled_file_service.js"
|
|
38
|
+
import { createTransformHtmlSourceFileService } from "./html/html_source_file_service.js"
|
|
38
39
|
|
|
39
40
|
let compileServerId = 0
|
|
40
41
|
|
|
@@ -12,10 +12,10 @@ import { serverUrlToCompileInfo } from "@jsenv/core/src/internal/url_conversion.
|
|
|
12
12
|
import { setUrlExtension } from "../url_utils.js"
|
|
13
13
|
|
|
14
14
|
import { shakeBabelPluginMap } from "./jsenv_directory/compile_profile.js"
|
|
15
|
-
import { compileFile } from "./
|
|
16
|
-
import { compileHtml } from "./
|
|
17
|
-
import { compileImportmap } from "./
|
|
18
|
-
import { compileJavascript } from "./
|
|
15
|
+
import { compileFile } from "./compile_file.js"
|
|
16
|
+
import { compileHtml } from "./html/jsenv_compile_html.js"
|
|
17
|
+
import { compileImportmap } from "./importmap/jsenv_compile_importmap.js"
|
|
18
|
+
import { compileJavascript } from "./js/jsenv_compile_js.js"
|
|
19
19
|
|
|
20
20
|
const jsenvCompilers = {
|
|
21
21
|
"**/*.js": compileJavascript,
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { createHash } from "node:crypto"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
All script type="module" will be converted to inline script.
|
|
6
|
-
These inline script execution order is non predictible it depends
|
|
7
|
-
which one is being done first
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { createHash } from "crypto"
|
|
12
|
-
|
|
13
|
-
import { require } from "../require.js"
|
|
3
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
14
4
|
|
|
15
5
|
// https://github.com/inikulin/parse5/blob/master/packages/parse5/lib/tree-adapters/default.js
|
|
16
6
|
// eslint-disable-next-line import/no-unresolved
|
|
@@ -22,13 +22,14 @@ import { composeTwoImportMaps, moveImportMap } from "@jsenv/importmap"
|
|
|
22
22
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
|
-
|
|
25
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
26
26
|
EVENT_SOURCE_CLIENT_BUILD_URL,
|
|
27
27
|
TOOLBAR_INJECTOR_BUILD_URL,
|
|
28
28
|
} from "@jsenv/core/dist/build_manifest.js"
|
|
29
|
-
import { fetchUrl } from "@jsenv/core/src/internal/
|
|
30
|
-
import {
|
|
31
|
-
import { getDefaultImportmap } from "@jsenv/core/src/internal/
|
|
29
|
+
import { fetchUrl } from "@jsenv/core/src/internal/fetching.js"
|
|
30
|
+
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
31
|
+
import { getDefaultImportmap } from "@jsenv/core/src/internal/import_resolution/importmap_default.js"
|
|
32
|
+
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
32
33
|
|
|
33
34
|
import {
|
|
34
35
|
parseHtmlString,
|
|
@@ -42,8 +43,7 @@ import {
|
|
|
42
43
|
getHtmlNodeTextNode,
|
|
43
44
|
setHtmlNodeText,
|
|
44
45
|
getIdForInlineHtmlNode,
|
|
45
|
-
} from "./
|
|
46
|
-
import { jsenvCoreDirectoryUrl } from "../jsenvCoreDirectoryUrl.js"
|
|
46
|
+
} from "./html_ast.js"
|
|
47
47
|
|
|
48
48
|
const jsenvDistDirectoryUrl = new URL("./dist/", jsenvCoreDirectoryUrl).href
|
|
49
49
|
|
|
@@ -165,8 +165,8 @@ const transformHTMLSourceFile = async ({
|
|
|
165
165
|
projectDirectoryUrl,
|
|
166
166
|
})
|
|
167
167
|
|
|
168
|
-
const
|
|
169
|
-
|
|
168
|
+
const browserClientBuildUrlRelativeToProject = urlToRelativeUrl(
|
|
169
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
170
170
|
projectDirectoryUrl,
|
|
171
171
|
)
|
|
172
172
|
|
|
@@ -185,7 +185,7 @@ const transformHTMLSourceFile = async ({
|
|
|
185
185
|
...(jsenvScriptInjection
|
|
186
186
|
? [
|
|
187
187
|
{
|
|
188
|
-
src: `/${
|
|
188
|
+
src: `/${browserClientBuildUrlRelativeToProject}`,
|
|
189
189
|
},
|
|
190
190
|
]
|
|
191
191
|
: []),
|
|
@@ -413,7 +413,7 @@ const forceInlineRessources = async ({
|
|
|
413
413
|
specifier: src,
|
|
414
414
|
mutateHtml: async (response) => {
|
|
415
415
|
const responseArrayBuffer = await response.arrayBuffer()
|
|
416
|
-
const responseAsBase64 =
|
|
416
|
+
const responseAsBase64 = DataUrl.stringify({
|
|
417
417
|
data: responseArrayBuffer,
|
|
418
418
|
base64Flag: true,
|
|
419
419
|
mediaType: response.headers["content-type"],
|
package/src/internal/{compiling/jsenvCompilerForHtml.js → compile_server/html/jsenv_compile_html.js}
RENAMED
|
@@ -7,21 +7,22 @@ import {
|
|
|
7
7
|
import { moveImportMap, composeTwoImportMaps } from "@jsenv/importmap"
|
|
8
8
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
9
9
|
|
|
10
|
-
import { jsenvDistDirectoryUrl } from "@jsenv/core/src/
|
|
10
|
+
import { jsenvDistDirectoryUrl } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
11
11
|
import {
|
|
12
|
-
|
|
12
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
13
13
|
EVENT_SOURCE_CLIENT_BUILD_URL,
|
|
14
14
|
TOOLBAR_INJECTOR_BUILD_URL,
|
|
15
15
|
} from "@jsenv/core/dist/build_manifest.js"
|
|
16
|
-
import { fetchUrl } from "@jsenv/core/src/internal/
|
|
17
|
-
import { getDefaultImportmap } from "@jsenv/core/src/internal/
|
|
18
|
-
|
|
16
|
+
import { fetchUrl } from "@jsenv/core/src/internal/fetching.js"
|
|
17
|
+
import { getDefaultImportmap } from "@jsenv/core/src/internal/import_resolution/importmap_default.js"
|
|
18
|
+
import { generateCompilationAssetUrl } from "@jsenv/core/src/internal/compile_server/jsenv_directory/compile_asset.js"
|
|
19
19
|
import {
|
|
20
20
|
generateSourcemapUrl,
|
|
21
21
|
setJavaScriptSourceMappingUrl,
|
|
22
22
|
sourcemapToBase64Url,
|
|
23
|
-
} from "
|
|
24
|
-
|
|
23
|
+
} from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
24
|
+
|
|
25
|
+
import { transformJs } from "../js/js_transformer.js"
|
|
25
26
|
import {
|
|
26
27
|
parseHtmlString,
|
|
27
28
|
parseHtmlAstRessources,
|
|
@@ -35,8 +36,7 @@ import {
|
|
|
35
36
|
setHtmlNodeText,
|
|
36
37
|
visitHtmlAst,
|
|
37
38
|
addHtmlNodeAttribute,
|
|
38
|
-
} from "./
|
|
39
|
-
import { generateCompilationAssetUrl } from "./jsenv_directory/compile_asset.js"
|
|
39
|
+
} from "./html_ast.js"
|
|
40
40
|
|
|
41
41
|
export const compileHtml = async ({
|
|
42
42
|
// cancellationToken,
|
|
@@ -61,8 +61,8 @@ export const compileHtml = async ({
|
|
|
61
61
|
code,
|
|
62
62
|
}) => {
|
|
63
63
|
const compileDirectoryUrl = `${projectDirectoryUrl}${jsenvDirectoryRelativeUrl}${compileId}/`
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const browserClientBuildUrlRelativeToProject = urlToRelativeUrl(
|
|
65
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
66
66
|
projectDirectoryUrl,
|
|
67
67
|
)
|
|
68
68
|
const eventSourceClientBuildRelativeUrlForProject = urlToRelativeUrl(
|
|
@@ -81,7 +81,7 @@ export const compileHtml = async ({
|
|
|
81
81
|
...(jsenvScriptInjection
|
|
82
82
|
? [
|
|
83
83
|
{
|
|
84
|
-
src: `/${
|
|
84
|
+
src: `/${browserClientBuildUrlRelativeToProject}`,
|
|
85
85
|
},
|
|
86
86
|
]
|
|
87
87
|
: []),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { composeTwoImportMaps } from "@jsenv/importmap"
|
|
2
2
|
|
|
3
|
-
import { getDefaultImportmap } from "@jsenv/core/src/internal/
|
|
3
|
+
import { getDefaultImportmap } from "@jsenv/core/src/internal/import_resolution/importmap_default.js"
|
|
4
4
|
|
|
5
5
|
export const compileImportmap = async ({
|
|
6
6
|
code,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-core/src/tools/build-external-helpers.js
|
|
2
2
|
// the list of possible helpers:
|
|
3
3
|
// https://github.com/babel/babel/blob/99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224/packages/babel-helpers/src/helpers.js#L13
|
|
4
|
-
import { require } from "
|
|
4
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
5
5
|
|
|
6
6
|
const babelHelperNameInsideJsenvCoreArray = [
|
|
7
7
|
"applyDecoratedDescriptor",
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { urlToRelativeUrl } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
3
|
import { setUrlSearchParamsDescriptor } from "@jsenv/core/src/internal/url_utils.js"
|
|
4
|
+
|
|
4
5
|
import { babelPluginImportVisitor } from "./babel_plugin_import_visitor.js"
|
|
5
6
|
|
|
6
7
|
export const babelPluginImportAssertions = (
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "@jsenv/filesystem"
|
|
6
6
|
|
|
7
7
|
import { require } from "@jsenv/core/src/internal/require.js"
|
|
8
|
-
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/
|
|
8
|
+
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
9
9
|
|
|
10
10
|
const regeneratorRuntimeHelperDirectoryUrl = resolveUrl(
|
|
11
11
|
"./helpers/regenerator-runtime/",
|
|
File without changes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs"
|
|
2
2
|
|
|
3
|
-
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/
|
|
3
|
+
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
4
4
|
|
|
5
5
|
export const babelPluginSystemJsPrepend = (api) => {
|
|
6
6
|
api.assertVersion(7)
|
|
7
7
|
const systemJsUrl = new URL(
|
|
8
|
-
"src/internal/
|
|
8
|
+
"src/internal/runtime_client/s.js",
|
|
9
9
|
jsenvCoreDirectoryUrl,
|
|
10
10
|
)
|
|
11
11
|
return {
|
|
File without changes
|
|
File without changes
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { urlToRelativeUrl, urlToFileSystemPath } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
3
|
import { require } from "@jsenv/core/src/internal/require.js"
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ansiToHTML } from "./ansi_to_html.js"
|
|
5
|
+
import { createParseError } from "./babel_parse_error.js"
|
|
6
6
|
import {
|
|
7
7
|
getMinimalBabelPluginMap,
|
|
8
8
|
babelPluginsFromBabelPluginMap,
|
|
9
|
-
} from "
|
|
10
|
-
import {
|
|
11
|
-
import { babelPluginImportMetadata } from "@jsenv/core/src/internal/compiling/babel_plugin_import_metadata.js"
|
|
12
|
-
|
|
13
|
-
import { ansiToHTML } from "./ansiToHTML.js"
|
|
14
|
-
import { babelPluginRegeneratorRuntimeAsJsenvImport } from "./babel_plugin_regenerator_runtime_as_jsenv_import.js"
|
|
9
|
+
} from "./babel_plugins.js"
|
|
10
|
+
import { babelHelperNameFromUrl } from "./babelHelper.js"
|
|
15
11
|
import { babelPluginBabelHelpersAsJsenvImports } from "./babel_plugin_babel_helpers_as_jsenv_imports.js"
|
|
12
|
+
import { babelPluginRegeneratorRuntimeAsJsenvImport } from "./babel_plugin_regenerator_runtime_as_jsenv_import.js"
|
|
13
|
+
import { babelPluginTransformImportMeta } from "./babel_plugin_transform_import_meta.js"
|
|
14
|
+
import { babelPluginImportMetadata } from "./babel_plugin_import_metadata.js"
|
|
15
|
+
import { babelPluginProxyExternalImports } from "./babel_plugin_proxy_external_imports.js"
|
|
16
16
|
import { babelPluginSystemJsPrepend } from "./babel_plugin_systemjs_prepend.js"
|
|
17
|
-
import { babelHelperNameFromUrl } from "./babelHelper.js"
|
|
18
17
|
|
|
19
18
|
export const transformJs = async ({
|
|
20
19
|
projectDirectoryUrl,
|