@jsenv/core 39.0.0 → 39.0.2
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/jsenv_core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readdir, chmod, stat, lstat, promises, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, watch, readdirSync, statSync, createReadStream, lstatSync, readFile, existsSync,
|
|
1
|
+
import { readdir, chmod, stat, lstat, promises, readFileSync, writeFileSync as writeFileSync$1, mkdirSync, unlink, openSync, closeSync, rmdir, watch, readdirSync, statSync, createReadStream, lstatSync, readFile, existsSync, realpathSync } from "node:fs";
|
|
2
2
|
import process$1 from "node:process";
|
|
3
3
|
import os, { networkInterfaces } from "node:os";
|
|
4
4
|
import tty from "node:tty";
|
|
@@ -834,6 +834,7 @@ const processSupportsBasicColor = createSupportsColor(process.stdout).hasBasic;
|
|
|
834
834
|
|
|
835
835
|
const ANSI = createAnsi({
|
|
836
836
|
supported:
|
|
837
|
+
process.env.FORCE_COLOR === "1" ||
|
|
837
838
|
processSupportsBasicColor ||
|
|
838
839
|
// GitHub workflow does support ANSI but "supports-color" returns false
|
|
839
840
|
// because stream.isTTY returns false, see https://github.com/actions/runner/issues/241
|
|
@@ -881,6 +882,9 @@ const createUnicode = ({ supported, ANSI }) => {
|
|
|
881
882
|
get CIRCLE_CROSS_RAW() {
|
|
882
883
|
return UNICODE.supported ? `ⓧ` : `(×)`;
|
|
883
884
|
},
|
|
885
|
+
get CIRCLE_DOTTED_RAW() {
|
|
886
|
+
return UNICODE.supported ? `◌` : `*`;
|
|
887
|
+
},
|
|
884
888
|
get COMMAND() {
|
|
885
889
|
return ANSI.color(UNICODE.COMMAND_RAW, ANSI.GREY); // ANSI_MAGENTA)
|
|
886
890
|
},
|
|
@@ -910,7 +914,7 @@ const createUnicode = ({ supported, ANSI }) => {
|
|
|
910
914
|
};
|
|
911
915
|
|
|
912
916
|
const UNICODE = createUnicode({
|
|
913
|
-
supported:
|
|
917
|
+
supported: process.env.FORCE_UNICODE === "1" || isUnicodeSupported(),
|
|
914
918
|
ANSI,
|
|
915
919
|
});
|
|
916
920
|
|
|
@@ -3233,6 +3237,9 @@ const writeDirectory = async (
|
|
|
3233
3237
|
const writeFileSync = (destination, content = "") => {
|
|
3234
3238
|
const destinationUrl = assertAndNormalizeFileUrl(destination);
|
|
3235
3239
|
const destinationUrlObject = new URL(destinationUrl);
|
|
3240
|
+
if (content && content instanceof URL) {
|
|
3241
|
+
content = readFileSync(content);
|
|
3242
|
+
}
|
|
3236
3243
|
try {
|
|
3237
3244
|
writeFileSync$1(destinationUrlObject, content);
|
|
3238
3245
|
} catch (error) {
|
|
@@ -4576,7 +4583,7 @@ const stringifyServerTimingHeader = (serverTimingHeader) => {
|
|
|
4576
4583
|
// https://www.w3.org/TR/2019/WD-server-timing-20190307/#the-server-timing-header-field
|
|
4577
4584
|
// https://tools.ietf.org/html/rfc7230#section-3.2.6
|
|
4578
4585
|
const validateServerTimingName = (name) => {
|
|
4579
|
-
const valid = /^[!#$%&'*+\-.^_`|~0-9a-z]+$/
|
|
4586
|
+
const valid = /^[!#$%&'*+\-.^_`|~0-9a-z]+$/i.test(name);
|
|
4580
4587
|
if (!valid) {
|
|
4581
4588
|
console.warn(`server timing contains invalid symbols`);
|
|
4582
4589
|
return false;
|
|
@@ -5126,7 +5133,7 @@ const onceReadableStreamUsedOrClosed = (readableStream, callback) => {
|
|
|
5126
5133
|
|
|
5127
5134
|
const normalizeHeaderName = (headerName) => {
|
|
5128
5135
|
headerName = String(headerName);
|
|
5129
|
-
if (/[^a-z0-9\-#$%&'
|
|
5136
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(headerName)) {
|
|
5130
5137
|
throw new TypeError("Invalid character in header field name");
|
|
5131
5138
|
}
|
|
5132
5139
|
|
|
@@ -13928,7 +13935,7 @@ const parseAsHashWithOptions = (token) => {
|
|
|
13928
13935
|
return { isValid, algo, base64Value, optionExpression };
|
|
13929
13936
|
};
|
|
13930
13937
|
|
|
13931
|
-
const BASE64_REGEX = /^[A-Za-z0-9
|
|
13938
|
+
const BASE64_REGEX = /^[A-Za-z0-9+/=]+$/;
|
|
13932
13939
|
const VCHAR_REGEX = /^[\x21-\x7E]+$/;
|
|
13933
13940
|
|
|
13934
13941
|
// https://www.w3.org/TR/SRI/#does-response-match-metadatalist
|
|
@@ -16425,7 +16432,7 @@ const escapeHtml = (string) => {
|
|
|
16425
16432
|
.replace(/'/g, "'");
|
|
16426
16433
|
};
|
|
16427
16434
|
const replacePlaceholders$2 = (html, replacers) => {
|
|
16428
|
-
return html.replace(
|
|
16435
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
16429
16436
|
const replacer = replacers[name];
|
|
16430
16437
|
if (replacer === undefined) {
|
|
16431
16438
|
return match;
|
|
@@ -18511,7 +18518,7 @@ const generateDirectoryContent = (
|
|
|
18511
18518
|
`);
|
|
18512
18519
|
};
|
|
18513
18520
|
const replacePlaceholders$1 = (html, replacers) => {
|
|
18514
|
-
return html.replace(
|
|
18521
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
18515
18522
|
const replacer = replacers[name];
|
|
18516
18523
|
if (replacer === undefined) {
|
|
18517
18524
|
return match;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "39.0.
|
|
3
|
+
"version": "39.0.2",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"dev": "node --conditions=development ./scripts/dev/dev.mjs",
|
|
49
49
|
"test": "node --conditions=development ./scripts/test/test.mjs",
|
|
50
50
|
"test:workspace": "npm run test --workspaces --if-present -- --workspace",
|
|
51
|
+
"test:ci": "CI=1 npm run test",
|
|
52
|
+
"test:workspace:ci": "CI=1 npm run test:workspace",
|
|
51
53
|
"test:only_dev_server_errors": "node --conditions=development ./tests/dev_server/errors/dev_errors_snapshots.test.mjs",
|
|
52
54
|
"build": "node --conditions=development ./scripts/build/build.mjs",
|
|
53
55
|
"build:file_size": "node ./scripts/build/build_file_size.mjs --log",
|
|
@@ -64,22 +66,22 @@
|
|
|
64
66
|
"dependencies": {
|
|
65
67
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
66
68
|
"@jsenv/abort": "4.3.0",
|
|
67
|
-
"@jsenv/ast": "6.1.
|
|
68
|
-
"@jsenv/filesystem": "4.7.
|
|
69
|
-
"@jsenv/humanize": "1.
|
|
69
|
+
"@jsenv/ast": "6.1.2",
|
|
70
|
+
"@jsenv/filesystem": "4.7.3",
|
|
71
|
+
"@jsenv/humanize": "1.2.0",
|
|
70
72
|
"@jsenv/importmap": "1.2.1",
|
|
71
|
-
"@jsenv/integrity": "0.0.
|
|
72
|
-
"@jsenv/js-module-fallback": "1.3.
|
|
73
|
+
"@jsenv/integrity": "0.0.2",
|
|
74
|
+
"@jsenv/js-module-fallback": "1.3.19",
|
|
73
75
|
"@jsenv/node-esm-resolution": "1.0.2",
|
|
74
|
-
"@jsenv/plugin-bundling": "2.6.
|
|
76
|
+
"@jsenv/plugin-bundling": "2.6.13",
|
|
75
77
|
"@jsenv/plugin-minification": "1.5.4",
|
|
76
|
-
"@jsenv/plugin-supervisor": "1.4.
|
|
77
|
-
"@jsenv/plugin-transpilation": "1.4.
|
|
78
|
+
"@jsenv/plugin-supervisor": "1.4.14",
|
|
79
|
+
"@jsenv/plugin-transpilation": "1.4.2",
|
|
78
80
|
"@jsenv/runtime-compat": "1.3.0",
|
|
79
|
-
"@jsenv/server": "15.2.
|
|
80
|
-
"@jsenv/sourcemap": "1.2.
|
|
81
|
+
"@jsenv/server": "15.2.10",
|
|
82
|
+
"@jsenv/sourcemap": "1.2.11",
|
|
81
83
|
"@jsenv/url-meta": "8.4.2",
|
|
82
|
-
"@jsenv/urls": "2.2.
|
|
84
|
+
"@jsenv/urls": "2.2.8",
|
|
83
85
|
"@jsenv/utils": "2.1.1"
|
|
84
86
|
},
|
|
85
87
|
"devDependencies": {
|
|
@@ -104,6 +106,7 @@
|
|
|
104
106
|
"eslint-plugin-html": "8.1.1",
|
|
105
107
|
"eslint-plugin-import": "2.29.1",
|
|
106
108
|
"eslint-plugin-react": "7.34.3",
|
|
109
|
+
"eslint-plugin-regexp": "2.6.0",
|
|
107
110
|
"open": "10.1.0",
|
|
108
111
|
"playwright": "1.45.1",
|
|
109
112
|
"prettier": "3.3.2"
|
|
@@ -366,7 +366,7 @@ const generateDirectoryContent = (
|
|
|
366
366
|
`);
|
|
367
367
|
};
|
|
368
368
|
const replacePlaceholders = (html, replacers) => {
|
|
369
|
-
return html.replace(
|
|
369
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
370
370
|
const replacer = replacers[name];
|
|
371
371
|
if (replacer === undefined) {
|
|
372
372
|
return match;
|
|
@@ -650,7 +650,7 @@ const escapeHtml = (string) => {
|
|
|
650
650
|
.replace(/'/g, "'");
|
|
651
651
|
};
|
|
652
652
|
const replacePlaceholders = (html, replacers) => {
|
|
653
|
-
return html.replace(
|
|
653
|
+
return html.replace(/\$\{(\w+)\}/g, (match, name) => {
|
|
654
654
|
const replacer = replacers[name];
|
|
655
655
|
if (replacer === undefined) {
|
|
656
656
|
return match;
|