@jsenv/core 27.0.0-alpha.78 → 27.0.0-alpha.79
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/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parentPort } from "node:worker_threads";
|
|
2
2
|
import { registerFileLifecycle, readFileSync as readFileSync$1, bufferToEtag, writeFileSync, ensureWindowsDriveLetter, collectFiles, assertAndNormalizeDirectoryUrl, registerDirectoryLifecycle, writeFile, ensureEmptyDirectory, writeDirectory } from "@jsenv/filesystem";
|
|
3
3
|
import { createDetailedMessage, createLogger, createTaskLog, loggerToLevels, ANSI, msAsDuration, msAsEllapsedTime, byteAsMemoryUsage, UNICODE, createLog, startSpinner, distributePercentages, byteAsFileSize } from "@jsenv/log";
|
|
4
|
-
import { urlToRelativeUrl, generateInlineContentUrl, ensurePathnameTrailingSlash, urlIsInsideOf, urlToFilename,
|
|
4
|
+
import { urlToRelativeUrl, generateInlineContentUrl, ensurePathnameTrailingSlash, urlIsInsideOf, urlToFilename, DATA_URL, injectQueryParams, injectQueryParamsIntoSpecifier, fileSystemPathToUrl, urlToFileSystemPath, isFileSystemPath, normalizeUrl, stringifyUrlSite, setUrlFilename, moveUrl, getCallerPosition, resolveUrl, resolveDirectoryUrl, asUrlWithoutSearch, asUrlUntilPathname, urlToBasename, urlToExtension } from "@jsenv/urls";
|
|
5
5
|
import { initReloadableProcess } from "@jsenv/utils/process_reload/process_reload.js";
|
|
6
6
|
import { URL_META } from "@jsenv/url-meta";
|
|
7
7
|
import { parseHtmlString, stringifyHtmlAst, visitHtmlAst, getHtmlNodeAttributeByName, htmlNodePosition, findNode, getHtmlNodeTextNode, removeHtmlNode, setHtmlNodeGeneratedText, removeHtmlNodeAttributeByName, parseScriptNode, injectScriptAsEarlyAsPossible, createHtmlNode, removeHtmlNodeText, assignHtmlNodeAttributes, parseLinkNode } from "@jsenv/utils/html_ast/html_ast.js";
|
|
@@ -11,7 +11,7 @@ import { applyPostCss } from "@jsenv/utils/css_ast/apply_post_css.js";
|
|
|
11
11
|
import { postCssPluginUrlVisitor } from "@jsenv/utils/css_ast/postcss_plugin_url_visitor.js";
|
|
12
12
|
import { parseJsUrls } from "@jsenv/utils/js_ast/parse_js_urls.js";
|
|
13
13
|
import { resolveImport, normalizeImportMap, composeTwoImportMaps } from "@jsenv/importmap";
|
|
14
|
-
import { applyNodeEsmResolution, defaultLookupPackageScope, defaultReadPackageJson, readCustomConditionsFromProcessArgs, applyFileSystemMagicResolution } from "@jsenv/node-esm-resolution";
|
|
14
|
+
import { applyNodeEsmResolution, defaultLookupPackageScope, defaultReadPackageJson, readCustomConditionsFromProcessArgs, applyFileSystemMagicResolution, getExtensionsToTry } from "@jsenv/node-esm-resolution";
|
|
15
15
|
import { statSync, realpathSync, readdirSync, readFileSync, existsSync } from "node:fs";
|
|
16
16
|
import { pathToFileURL } from "node:url";
|
|
17
17
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js";
|
|
@@ -1066,19 +1066,6 @@ const jsenvPluginFileUrls = ({
|
|
|
1066
1066
|
preservesSymlink = true,
|
|
1067
1067
|
directoryReferenceAllowed = false
|
|
1068
1068
|
}) => {
|
|
1069
|
-
const getExtensionsToTry = (magicExtensions, importer) => {
|
|
1070
|
-
const extensionsSet = new Set();
|
|
1071
|
-
magicExtensions.forEach(magicExtension => {
|
|
1072
|
-
if (magicExtension === "inherit") {
|
|
1073
|
-
const importerExtension = urlToExtension(importer);
|
|
1074
|
-
extensionsSet.add(importerExtension);
|
|
1075
|
-
} else {
|
|
1076
|
-
extensionsSet.add(magicExtension);
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
return Array.from(extensionsSet.values());
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
1069
|
return [{
|
|
1083
1070
|
name: "jsenv:file_url_resolution",
|
|
1084
1071
|
appliesDuring: "*",
|
|
@@ -2870,7 +2857,7 @@ const jsenvPluginAsJsClassicHtml = ({
|
|
|
2870
2857
|
specifierLine: line - 1,
|
|
2871
2858
|
specifierColumn: column,
|
|
2872
2859
|
specifier: inlineScriptUrl,
|
|
2873
|
-
contentType: "
|
|
2860
|
+
contentType: "text/javascript",
|
|
2874
2861
|
content: textNode.value
|
|
2875
2862
|
});
|
|
2876
2863
|
const [, newUrlInfo] = await getReferenceAsJsClassic(inlineReference, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "27.0.0-alpha.
|
|
3
|
+
"version": "27.0.0-alpha.79",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -68,16 +68,16 @@
|
|
|
68
68
|
"@financial-times/polyfill-useragent-normaliser": "2.0.1",
|
|
69
69
|
"@jsenv/abort": "4.2.2",
|
|
70
70
|
"@jsenv/babel-plugins": "1.0.3",
|
|
71
|
-
"@jsenv/filesystem": "4.0.
|
|
71
|
+
"@jsenv/filesystem": "4.0.9",
|
|
72
72
|
"@jsenv/importmap": "1.2.0",
|
|
73
73
|
"@jsenv/integrity": "0.0.1",
|
|
74
74
|
"@jsenv/log": "2.0.0",
|
|
75
|
-
"@jsenv/node-esm-resolution": "0.0
|
|
76
|
-
"@jsenv/server": "12.
|
|
75
|
+
"@jsenv/node-esm-resolution": "0.1.0",
|
|
76
|
+
"@jsenv/server": "12.7.0",
|
|
77
77
|
"@jsenv/uneval": "1.6.0",
|
|
78
|
-
"@jsenv/utils": "1.8.
|
|
78
|
+
"@jsenv/utils": "1.8.12",
|
|
79
79
|
"@jsenv/url-meta": "7.0.0",
|
|
80
|
-
"@jsenv/urls": "1.2.
|
|
80
|
+
"@jsenv/urls": "1.2.5",
|
|
81
81
|
"construct-style-sheets-polyfill": "3.1.0",
|
|
82
82
|
"cssnano": "5.1.7",
|
|
83
83
|
"cssnano-preset-default": "5.2.7",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"eslint-plugin-html": "6.2.0",
|
|
112
112
|
"eslint-plugin-import": "2.26.0",
|
|
113
113
|
"eslint-plugin-react": "7.29.4",
|
|
114
|
-
"playwright": "1.
|
|
114
|
+
"playwright": "1.22.2",
|
|
115
115
|
"postcss-import": "14.1.0",
|
|
116
116
|
"prettier": "2.6.2",
|
|
117
117
|
"redux": "4.1.2",
|
|
@@ -3,12 +3,14 @@ import { pathToFileURL } from "node:url"
|
|
|
3
3
|
import {
|
|
4
4
|
urlIsInsideOf,
|
|
5
5
|
urlToRelativeUrl,
|
|
6
|
-
urlToExtension,
|
|
7
6
|
urlToFilename,
|
|
8
7
|
ensurePathnameTrailingSlash,
|
|
9
8
|
} from "@jsenv/urls"
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
applyFileSystemMagicResolution,
|
|
12
|
+
getExtensionsToTry,
|
|
13
|
+
} from "@jsenv/node-esm-resolution"
|
|
12
14
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
13
15
|
|
|
14
16
|
export const jsenvPluginFileUrls = ({
|
|
@@ -17,19 +19,6 @@ export const jsenvPluginFileUrls = ({
|
|
|
17
19
|
preservesSymlink = true,
|
|
18
20
|
directoryReferenceAllowed = false,
|
|
19
21
|
}) => {
|
|
20
|
-
const getExtensionsToTry = (magicExtensions, importer) => {
|
|
21
|
-
const extensionsSet = new Set()
|
|
22
|
-
magicExtensions.forEach((magicExtension) => {
|
|
23
|
-
if (magicExtension === "inherit") {
|
|
24
|
-
const importerExtension = urlToExtension(importer)
|
|
25
|
-
extensionsSet.add(importerExtension)
|
|
26
|
-
} else {
|
|
27
|
-
extensionsSet.add(magicExtension)
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
return Array.from(extensionsSet.values())
|
|
31
|
-
}
|
|
32
|
-
|
|
33
22
|
return [
|
|
34
23
|
{
|
|
35
24
|
name: "jsenv:file_url_resolution",
|
|
@@ -190,7 +190,7 @@ export const jsenvPluginAsJsClassicHtml = ({
|
|
|
190
190
|
specifierLine: line - 1,
|
|
191
191
|
specifierColumn: column,
|
|
192
192
|
specifier: inlineScriptUrl,
|
|
193
|
-
contentType: "
|
|
193
|
+
contentType: "text/javascript",
|
|
194
194
|
content: textNode.value,
|
|
195
195
|
})
|
|
196
196
|
const [, newUrlInfo] = await getReferenceAsJsClassic(
|