@cloudflare/vitest-pool-workers 0.14.6 → 0.14.8
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/pool/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import crypto from "node:crypto";
|
|
|
4
4
|
import fs, { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
5
|
import path, { dirname, isAbsolute, join, resolve } from "node:path";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
+
import util from "node:util";
|
|
7
8
|
import os from "node:os";
|
|
8
9
|
import net from "node:net";
|
|
9
10
|
import { Log, LogLevel, Miniflare, ModuleRuleTypeSchema, PLUGINS, Response, compileModuleRules, formatZodError, getNodeCompat, getRootPath, kCurrentWorker, kUnsafeEphemeralUniqueKey, maybeApply, mergeWorkerOptions, parseWithRootPath, structuredSerializableReducers, structuredSerializableRevivers, testRegExps } from "miniflare";
|
|
@@ -11,7 +12,6 @@ import { experimental_readRawConfig } from "wrangler";
|
|
|
11
12
|
import { build } from "esbuild";
|
|
12
13
|
import fs$1 from "node:fs/promises";
|
|
13
14
|
import posixPath from "node:path/posix";
|
|
14
|
-
import util from "node:util";
|
|
15
15
|
import * as cjsModuleLexer from "cjs-module-lexer";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
|
|
@@ -89,7 +89,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
89
89
|
}) : target, mod));
|
|
90
90
|
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region ../workers-utils/dist/chunk-
|
|
92
|
+
//#region ../workers-utils/dist/chunk-L6UDSO24.mjs
|
|
93
93
|
function isCompatDate(str) {
|
|
94
94
|
return /^\d{4}-\d{2}-\d{2}$/.test(str);
|
|
95
95
|
}
|
|
@@ -171,6 +171,12 @@ function mapWorkerMetadataBindings(bindings) {
|
|
|
171
171
|
secret_name: binding.secret_name
|
|
172
172
|
}];
|
|
173
173
|
break;
|
|
174
|
+
case "artifacts":
|
|
175
|
+
configObj.artifacts = [...configObj.artifacts ?? [], {
|
|
176
|
+
binding: binding.name,
|
|
177
|
+
namespace: binding.namespace
|
|
178
|
+
}];
|
|
179
|
+
break;
|
|
174
180
|
case "unsafe_hello_world":
|
|
175
181
|
configObj.unsafe_hello_world = [...configObj.unsafe_hello_world ?? [], {
|
|
176
182
|
binding: binding.name,
|
|
@@ -3444,6 +3450,7 @@ var defaultWranglerConfig = {
|
|
|
3444
3450
|
hyperdrive: [],
|
|
3445
3451
|
workflows: [],
|
|
3446
3452
|
secrets_store_secrets: [],
|
|
3453
|
+
artifacts: [],
|
|
3447
3454
|
services: [],
|
|
3448
3455
|
analytics_engine_datasets: [],
|
|
3449
3456
|
ai: void 0,
|
|
@@ -7491,7 +7498,7 @@ var friendlyBindingNames = {
|
|
|
7491
7498
|
services: "Worker",
|
|
7492
7499
|
analytics_engine_datasets: "Analytics Engine Dataset",
|
|
7493
7500
|
text_blobs: "Text Blob",
|
|
7494
|
-
browser: "Browser",
|
|
7501
|
+
browser: "Browser Run",
|
|
7495
7502
|
ai: "AI",
|
|
7496
7503
|
images: "Images",
|
|
7497
7504
|
stream: "Stream",
|
|
@@ -7505,6 +7512,7 @@ var friendlyBindingNames = {
|
|
|
7505
7512
|
workflows: "Workflow",
|
|
7506
7513
|
pipelines: "Pipeline",
|
|
7507
7514
|
secrets_store_secrets: "Secrets Store Secret",
|
|
7515
|
+
artifacts: "Artifacts",
|
|
7508
7516
|
ratelimits: "Rate Limit",
|
|
7509
7517
|
assets: "Assets",
|
|
7510
7518
|
unsafe_hello_world: "Hello World",
|
|
@@ -7521,7 +7529,7 @@ var bindingTypeFriendlyNames = {
|
|
|
7521
7529
|
send_email: "Send Email",
|
|
7522
7530
|
wasm_module: "Wasm Module",
|
|
7523
7531
|
text_blob: "Text Blob",
|
|
7524
|
-
browser: "Browser",
|
|
7532
|
+
browser: "Browser Run",
|
|
7525
7533
|
ai: "AI",
|
|
7526
7534
|
images: "Images",
|
|
7527
7535
|
stream: "Stream",
|
|
@@ -7543,6 +7551,7 @@ var bindingTypeFriendlyNames = {
|
|
|
7543
7551
|
mtls_certificate: "mTLS Certificate",
|
|
7544
7552
|
pipeline: "Pipeline",
|
|
7545
7553
|
secrets_store_secret: "Secrets Store Secret",
|
|
7554
|
+
artifacts: "Artifacts",
|
|
7546
7555
|
logfwdr: "logfwdr",
|
|
7547
7556
|
unsafe_hello_world: "Hello World",
|
|
7548
7557
|
flagship: "Flagship",
|
|
@@ -8017,6 +8026,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
|
8017
8026
|
media: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "media", validateNamedSimpleBinding(envName), void 0),
|
|
8018
8027
|
pipelines: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "pipelines", validateBindingArray(envName, validatePipelineBinding), []),
|
|
8019
8028
|
secrets_store_secrets: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "secrets_store_secrets", validateBindingArray(envName, validateSecretsStoreSecretBinding), []),
|
|
8029
|
+
artifacts: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "artifacts", validateBindingArray(envName, validateArtifactsBinding), []),
|
|
8020
8030
|
unsafe_hello_world: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "unsafe_hello_world", validateBindingArray(envName, validateHelloWorldBinding), []),
|
|
8021
8031
|
flagship: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "flagship", validateBindingArray(envName, validateFlagshipBinding), []),
|
|
8022
8032
|
worker_loaders: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "worker_loaders", validateBindingArray(envName, validateWorkerLoaderBinding), []),
|
|
@@ -8456,7 +8466,8 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
|
|
|
8456
8466
|
"flagship",
|
|
8457
8467
|
"vpc_network",
|
|
8458
8468
|
"stream",
|
|
8459
|
-
"media"
|
|
8469
|
+
"media",
|
|
8470
|
+
"artifacts"
|
|
8460
8471
|
].includes(value.type)) diagnostics.warnings.push(`The binding type "${value.type}" is directly supported by wrangler.
|
|
8461
8472
|
Consider migrating this unsafe binding to a format for '${value.type}' bindings that is supported by wrangler for optimal support.
|
|
8462
8473
|
For more details, see https://developers.cloudflare.com/workers/cli-wrangler/configuration`);
|
|
@@ -8576,6 +8587,7 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
8576
8587
|
]);
|
|
8577
8588
|
if ("instances" in containerAppOptional) diagnostics.warnings.push(`"containers.instances" is deprecated. Use "containers.max_instances" instead.`);
|
|
8578
8589
|
if ("durable_objects" in containerAppOptional) diagnostics.warnings.push(`"containers.durable_objects" is deprecated. Use the "class_name" field instead.`);
|
|
8590
|
+
if ("wrangler_ssh" in containerAppOptional) diagnostics.warnings.push(`"containers.wrangler_ssh" is deprecated. Use "containers.ssh" instead.`);
|
|
8579
8591
|
if ("unsafe" in containerAppOptional) {
|
|
8580
8592
|
if (containerAppOptional.unsafe && typeof containerAppOptional.unsafe !== "object" || Array.isArray(containerAppOptional.unsafe)) diagnostics.errors.push(`The field "containers.unsafe" should be an object but got ${JSON.stringify(typeof containerAppOptional.unsafe)}.`);
|
|
8581
8593
|
}
|
|
@@ -8589,6 +8601,7 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
8589
8601
|
"class_name",
|
|
8590
8602
|
"scheduling_policy",
|
|
8591
8603
|
"instance_type",
|
|
8604
|
+
"ssh",
|
|
8592
8605
|
"wrangler_ssh",
|
|
8593
8606
|
"authorized_keys",
|
|
8594
8607
|
"trusted_user_ca_keys",
|
|
@@ -8609,9 +8622,22 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
8609
8622
|
"vcpu",
|
|
8610
8623
|
"memory_mib"
|
|
8611
8624
|
]);
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8625
|
+
let sshField;
|
|
8626
|
+
let sshConfig;
|
|
8627
|
+
if ("ssh" in containerAppOptional) {
|
|
8628
|
+
sshField = "ssh";
|
|
8629
|
+
sshConfig = containerAppOptional.ssh;
|
|
8630
|
+
containerAppOptional.wrangler_ssh = containerAppOptional.ssh;
|
|
8631
|
+
delete containerAppOptional.ssh;
|
|
8632
|
+
} else if ("wrangler_ssh" in containerAppOptional) {
|
|
8633
|
+
sshField = "wrangler_ssh";
|
|
8634
|
+
sshConfig = containerAppOptional.wrangler_ssh;
|
|
8635
|
+
}
|
|
8636
|
+
if (sshField !== void 0) {
|
|
8637
|
+
const sshConfigObject = typeof sshConfig === "object" && sshConfig !== null ? sshConfig : {};
|
|
8638
|
+
if (!isRequiredProperty(sshConfigObject, "enabled", "boolean")) diagnostics.errors.push(`${field}.${sshField}.enabled must be a boolean`);
|
|
8639
|
+
const sshPort = "port" in sshConfigObject ? sshConfigObject.port : void 0;
|
|
8640
|
+
if (!isOptionalProperty(sshConfigObject, "port", "number") || typeof sshPort === "number" && (sshPort < 1 || sshPort > 65535)) diagnostics.errors.push(`${field}.${sshField}.port must be a number between 1 and 65535 inclusive`);
|
|
8615
8641
|
}
|
|
8616
8642
|
if ("authorized_keys" in containerAppOptional) if (!Array.isArray(containerAppOptional.authorized_keys)) diagnostics.errors.push(`${field}.authorized_keys must be an array`);
|
|
8617
8643
|
else for (const index in containerAppOptional.authorized_keys) {
|
|
@@ -8636,6 +8662,22 @@ function validateContainerApp(envName, topLevelName, configPath) {
|
|
|
8636
8662
|
if ("tiers" in constraints) diagnostics.errors.push(`${field}.constraints.tier and ${field}.constraints.tiers cannot both be set`);
|
|
8637
8663
|
}
|
|
8638
8664
|
validateOptionalTypedArray(diagnostics, `${field}.constraints.tiers`, constraints.tiers, "number");
|
|
8665
|
+
validateOptionalProperty(diagnostics, `${field}.constraints`, "jurisdiction", constraints.jurisdiction, "string");
|
|
8666
|
+
if (constraints.jurisdiction && !["eu", "fedramp"].includes(constraints.jurisdiction)) diagnostics.errors.push(`${field}.constraints.jurisdiction must be one of: "eu", "fedramp"`);
|
|
8667
|
+
if (validateOptionalTypedArray(diagnostics, `${field}.constraints.regions`, constraints.regions, "string") && constraints.regions && Array.isArray(constraints.regions)) {
|
|
8668
|
+
const validRegions = [
|
|
8669
|
+
"ENAM",
|
|
8670
|
+
"WNAM",
|
|
8671
|
+
"EEUR",
|
|
8672
|
+
"WEUR",
|
|
8673
|
+
"APAC",
|
|
8674
|
+
"SAM",
|
|
8675
|
+
"ME",
|
|
8676
|
+
"OC",
|
|
8677
|
+
"AFR"
|
|
8678
|
+
];
|
|
8679
|
+
for (const region of constraints.regions) if (typeof region === "string" && !validRegions.includes(region.toUpperCase())) diagnostics.errors.push(`${field}.constraints.regions contains invalid region "${region}". Valid regions are: ${validRegions.join(", ")}`);
|
|
8680
|
+
}
|
|
8639
8681
|
}
|
|
8640
8682
|
if (typeof containerAppOptional.instance_type === "string") {
|
|
8641
8683
|
validateOptionalProperty(diagnostics, field, "instance_type", containerAppOptional.instance_type, "string", ALLOWED_INSTANCE_TYPES);
|
|
@@ -9265,6 +9307,28 @@ var validateSecretsStoreSecretBinding = /* @__PURE__ */ __name((diagnostics, fie
|
|
|
9265
9307
|
]);
|
|
9266
9308
|
return isValid2;
|
|
9267
9309
|
}, "validateSecretsStoreSecretBinding");
|
|
9310
|
+
var validateArtifactsBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
9311
|
+
if (typeof value !== "object" || value === null) {
|
|
9312
|
+
diagnostics.errors.push(`"artifacts" bindings should be objects, but got ${JSON.stringify(value)}`);
|
|
9313
|
+
return false;
|
|
9314
|
+
}
|
|
9315
|
+
let isValid2 = true;
|
|
9316
|
+
if (!isRequiredProperty(value, "binding", "string")) {
|
|
9317
|
+
diagnostics.errors.push(`"${field}" bindings must have a string "binding" field but got ${JSON.stringify(value)}.`);
|
|
9318
|
+
isValid2 = false;
|
|
9319
|
+
}
|
|
9320
|
+
if (!isRequiredProperty(value, "namespace", "string")) {
|
|
9321
|
+
diagnostics.errors.push(`"${field}" bindings must have a string "namespace" field but got ${JSON.stringify(value)}.`);
|
|
9322
|
+
isValid2 = false;
|
|
9323
|
+
}
|
|
9324
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
9325
|
+
"binding",
|
|
9326
|
+
"namespace",
|
|
9327
|
+
"remote"
|
|
9328
|
+
]);
|
|
9329
|
+
if (!isRemoteValid(value, field, diagnostics)) isValid2 = false;
|
|
9330
|
+
return isValid2;
|
|
9331
|
+
}, "validateArtifactsBinding");
|
|
9268
9332
|
var validateHelloWorldBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
9269
9333
|
if (typeof value !== "object" || value === null) {
|
|
9270
9334
|
diagnostics.errors.push(`"unsafe_hello_world" bindings should be objects, but got ${JSON.stringify(value)}`);
|
|
@@ -9397,6 +9461,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
9397
9461
|
"media",
|
|
9398
9462
|
"pipelines",
|
|
9399
9463
|
"secrets_store_secrets",
|
|
9464
|
+
"artifacts",
|
|
9400
9465
|
"unsafe_hello_world",
|
|
9401
9466
|
"worker_loaders",
|
|
9402
9467
|
"ratelimits",
|
|
@@ -9431,6 +9496,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
9431
9496
|
if (previews.media !== void 0) isValid2 = validateNamedSimpleBinding(envName)(diagnostics, `${field}.media`, previews.media, void 0) && isValid2;
|
|
9432
9497
|
isValid2 = validateBindingArray(envName, validatePipelineBinding)(diagnostics, `${field}.pipelines`, previews.pipelines, void 0) && isValid2;
|
|
9433
9498
|
isValid2 = validateBindingArray(envName, validateSecretsStoreSecretBinding)(diagnostics, `${field}.secrets_store_secrets`, previews.secrets_store_secrets, void 0) && isValid2;
|
|
9499
|
+
isValid2 = validateBindingArray(envName, validateArtifactsBinding)(diagnostics, `${field}.artifacts`, previews.artifacts, void 0) && isValid2;
|
|
9434
9500
|
isValid2 = validateBindingArray(envName, validateHelloWorldBinding)(diagnostics, `${field}.unsafe_hello_world`, previews.unsafe_hello_world, void 0) && isValid2;
|
|
9435
9501
|
isValid2 = validateBindingArray(envName, validateWorkerLoaderBinding)(diagnostics, `${field}.worker_loaders`, previews.worker_loaders, void 0) && isValid2;
|
|
9436
9502
|
isValid2 = validateBindingArray(envName, validateRateLimitBinding)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid2;
|
|
@@ -10433,15 +10499,15 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
10433
10499
|
//#endregion
|
|
10434
10500
|
//#region ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js
|
|
10435
10501
|
var require_debug = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js": ((exports, module) => {
|
|
10436
|
-
const debug$
|
|
10437
|
-
module.exports = debug$
|
|
10502
|
+
const debug$5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
10503
|
+
module.exports = debug$5;
|
|
10438
10504
|
}) });
|
|
10439
10505
|
|
|
10440
10506
|
//#endregion
|
|
10441
10507
|
//#region ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js
|
|
10442
10508
|
var require_re = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js": ((exports, module) => {
|
|
10443
10509
|
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH: MAX_LENGTH$1 } = require_constants();
|
|
10444
|
-
const debug$
|
|
10510
|
+
const debug$4 = require_debug();
|
|
10445
10511
|
exports = module.exports = {};
|
|
10446
10512
|
const re$3 = exports.re = [];
|
|
10447
10513
|
const safeRe = exports.safeRe = [];
|
|
@@ -10462,7 +10528,7 @@ var require_re = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/semver
|
|
|
10462
10528
|
const createToken = (name, value, isGlobal) => {
|
|
10463
10529
|
const safe = makeSafeRegex(value);
|
|
10464
10530
|
const index = R++;
|
|
10465
|
-
debug$
|
|
10531
|
+
debug$4(name, index, value);
|
|
10466
10532
|
t$3[name] = index;
|
|
10467
10533
|
src$1[index] = value;
|
|
10468
10534
|
safeSrc[index] = safe;
|
|
@@ -10540,7 +10606,7 @@ var require_identifiers = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
10540
10606
|
//#endregion
|
|
10541
10607
|
//#region ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js
|
|
10542
10608
|
var require_semver = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js": ((exports, module) => {
|
|
10543
|
-
const debug$
|
|
10609
|
+
const debug$3 = require_debug();
|
|
10544
10610
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
10545
10611
|
const { safeRe: re$2, safeSrc: src, t: t$2 } = require_re();
|
|
10546
10612
|
const parseOptions$2 = require_parse_options();
|
|
@@ -10552,7 +10618,7 @@ var require_semver = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/se
|
|
|
10552
10618
|
else version = version.version;
|
|
10553
10619
|
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
10554
10620
|
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
10555
|
-
debug$
|
|
10621
|
+
debug$3("SemVer", version, options);
|
|
10556
10622
|
this.options = options;
|
|
10557
10623
|
this.loose = !!options.loose;
|
|
10558
10624
|
this.includePrerelease = !!options.includePrerelease;
|
|
@@ -10585,7 +10651,7 @@ var require_semver = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/se
|
|
|
10585
10651
|
return this.version;
|
|
10586
10652
|
}
|
|
10587
10653
|
compare(other) {
|
|
10588
|
-
debug$
|
|
10654
|
+
debug$3("SemVer.compare", this.version, this.options, other);
|
|
10589
10655
|
if (!(other instanceof SemVer$3)) {
|
|
10590
10656
|
if (typeof other === "string" && other === this.version) return 0;
|
|
10591
10657
|
other = new SemVer$3(other, this.options);
|
|
@@ -10606,7 +10672,7 @@ var require_semver = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/se
|
|
|
10606
10672
|
do {
|
|
10607
10673
|
const a = this.prerelease[i];
|
|
10608
10674
|
const b = other.prerelease[i];
|
|
10609
|
-
debug$
|
|
10675
|
+
debug$3("prerelease compare", i, a, b);
|
|
10610
10676
|
if (a === void 0 && b === void 0) return 0;
|
|
10611
10677
|
else if (b === void 0) return 1;
|
|
10612
10678
|
else if (a === void 0) return -1;
|
|
@@ -10620,7 +10686,7 @@ var require_semver = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/se
|
|
|
10620
10686
|
do {
|
|
10621
10687
|
const a = this.build[i];
|
|
10622
10688
|
const b = other.build[i];
|
|
10623
|
-
debug$
|
|
10689
|
+
debug$3("build compare", i, a, b);
|
|
10624
10690
|
if (a === void 0 && b === void 0) return 0;
|
|
10625
10691
|
else if (b === void 0) return 1;
|
|
10626
10692
|
else if (a === void 0) return -1;
|
|
@@ -10814,13 +10880,13 @@ var require_comparator = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
10814
10880
|
if (comp instanceof Comparator$1) if (comp.loose === !!options.loose) return comp;
|
|
10815
10881
|
else comp = comp.value;
|
|
10816
10882
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
10817
|
-
debug$
|
|
10883
|
+
debug$2("comparator", comp, options);
|
|
10818
10884
|
this.options = options;
|
|
10819
10885
|
this.loose = !!options.loose;
|
|
10820
10886
|
this.parse(comp);
|
|
10821
10887
|
if (this.semver === ANY) this.value = "";
|
|
10822
10888
|
else this.value = this.operator + this.semver.version;
|
|
10823
|
-
debug$
|
|
10889
|
+
debug$2("comp", this);
|
|
10824
10890
|
}
|
|
10825
10891
|
parse(comp) {
|
|
10826
10892
|
const r = this.options.loose ? re$1[t$1.COMPARATORLOOSE] : re$1[t$1.COMPARATOR];
|
|
@@ -10835,7 +10901,7 @@ var require_comparator = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
10835
10901
|
return this.value;
|
|
10836
10902
|
}
|
|
10837
10903
|
test(version) {
|
|
10838
|
-
debug$
|
|
10904
|
+
debug$2("Comparator.test", version, this.options.loose);
|
|
10839
10905
|
if (this.semver === ANY || version === ANY) return true;
|
|
10840
10906
|
if (typeof version === "string") try {
|
|
10841
10907
|
version = new SemVer$1(version, this.options);
|
|
@@ -10868,7 +10934,7 @@ var require_comparator = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnp
|
|
|
10868
10934
|
const parseOptions$1 = require_parse_options();
|
|
10869
10935
|
const { safeRe: re$1, t: t$1 } = require_re();
|
|
10870
10936
|
const cmp = require_cmp();
|
|
10871
|
-
const debug$
|
|
10937
|
+
const debug$2 = require_debug();
|
|
10872
10938
|
const SemVer$1 = require_semver();
|
|
10873
10939
|
const Range$2 = require_range();
|
|
10874
10940
|
}) });
|
|
@@ -10934,19 +11000,19 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
10934
11000
|
const loose = this.options.loose;
|
|
10935
11001
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
10936
11002
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
10937
|
-
debug("hyphen replace", range);
|
|
11003
|
+
debug$1("hyphen replace", range);
|
|
10938
11004
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
10939
|
-
debug("comparator trim", range);
|
|
11005
|
+
debug$1("comparator trim", range);
|
|
10940
11006
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
10941
|
-
debug("tilde trim", range);
|
|
11007
|
+
debug$1("tilde trim", range);
|
|
10942
11008
|
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
10943
|
-
debug("caret trim", range);
|
|
11009
|
+
debug$1("caret trim", range);
|
|
10944
11010
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
10945
11011
|
if (loose) rangeList = rangeList.filter((comp) => {
|
|
10946
|
-
debug("loose invalid filter", comp, this.options);
|
|
11012
|
+
debug$1("loose invalid filter", comp, this.options);
|
|
10947
11013
|
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
10948
11014
|
});
|
|
10949
|
-
debug("range list", rangeList);
|
|
11015
|
+
debug$1("range list", rangeList);
|
|
10950
11016
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
10951
11017
|
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
10952
11018
|
for (const comp of comparators) {
|
|
@@ -10985,7 +11051,7 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
10985
11051
|
const cache = new (require_lrucache())();
|
|
10986
11052
|
const parseOptions = require_parse_options();
|
|
10987
11053
|
const Comparator = require_comparator();
|
|
10988
|
-
const debug = require_debug();
|
|
11054
|
+
const debug$1 = require_debug();
|
|
10989
11055
|
const SemVer = require_semver();
|
|
10990
11056
|
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
10991
11057
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
@@ -11004,15 +11070,15 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
11004
11070
|
return result;
|
|
11005
11071
|
};
|
|
11006
11072
|
const parseComparator = (comp, options) => {
|
|
11007
|
-
debug("comp", comp, options);
|
|
11073
|
+
debug$1("comp", comp, options);
|
|
11008
11074
|
comp = replaceCarets(comp, options);
|
|
11009
|
-
debug("caret", comp);
|
|
11075
|
+
debug$1("caret", comp);
|
|
11010
11076
|
comp = replaceTildes(comp, options);
|
|
11011
|
-
debug("tildes", comp);
|
|
11077
|
+
debug$1("tildes", comp);
|
|
11012
11078
|
comp = replaceXRanges(comp, options);
|
|
11013
|
-
debug("xrange", comp);
|
|
11079
|
+
debug$1("xrange", comp);
|
|
11014
11080
|
comp = replaceStars(comp, options);
|
|
11015
|
-
debug("stars", comp);
|
|
11081
|
+
debug$1("stars", comp);
|
|
11016
11082
|
return comp;
|
|
11017
11083
|
};
|
|
11018
11084
|
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
@@ -11022,16 +11088,16 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
11022
11088
|
const replaceTilde = (comp, options) => {
|
|
11023
11089
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
11024
11090
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
11025
|
-
debug("tilde", comp, _, M, m, p, pr);
|
|
11091
|
+
debug$1("tilde", comp, _, M, m, p, pr);
|
|
11026
11092
|
let ret;
|
|
11027
11093
|
if (isX(M)) ret = "";
|
|
11028
11094
|
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
11029
11095
|
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
11030
11096
|
else if (pr) {
|
|
11031
|
-
debug("replaceTilde pr", pr);
|
|
11097
|
+
debug$1("replaceTilde pr", pr);
|
|
11032
11098
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
11033
11099
|
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
11034
|
-
debug("tilde return", ret);
|
|
11100
|
+
debug$1("tilde return", ret);
|
|
11035
11101
|
return ret;
|
|
11036
11102
|
});
|
|
11037
11103
|
};
|
|
@@ -11039,40 +11105,40 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
11039
11105
|
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
11040
11106
|
};
|
|
11041
11107
|
const replaceCaret = (comp, options) => {
|
|
11042
|
-
debug("caret", comp, options);
|
|
11108
|
+
debug$1("caret", comp, options);
|
|
11043
11109
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
11044
11110
|
const z$2 = options.includePrerelease ? "-0" : "";
|
|
11045
11111
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
11046
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
11112
|
+
debug$1("caret", comp, _, M, m, p, pr);
|
|
11047
11113
|
let ret;
|
|
11048
11114
|
if (isX(M)) ret = "";
|
|
11049
11115
|
else if (isX(m)) ret = `>=${M}.0.0${z$2} <${+M + 1}.0.0-0`;
|
|
11050
11116
|
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z$2} <${M}.${+m + 1}.0-0`;
|
|
11051
11117
|
else ret = `>=${M}.${m}.0${z$2} <${+M + 1}.0.0-0`;
|
|
11052
11118
|
else if (pr) {
|
|
11053
|
-
debug("replaceCaret pr", pr);
|
|
11119
|
+
debug$1("replaceCaret pr", pr);
|
|
11054
11120
|
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
11055
11121
|
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
11056
11122
|
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
11057
11123
|
} else {
|
|
11058
|
-
debug("no pr");
|
|
11124
|
+
debug$1("no pr");
|
|
11059
11125
|
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z$2} <${M}.${m}.${+p + 1}-0`;
|
|
11060
11126
|
else ret = `>=${M}.${m}.${p}${z$2} <${M}.${+m + 1}.0-0`;
|
|
11061
11127
|
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
11062
11128
|
}
|
|
11063
|
-
debug("caret return", ret);
|
|
11129
|
+
debug$1("caret return", ret);
|
|
11064
11130
|
return ret;
|
|
11065
11131
|
});
|
|
11066
11132
|
};
|
|
11067
11133
|
const replaceXRanges = (comp, options) => {
|
|
11068
|
-
debug("replaceXRanges", comp, options);
|
|
11134
|
+
debug$1("replaceXRanges", comp, options);
|
|
11069
11135
|
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
11070
11136
|
};
|
|
11071
11137
|
const replaceXRange = (comp, options) => {
|
|
11072
11138
|
comp = comp.trim();
|
|
11073
11139
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
11074
11140
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
11075
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
11141
|
+
debug$1("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
11076
11142
|
const xM = isX(M);
|
|
11077
11143
|
const xm = xM || isX(m);
|
|
11078
11144
|
const xp = xm || isX(p);
|
|
@@ -11103,16 +11169,16 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
11103
11169
|
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
11104
11170
|
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
11105
11171
|
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
11106
|
-
debug("xRange return", ret);
|
|
11172
|
+
debug$1("xRange return", ret);
|
|
11107
11173
|
return ret;
|
|
11108
11174
|
});
|
|
11109
11175
|
};
|
|
11110
11176
|
const replaceStars = (comp, options) => {
|
|
11111
|
-
debug("replaceStars", comp, options);
|
|
11177
|
+
debug$1("replaceStars", comp, options);
|
|
11112
11178
|
return comp.trim().replace(re[t.STAR], "");
|
|
11113
11179
|
};
|
|
11114
11180
|
const replaceGTE0 = (comp, options) => {
|
|
11115
|
-
debug("replaceGTE0", comp, options);
|
|
11181
|
+
debug$1("replaceGTE0", comp, options);
|
|
11116
11182
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
11117
11183
|
};
|
|
11118
11184
|
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
@@ -11133,7 +11199,7 @@ var require_range = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/sem
|
|
|
11133
11199
|
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
11134
11200
|
if (version.prerelease.length && !options.includePrerelease) {
|
|
11135
11201
|
for (let i = 0; i < set.length; i++) {
|
|
11136
|
-
debug(set[i].semver);
|
|
11202
|
+
debug$1(set[i].semver);
|
|
11137
11203
|
if (set[i].semver === Comparator.ANY) continue;
|
|
11138
11204
|
if (set[i].semver.prerelease.length > 0) {
|
|
11139
11205
|
const allowed = set[i].semver;
|
|
@@ -12281,7 +12347,8 @@ function structuredSerializableStringify(value) {
|
|
|
12281
12347
|
function structuredSerializableParse(value) {
|
|
12282
12348
|
return parse(value, structuredSerializableRevivers);
|
|
12283
12349
|
}
|
|
12284
|
-
const log = new Log(LogLevel.
|
|
12350
|
+
const log = new Log(LogLevel.INFO, { prefix: "vpw" });
|
|
12351
|
+
const debug = util.debuglog("vitest-pool-workers");
|
|
12285
12352
|
const mfLog = new Log(LogLevel.WARN);
|
|
12286
12353
|
const __filename = fileURLToPath(import.meta.url);
|
|
12287
12354
|
const __dirname = path.dirname(__filename);
|
|
@@ -12387,7 +12454,7 @@ async function buildProjectWorkerOptions(project, customOptions, main) {
|
|
|
12387
12454
|
runnerWorker.compatibilityFlags.push("no_handle_cross_request_promise_resolution");
|
|
12388
12455
|
if (runnerWorker.compatibilityDate === void 0) {
|
|
12389
12456
|
runnerWorker.compatibilityDate = getTodaysCompatDate();
|
|
12390
|
-
|
|
12457
|
+
debug("No compatibility date was provided for project %s, defaulting to today's date %s.", getRelativeProjectPath(project), runnerWorker.compatibilityDate);
|
|
12391
12458
|
}
|
|
12392
12459
|
const flagAssertions = new CompatibilityFlagAssertions({
|
|
12393
12460
|
compatibilityDate: runnerWorker.compatibilityDate,
|
|
@@ -12555,7 +12622,8 @@ async function buildProjectMiniflareOptions(ctx, project, customOptions, main) {
|
|
|
12555
12622
|
}
|
|
12556
12623
|
async function getProjectMiniflare(ctx, project, poolOptions, main) {
|
|
12557
12624
|
const mfOptions = await buildProjectMiniflareOptions(ctx, project, poolOptions, main);
|
|
12558
|
-
|
|
12625
|
+
debug("Starting runtime for %s...", getRelativeProjectPath(project));
|
|
12626
|
+
if (mfOptions.inspectorPort !== void 0) log.info(`Starting inspector on port ${mfOptions.inspectorPort} for ${getRelativeProjectPath(project)}`);
|
|
12559
12627
|
const mf = new Miniflare(mfOptions);
|
|
12560
12628
|
await mf.ready;
|
|
12561
12629
|
return mf;
|
|
@@ -12633,11 +12701,11 @@ function ensureFeature(compatibilityFlags, feature) {
|
|
|
12633
12701
|
const flagToEnable = `enable_${feature}`;
|
|
12634
12702
|
const flagToDisable = `disable_${feature}`;
|
|
12635
12703
|
if (!compatibilityFlags.includes(flagToEnable)) {
|
|
12636
|
-
|
|
12704
|
+
debug("Adding `%s` compatibility flag during tests as this feature is needed to support the Vitest runner.", flagToEnable);
|
|
12637
12705
|
compatibilityFlags.push(flagToEnable);
|
|
12638
12706
|
}
|
|
12639
12707
|
if (compatibilityFlags.includes(flagToDisable)) {
|
|
12640
|
-
log.
|
|
12708
|
+
log.warn(`Removing \`${flagToDisable}\` compatibility flag during tests as that feature is needed to support the Vitest runner.`);
|
|
12641
12709
|
compatibilityFlags.splice(compatibilityFlags.indexOf(flagToDisable), 1);
|
|
12642
12710
|
}
|
|
12643
12711
|
}
|