@jsenv/core 27.0.0-alpha.76 → 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 +5 -21
- package/package.json +9 -10
- package/src/build/build.js +1 -3
- package/src/build/start_build_server.js +2 -3
- package/src/dev/start_dev_server.js +2 -3
- package/src/execute/execute.js +1 -2
- package/src/execute/runtimes/browsers/from_playwright.js +2 -2
- package/src/execute/runtimes/node/child_exec_options.js +1 -1
- package/src/execute/runtimes/node/node_process.js +2 -2
- package/src/omega/errors.js +1 -1
- package/src/omega/kitchen.js +2 -5
- package/src/plugins/bundling/js_module/bundle_js_module.js +2 -2
- package/src/plugins/file_urls/jsenv_plugin_file_urls.js +4 -15
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_html.js +1 -1
- package/src/test/execute_plan.js +7 -2
- package/src/test/execute_test_plan.js +1 -1
- package/src/test/execution_steps.js +1 -1
package/dist/main.js
CHANGED
|
@@ -1,8 +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
|
-
import { createDetailedMessage, createLogger, loggerToLevels } from "@jsenv/
|
|
4
|
-
import {
|
|
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";
|
|
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, DATA_URL, injectQueryParams, injectQueryParamsIntoSpecifier, fileSystemPathToUrl, urlToFileSystemPath, isFileSystemPath, normalizeUrl, stringifyUrlSite, setUrlFilename, moveUrl, getCallerPosition, resolveUrl, resolveDirectoryUrl, asUrlWithoutSearch, asUrlUntilPathname, urlToBasename, urlToExtension } from "@jsenv/urls";
|
|
6
5
|
import { initReloadableProcess } from "@jsenv/utils/process_reload/process_reload.js";
|
|
7
6
|
import { URL_META } from "@jsenv/url-meta";
|
|
8
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";
|
|
@@ -12,7 +11,7 @@ import { applyPostCss } from "@jsenv/utils/css_ast/apply_post_css.js";
|
|
|
12
11
|
import { postCssPluginUrlVisitor } from "@jsenv/utils/css_ast/postcss_plugin_url_visitor.js";
|
|
13
12
|
import { parseJsUrls } from "@jsenv/utils/js_ast/parse_js_urls.js";
|
|
14
13
|
import { resolveImport, normalizeImportMap, composeTwoImportMaps } from "@jsenv/importmap";
|
|
15
|
-
import { applyNodeEsmResolution, defaultLookupPackageScope, defaultReadPackageJson, readCustomConditionsFromProcessArgs, applyFileSystemMagicResolution } from "@jsenv/node-esm-resolution";
|
|
14
|
+
import { applyNodeEsmResolution, defaultLookupPackageScope, defaultReadPackageJson, readCustomConditionsFromProcessArgs, applyFileSystemMagicResolution, getExtensionsToTry } from "@jsenv/node-esm-resolution";
|
|
16
15
|
import { statSync, realpathSync, readdirSync, readFileSync, existsSync } from "node:fs";
|
|
17
16
|
import { pathToFileURL } from "node:url";
|
|
18
17
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js";
|
|
@@ -1067,19 +1066,6 @@ const jsenvPluginFileUrls = ({
|
|
|
1067
1066
|
preservesSymlink = true,
|
|
1068
1067
|
directoryReferenceAllowed = false
|
|
1069
1068
|
}) => {
|
|
1070
|
-
const getExtensionsToTry = (magicExtensions, importer) => {
|
|
1071
|
-
const extensionsSet = new Set();
|
|
1072
|
-
magicExtensions.forEach(magicExtension => {
|
|
1073
|
-
if (magicExtension === "inherit") {
|
|
1074
|
-
const importerExtension = urlToExtension(importer);
|
|
1075
|
-
extensionsSet.add(importerExtension);
|
|
1076
|
-
} else {
|
|
1077
|
-
extensionsSet.add(magicExtension);
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
return Array.from(extensionsSet.values());
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
1069
|
return [{
|
|
1084
1070
|
name: "jsenv:file_url_resolution",
|
|
1085
1071
|
appliesDuring: "*",
|
|
@@ -2871,7 +2857,7 @@ const jsenvPluginAsJsClassicHtml = ({
|
|
|
2871
2857
|
specifierLine: line - 1,
|
|
2872
2858
|
specifierColumn: column,
|
|
2873
2859
|
specifier: inlineScriptUrl,
|
|
2874
|
-
contentType: "
|
|
2860
|
+
contentType: "text/javascript",
|
|
2875
2861
|
content: textNode.value
|
|
2876
2862
|
});
|
|
2877
2863
|
const [, newUrlInfo] = await getReferenceAsJsClassic(inlineReference, {
|
|
@@ -7311,9 +7297,7 @@ const createKitchen = ({
|
|
|
7311
7297
|
} = dishContext;
|
|
7312
7298
|
|
|
7313
7299
|
context.cook = (urlInfo, nestedDishContext) => {
|
|
7314
|
-
return cookDuringCook(urlInfo, {
|
|
7315
|
-
outDirectoryUrl: dishContext.outDirectoryUrl,
|
|
7316
|
-
clientRuntimeCompat: dishContext.clientRuntimeCompat,
|
|
7300
|
+
return cookDuringCook(urlInfo, { ...dishContext,
|
|
7317
7301
|
...nestedDishContext
|
|
7318
7302
|
});
|
|
7319
7303
|
};
|
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": {
|
|
@@ -66,19 +66,18 @@
|
|
|
66
66
|
"@babel/plugin-transform-modules-umd": "7.16.7",
|
|
67
67
|
"@c88/v8-coverage": "0.1.1",
|
|
68
68
|
"@financial-times/polyfill-useragent-normaliser": "2.0.1",
|
|
69
|
-
"@jsenv/abort": "4.
|
|
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
|
-
"@jsenv/log": "
|
|
75
|
-
"@jsenv/
|
|
76
|
-
"@jsenv/
|
|
77
|
-
"@jsenv/server": "12.6.3",
|
|
74
|
+
"@jsenv/log": "2.0.0",
|
|
75
|
+
"@jsenv/node-esm-resolution": "0.1.0",
|
|
76
|
+
"@jsenv/server": "12.7.0",
|
|
78
77
|
"@jsenv/uneval": "1.6.0",
|
|
79
|
-
"@jsenv/utils": "1.8.
|
|
78
|
+
"@jsenv/utils": "1.8.12",
|
|
80
79
|
"@jsenv/url-meta": "7.0.0",
|
|
81
|
-
"@jsenv/urls": "1.2.
|
|
80
|
+
"@jsenv/urls": "1.2.5",
|
|
82
81
|
"construct-style-sheets-polyfill": "3.1.0",
|
|
83
82
|
"cssnano": "5.1.7",
|
|
84
83
|
"cssnano-preset-default": "5.2.7",
|
|
@@ -112,7 +111,7 @@
|
|
|
112
111
|
"eslint-plugin-html": "6.2.0",
|
|
113
112
|
"eslint-plugin-import": "2.26.0",
|
|
114
113
|
"eslint-plugin-react": "7.29.4",
|
|
115
|
-
"playwright": "1.
|
|
114
|
+
"playwright": "1.22.2",
|
|
116
115
|
"postcss-import": "14.1.0",
|
|
117
116
|
"prettier": "2.6.2",
|
|
118
117
|
"redux": "4.1.2",
|
package/src/build/build.js
CHANGED
|
@@ -25,9 +25,7 @@ import {
|
|
|
25
25
|
registerDirectoryLifecycle,
|
|
26
26
|
} from "@jsenv/filesystem"
|
|
27
27
|
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
|
|
28
|
-
import { createLogger, loggerToLevels } from "@jsenv/
|
|
29
|
-
|
|
30
|
-
import { createTaskLog } from "@jsenv/log"
|
|
28
|
+
import { createLogger, loggerToLevels, createTaskLog } from "@jsenv/log"
|
|
31
29
|
import { createVersionGenerator } from "@jsenv/utils/versioning/version_generator.js"
|
|
32
30
|
import { generateSourcemapUrl } from "@jsenv/utils/sourcemap/sourcemap_utils.js"
|
|
33
31
|
import {
|
|
@@ -23,13 +23,12 @@ import {
|
|
|
23
23
|
fetchFileSystem,
|
|
24
24
|
composeServices,
|
|
25
25
|
} from "@jsenv/server"
|
|
26
|
+
|
|
26
27
|
import {
|
|
27
28
|
assertAndNormalizeDirectoryUrl,
|
|
28
29
|
registerDirectoryLifecycle,
|
|
29
30
|
} from "@jsenv/filesystem"
|
|
30
|
-
import { createLogger, loggerToLevels } from "@jsenv/
|
|
31
|
-
|
|
32
|
-
import { createTaskLog } from "@jsenv/log"
|
|
31
|
+
import { createLogger, loggerToLevels, createTaskLog } from "@jsenv/log"
|
|
33
32
|
import { getCallerPosition } from "@jsenv/urls"
|
|
34
33
|
import { initReloadableProcess } from "@jsenv/utils/process_reload/process_reload.js"
|
|
35
34
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { parentPort } from "node:worker_threads"
|
|
2
|
+
|
|
2
3
|
import {
|
|
3
4
|
assertAndNormalizeDirectoryUrl,
|
|
4
5
|
registerDirectoryLifecycle,
|
|
5
6
|
} from "@jsenv/filesystem"
|
|
6
|
-
import { createLogger, loggerToLevels } from "@jsenv/
|
|
7
|
-
|
|
8
|
-
import { createTaskLog } from "@jsenv/log"
|
|
7
|
+
import { createLogger, loggerToLevels, createTaskLog } from "@jsenv/log"
|
|
9
8
|
import { getCallerPosition } from "@jsenv/urls"
|
|
10
9
|
import { initReloadableProcess } from "@jsenv/utils/process_reload/process_reload.js"
|
|
11
10
|
import { getCorePlugins } from "@jsenv/core/src/plugins/plugins.js"
|
package/src/execute/execute.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
|
|
2
2
|
|
|
3
3
|
import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem"
|
|
4
|
-
import { createLogger } from "@jsenv/
|
|
5
|
-
|
|
4
|
+
import { createLogger } from "@jsenv/log"
|
|
6
5
|
import { getCorePlugins } from "@jsenv/core/src/plugins/plugins.js"
|
|
7
6
|
import { createUrlGraph } from "@jsenv/core/src/omega/url_graph.js"
|
|
8
7
|
import { createKitchen } from "@jsenv/core/src/omega/kitchen.js"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Script } from "node:vm"
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { createDetailedMessage } from "@jsenv/log"
|
|
3
4
|
import {
|
|
4
5
|
Abort,
|
|
5
6
|
createCallbackListNotifiedOnce,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
raceCallbacks,
|
|
8
9
|
} from "@jsenv/abort"
|
|
9
10
|
import { moveUrl } from "@jsenv/urls"
|
|
10
|
-
|
|
11
11
|
import { memoize } from "@jsenv/utils/memoize/memoize.js"
|
|
12
12
|
import { filterV8Coverage } from "@jsenv/utils/coverage/v8_coverage_from_directory.js"
|
|
13
13
|
import { composeTwoFileByFileIstanbulCoverages } from "@jsenv/utils/coverage/istanbul_coverage_composition.js"
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { fork } from "node:child_process"
|
|
2
|
-
import { urlToFileSystemPath } from "@jsenv/urls"
|
|
3
|
-
import { createDetailedMessage } from "@jsenv/logger"
|
|
4
2
|
import {
|
|
5
3
|
Abort,
|
|
6
4
|
raceCallbacks,
|
|
@@ -8,6 +6,8 @@ import {
|
|
|
8
6
|
} from "@jsenv/abort"
|
|
9
7
|
import { uneval } from "@jsenv/uneval"
|
|
10
8
|
|
|
9
|
+
import { urlToFileSystemPath } from "@jsenv/urls"
|
|
10
|
+
import { createDetailedMessage } from "@jsenv/log"
|
|
11
11
|
import { memoize } from "@jsenv/utils/memoize/memoize.js"
|
|
12
12
|
import { createChildExecOptions } from "./child_exec_options.js"
|
|
13
13
|
import { ExecOptions } from "./exec_options.js"
|
package/src/omega/errors.js
CHANGED
package/src/omega/kitchen.js
CHANGED
|
@@ -7,10 +7,8 @@ import {
|
|
|
7
7
|
setUrlFilename,
|
|
8
8
|
} from "@jsenv/urls"
|
|
9
9
|
import { writeFileSync, ensureWindowsDriveLetter } from "@jsenv/filesystem"
|
|
10
|
-
import { createDetailedMessage } from "@jsenv/
|
|
11
|
-
|
|
10
|
+
import { createDetailedMessage } from "@jsenv/log"
|
|
12
11
|
import { CONTENT_TYPE } from "@jsenv/utils/content_type/content_type.js"
|
|
13
|
-
|
|
14
12
|
import { createPluginController } from "../plugins/plugin_controller.js"
|
|
15
13
|
import { urlSpecifierEncoding } from "./url_specifier_encoding.js"
|
|
16
14
|
import { createUrlInfoTransformer } from "./url_graph/url_info_transformations.js"
|
|
@@ -356,8 +354,7 @@ export const createKitchen = ({
|
|
|
356
354
|
const { cookDuringCook = cook } = dishContext
|
|
357
355
|
context.cook = (urlInfo, nestedDishContext) => {
|
|
358
356
|
return cookDuringCook(urlInfo, {
|
|
359
|
-
|
|
360
|
-
clientRuntimeCompat: dishContext.clientRuntimeCompat,
|
|
357
|
+
...dishContext,
|
|
361
358
|
...nestedDishContext,
|
|
362
359
|
})
|
|
363
360
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { pathToFileURL } from "node:url"
|
|
2
|
+
|
|
2
3
|
import { URL_META } from "@jsenv/url-meta"
|
|
3
4
|
import { isFileSystemPath } from "@jsenv/urls"
|
|
4
|
-
import { createDetailedMessage } from "@jsenv/
|
|
5
|
-
|
|
5
|
+
import { createDetailedMessage } from "@jsenv/log"
|
|
6
6
|
import { babelHelperNameFromUrl } from "@jsenv/babel-plugins"
|
|
7
7
|
import { applyRollupPlugins } from "@jsenv/utils/js_ast/apply_rollup_plugins.js"
|
|
8
8
|
import { sourcemapConverter } from "@jsenv/utils/sourcemap/sourcemap_converter.js"
|
|
@@ -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(
|
package/src/test/execute_plan.js
CHANGED
|
@@ -3,10 +3,15 @@ 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
|
+
|
|
6
7
|
import { URL_META } from "@jsenv/url-meta"
|
|
7
8
|
import { urlToFileSystemPath } from "@jsenv/urls"
|
|
8
|
-
import {
|
|
9
|
-
|
|
9
|
+
import {
|
|
10
|
+
createDetailedMessage,
|
|
11
|
+
loggerToLevels,
|
|
12
|
+
createLog,
|
|
13
|
+
startSpinner,
|
|
14
|
+
} from "@jsenv/log"
|
|
10
15
|
import { Abort, raceProcessTeardownEvents } from "@jsenv/abort"
|
|
11
16
|
import {
|
|
12
17
|
writeDirectory,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ensureEmptyDirectory,
|
|
5
5
|
assertAndNormalizeDirectoryUrl,
|
|
6
6
|
} from "@jsenv/filesystem"
|
|
7
|
-
import { createLogger, createDetailedMessage } from "@jsenv/
|
|
7
|
+
import { createLogger, createDetailedMessage } from "@jsenv/log"
|
|
8
8
|
|
|
9
9
|
import { generateCoverageJsonFile } from "@jsenv/utils/coverage/coverage_reporter_json_file.js"
|
|
10
10
|
import { generateCoverageHtmlDirectory } from "@jsenv/utils/coverage/coverage_reporter_html_directory.js"
|