@jsenv/core 27.0.0-alpha.71 → 27.0.0-alpha.72
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 +6 -5
- package/package.json +5 -4
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +2 -2
- package/src/plugins/bundling/js_module/bundle_js_module.js +2 -1
- package/src/plugins/inline/jsenv_plugin_data_urls.js +3 -3
- package/src/plugins/inline/jsenv_plugin_inline_query_param.js +2 -2
- package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +2 -1
- package/src/test/execute_plan.js +2 -1
- package/src/test/execute_test_plan.js +2 -1
package/dist/main.js
CHANGED
|
@@ -2,8 +2,9 @@ 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, loggerToLevels } from "@jsenv/logger";
|
|
4
4
|
import { createTaskLog, ANSI, msAsDuration, msAsEllapsedTime, byteAsMemoryUsage, UNICODE, createLog, startSpinner, distributePercentages, byteAsFileSize } from "@jsenv/log";
|
|
5
|
-
import { urlToRelativeUrl,
|
|
5
|
+
import { urlToRelativeUrl, generateInlineContentUrl, ensurePathnameTrailingSlash, urlIsInsideOf, urlToFilename, urlToExtension, DATA_URL, injectQueryParams, injectQueryParamsIntoSpecifier, fileSystemPathToUrl, urlToFileSystemPath, isFileSystemPath, normalizeUrl, stringifyUrlSite, setUrlFilename, moveUrl, getCallerPosition, resolveUrl, resolveDirectoryUrl, asUrlWithoutSearch, asUrlUntilPathname, urlToBasename } from "@jsenv/urls";
|
|
6
6
|
import { initReloadableProcess } from "@jsenv/utils/process_reload/process_reload.js";
|
|
7
|
+
import { URL_META } from "@jsenv/url-meta";
|
|
7
8
|
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";
|
|
8
9
|
import { htmlAttributeSrcSet } from "@jsenv/utils/html_ast/html_attribute_src_set.js";
|
|
9
10
|
import { createMagicSource } from "@jsenv/utils/sourcemap/magic_source.js";
|
|
@@ -1787,7 +1788,7 @@ const jsenvPluginDataUrls = () => {
|
|
|
1787
1788
|
contentType,
|
|
1788
1789
|
base64Flag,
|
|
1789
1790
|
data: urlData
|
|
1790
|
-
} =
|
|
1791
|
+
} = DATA_URL.parse(urlInfo.url);
|
|
1791
1792
|
urlInfo.data.base64Flag = base64Flag;
|
|
1792
1793
|
return {
|
|
1793
1794
|
contentType,
|
|
@@ -1817,7 +1818,7 @@ const jsenvPluginDataUrls = () => {
|
|
|
1817
1818
|
return reference.generatedUrl;
|
|
1818
1819
|
}
|
|
1819
1820
|
|
|
1820
|
-
const specifier =
|
|
1821
|
+
const specifier = DATA_URL.stringify({
|
|
1821
1822
|
contentType: urlInfo.contentType,
|
|
1822
1823
|
base64Flag: urlInfo.data.base64Flag,
|
|
1823
1824
|
data: urlInfo.data.base64Flag ? dataToBase64(urlInfo.content) : String(urlInfo.content)
|
|
@@ -1883,7 +1884,7 @@ const jsenvPluginInlineQueryParam = () => {
|
|
|
1883
1884
|
await context.cook(urlInfo, {
|
|
1884
1885
|
reference
|
|
1885
1886
|
});
|
|
1886
|
-
const specifier =
|
|
1887
|
+
const specifier = DATA_URL.stringify({
|
|
1887
1888
|
mediaType: urlInfo.contentType,
|
|
1888
1889
|
base64Flag: true,
|
|
1889
1890
|
data: Buffer.from(urlInfo.content).toString("base64")
|
|
@@ -8358,7 +8359,7 @@ const jsenvPluginExplorer = ({
|
|
|
8358
8359
|
meta
|
|
8359
8360
|
}));
|
|
8360
8361
|
let html = String(readFileSync(new URL(htmlClientFileUrl)));
|
|
8361
|
-
html = html.replace("virtual:FAVICON_HREF",
|
|
8362
|
+
html = html.replace("virtual:FAVICON_HREF", DATA_URL.stringify({
|
|
8362
8363
|
contentType: CONTENT_TYPE.fromUrlExtension(faviconClientFileUrl),
|
|
8363
8364
|
base64Flag: true,
|
|
8364
8365
|
data: readFileSync(new URL(faviconClientFileUrl)).toString("base64")
|
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.72",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@financial-times/polyfill-useragent-normaliser": "2.0.1",
|
|
70
70
|
"@jsenv/abort": "4.1.2",
|
|
71
71
|
"@jsenv/babel-plugins": "1.0.3",
|
|
72
|
-
"@jsenv/filesystem": "4.0.
|
|
72
|
+
"@jsenv/filesystem": "4.0.3",
|
|
73
73
|
"@jsenv/importmap": "1.2.0",
|
|
74
74
|
"@jsenv/integrity": "0.0.1",
|
|
75
75
|
"@jsenv/log": "1.6.3",
|
|
@@ -77,8 +77,9 @@
|
|
|
77
77
|
"@jsenv/node-esm-resolution": "0.0.10",
|
|
78
78
|
"@jsenv/server": "12.6.3",
|
|
79
79
|
"@jsenv/uneval": "1.6.0",
|
|
80
|
-
"@jsenv/utils": "1.8.
|
|
81
|
-
"@jsenv/
|
|
80
|
+
"@jsenv/utils": "1.8.6",
|
|
81
|
+
"@jsenv/url-meta": "7.0.0",
|
|
82
|
+
"@jsenv/urls": "1.2.0",
|
|
82
83
|
"construct-style-sheets-polyfill": "3.1.0",
|
|
83
84
|
"cssnano": "5.1.7",
|
|
84
85
|
"cssnano-preset-default": "5.2.7",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs"
|
|
2
|
-
import {
|
|
2
|
+
import { DATA_URL } from "@jsenv/urls"
|
|
3
3
|
import { collectFiles } from "@jsenv/filesystem"
|
|
4
4
|
|
|
5
5
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
@@ -38,7 +38,7 @@ export const jsenvPluginExplorer = ({ groups }) => {
|
|
|
38
38
|
let html = String(readFileSync(new URL(htmlClientFileUrl)))
|
|
39
39
|
html = html.replace(
|
|
40
40
|
"virtual:FAVICON_HREF",
|
|
41
|
-
|
|
41
|
+
DATA_URL.stringify({
|
|
42
42
|
contentType: CONTENT_TYPE.fromUrlExtension(faviconClientFileUrl),
|
|
43
43
|
base64Flag: true,
|
|
44
44
|
data: readFileSync(new URL(faviconClientFileUrl)).toString("base64"),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url"
|
|
2
|
-
import {
|
|
2
|
+
import { URL_META } from "@jsenv/url-meta"
|
|
3
|
+
import { isFileSystemPath } from "@jsenv/urls"
|
|
3
4
|
import { createDetailedMessage } from "@jsenv/logger"
|
|
4
5
|
|
|
5
6
|
import { babelHelperNameFromUrl } from "@jsenv/babel-plugins"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DATA_URL } from "@jsenv/urls"
|
|
2
2
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
3
3
|
|
|
4
4
|
export const jsenvPluginDataUrls = () => {
|
|
@@ -19,7 +19,7 @@ export const jsenvPluginDataUrls = () => {
|
|
|
19
19
|
contentType,
|
|
20
20
|
base64Flag,
|
|
21
21
|
data: urlData,
|
|
22
|
-
} =
|
|
22
|
+
} = DATA_URL.parse(urlInfo.url)
|
|
23
23
|
urlInfo.data.base64Flag = base64Flag
|
|
24
24
|
return {
|
|
25
25
|
contentType,
|
|
@@ -39,7 +39,7 @@ export const jsenvPluginDataUrls = () => {
|
|
|
39
39
|
if (urlInfo.originalContent === urlInfo.content) {
|
|
40
40
|
return reference.generatedUrl
|
|
41
41
|
}
|
|
42
|
-
const specifier =
|
|
42
|
+
const specifier = DATA_URL.stringify({
|
|
43
43
|
contentType: urlInfo.contentType,
|
|
44
44
|
base64Flag: urlInfo.data.base64Flag,
|
|
45
45
|
data: urlInfo.data.base64Flag
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DATA_URL } from "@jsenv/urls"
|
|
2
2
|
|
|
3
3
|
export const jsenvPluginInlineQueryParam = () => {
|
|
4
4
|
return {
|
|
@@ -26,7 +26,7 @@ export const jsenvPluginInlineQueryParam = () => {
|
|
|
26
26
|
return (async () => {
|
|
27
27
|
const urlInfo = context.urlGraph.getUrlInfo(reference.url)
|
|
28
28
|
await context.cook(urlInfo, { reference })
|
|
29
|
-
const specifier =
|
|
29
|
+
const specifier = DATA_URL.stringify({
|
|
30
30
|
mediaType: urlInfo.contentType,
|
|
31
31
|
base64Flag: true,
|
|
32
32
|
data: Buffer.from(urlInfo.content).toString("base64"),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { URL_META } from "@jsenv/url-meta"
|
|
2
|
+
import { urlToRelativeUrl } from "@jsenv/urls"
|
|
2
3
|
|
|
3
4
|
import { parseAndTransformHtmlUrls } from "./html/html_urls.js"
|
|
4
5
|
import { parseAndTransformCssUrls } from "./css/css_urls.js"
|
package/src/test/execute_plan.js
CHANGED
|
@@ -3,7 +3,8 @@ import { memoryUsage } from "node:process"
|
|
|
3
3
|
import wrapAnsi from "wrap-ansi"
|
|
4
4
|
import stripAnsi from "strip-ansi"
|
|
5
5
|
import cuid from "cuid"
|
|
6
|
-
import { URL_META
|
|
6
|
+
import { URL_META } from "@jsenv/url-meta"
|
|
7
|
+
import { urlToFileSystemPath } from "@jsenv/urls"
|
|
7
8
|
import { createDetailedMessage, loggerToLevels } from "@jsenv/logger"
|
|
8
9
|
import { createLog, startSpinner } from "@jsenv/log"
|
|
9
10
|
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
|