@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
|
@@ -7,13 +7,14 @@ 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,
|
|
15
15
|
|
|
16
16
|
projectDirectoryUrl,
|
|
17
|
+
jsenvDirectory,
|
|
17
18
|
jsenvRemoteDirectory,
|
|
18
19
|
originalFileUrl,
|
|
19
20
|
compiledFileUrl,
|
|
@@ -47,7 +48,7 @@ export const compileFile = async ({
|
|
|
47
48
|
|
|
48
49
|
try {
|
|
49
50
|
const { meta, compileResult, compileResultStatus, timing } =
|
|
50
|
-
await
|
|
51
|
+
await reuseOrCreateCompiledFile({
|
|
51
52
|
logger,
|
|
52
53
|
projectDirectoryUrl,
|
|
53
54
|
originalFileUrl,
|
|
@@ -101,8 +102,9 @@ export const compileFile = async ({
|
|
|
101
102
|
if (compileResultStatus !== "cached" && compileCacheStrategy !== "none") {
|
|
102
103
|
// we MUST await updateMeta otherwise we might get 404
|
|
103
104
|
// when serving sourcemap files
|
|
104
|
-
await
|
|
105
|
+
await updateCompileCache({
|
|
105
106
|
logger,
|
|
107
|
+
jsenvDirectory,
|
|
106
108
|
meta,
|
|
107
109
|
compileResult,
|
|
108
110
|
compileResultStatus,
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
readRequestBody,
|
|
10
10
|
} from "@jsenv/server"
|
|
11
11
|
import {
|
|
12
|
-
resolveUrl,
|
|
13
12
|
urlToRelativeUrl,
|
|
14
13
|
resolveDirectoryUrl,
|
|
15
14
|
urlIsInsideOf,
|
|
@@ -18,24 +17,25 @@ import { createLogger, createDetailedMessage } from "@jsenv/logger"
|
|
|
18
17
|
import { createCallbackListNotifiedOnce } from "@jsenv/abort"
|
|
19
18
|
|
|
20
19
|
import {
|
|
20
|
+
jsenvDistDirectoryUrl,
|
|
21
21
|
sourcemapMainFileInfo,
|
|
22
22
|
sourcemapMappingFileInfo,
|
|
23
|
-
} from "@jsenv/core/src/
|
|
23
|
+
} from "@jsenv/core/src/jsenv_file_urls.js"
|
|
24
24
|
import { createJsenvRemoteDirectory } from "../jsenv_remote_directory.js"
|
|
25
|
-
|
|
26
|
-
import { jsenvDistDirectoryUrl } from "../jsenvCoreDirectoryUrl.js"
|
|
25
|
+
|
|
27
26
|
import { createCompileContext } from "./jsenv_directory/compile_context.js"
|
|
28
27
|
import { createCompileProfile } from "./jsenv_directory/compile_profile.js"
|
|
29
28
|
import { setupJsenvDirectory } from "./jsenv_directory/jsenv_directory.js"
|
|
30
29
|
import { urlIsCompilationAsset } from "./jsenv_directory/compile_asset.js"
|
|
31
30
|
import { createSSEService } from "./sse_service/sse_service.js"
|
|
32
|
-
import { loadBabelPluginMapFromFile } from "./load_babel_plugin_map_from_file.js"
|
|
33
|
-
import { extractSyntaxBabelPluginMap } from "./babel_plugins.js"
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
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"
|
|
39
39
|
|
|
40
40
|
let compileServerId = 0
|
|
41
41
|
|
|
@@ -79,8 +79,6 @@ export const startCompileServer = async ({
|
|
|
79
79
|
babelConfigFileUrl,
|
|
80
80
|
customCompilers = {},
|
|
81
81
|
preservedUrls,
|
|
82
|
-
workers = [],
|
|
83
|
-
serviceWorkers = [],
|
|
84
82
|
importMapInWebWorkers = false,
|
|
85
83
|
prependSystemJs,
|
|
86
84
|
|
|
@@ -127,12 +125,6 @@ export const startCompileServer = async ({
|
|
|
127
125
|
*/
|
|
128
126
|
...preservedUrls,
|
|
129
127
|
}
|
|
130
|
-
const workerUrls = workers.map((worker) =>
|
|
131
|
-
resolveUrl(worker, projectDirectoryUrl),
|
|
132
|
-
)
|
|
133
|
-
const serviceWorkerUrls = serviceWorkers.map((serviceWorker) =>
|
|
134
|
-
resolveUrl(serviceWorker, projectDirectoryUrl),
|
|
135
|
-
)
|
|
136
128
|
const babelPluginMapFromFile = await loadBabelPluginMapFromFile({
|
|
137
129
|
projectDirectoryUrl,
|
|
138
130
|
babelConfigFileUrl,
|
|
@@ -209,8 +201,6 @@ export const startCompileServer = async ({
|
|
|
209
201
|
})
|
|
210
202
|
const compileContext = await createCompileContext({
|
|
211
203
|
preservedUrls,
|
|
212
|
-
workers,
|
|
213
|
-
serviceWorkers,
|
|
214
204
|
replaceProcessEnvNodeEnv,
|
|
215
205
|
inlineImportMapIntoHTML,
|
|
216
206
|
})
|
|
@@ -252,7 +242,6 @@ export const startCompileServer = async ({
|
|
|
252
242
|
customCompilers,
|
|
253
243
|
babelPluginMapWithoutSyntax,
|
|
254
244
|
preservedUrls,
|
|
255
|
-
workerUrls,
|
|
256
245
|
importMapInWebWorkers,
|
|
257
246
|
moduleOutFormat,
|
|
258
247
|
sourcemapMethod,
|
|
@@ -343,8 +332,6 @@ export const startCompileServer = async ({
|
|
|
343
332
|
topLevelAwait,
|
|
344
333
|
babelPluginMap,
|
|
345
334
|
customCompilers,
|
|
346
|
-
workerUrls,
|
|
347
|
-
serviceWorkerUrls,
|
|
348
335
|
prependSystemJs,
|
|
349
336
|
jsenvEventSourceClientInjection,
|
|
350
337
|
jsenvToolbarInjection,
|
|
@@ -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,
|
|
@@ -41,8 +41,6 @@ export const createCompiledFileService = ({
|
|
|
41
41
|
topLevelAwait,
|
|
42
42
|
prependSystemJs,
|
|
43
43
|
customCompilers,
|
|
44
|
-
workerUrls,
|
|
45
|
-
serviceWorkerUrls,
|
|
46
44
|
|
|
47
45
|
jsenvEventSourceClientInjection,
|
|
48
46
|
jsenvToolbarInjection,
|
|
@@ -140,6 +138,7 @@ export const createCompiledFileService = ({
|
|
|
140
138
|
logger,
|
|
141
139
|
|
|
142
140
|
projectDirectoryUrl,
|
|
141
|
+
jsenvDirectory,
|
|
143
142
|
jsenvRemoteDirectory,
|
|
144
143
|
originalFileUrl,
|
|
145
144
|
compiledFileUrl,
|
|
@@ -167,8 +166,6 @@ export const createCompiledFileService = ({
|
|
|
167
166
|
babelPluginMap,
|
|
168
167
|
compileProfile,
|
|
169
168
|
}),
|
|
170
|
-
workerUrls,
|
|
171
|
-
serviceWorkerUrls,
|
|
172
169
|
topLevelAwait,
|
|
173
170
|
prependSystemJs,
|
|
174
171
|
|
|
@@ -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,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { generateSourcemapUrl } from "@jsenv/core/src/internal/
|
|
1
|
+
import { generateSourcemapUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { asCompilationResult } from "@jsenv/core/src/internal/compile_server/jsenv_directory/compilation_result.js"
|
|
4
|
+
|
|
5
|
+
import { transformJs } from "./js_transformer.js"
|
|
5
6
|
|
|
6
7
|
export const compileJavascript = async ({
|
|
7
8
|
projectDirectoryUrl,
|
|
@@ -11,8 +12,6 @@ export const compileJavascript = async ({
|
|
|
11
12
|
|
|
12
13
|
compileProfile,
|
|
13
14
|
babelPluginMap,
|
|
14
|
-
workerUrls,
|
|
15
|
-
serviceWorkerUrls,
|
|
16
15
|
topLevelAwait,
|
|
17
16
|
prependSystemJs,
|
|
18
17
|
|
|
@@ -22,8 +21,9 @@ export const compileJavascript = async ({
|
|
|
22
21
|
sourcemapMethod,
|
|
23
22
|
}) => {
|
|
24
23
|
if (prependSystemJs === undefined) {
|
|
24
|
+
const { searchParams } = new URL(url)
|
|
25
25
|
prependSystemJs =
|
|
26
|
-
|
|
26
|
+
searchParams.has("worker") || searchParams.has("service_worker")
|
|
27
27
|
}
|
|
28
28
|
const transformResult = await transformJs({
|
|
29
29
|
projectDirectoryUrl,
|
|
@@ -39,7 +39,7 @@ export const compileJavascript = async ({
|
|
|
39
39
|
code,
|
|
40
40
|
map,
|
|
41
41
|
})
|
|
42
|
-
return
|
|
42
|
+
return asCompilationResult(
|
|
43
43
|
{
|
|
44
44
|
contentType: "application/javascript",
|
|
45
45
|
metadata: transformResult.metadata,
|
|
File without changes
|
|
File without changes
|
|
@@ -10,18 +10,19 @@ import {
|
|
|
10
10
|
replaceBackSlashesWithSlashes,
|
|
11
11
|
startsWithWindowsDriveLetter,
|
|
12
12
|
windowsFilePathToUrl,
|
|
13
|
-
} from "
|
|
13
|
+
} from "@jsenv/core/src/internal/windows_file_path_utils.js"
|
|
14
14
|
import {
|
|
15
15
|
setJavaScriptSourceMappingUrl,
|
|
16
16
|
setCssSourceMappingUrl,
|
|
17
17
|
sourcemapToBase64Url,
|
|
18
|
-
} from "
|
|
19
|
-
|
|
20
|
-
import {
|
|
18
|
+
} from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
19
|
+
|
|
20
|
+
import { generateCompilationAssetUrl } from "./compile_asset.js"
|
|
21
|
+
import { testFilePresence } from "./fs_optimized_for_cache.js"
|
|
21
22
|
|
|
22
23
|
const isWindows = process.platform === "win32"
|
|
23
24
|
|
|
24
|
-
export const
|
|
25
|
+
export const asCompilationResult = async (
|
|
25
26
|
{ contentType, metadata = {}, code, map },
|
|
26
27
|
{
|
|
27
28
|
projectDirectoryUrl,
|
|
@@ -7,15 +7,16 @@ json file etag is used to invalidate the cache
|
|
|
7
7
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { readFileSync } from "fs"
|
|
10
|
+
import { readFileSync } from "node:fs"
|
|
11
11
|
import {
|
|
12
12
|
urlToRelativeUrl,
|
|
13
13
|
urlToFileSystemPath,
|
|
14
14
|
resolveUrl,
|
|
15
15
|
} from "@jsenv/filesystem"
|
|
16
|
-
import { setJavaScriptSourceMappingUrl } from "../sourceMappingURLUtils.js"
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
import { setJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
18
|
+
|
|
19
|
+
export const compilationResultFromBuild = (
|
|
19
20
|
{ rollupBuild, urlResponseBodyMap },
|
|
20
21
|
{ mainFileName, projectDirectoryUrl, compiledFileUrl, sourcemapFileUrl },
|
|
21
22
|
) => {
|
|
File without changes
|
|
@@ -3,19 +3,14 @@ import { resolveUrl, readFile } from "@jsenv/filesystem"
|
|
|
3
3
|
import {
|
|
4
4
|
TOOLBAR_INJECTOR_BUILD_URL,
|
|
5
5
|
EVENT_SOURCE_CLIENT_BUILD_URL,
|
|
6
|
-
|
|
6
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
7
7
|
} from "@jsenv/core/dist/build_manifest.js"
|
|
8
|
-
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/
|
|
8
|
+
import { jsenvCoreDirectoryUrl } from "@jsenv/core/src/jsenv_file_urls.js"
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
sameValuesInTwoArrays,
|
|
12
|
-
sameValueInTwoObjects,
|
|
13
|
-
} from "./comparison_utils.js"
|
|
10
|
+
import { sameValueInTwoObjects } from "./comparison_utils.js"
|
|
14
11
|
|
|
15
12
|
const COMPARERS = {
|
|
16
13
|
preservedUrls: sameValueInTwoObjects,
|
|
17
|
-
workers: sameValuesInTwoArrays,
|
|
18
|
-
serviceWorkers: sameValuesInTwoArrays,
|
|
19
14
|
replaceProcessEnvNodeEnv: (a, b) => a === b,
|
|
20
15
|
inlineImportMapIntoHTML: (a, b) => a === b,
|
|
21
16
|
|
|
@@ -36,15 +31,11 @@ export const compareCompileContexts = (
|
|
|
36
31
|
|
|
37
32
|
export const createCompileContext = async ({
|
|
38
33
|
preservedUrls,
|
|
39
|
-
workers,
|
|
40
|
-
serviceWorkers,
|
|
41
34
|
replaceProcessEnvNodeEnv,
|
|
42
35
|
inlineImportMapIntoHTML,
|
|
43
36
|
}) => {
|
|
44
37
|
return {
|
|
45
38
|
preservedUrls,
|
|
46
|
-
workers,
|
|
47
|
-
serviceWorkers,
|
|
48
39
|
replaceProcessEnvNodeEnv,
|
|
49
40
|
inlineImportMapIntoHTML,
|
|
50
41
|
|
|
@@ -52,7 +43,7 @@ export const createCompileContext = async ({
|
|
|
52
43
|
jsenvCorePackageVersion: await readJsenvCoreVersionFromPackageFile(),
|
|
53
44
|
TOOLBAR_INJECTOR_BUILD_URL,
|
|
54
45
|
EVENT_SOURCE_CLIENT_BUILD_URL,
|
|
55
|
-
|
|
46
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
56
47
|
}
|
|
57
48
|
}
|
|
58
49
|
|
|
@@ -18,7 +18,6 @@ export const createCompileProfile = ({
|
|
|
18
18
|
preservedUrls,
|
|
19
19
|
customCompilers,
|
|
20
20
|
babelPluginMapWithoutSyntax,
|
|
21
|
-
workerUrls,
|
|
22
21
|
importMapInWebWorkers,
|
|
23
22
|
moduleOutFormat,
|
|
24
23
|
sourcemapMethod,
|
|
@@ -65,7 +64,7 @@ export const createCompileProfile = ({
|
|
|
65
64
|
import_assertion_type_css: true,
|
|
66
65
|
})
|
|
67
66
|
}
|
|
68
|
-
if (env.browser
|
|
67
|
+
if (env.browser) {
|
|
69
68
|
features["worker_type_module"] = true
|
|
70
69
|
}
|
|
71
70
|
if (env.browser && importMapInWebWorkers) {
|
|
File without changes
|
package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.test.js
RENAMED
|
File without changes
|