@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
|
@@ -38,6 +38,7 @@ export const setupJsenvDirectory = async ({
|
|
|
38
38
|
)
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
const compiledFileWriteSignal = { onwrite: () => {} }
|
|
41
42
|
if (compileServerCanWriteOnFilesystem) {
|
|
42
43
|
if (jsenvDirectoryClean) {
|
|
43
44
|
await ensureEmptyDirectory(jsenvDirectoryUrl)
|
|
@@ -46,9 +47,15 @@ export const setupJsenvDirectory = async ({
|
|
|
46
47
|
logger,
|
|
47
48
|
jsenvDirectoryUrl,
|
|
48
49
|
jsenvDirectoryMetaFileUrl,
|
|
49
|
-
writeMetaFile,
|
|
50
50
|
jsenvDirectoryMeta,
|
|
51
51
|
})
|
|
52
|
+
// We want ".jsenv" directory to appear on the filesystem only
|
|
53
|
+
// if there is a compiled file inside (and not immediatly when compile server starts)
|
|
54
|
+
// To do this we wait for a file to be written to write "__jsenv_meta__.json" file
|
|
55
|
+
compiledFileWriteSignal.onwrite = async () => {
|
|
56
|
+
compiledFileWriteSignal.onwrite = () => {}
|
|
57
|
+
await writeMetaFile()
|
|
58
|
+
}
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
/*
|
|
@@ -88,7 +95,7 @@ export const setupJsenvDirectory = async ({
|
|
|
88
95
|
}
|
|
89
96
|
return existingCompileId
|
|
90
97
|
}
|
|
91
|
-
const compileIdBase = generateCompileId({ compileProfile })
|
|
98
|
+
const compileIdBase = generateCompileId({ compileProfile, runtime })
|
|
92
99
|
let compileId = compileIdBase
|
|
93
100
|
let integer = 1
|
|
94
101
|
while (existingCompileIds.includes(compileId)) {
|
|
@@ -106,13 +113,20 @@ export const setupJsenvDirectory = async ({
|
|
|
106
113
|
return {
|
|
107
114
|
compileDirectories,
|
|
108
115
|
getOrCreateCompileId,
|
|
116
|
+
compiledFileWriteSignal,
|
|
109
117
|
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
|
-
const generateCompileId = ({ compileProfile }) => {
|
|
120
|
+
const generateCompileId = ({ compileProfile, runtime }) => {
|
|
121
|
+
if (runtime.name === "jsenv_build") {
|
|
122
|
+
return `out_build`
|
|
123
|
+
}
|
|
113
124
|
if (compileProfile.missingFeatures["transform-instrument"]) {
|
|
114
125
|
return `out_instrumented`
|
|
115
126
|
}
|
|
127
|
+
if (compileProfile.moduleOutFormat === "systemjs") {
|
|
128
|
+
return `out_system`
|
|
129
|
+
}
|
|
116
130
|
return `out`
|
|
117
131
|
}
|
|
118
132
|
|
|
@@ -121,7 +135,6 @@ const applyFileSystemEffects = async ({
|
|
|
121
135
|
jsenvDirectoryUrl,
|
|
122
136
|
jsenvDirectoryMetaFileUrl,
|
|
123
137
|
jsenvDirectoryMeta,
|
|
124
|
-
writeMetaFile,
|
|
125
138
|
}) => {
|
|
126
139
|
try {
|
|
127
140
|
const source = await readFile(jsenvDirectoryMetaFileUrl)
|
|
@@ -130,7 +143,6 @@ const applyFileSystemEffects = async ({
|
|
|
130
143
|
`${jsenvDirectoryMetaFileUrl} is empty -> clean ${jsenvDirectoryUrl} directory`,
|
|
131
144
|
)
|
|
132
145
|
await ensureEmptyDirectory(jsenvDirectoryUrl)
|
|
133
|
-
await writeMetaFile()
|
|
134
146
|
return
|
|
135
147
|
}
|
|
136
148
|
const jsenvDirectoryMetaPrevious = JSON.parse(source)
|
|
@@ -144,7 +156,6 @@ const applyFileSystemEffects = async ({
|
|
|
144
156
|
`compile context has changed -> clean ${jsenvDirectoryUrl} directory`,
|
|
145
157
|
)
|
|
146
158
|
await ensureEmptyDirectory(jsenvDirectoryUrl)
|
|
147
|
-
await writeMetaFile()
|
|
148
159
|
return
|
|
149
160
|
}
|
|
150
161
|
// reuse existing compile directories
|
|
@@ -158,7 +169,6 @@ const applyFileSystemEffects = async ({
|
|
|
158
169
|
`${jsenvDirectoryMetaFileUrl} not found -> clean ${jsenvDirectoryUrl} directory`,
|
|
159
170
|
)
|
|
160
171
|
await ensureEmptyDirectory(jsenvDirectoryUrl)
|
|
161
|
-
await writeMetaFile()
|
|
162
172
|
return
|
|
163
173
|
}
|
|
164
174
|
if (e.name === "SyntaxError") {
|
|
@@ -166,7 +176,6 @@ const applyFileSystemEffects = async ({
|
|
|
166
176
|
`${jsenvDirectoryMetaFileUrl} syntax error -> clean ${jsenvDirectoryUrl} directory`,
|
|
167
177
|
)
|
|
168
178
|
await ensureEmptyDirectory(jsenvDirectoryUrl)
|
|
169
|
-
await writeMetaFile()
|
|
170
179
|
return
|
|
171
180
|
}
|
|
172
181
|
throw e
|
|
@@ -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,
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
urlToRelativeUrl,
|
|
3
|
+
urlToFileSystemPath,
|
|
4
|
+
bufferToEtag,
|
|
5
|
+
} from "@jsenv/filesystem"
|
|
6
|
+
import { utimesSync } from "node:fs"
|
|
7
|
+
|
|
8
|
+
import { writeFileContent, testFilePresence } from "./fs_optimized_for_cache.js"
|
|
9
|
+
import { getMetaJsonFileUrl } from "./compile_asset.js"
|
|
10
|
+
|
|
11
|
+
export const updateCompileCache = async ({
|
|
12
|
+
logger,
|
|
13
|
+
jsenvDirectory,
|
|
14
|
+
meta,
|
|
15
|
+
compiledFileUrl,
|
|
16
|
+
compileResult,
|
|
17
|
+
compileResultStatus,
|
|
18
|
+
}) => {
|
|
19
|
+
const isNew = compileResultStatus === "created"
|
|
20
|
+
const isUpdated = compileResultStatus === "updated"
|
|
21
|
+
if (!isNew && !isUpdated) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
const {
|
|
25
|
+
compiledSource,
|
|
26
|
+
contentType,
|
|
27
|
+
sources,
|
|
28
|
+
sourcesContent,
|
|
29
|
+
assets,
|
|
30
|
+
assetsContent,
|
|
31
|
+
dependencies,
|
|
32
|
+
} = compileResult
|
|
33
|
+
const promises = []
|
|
34
|
+
// ensure source that does not leads to concrete files are not capable to invalidate the cache
|
|
35
|
+
const sourcesToRemove = sources.filter((sourceFileUrl) => {
|
|
36
|
+
return (
|
|
37
|
+
sourceFileUrl.startsWith("file://") && !testFilePresence(sourceFileUrl)
|
|
38
|
+
)
|
|
39
|
+
})
|
|
40
|
+
const sourceNotFoundCount = sourcesToRemove.length
|
|
41
|
+
if (sourceNotFoundCount > 0) {
|
|
42
|
+
logger.warn(`SOURCE_META_NOT_FOUND: ${sourceNotFoundCount} source file(s) not found.
|
|
43
|
+
--- consequence ---
|
|
44
|
+
cache will be reused even if one of the source file is modified
|
|
45
|
+
--- source files not found ---
|
|
46
|
+
${sourcesToRemove.join(`\n`)}`)
|
|
47
|
+
sourcesToRemove.forEach((url) => {
|
|
48
|
+
const sourceIndex = sources.indexOf(url)
|
|
49
|
+
if (sourceIndex) {
|
|
50
|
+
sources.splice(sourceIndex, 1)
|
|
51
|
+
sourcesContent.splice(sourceIndex, 1)
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
const { writeCompiledSourceFile = true, writeAssetsFile = true } =
|
|
56
|
+
compileResult
|
|
57
|
+
if (writeCompiledSourceFile) {
|
|
58
|
+
logger.debug(
|
|
59
|
+
`write compiled file at ${urlToFileSystemPath(compiledFileUrl)}`,
|
|
60
|
+
)
|
|
61
|
+
promises.push(
|
|
62
|
+
writeFileContent(compiledFileUrl, compiledSource, {
|
|
63
|
+
fileLikelyNotFound: isNew,
|
|
64
|
+
}).then(() => {
|
|
65
|
+
const mtime = compileResult.compiledMtime
|
|
66
|
+
// when compileResult.compiledMtime do not exists it means
|
|
67
|
+
// the client is not interested in it so
|
|
68
|
+
// -> moment we write the file is not important
|
|
69
|
+
// -> There is no need to update mtime
|
|
70
|
+
if (mtime) {
|
|
71
|
+
utimesSync(
|
|
72
|
+
urlToFileSystemPath(compiledFileUrl),
|
|
73
|
+
new Date(mtime),
|
|
74
|
+
new Date(mtime),
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
}),
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
if (writeAssetsFile) {
|
|
81
|
+
promises.push(
|
|
82
|
+
...assets.map((assetFileUrl, index) => {
|
|
83
|
+
logger.debug(
|
|
84
|
+
`write compiled file asset at ${urlToFileSystemPath(assetFileUrl)}`,
|
|
85
|
+
)
|
|
86
|
+
return writeFileContent(assetFileUrl, assetsContent[index], {
|
|
87
|
+
fileLikelyNotFound: isNew,
|
|
88
|
+
})
|
|
89
|
+
}),
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
const metaJsonFileUrl = getMetaJsonFileUrl(compiledFileUrl)
|
|
93
|
+
let latestMeta
|
|
94
|
+
const sourceAndAssetProps = {
|
|
95
|
+
sources: sources.map((source) => urlToRelativeUrl(source, metaJsonFileUrl)),
|
|
96
|
+
sourcesEtag: sourcesContent.map((sourceContent) =>
|
|
97
|
+
bufferToEtag(Buffer.from(sourceContent)),
|
|
98
|
+
),
|
|
99
|
+
assets: assets.map((asset) => urlToRelativeUrl(asset, metaJsonFileUrl)),
|
|
100
|
+
assetsEtag: assetsContent.map((assetContent) =>
|
|
101
|
+
bufferToEtag(Buffer.from(assetContent)),
|
|
102
|
+
),
|
|
103
|
+
dependencies: dependencies.filter((dep) => {
|
|
104
|
+
return !dep.startsWith("data:")
|
|
105
|
+
}),
|
|
106
|
+
}
|
|
107
|
+
if (isNew) {
|
|
108
|
+
latestMeta = {
|
|
109
|
+
contentType,
|
|
110
|
+
...sourceAndAssetProps,
|
|
111
|
+
createdMs: Number(Date.now()),
|
|
112
|
+
lastModifiedMs: Number(Date.now()),
|
|
113
|
+
}
|
|
114
|
+
} else if (isUpdated) {
|
|
115
|
+
latestMeta = {
|
|
116
|
+
...meta,
|
|
117
|
+
...sourceAndAssetProps,
|
|
118
|
+
lastModifiedMs: Number(Date.now()),
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
logger.debug(
|
|
122
|
+
`write compiled file meta at ${urlToFileSystemPath(metaJsonFileUrl)}`,
|
|
123
|
+
)
|
|
124
|
+
promises.push(
|
|
125
|
+
writeFileContent(metaJsonFileUrl, JSON.stringify(latestMeta, null, " "), {
|
|
126
|
+
fileLikelyNotFound: isNew,
|
|
127
|
+
}),
|
|
128
|
+
)
|
|
129
|
+
promises.push(jsenvDirectory.compiledFileWriteSignal.onwrite())
|
|
130
|
+
await Promise.all(promises)
|
|
131
|
+
}
|
|
@@ -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,
|
|
@@ -62,6 +62,7 @@ export const reportToCoverage = async (
|
|
|
62
62
|
|
|
63
63
|
if (!coverageForceIstanbul && process.env.NODE_V8_COVERAGE) {
|
|
64
64
|
await visitNodeV8Directory({
|
|
65
|
+
logger,
|
|
65
66
|
signal,
|
|
66
67
|
NODE_V8_COVERAGE: process.env.NODE_V8_COVERAGE,
|
|
67
68
|
onV8Coverage: (nodeV8Coverage) => {
|
|
File without changes
|
|
File without changes
|
|
@@ -8,6 +8,7 @@ import { createDetailedMessage } from "@jsenv/logger"
|
|
|
8
8
|
import { Abort } from "@jsenv/abort"
|
|
9
9
|
|
|
10
10
|
export const visitNodeV8Directory = async ({
|
|
11
|
+
logger,
|
|
11
12
|
signal,
|
|
12
13
|
NODE_V8_COVERAGE,
|
|
13
14
|
onV8Coverage,
|
|
@@ -20,7 +21,7 @@ export const visitNodeV8Directory = async ({
|
|
|
20
21
|
if (dirContent.length > 0) {
|
|
21
22
|
return dirContent
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
logger.warn(`v8 coverage directory is empty at ${NODE_V8_COVERAGE}`)
|
|
24
25
|
return dirContent
|
|
25
26
|
}
|
|
26
27
|
|
|
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
|
|