@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,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,
|
|
@@ -38,7 +39,7 @@ export const compileJavascript = async ({
|
|
|
38
39
|
code,
|
|
39
40
|
map,
|
|
40
41
|
})
|
|
41
|
-
return
|
|
42
|
+
return asCompilationResult(
|
|
42
43
|
{
|
|
43
44
|
contentType: "application/javascript",
|
|
44
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,9 +3,9 @@ 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
10
|
import { sameValueInTwoObjects } from "./comparison_utils.js"
|
|
11
11
|
|
|
@@ -43,7 +43,7 @@ export const createCompileContext = async ({
|
|
|
43
43
|
jsenvCorePackageVersion: await readJsenvCoreVersionFromPackageFile(),
|
|
44
44
|
TOOLBAR_INJECTOR_BUILD_URL,
|
|
45
45
|
EVENT_SOURCE_CLIENT_BUILD_URL,
|
|
46
|
-
|
|
46
|
+
BROWSER_CLIENT_BUILD_URL,
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
File without changes
|
|
File without changes
|
package/src/internal/{compiling → compile_server}/jsenv_directory/file_lock_registry.test.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,13 +2,13 @@ import { timeStart, timeFunction } from "@jsenv/server"
|
|
|
2
2
|
import { urlToFileSystemPath, readFile } from "@jsenv/filesystem"
|
|
3
3
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { validateCompileCache } from "./validate_compile_cache.js"
|
|
6
6
|
import { getMetaJsonFileUrl } from "./compile_asset.js"
|
|
7
7
|
import { createLockRegistry } from "./file_lock_registry.js"
|
|
8
8
|
|
|
9
9
|
const { lockForRessource } = createLockRegistry()
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const reuseOrCreateCompiledFile = async ({
|
|
12
12
|
logger,
|
|
13
13
|
|
|
14
14
|
projectDirectoryUrl,
|
|
@@ -119,7 +119,7 @@ const computeCompileReport = async ({
|
|
|
119
119
|
// },
|
|
120
120
|
// }
|
|
121
121
|
// }
|
|
122
|
-
return
|
|
122
|
+
return validateCompileCache({
|
|
123
123
|
logger,
|
|
124
124
|
compiledFileUrl,
|
|
125
125
|
compileCacheStrategy,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
} from "@jsenv/filesystem"
|
|
6
6
|
import { utimesSync } from "node:fs"
|
|
7
7
|
|
|
8
|
-
import { writeFileContent, testFilePresence } from "./
|
|
8
|
+
import { writeFileContent, testFilePresence } from "./fs_optimized_for_cache.js"
|
|
9
9
|
import { getMetaJsonFileUrl } from "./compile_asset.js"
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const updateCompileCache = async ({
|
|
12
12
|
logger,
|
|
13
13
|
meta,
|
|
14
14
|
compiledFileUrl,
|
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from "node:url"
|
|
|
2
2
|
import { readFileSync, statSync } from "node:fs"
|
|
3
3
|
import { resolveUrl, bufferToEtag } from "@jsenv/filesystem"
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const validateCompileCache = async ({
|
|
6
6
|
compiledFileUrl,
|
|
7
7
|
compileCacheStrategy,
|
|
8
8
|
compileCacheSourcesValidation = true,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { createLogger } from "@jsenv/logger"
|
|
10
10
|
import { createCallbackList } from "@jsenv/abort"
|
|
11
11
|
|
|
12
|
-
import { urlIsCompilationAsset } from "@jsenv/core/src/internal/
|
|
12
|
+
import { urlIsCompilationAsset } from "@jsenv/core/src/internal/compile_server/jsenv_directory/compile_asset.js"
|
|
13
13
|
|
|
14
14
|
export const createSSEService = ({
|
|
15
15
|
projectDirectoryUrl,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
urlToMeta,
|
|
5
5
|
} from "@jsenv/filesystem"
|
|
6
6
|
|
|
7
|
-
import { require } from "
|
|
7
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
8
8
|
|
|
9
9
|
// https://github.com/istanbuljs/babel-plugin-istanbul/blob/321740f7b25d803f881466ea819d870f7ed6a254/src/index.js
|
|
10
10
|
|
package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_html_directory.js
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs"
|
|
2
2
|
import { resolveUrl, urlToFileSystemPath } from "@jsenv/filesystem"
|
|
3
3
|
|
|
4
|
-
import { require } from "
|
|
5
|
-
|
|
4
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
5
|
+
|
|
6
|
+
import { istanbulCoverageMapFromCoverage } from "./istanbul_coverage_map_from_coverage.js"
|
|
6
7
|
|
|
7
8
|
export const generateCoverageHtmlDirectory = async (
|
|
8
9
|
coverage,
|
package/src/internal/{executing/coverage_reporter → coverage}/coverage_reporter_json_file.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { writeFile, urlToFileSystemPath } from "@jsenv/filesystem"
|
|
2
2
|
|
|
3
|
-
import { byteAsFileSize } from "@jsenv/core/src/internal/logs/
|
|
3
|
+
import { byteAsFileSize } from "@jsenv/core/src/internal/logs/byte_as_file_size.js"
|
|
4
4
|
|
|
5
5
|
export const generateCoverageJsonFile = async ({
|
|
6
6
|
coverage,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { require } from "
|
|
2
|
-
|
|
1
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
2
|
+
|
|
3
|
+
import { istanbulCoverageMapFromCoverage } from "./istanbul_coverage_map_from_coverage.js"
|
|
3
4
|
|
|
4
5
|
export const generateCoverageTextLog = (
|
|
5
6
|
coverage,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { require } from "@jsenv/core/src/internal/require.js"
|
|
2
|
+
|
|
1
3
|
import { resolveUrl, urlToFileSystemPath, readFile } from "@jsenv/filesystem"
|
|
2
4
|
import { Abort } from "@jsenv/abort"
|
|
3
5
|
|
|
4
6
|
import {
|
|
5
7
|
babelPluginsFromBabelPluginMap,
|
|
6
8
|
getMinimalBabelPluginMap,
|
|
7
|
-
} from "@jsenv/core/src/internal/
|
|
8
|
-
|
|
9
|
-
import {
|
|
9
|
+
} from "@jsenv/core/src/internal/compile_server/js/babel_plugins.js"
|
|
10
|
+
|
|
11
|
+
import { babelPluginInstrument } from "./babel_plugin_instrument.js"
|
|
10
12
|
|
|
11
13
|
export const relativeUrlToEmptyCoverage = async (
|
|
12
14
|
relativeUrl,
|
|
@@ -61,3 +63,8 @@ export const relativeUrlToEmptyCoverage = async (
|
|
|
61
63
|
await operation.end()
|
|
62
64
|
}
|
|
63
65
|
}
|
|
66
|
+
|
|
67
|
+
const createEmptyCoverage = (relativeUrl) => {
|
|
68
|
+
const { createFileCoverage } = require("istanbul-lib-coverage")
|
|
69
|
+
return createFileCoverage(relativeUrl).toJSON()
|
|
70
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Abort } from "@jsenv/abort"
|
|
2
2
|
|
|
3
3
|
import { listRelativeFileUrlToCover } from "./list_files_not_covered.js"
|
|
4
|
-
import { relativeUrlToEmptyCoverage } from "./
|
|
4
|
+
import { relativeUrlToEmptyCoverage } from "./empty_coverage_factory.js"
|
|
5
5
|
|
|
6
6
|
export const getMissingFileByFileCoverage = async ({
|
|
7
7
|
signal,
|
package/src/internal/{executing/coverage/reportToCoverage.js → coverage/report_to_coverage.js}
RENAMED
|
@@ -4,13 +4,13 @@ import { Abort } from "@jsenv/abort"
|
|
|
4
4
|
import {
|
|
5
5
|
visitNodeV8Directory,
|
|
6
6
|
filterV8Coverage,
|
|
7
|
-
} from "
|
|
8
|
-
import { composeTwoV8Coverages } from "
|
|
9
|
-
import { composeTwoFileByFileIstanbulCoverages } from "
|
|
10
|
-
import { v8CoverageToIstanbul } from "
|
|
11
|
-
import { composeV8AndIstanbul } from "
|
|
12
|
-
import { normalizeFileByFileCoveragePaths } from "
|
|
13
|
-
import { getMissingFileByFileCoverage } from "
|
|
7
|
+
} from "./v8_coverage_from_directory.js"
|
|
8
|
+
import { composeTwoV8Coverages } from "./v8_coverage_composition.js"
|
|
9
|
+
import { composeTwoFileByFileIstanbulCoverages } from "./istanbul_coverage_composition.js"
|
|
10
|
+
import { v8CoverageToIstanbul } from "./v8_coverage_to_istanbul.js"
|
|
11
|
+
import { composeV8AndIstanbul } from "./v8_and_istanbul.js"
|
|
12
|
+
import { normalizeFileByFileCoveragePaths } from "./file_by_file_coverage.js"
|
|
13
|
+
import { getMissingFileByFileCoverage } from "./missing_coverage.js"
|
|
14
14
|
|
|
15
15
|
export const reportToCoverage = async (
|
|
16
16
|
report,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-env browser, node */
|
|
2
|
+
|
|
3
|
+
export const DataUrl = {
|
|
4
|
+
parse: (string, { as = "raw" } = {}) => {
|
|
5
|
+
const afterDataProtocol = string.slice("data:".length)
|
|
6
|
+
const commaIndex = afterDataProtocol.indexOf(",")
|
|
7
|
+
const beforeComma = afterDataProtocol.slice(0, commaIndex)
|
|
8
|
+
|
|
9
|
+
let mediaType
|
|
10
|
+
let base64Flag
|
|
11
|
+
if (beforeComma.endsWith(`;base64`)) {
|
|
12
|
+
mediaType = beforeComma.slice(0, -`;base64`.length)
|
|
13
|
+
base64Flag = true
|
|
14
|
+
} else {
|
|
15
|
+
mediaType = beforeComma
|
|
16
|
+
base64Flag = false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const afterComma = afterDataProtocol.slice(commaIndex + 1)
|
|
20
|
+
return {
|
|
21
|
+
mediaType: mediaType === "" ? "text/plain;charset=US-ASCII" : mediaType,
|
|
22
|
+
base64Flag,
|
|
23
|
+
data:
|
|
24
|
+
as === "string" && base64Flag ? base64ToString(afterComma) : afterComma,
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
stringify: ({ mediaType, base64Flag = true, data }) => {
|
|
29
|
+
if (!mediaType || mediaType === "text/plain;charset=US-ASCII") {
|
|
30
|
+
// can be a buffer or a string, hence check on data.length instead of !data or data === ''
|
|
31
|
+
if (data.length === 0) {
|
|
32
|
+
return `data:,`
|
|
33
|
+
}
|
|
34
|
+
if (base64Flag) {
|
|
35
|
+
return `data:,${data}`
|
|
36
|
+
}
|
|
37
|
+
return `data:,${dataToBase64(data)}`
|
|
38
|
+
}
|
|
39
|
+
if (base64Flag) {
|
|
40
|
+
return `data:${mediaType};base64,${dataToBase64(data)}`
|
|
41
|
+
}
|
|
42
|
+
return `data:${mediaType},${data}`
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const dataToBase64 =
|
|
47
|
+
typeof window === "object"
|
|
48
|
+
? window.atob
|
|
49
|
+
: (data) => Buffer.from(data).toString("base64")
|
|
50
|
+
|
|
51
|
+
const base64ToString =
|
|
52
|
+
typeof window === "object"
|
|
53
|
+
? window.btoa
|
|
54
|
+
: (base64String) => Buffer.from(base64String, "base64").toString("utf8")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetchUrl } from "../toolbar/util/fetching.js"
|
|
2
2
|
import { createPreference } from "../toolbar/util/preferences.js"
|
|
3
3
|
import { startJavaScriptAnimation } from "../toolbar/util/animation.js"
|
|
4
|
-
import { fetchExploringJson } from "./
|
|
4
|
+
import { fetchExploringJson } from "./fetch_exploring_json.js"
|
|
5
5
|
|
|
6
6
|
const fetchJSON = async (url, options) => {
|
|
7
7
|
const response = await fetchUrl(url, options)
|
package/src/internal/dev_server/toolbar/animation/{toolbar.animation.js → toolbar_animation.js}
RENAMED
|
File without changes
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { scanBrowserRuntimeFeatures } from "
|
|
1
|
+
import { scanBrowserRuntimeFeatures } from "@jsenv/core/src/internal/features/browser_feature_detection/browser_feature_detection.js"
|
|
2
|
+
|
|
2
3
|
import { setLinkHrefForParentWindow } from "../util/iframe_to_parent_href.js"
|
|
3
4
|
import { removeForceHideElement } from "../util/dom.js"
|
|
4
5
|
import { enableVariant } from "../variant/variant.js"
|
|
5
6
|
import {
|
|
6
7
|
enableWarningStyle,
|
|
7
8
|
disableWarningStyle,
|
|
8
|
-
} from "../settings/
|
|
9
|
+
} from "../settings/toolbar_settings.js"
|
|
9
10
|
|
|
10
11
|
export const renderCompilationInToolbar = ({ compileGroup }) => {
|
|
11
12
|
const browserSupportRootNode = document.querySelector("#browser_support")
|
|
File without changes
|
package/src/internal/dev_server/toolbar/execution/{toolbar.execution.js → toolbar_execution.js}
RENAMED
|
@@ -2,7 +2,7 @@ import { removeForceHideElement, activateToolbarSection } from "../util/dom.js"
|
|
|
2
2
|
import { enableVariant } from "../variant/variant.js"
|
|
3
3
|
import { createHorizontalBreakpoint } from "../util/responsive.js"
|
|
4
4
|
import { toggleTooltip } from "../tooltip/tooltip.js"
|
|
5
|
-
import { notifyExecutionResult } from "../notification/
|
|
5
|
+
import { notifyExecutionResult } from "../notification/toolbar_notification.js"
|
|
6
6
|
|
|
7
7
|
const WINDOW_MEDIUM_WIDTH = 570
|
|
8
8
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/internal/dev_server/toolbar/responsive/{toolbar.responsive.js → toolbar_responsive.js}
RENAMED
|
File without changes
|
package/src/internal/dev_server/toolbar/settings/{toolbar.settings.js → toolbar_settings.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link
|
|
9
9
|
rel="stylesheet"
|
|
10
10
|
type="text/css"
|
|
11
|
-
href="./
|
|
11
|
+
href="./toolbar_main.css"
|
|
12
12
|
data-jsenv-force-inline
|
|
13
13
|
/>
|
|
14
14
|
</head>
|
|
@@ -609,7 +609,7 @@
|
|
|
609
609
|
</script>
|
|
610
610
|
<script
|
|
611
611
|
type="module"
|
|
612
|
-
src="./
|
|
612
|
+
src="./toolbar_main.js"
|
|
613
613
|
data-jsenv-force-inline
|
|
614
614
|
></script>
|
|
615
615
|
</body>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { fetchExploringJson } from "@jsenv/core/src/internal/dev_server/exploring/
|
|
1
|
+
import { fetchExploringJson } from "@jsenv/core/src/internal/dev_server/exploring/fetch_exploring_json.js"
|
|
2
|
+
|
|
2
3
|
import { setAttributes, setStyles } from "./util/dom.js"
|
|
3
4
|
|
|
4
5
|
// eslint-disable-next-line no-undef
|
|
5
6
|
const TOOLBAR_BUILD_RELATIVE_URL = __TOOLBAR_BUILD_RELATIVE_URL_
|
|
6
|
-
const jsenvLogoSvgUrl = new URL("./
|
|
7
|
+
const jsenvLogoSvgUrl = new URL("./jsenv_logo.svg", import.meta.url)
|
|
7
8
|
|
|
8
9
|
const injectToolbar = async () => {
|
|
9
10
|
await new Promise((resolve) => {
|
|
@@ -60,7 +61,7 @@ const injectToolbar = async () => {
|
|
|
60
61
|
div.innerHTML = `
|
|
61
62
|
<div id="jsenv-toolbar-trigger">
|
|
62
63
|
<svg id="jsenv-toolbar-trigger-icon">
|
|
63
|
-
<use xlink:href="${jsenvLogoSvgUrl}#
|
|
64
|
+
<use xlink:href="${jsenvLogoSvgUrl}#jsenv_logo"></use>
|
|
64
65
|
</svg>
|
|
65
66
|
<style>
|
|
66
67
|
#jsenv-toolbar-trigger {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@import "./compilation/compilation.css";
|
|
3
3
|
@import "./focus/focus.css";
|
|
4
4
|
@import "./eventsource/eventsource.css";
|
|
5
|
-
@import "./responsive/
|
|
5
|
+
@import "./responsive/overflow_menu.css";
|
|
6
6
|
@import "./settings/settings.css";
|
|
7
|
-
@import "./theme/
|
|
7
|
+
@import "./theme/light_theme.css";
|
|
8
8
|
@import "./tooltip/tooltip.css";
|
|
9
9
|
|
|
10
10
|
html[data-animation-disabled] * {
|
|
@@ -2,7 +2,7 @@ import { urlIsInsideOf } from "@jsenv/filesystem/src/urlIsInsideOf.js"
|
|
|
2
2
|
import { urlToRelativeUrl } from "@jsenv/filesystem/src/urlToRelativeUrl.js"
|
|
3
3
|
|
|
4
4
|
import { startJavaScriptAnimation } from "../toolbar/util/animation.js"
|
|
5
|
-
import "./focus/
|
|
5
|
+
import "./focus/toolbar_focus.js"
|
|
6
6
|
import { setLinkHrefForParentWindow } from "./util/iframe_to_parent_href.js"
|
|
7
7
|
import {
|
|
8
8
|
getToolbarIframe,
|
|
@@ -14,14 +14,14 @@ import { hideTooltip, hideAllTooltip } from "./tooltip/tooltip.js"
|
|
|
14
14
|
import {
|
|
15
15
|
renderToolbarSettings,
|
|
16
16
|
hideSettings,
|
|
17
|
-
} from "./settings/
|
|
18
|
-
import { renderToolbarNotification } from "./notification/
|
|
19
|
-
import { renderToolbarTheme } from "./theme/
|
|
20
|
-
import { renderToolbarAnimation } from "./animation/
|
|
21
|
-
import { renderExecutionInToolbar } from "./execution/
|
|
22
|
-
import { renderCompilationInToolbar } from "./compilation/
|
|
23
|
-
import { initToolbarEventSource } from "./eventsource/
|
|
24
|
-
import { makeToolbarResponsive } from "./responsive/
|
|
17
|
+
} from "./settings/toolbar_settings.js"
|
|
18
|
+
import { renderToolbarNotification } from "./notification/toolbar_notification.js"
|
|
19
|
+
import { renderToolbarTheme } from "./theme/toolbar_theme.js"
|
|
20
|
+
import { renderToolbarAnimation } from "./animation/toolbar_animation.js"
|
|
21
|
+
import { renderExecutionInToolbar } from "./execution/toolbar_execution.js"
|
|
22
|
+
import { renderCompilationInToolbar } from "./compilation/toolbar_compilation.js"
|
|
23
|
+
import { initToolbarEventSource } from "./eventsource/toolbar_eventsource.js"
|
|
24
|
+
import { makeToolbarResponsive } from "./responsive/toolbar_responsive.js"
|
|
25
25
|
|
|
26
26
|
const toolbarVisibilityPreference = createPreference("toolbar")
|
|
27
27
|
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { remapStack } from "./remap_stack.js"
|
|
4
|
+
import { stringifyStack } from "./stringify_stack.js"
|
|
4
5
|
|
|
5
6
|
export const installErrorStackRemapping = ({
|
|
6
7
|
fetchFile,
|
|
@@ -56,7 +57,7 @@ export const installErrorStackRemapping = ({
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
const stackRemappingPromise =
|
|
60
|
+
const stackRemappingPromise = remapStack({
|
|
60
61
|
stack,
|
|
61
62
|
error,
|
|
62
63
|
resolveFile,
|
|
@@ -68,7 +69,7 @@ export const installErrorStackRemapping = ({
|
|
|
68
69
|
})
|
|
69
70
|
errorRemappingCache.set(error, stackRemappingPromise)
|
|
70
71
|
|
|
71
|
-
return
|
|
72
|
+
return stringifyStack(stack, { error, indent })
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
const getErrorOriginalStackString = async (
|
|
@@ -108,7 +109,7 @@ export const installErrorStackRemapping = ({
|
|
|
108
109
|
columnno: firstCall.getColumnNumber(),
|
|
109
110
|
})
|
|
110
111
|
}
|
|
111
|
-
return
|
|
112
|
+
return stringifyStack(originalCallsites, { error, indent })
|
|
112
113
|
} catch (e) {
|
|
113
114
|
onFailure(
|
|
114
115
|
createDetailedMessage(`error while computing original stack.`, {
|
package/src/internal/{error-stack-remapping/remapCallSite.js → error_stack_remap/remap_call_site.js}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
4
|
startsWithWindowsDriveLetter,
|
|
4
5
|
windowsFilePathToUrl,
|
|
5
|
-
} from "
|
|
6
|
+
} from "@jsenv/core/src/internal/windows_file_path_utils.js"
|
|
6
7
|
|
|
7
8
|
export const remapCallSite = async (
|
|
8
9
|
callSite,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
2
|
-
import { parseDataUrl, dataUrlToRawData } from "../dataUrl.utils.js"
|
|
3
|
-
import { getJavaScriptSourceMappingUrl } from "../sourceMappingURLUtils.js"
|
|
4
|
-
import { remapCallSite } from "./remapCallSite.js"
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
4
|
+
import { getJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
5
|
+
|
|
6
|
+
import { remapCallSite } from "./remap_call_site.js"
|
|
7
|
+
|
|
8
|
+
export const remapStack = async ({
|
|
7
9
|
stack,
|
|
8
10
|
resolveFile,
|
|
9
11
|
fetchFile,
|
|
@@ -60,7 +62,7 @@ export const getOriginalCallsites = async ({
|
|
|
60
62
|
let sourcemapString
|
|
61
63
|
if (jsSourcemapUrl.startsWith("data:")) {
|
|
62
64
|
sourcemapUrl = stackTraceFileUrl
|
|
63
|
-
sourcemapString =
|
|
65
|
+
sourcemapString = DataUrl.parse(jsSourcemapUrl, { as: "string" })
|
|
64
66
|
} else {
|
|
65
67
|
sourcemapUrl = resolveFile(jsSourcemapUrl, stackTraceFileUrl, {
|
|
66
68
|
type: "source-map",
|
|
@@ -191,7 +193,6 @@ export const getOriginalCallsites = async ({
|
|
|
191
193
|
}
|
|
192
194
|
},
|
|
193
195
|
)
|
|
194
|
-
|
|
195
196
|
const originalCallsites = await Promise.all(
|
|
196
197
|
stack.map((callSite) =>
|
|
197
198
|
remapCallSite(callSite, {
|