@jsenv/core 39.2.1 → 39.2.3
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/README.md +9 -11
- package/dist/jsenv_core.js +14088 -14085
- package/package.json +15 -13
- package/src/build/build.js +4 -4
- package/src/build/build_specifier_manager.js +15 -15
- package/src/build/build_urls_generator.js +1 -1
- package/src/build/start_build_server.js +6 -6
- package/src/build/version_mappings_injection.js +2 -2
- package/src/dev/start_dev_server.js +9 -9
- package/src/helpers/command/command.js +1 -1
- package/src/helpers/web_url_converter.js +1 -1
- package/src/kitchen/errors.js +1 -1
- package/src/kitchen/kitchen.js +11 -11
- package/src/kitchen/prepend_content.js +4 -4
- package/src/kitchen/url_graph/references.js +3 -3
- package/src/kitchen/url_graph/url_graph.js +2 -2
- package/src/kitchen/url_graph/url_graph_report.js +1 -1
- package/src/kitchen/url_graph/url_info_transformations.js +5 -5
- package/src/plugins/autoreload/jsenv_plugin_autoreload.js +1 -1
- package/src/plugins/autoreload/jsenv_plugin_autoreload_client.js +1 -1
- package/src/plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +1 -1
- package/src/plugins/global_scenarios/jsenv_plugin_global_scenarios.js +1 -1
- package/src/plugins/html_syntax_error_fallback/jsenv_plugin_html_syntax_error_fallback.js +2 -2
- package/src/plugins/import_meta_hot/html_hot_dependencies.js +1 -1
- package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +2 -2
- package/src/plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +1 -1
- package/src/plugins/injections/internal/inject_globals.js +1 -1
- package/src/plugins/injections/jsenv_plugin_injections.js +1 -1
- package/src/plugins/inlining/jsenv_plugin_inlining_into_html.js +6 -6
- package/src/plugins/plugins.js +2 -0
- package/src/plugins/protocol_file/jsenv_plugin_protocol_file.js +17 -17
- package/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +11 -11
- package/src/plugins/reference_analysis/js/jsenv_plugin_js_reference_analysis.js +1 -1
- package/src/plugins/reference_analysis/jsenv_plugin_reference_analysis.js +4 -4
- package/src/plugins/resolution_node_esm/node_esm_resolver.js +2 -2
- package/src/plugins/ribbon/jsenv_plugin_ribbon.js +1 -1
- package/src/plugins/server_events/jsenv_plugin_server_events_client_injection.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "39.2.
|
|
3
|
+
"version": "39.2.3",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
"monorepo:publish": "node ./scripts/monorepo/publish_packages.mjs",
|
|
53
53
|
"monorepo:upgrade_versions": "node ./scripts/monorepo/upgrade_external_versions.mjs",
|
|
54
54
|
"monorepo:node_modules_clear": "npx @jsenv/snapshot clear **/node_modules/",
|
|
55
|
-
"build
|
|
55
|
+
"doc:build": "node ./docs/build.js",
|
|
56
56
|
"performances": "node --expose-gc ./scripts/performance/generate_performance_report.mjs --log --once",
|
|
57
|
+
"build:file_size": "node ./scripts/build/build_file_size.mjs --log",
|
|
57
58
|
"prettier": "prettier --write .",
|
|
58
59
|
"test:ci": "CI=1 npm run test",
|
|
59
60
|
"test:only_dev_server_errors": "node --conditions=development ./tests/dev_server/errors/dev_errors_snapshots.test.mjs",
|
|
@@ -65,22 +66,22 @@
|
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
67
68
|
"@jsenv/abort": "4.3.0",
|
|
68
|
-
"@jsenv/ast": "6.2.
|
|
69
|
-
"@jsenv/filesystem": "4.8.
|
|
70
|
-
"@jsenv/humanize": "1.2.
|
|
69
|
+
"@jsenv/ast": "6.2.5",
|
|
70
|
+
"@jsenv/filesystem": "4.8.2",
|
|
71
|
+
"@jsenv/humanize": "1.2.5",
|
|
71
72
|
"@jsenv/importmap": "1.2.1",
|
|
72
73
|
"@jsenv/integrity": "0.0.2",
|
|
73
|
-
"@jsenv/js-module-fallback": "1.3.
|
|
74
|
+
"@jsenv/js-module-fallback": "1.3.26",
|
|
74
75
|
"@jsenv/node-esm-resolution": "1.0.2",
|
|
75
|
-
"@jsenv/plugin-bundling": "2.6.
|
|
76
|
+
"@jsenv/plugin-bundling": "2.6.18",
|
|
76
77
|
"@jsenv/plugin-minification": "1.5.5",
|
|
77
|
-
"@jsenv/plugin-supervisor": "1.5.
|
|
78
|
-
"@jsenv/plugin-transpilation": "1.4.
|
|
78
|
+
"@jsenv/plugin-supervisor": "1.5.6",
|
|
79
|
+
"@jsenv/plugin-transpilation": "1.4.9",
|
|
79
80
|
"@jsenv/runtime-compat": "1.3.0",
|
|
80
|
-
"@jsenv/server": "15.2.
|
|
81
|
-
"@jsenv/sourcemap": "1.2.
|
|
81
|
+
"@jsenv/server": "15.2.14",
|
|
82
|
+
"@jsenv/sourcemap": "1.2.16",
|
|
82
83
|
"@jsenv/url-meta": "8.4.2",
|
|
83
|
-
"@jsenv/urls": "2.3.
|
|
84
|
+
"@jsenv/urls": "2.3.1",
|
|
84
85
|
"@jsenv/utils": "2.1.1"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
@@ -110,6 +111,7 @@
|
|
|
110
111
|
"marked": "13.0.2",
|
|
111
112
|
"open": "10.1.0",
|
|
112
113
|
"playwright": "1.45.2",
|
|
113
|
-
"prettier": "3.3.3"
|
|
114
|
+
"prettier": "3.3.3",
|
|
115
|
+
"prettier-plugin-organize-imports": "4.0.0"
|
|
114
116
|
}
|
|
115
117
|
}
|
package/src/build/build.js
CHANGED
|
@@ -16,26 +16,26 @@
|
|
|
16
16
|
* - injecting urls into service workers
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort";
|
|
20
|
+
import { parseHtml, stringifyHtmlAst } from "@jsenv/ast";
|
|
19
21
|
import {
|
|
20
22
|
assertAndNormalizeDirectoryUrl,
|
|
21
23
|
ensureEmptyDirectory,
|
|
22
24
|
writeFileSync,
|
|
23
25
|
} from "@jsenv/filesystem";
|
|
24
|
-
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort";
|
|
25
26
|
import { createLogger, createTaskLog } from "@jsenv/humanize";
|
|
26
|
-
import { parseHtml, stringifyHtmlAst } from "@jsenv/ast";
|
|
27
27
|
import { jsenvPluginBundling } from "@jsenv/plugin-bundling";
|
|
28
28
|
import { jsenvPluginMinification } from "@jsenv/plugin-minification";
|
|
29
29
|
import { jsenvPluginJsModuleFallback } from "@jsenv/plugin-transpilation";
|
|
30
30
|
|
|
31
31
|
import { lookupPackageDirectory } from "../helpers/lookup_package_directory.js";
|
|
32
32
|
import { watchSourceFiles } from "../helpers/watch_source_files.js";
|
|
33
|
-
import { GRAPH_VISITOR } from "../kitchen/url_graph/url_graph_visitor.js";
|
|
34
33
|
import { createKitchen } from "../kitchen/kitchen.js";
|
|
35
34
|
import { createUrlGraphSummary } from "../kitchen/url_graph/url_graph_report.js";
|
|
35
|
+
import { GRAPH_VISITOR } from "../kitchen/url_graph/url_graph_visitor.js";
|
|
36
|
+
import { jsenvPluginInlining } from "../plugins/inlining/jsenv_plugin_inlining.js";
|
|
36
37
|
import { getCorePlugins } from "../plugins/plugins.js";
|
|
37
38
|
import { jsenvPluginReferenceAnalysis } from "../plugins/reference_analysis/jsenv_plugin_reference_analysis.js";
|
|
38
|
-
import { jsenvPluginInlining } from "../plugins/inlining/jsenv_plugin_inlining.js";
|
|
39
39
|
import { jsenvPluginLineBreakNormalization } from "./jsenv_plugin_line_break_normalization.js";
|
|
40
40
|
|
|
41
41
|
import { createBuildSpecifierManager } from "./build_specifier_manager.js";
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createHtmlNode,
|
|
3
|
+
findHtmlNode,
|
|
4
|
+
getHtmlNodeAttribute,
|
|
5
|
+
insertHtmlNodeAfter,
|
|
6
|
+
parseHtml,
|
|
7
|
+
removeHtmlNode,
|
|
8
|
+
setHtmlNodeAttributes,
|
|
9
|
+
stringifyHtmlAst,
|
|
10
|
+
visitHtmlNodes,
|
|
11
|
+
} from "@jsenv/ast";
|
|
3
12
|
import { comparePathnames } from "@jsenv/filesystem";
|
|
13
|
+
import { createDetailedMessage, UNICODE } from "@jsenv/humanize";
|
|
4
14
|
import { createMagicSource, generateSourcemapFileUrl } from "@jsenv/sourcemap";
|
|
5
15
|
import {
|
|
6
16
|
ensurePathnameTrailingSlash,
|
|
7
|
-
urlToRelativeUrl,
|
|
8
17
|
injectQueryParamIntoSpecifierWithoutEncoding,
|
|
9
18
|
renderUrlOrRelativeUrlFilename,
|
|
19
|
+
urlToRelativeUrl,
|
|
10
20
|
} from "@jsenv/urls";
|
|
11
|
-
import {
|
|
12
|
-
parseHtml,
|
|
13
|
-
stringifyHtmlAst,
|
|
14
|
-
visitHtmlNodes,
|
|
15
|
-
getHtmlNodeAttribute,
|
|
16
|
-
setHtmlNodeAttributes,
|
|
17
|
-
removeHtmlNode,
|
|
18
|
-
createHtmlNode,
|
|
19
|
-
insertHtmlNodeAfter,
|
|
20
|
-
findHtmlNode,
|
|
21
|
-
} from "@jsenv/ast";
|
|
22
21
|
import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js";
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
23
|
|
|
24
24
|
import { escapeRegexpSpecialChars } from "@jsenv/utils/src/string/escape_regexp_special_chars.js";
|
|
25
|
+
import { prependContent } from "../kitchen/prepend_content.js";
|
|
25
26
|
import { GRAPH_VISITOR } from "../kitchen/url_graph/url_graph_visitor.js";
|
|
26
27
|
import { isWebWorkerUrlInfo } from "../kitchen/web_workers.js";
|
|
27
|
-
import { prependContent } from "../kitchen/prepend_content.js";
|
|
28
28
|
import { createBuildUrlsGenerator } from "./build_urls_generator.js";
|
|
29
29
|
import {
|
|
30
30
|
injectVersionMappingsAsGlobal,
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
* we want to be in the user shoes and we should not alter build files.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort";
|
|
17
|
+
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem";
|
|
18
|
+
import { createLogger, createTaskLog } from "@jsenv/humanize";
|
|
17
19
|
import {
|
|
18
|
-
jsenvAccessControlAllowedHeaders,
|
|
19
|
-
startServer,
|
|
20
20
|
fetchFileSystem,
|
|
21
|
+
jsenvAccessControlAllowedHeaders,
|
|
21
22
|
jsenvServiceCORS,
|
|
22
23
|
jsenvServiceErrorHandler,
|
|
24
|
+
startServer,
|
|
23
25
|
} from "@jsenv/server";
|
|
24
|
-
import {
|
|
25
|
-
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort";
|
|
26
|
-
import { createLogger, createTaskLog } from "@jsenv/humanize";
|
|
26
|
+
import { existsSync } from "node:fs";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Start a server for build files.
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { URL_META } from "@jsenv/url-meta";
|
|
3
1
|
import {
|
|
4
2
|
assertAndNormalizeDirectoryUrl,
|
|
5
3
|
bufferToEtag,
|
|
6
4
|
} from "@jsenv/filesystem";
|
|
7
5
|
import { createLogger, createTaskLog } from "@jsenv/humanize";
|
|
8
|
-
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
9
6
|
import {
|
|
7
|
+
composeTwoResponses,
|
|
10
8
|
jsenvAccessControlAllowedHeaders,
|
|
11
|
-
startServer,
|
|
12
9
|
jsenvServiceCORS,
|
|
13
10
|
jsenvServiceErrorHandler,
|
|
14
11
|
serveDirectory,
|
|
15
|
-
|
|
12
|
+
startServer,
|
|
16
13
|
} from "@jsenv/server";
|
|
17
14
|
import { convertFileSystemErrorToResponseProperties } from "@jsenv/server/src/internal/convertFileSystemErrorToResponseProperties.js";
|
|
15
|
+
import { URL_META } from "@jsenv/url-meta";
|
|
16
|
+
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
17
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
import { watchSourceFiles } from "../helpers/watch_source_files.js";
|
|
19
|
+
import { defaultRuntimeCompat } from "../build/build.js";
|
|
21
20
|
import { createEventEmitter } from "../helpers/event_emitter.js";
|
|
22
21
|
import { lookupPackageDirectory } from "../helpers/lookup_package_directory.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
import { watchSourceFiles } from "../helpers/watch_source_files.js";
|
|
23
|
+
import { WEB_URL_CONVERTER } from "../helpers/web_url_converter.js";
|
|
25
24
|
import { createKitchen } from "../kitchen/kitchen.js";
|
|
26
25
|
import { getCorePlugins } from "../plugins/plugins.js";
|
|
27
26
|
import { jsenvPluginServerEventsClientInjection } from "../plugins/server_events/jsenv_plugin_server_events_client_injection.js";
|
|
27
|
+
import { createServerEventsDispatcher } from "../plugins/server_events/server_events_dispatcher.js";
|
|
28
28
|
import { parseUserAgentHeader } from "./user_agent.js";
|
|
29
29
|
|
|
30
30
|
/**
|
package/src/kitchen/errors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { pathToFileURL } from "node:url";
|
|
2
1
|
import { createDetailedMessage, generateContentFrame } from "@jsenv/humanize";
|
|
3
2
|
import { stringifyUrlSite } from "@jsenv/urls";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
export const createResolveUrlError = ({
|
|
6
6
|
pluginController,
|
package/src/kitchen/kitchen.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
+
import { ensureWindowsDriveLetter } from "@jsenv/filesystem";
|
|
2
|
+
import { ANSI, createDetailedMessage, createLogger } from "@jsenv/humanize";
|
|
3
|
+
import { RUNTIME_COMPAT } from "@jsenv/runtime-compat";
|
|
4
|
+
import { URL_META } from "@jsenv/url-meta";
|
|
1
5
|
import {
|
|
2
|
-
urlIsInsideOf,
|
|
3
6
|
moveUrl,
|
|
4
7
|
normalizeUrl,
|
|
5
8
|
setUrlFilename,
|
|
9
|
+
urlIsInsideOf,
|
|
6
10
|
} from "@jsenv/urls";
|
|
7
|
-
import { URL_META } from "@jsenv/url-meta";
|
|
8
|
-
import { ensureWindowsDriveLetter } from "@jsenv/filesystem";
|
|
9
|
-
import { createLogger, createDetailedMessage, ANSI } from "@jsenv/humanize";
|
|
10
11
|
import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js";
|
|
11
|
-
import { RUNTIME_COMPAT } from "@jsenv/runtime-compat";
|
|
12
12
|
|
|
13
|
-
import { createUrlGraph } from "./url_graph/url_graph.js";
|
|
14
|
-
import { urlSpecifierEncoding } from "./url_graph/url_specifier_encoding.js";
|
|
15
|
-
import { createPluginController } from "../plugins/plugin_controller.js";
|
|
16
13
|
import { jsenvPluginHtmlSyntaxErrorFallback } from "../plugins/html_syntax_error_fallback/jsenv_plugin_html_syntax_error_fallback.js";
|
|
17
|
-
import {
|
|
14
|
+
import { createPluginController } from "../plugins/plugin_controller.js";
|
|
18
15
|
import {
|
|
19
|
-
createResolveUrlError,
|
|
20
16
|
createFetchUrlContentError,
|
|
21
|
-
createTransformUrlContentError,
|
|
22
17
|
createFinalizeUrlContentError,
|
|
18
|
+
createResolveUrlError,
|
|
19
|
+
createTransformUrlContentError,
|
|
23
20
|
} from "./errors.js";
|
|
24
21
|
import { assertFetchedContentCompliance } from "./fetched_content_compliance.js";
|
|
22
|
+
import { createUrlGraph } from "./url_graph/url_graph.js";
|
|
23
|
+
import { createUrlInfoTransformer } from "./url_graph/url_info_transformations.js";
|
|
24
|
+
import { urlSpecifierEncoding } from "./url_graph/url_specifier_encoding.js";
|
|
25
25
|
|
|
26
26
|
const inlineContentClientFileUrl = new URL(
|
|
27
27
|
"./client/inline_content.js",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createMagicSource, composeTwoSourcemaps } from "@jsenv/sourcemap";
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
stringifyHtmlAst,
|
|
2
|
+
applyBabelPlugins,
|
|
5
3
|
createHtmlNode,
|
|
6
4
|
injectHtmlNodeAsEarlyAsPossible,
|
|
7
|
-
|
|
5
|
+
parseHtml,
|
|
6
|
+
stringifyHtmlAst,
|
|
8
7
|
} from "@jsenv/ast";
|
|
8
|
+
import { composeTwoSourcemaps, createMagicSource } from "@jsenv/sourcemap";
|
|
9
9
|
|
|
10
10
|
export const prependContent = async (
|
|
11
11
|
urlInfoReceivingCode,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { generateUrlForInlineContent } from "@jsenv/ast";
|
|
2
|
+
import { generateContentFrame } from "@jsenv/humanize";
|
|
1
3
|
import {
|
|
2
4
|
getCallerPosition,
|
|
3
5
|
stringifyUrlSite,
|
|
4
6
|
urlToBasename,
|
|
5
7
|
urlToExtension,
|
|
6
8
|
} from "@jsenv/urls";
|
|
7
|
-
import { generateUrlForInlineContent } from "@jsenv/ast";
|
|
8
|
-
import { generateContentFrame } from "@jsenv/humanize";
|
|
9
9
|
|
|
10
|
-
import { isWebWorkerEntryPointReference } from "../web_workers.js";
|
|
11
10
|
import { prependContent } from "../prepend_content.js";
|
|
11
|
+
import { isWebWorkerEntryPointReference } from "../web_workers.js";
|
|
12
12
|
|
|
13
13
|
let referenceId = 0;
|
|
14
14
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
urlToRelativeUrl,
|
|
3
2
|
asUrlWithoutSearch,
|
|
4
3
|
injectQueryParamsIntoSpecifier,
|
|
4
|
+
urlToRelativeUrl,
|
|
5
5
|
} from "@jsenv/urls";
|
|
6
6
|
|
|
7
7
|
import { createEventEmitter } from "../../helpers/event_emitter.js";
|
|
8
|
-
import { urlSpecifierEncoding } from "./url_specifier_encoding.js";
|
|
9
8
|
import { createDependencies } from "./references.js";
|
|
10
9
|
import { GRAPH_VISITOR } from "./url_graph_visitor.js";
|
|
10
|
+
import { urlSpecifierEncoding } from "./url_specifier_encoding.js";
|
|
11
11
|
|
|
12
12
|
export const createUrlGraph = ({
|
|
13
13
|
rootDirectoryUrl,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { pathToFileURL } from "node:url";
|
|
2
1
|
import { writeFileSync } from "@jsenv/filesystem";
|
|
3
|
-
import { urlToRelativeUrl, isFileSystemPath } from "@jsenv/urls";
|
|
4
2
|
import {
|
|
5
3
|
composeTwoSourcemaps,
|
|
6
|
-
SOURCEMAP,
|
|
7
|
-
generateSourcemapFileUrl,
|
|
8
4
|
generateSourcemapDataUrl,
|
|
5
|
+
generateSourcemapFileUrl,
|
|
6
|
+
SOURCEMAP,
|
|
9
7
|
} from "@jsenv/sourcemap";
|
|
8
|
+
import { isFileSystemPath, urlToRelativeUrl } from "@jsenv/urls";
|
|
9
|
+
import { pathToFileURL } from "node:url";
|
|
10
10
|
import {
|
|
11
|
-
defineGettersOnPropertiesDerivedFromOriginalContent,
|
|
12
11
|
defineGettersOnPropertiesDerivedFromContent,
|
|
12
|
+
defineGettersOnPropertiesDerivedFromOriginalContent,
|
|
13
13
|
} from "./url_content.js";
|
|
14
14
|
|
|
15
15
|
export const createUrlInfoTransformer = ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsenvPluginHotSearchParam } from "./jsenv_plugin_hot_search_param.js";
|
|
2
1
|
import { jsenvPluginAutoreloadClient } from "./jsenv_plugin_autoreload_client.js";
|
|
3
2
|
import { jsenvPluginAutoreloadServer } from "./jsenv_plugin_autoreload_server.js";
|
|
3
|
+
import { jsenvPluginHotSearchParam } from "./jsenv_plugin_hot_search_param.js";
|
|
4
4
|
|
|
5
5
|
export const jsenvPluginAutoreload = ({
|
|
6
6
|
clientFileChangeEventEmitter,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - global
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { createMagicSource } from "@jsenv/sourcemap";
|
|
11
10
|
import { applyBabelPlugins } from "@jsenv/ast";
|
|
11
|
+
import { createMagicSource } from "@jsenv/sourcemap";
|
|
12
12
|
|
|
13
13
|
export const jsenvPluginCommonJsGlobals = () => {
|
|
14
14
|
const transformCommonJsGlobals = async (urlInfo) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
3
1
|
import { parseHtml } from "@jsenv/ast";
|
|
2
|
+
import { urlToRelativeUrl } from "@jsenv/urls";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
4
|
|
|
5
5
|
import { generateContentFrame } from "@jsenv/humanize";
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { applyBabelPlugins, parseHtml } from "@jsenv/ast";
|
|
1
2
|
import { createMagicSource } from "@jsenv/sourcemap";
|
|
2
|
-
import { parseHtml, applyBabelPlugins } from "@jsenv/ast";
|
|
3
3
|
|
|
4
|
-
import { collectHotDataFromHtmlAst } from "./html_hot_dependencies.js";
|
|
5
4
|
import { babelPluginMetadataImportMetaHot } from "./babel_plugin_metadata_import_meta_hot.js";
|
|
5
|
+
import { collectHotDataFromHtmlAst } from "./html_hot_dependencies.js";
|
|
6
6
|
|
|
7
7
|
export const jsenvPluginImportMetaHot = () => {
|
|
8
8
|
const importMetaHotClientFileUrl = new URL(
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* - replaced by undefined (import.meta.dev but it's build; the goal is to ensure it's tree-shaked)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { createMagicSource } from "@jsenv/sourcemap";
|
|
12
11
|
import { applyBabelPlugins } from "@jsenv/ast";
|
|
12
|
+
import { createMagicSource } from "@jsenv/sourcemap";
|
|
13
13
|
|
|
14
14
|
export const jsenvPluginImportMetaScenarios = () => {
|
|
15
15
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { injectJsenvScript, parseHtml, stringifyHtmlAst } from "@jsenv/ast";
|
|
1
2
|
import { createMagicSource } from "@jsenv/sourcemap";
|
|
2
|
-
import { parseHtml, injectJsenvScript, stringifyHtmlAst } from "@jsenv/ast";
|
|
3
3
|
|
|
4
4
|
export const injectGlobals = (content, globals, urlInfo) => {
|
|
5
5
|
if (urlInfo.type === "html") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { createMagicSource } from "@jsenv/sourcemap";
|
|
1
2
|
import { URL_META } from "@jsenv/url-meta";
|
|
2
3
|
import { asUrlWithoutSearch } from "@jsenv/urls";
|
|
3
|
-
import { createMagicSource } from "@jsenv/sourcemap";
|
|
4
4
|
|
|
5
5
|
export const jsenvPluginInjections = (rawAssociations) => {
|
|
6
6
|
let resolvedAssociations;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
parseHtml,
|
|
3
|
-
stringifyHtmlAst,
|
|
4
|
-
visitHtmlNodes,
|
|
5
|
-
getHtmlNodeText,
|
|
6
2
|
analyzeScriptNode,
|
|
7
3
|
getHtmlNodeAttribute,
|
|
8
|
-
setHtmlNodeAttributes,
|
|
9
|
-
setHtmlNodeText,
|
|
10
4
|
getHtmlNodePosition,
|
|
5
|
+
getHtmlNodeText,
|
|
11
6
|
getUrlForContentInsideHtml,
|
|
7
|
+
parseHtml,
|
|
8
|
+
setHtmlNodeAttributes,
|
|
9
|
+
setHtmlNodeText,
|
|
10
|
+
stringifyHtmlAst,
|
|
11
|
+
visitHtmlNodes,
|
|
12
12
|
} from "@jsenv/ast";
|
|
13
13
|
|
|
14
14
|
export const jsenvPluginInliningIntoHtml = () => {
|
package/src/plugins/plugins.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
statSync,
|
|
6
|
-
lstatSync,
|
|
7
|
-
readdirSync,
|
|
8
|
-
} from "node:fs";
|
|
9
|
-
import { pathToFileURL } from "node:url";
|
|
10
|
-
import {
|
|
11
|
-
urlIsInsideOf,
|
|
12
|
-
urlToRelativeUrl,
|
|
13
|
-
urlToFilename,
|
|
14
|
-
ensurePathnameTrailingSlash,
|
|
15
|
-
} from "@jsenv/urls";
|
|
2
|
+
assertAndNormalizeDirectoryUrl,
|
|
3
|
+
comparePathnames,
|
|
4
|
+
} from "@jsenv/filesystem";
|
|
16
5
|
import {
|
|
17
6
|
applyFileSystemMagicResolution,
|
|
18
7
|
getExtensionsToTry,
|
|
19
8
|
} from "@jsenv/node-esm-resolution";
|
|
20
9
|
import { pickContentType } from "@jsenv/server";
|
|
10
|
+
import {
|
|
11
|
+
ensurePathnameTrailingSlash,
|
|
12
|
+
urlIsInsideOf,
|
|
13
|
+
urlToFilename,
|
|
14
|
+
urlToRelativeUrl,
|
|
15
|
+
} from "@jsenv/urls";
|
|
21
16
|
import { CONTENT_TYPE } from "@jsenv/utils/src/content_type/content_type.js";
|
|
22
17
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
existsSync,
|
|
19
|
+
lstatSync,
|
|
20
|
+
readdirSync,
|
|
21
|
+
readFileSync,
|
|
22
|
+
realpathSync,
|
|
23
|
+
statSync,
|
|
24
|
+
} from "node:fs";
|
|
25
|
+
import { pathToFileURL } from "node:url";
|
|
26
26
|
|
|
27
27
|
const html404AndParentDirIsEmptyFileUrl = new URL(
|
|
28
28
|
"./html_404_and_parent_dir_is_empty.html",
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
visitHtmlNodes,
|
|
4
|
-
getHtmlNodeText,
|
|
5
|
-
setHtmlNodeText,
|
|
6
|
-
removeHtmlNodeText,
|
|
7
|
-
removeHtmlNode,
|
|
2
|
+
analyzeScriptNode,
|
|
8
3
|
getHtmlNodeAttribute,
|
|
9
|
-
getHtmlNodePosition,
|
|
10
|
-
setHtmlNodeAttributes,
|
|
11
4
|
getHtmlNodeAttributePosition,
|
|
12
|
-
|
|
5
|
+
getHtmlNodePosition,
|
|
6
|
+
getHtmlNodeText,
|
|
7
|
+
getUrlForContentInsideHtml,
|
|
8
|
+
parseHtml,
|
|
13
9
|
parseSrcSet,
|
|
10
|
+
removeHtmlNode,
|
|
11
|
+
removeHtmlNodeText,
|
|
12
|
+
setHtmlNodeAttributes,
|
|
13
|
+
setHtmlNodeText,
|
|
14
14
|
stringifyHtmlAst,
|
|
15
|
-
|
|
15
|
+
visitHtmlNodes,
|
|
16
16
|
} from "@jsenv/ast";
|
|
17
17
|
import {
|
|
18
|
-
resolveImport,
|
|
19
18
|
composeTwoImportMaps,
|
|
20
19
|
normalizeImportMap,
|
|
20
|
+
resolveImport,
|
|
21
21
|
} from "@jsenv/importmap";
|
|
22
22
|
|
|
23
23
|
export const jsenvPluginHtmlReferenceAnalysis = ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { getUrlForContentInsideJs, parseJsUrls } from "@jsenv/ast";
|
|
1
2
|
import { createMagicSource } from "@jsenv/sourcemap";
|
|
2
|
-
import { parseJsUrls, getUrlForContentInsideJs } from "@jsenv/ast";
|
|
3
3
|
import { urlToExtension } from "@jsenv/urls";
|
|
4
4
|
import { JS_QUOTES } from "@jsenv/utils/src/string/js_quotes.js";
|
|
5
5
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsenvPluginDirectoryReferenceAnalysis } from "./directory/jsenv_plugin_directory_reference_analysis.js";
|
|
1
|
+
import { jsenvPluginCssReferenceAnalysis } from "./css/jsenv_plugin_css_reference_analysis.js";
|
|
3
2
|
import { jsenvPluginDataUrlsAnalysis } from "./data_urls/jsenv_plugin_data_urls_analysis.js";
|
|
3
|
+
import { jsenvPluginDirectoryReferenceAnalysis } from "./directory/jsenv_plugin_directory_reference_analysis.js";
|
|
4
4
|
import { jsenvPluginHtmlReferenceAnalysis } from "./html/jsenv_plugin_html_reference_analysis.js";
|
|
5
|
-
import { jsenvPluginWebmanifestReferenceAnalysis } from "./webmanifest/jsenv_plugin_webmanifest_reference_analysis.js";
|
|
6
|
-
import { jsenvPluginCssReferenceAnalysis } from "./css/jsenv_plugin_css_reference_analysis.js";
|
|
7
5
|
import { jsenvPluginJsReferenceAnalysis } from "./js/jsenv_plugin_js_reference_analysis.js";
|
|
6
|
+
import { jsenvPluginReferenceExpectedTypes } from "./jsenv_plugin_reference_expected_types.js";
|
|
7
|
+
import { jsenvPluginWebmanifestReferenceAnalysis } from "./webmanifest/jsenv_plugin_webmanifest_reference_analysis.js";
|
|
8
8
|
|
|
9
9
|
export const jsenvPluginReferenceAnalysis = ({
|
|
10
10
|
inlineContent = true,
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* it should likely be an other plugin happening after the others
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { readFileSync } from "node:fs";
|
|
11
10
|
import {
|
|
12
11
|
applyNodeEsmResolution,
|
|
13
|
-
readCustomConditionsFromProcessArgs,
|
|
14
12
|
defaultLookupPackageScope,
|
|
15
13
|
defaultReadPackageJson,
|
|
14
|
+
readCustomConditionsFromProcessArgs,
|
|
16
15
|
} from "@jsenv/node-esm-resolution";
|
|
16
|
+
import { readFileSync } from "node:fs";
|
|
17
17
|
|
|
18
18
|
export const createNodeEsmResolver = ({
|
|
19
19
|
runtimeCompat,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* to provide "serverEvents" used by other plugins
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { injectJsenvScript, parseHtml, stringifyHtmlAst } from "@jsenv/ast";
|
|
7
7
|
|
|
8
8
|
const serverEventsClientFileUrl = new URL(
|
|
9
9
|
"./client/server_events_client.js",
|