@cloudflare/vitest-plugin 1.1.11 → 1.1.13
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 +50 -13
- package/dist/pool/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/pool/index.mjs
CHANGED
|
@@ -2802,8 +2802,8 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
|
|
|
2802
2802
|
__name$3(formatConfigSnippet, "formatConfigSnippet");
|
|
2803
2803
|
|
|
2804
2804
|
//#endregion
|
|
2805
|
-
//#region ../workers-utils/dist/chunk-
|
|
2806
|
-
var DEFAULT_COMPAT_DATE = "2026-09-
|
|
2805
|
+
//#region ../workers-utils/dist/chunk-S6ZAI5DC.mjs
|
|
2806
|
+
var DEFAULT_COMPAT_DATE = "2026-09-18";
|
|
2807
2807
|
function assertNever(_value) {}
|
|
2808
2808
|
__name$3(assertNever, "assertNever");
|
|
2809
2809
|
function mapWorkerMetadataBindings(bindings) {
|
|
@@ -44329,19 +44329,34 @@ var validateObservability = /* @__PURE__ */ __name$3((diagnostics, field, value)
|
|
|
44329
44329
|
key: "traces.enabled",
|
|
44330
44330
|
value: val.traces?.enabled,
|
|
44331
44331
|
type: "boolean"
|
|
44332
|
+
},
|
|
44333
|
+
{
|
|
44334
|
+
key: "issues.enabled",
|
|
44335
|
+
value: val.issues?.enabled,
|
|
44336
|
+
type: "boolean"
|
|
44332
44337
|
}
|
|
44333
44338
|
]) && isValid;
|
|
44334
44339
|
isValid = validateOptionalProperty(diagnostics, field, "head_sampling_rate", val.head_sampling_rate, "number") && isValid;
|
|
44335
44340
|
isValid = validateOptionalProperty(diagnostics, field, "redact_query_string", val.redact_query_string, "boolean") && isValid;
|
|
44341
|
+
const issuesIsObject = val.issues === void 0 || val.issues !== null && typeof val.issues === "object" && !Array.isArray(val.issues);
|
|
44342
|
+
if (!issuesIsObject) {
|
|
44343
|
+
diagnostics.errors.push(`"${field}.issues" should be an object but got ${JSON.stringify(val.issues)}.`);
|
|
44344
|
+
isValid = false;
|
|
44345
|
+
}
|
|
44336
44346
|
isValid = validateOptionalProperty(diagnostics, field, "logs", val.logs, "object") && isValid;
|
|
44337
44347
|
isValid = validateOptionalProperty(diagnostics, field, "traces", val.traces, "object") && isValid;
|
|
44338
44348
|
isValid = validateAdditionalProperties(diagnostics, field, Object.keys(val), [
|
|
44339
44349
|
"enabled",
|
|
44340
44350
|
"head_sampling_rate",
|
|
44341
44351
|
"redact_query_string",
|
|
44352
|
+
"issues",
|
|
44342
44353
|
"logs",
|
|
44343
44354
|
"traces"
|
|
44344
44355
|
]) && isValid;
|
|
44356
|
+
if (val.issues !== void 0 && issuesIsObject) {
|
|
44357
|
+
isValid = validateOptionalProperty(diagnostics, `${field}.issues`, "enabled", val.issues.enabled, "boolean") && isValid;
|
|
44358
|
+
isValid = validateAdditionalProperties(diagnostics, `${field}.issues`, Object.keys(val.issues), ["enabled"]) && isValid;
|
|
44359
|
+
}
|
|
44345
44360
|
if (typeof val.logs === "object") {
|
|
44346
44361
|
isValid = validateOptionalProperty(diagnostics, field, "logs.enabled", val.logs.enabled, "boolean") && isValid;
|
|
44347
44362
|
isValid = validateOptionalProperty(diagnostics, field, "logs.head_sampling_rate", val.logs.head_sampling_rate, "number") && isValid;
|
|
@@ -44568,6 +44583,7 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
44568
44583
|
pipeline: "local-and-remote",
|
|
44569
44584
|
service: "local-and-remote",
|
|
44570
44585
|
queue: "local-and-remote",
|
|
44586
|
+
flagship: "local-and-remote",
|
|
44571
44587
|
vectorize: "remote",
|
|
44572
44588
|
mtls_certificate: "remote",
|
|
44573
44589
|
dispatch_namespace: "remote",
|
|
@@ -44576,7 +44592,6 @@ var BINDING_LOCAL_SUPPORT = {
|
|
|
44576
44592
|
ai_search_namespace: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44577
44593
|
media: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44578
44594
|
artifacts: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44579
|
-
flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44580
44595
|
vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44581
44596
|
vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
|
|
44582
44597
|
agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
|
|
@@ -45291,12 +45306,12 @@ function printBindings(bindings, options) {
|
|
|
45291
45306
|
mode: getMode({ isSimulatedLocally: true })
|
|
45292
45307
|
};
|
|
45293
45308
|
}));
|
|
45294
|
-
if (flagship.length > 0) output.push(...flagship.map(({ binding, app_id }) => {
|
|
45309
|
+
if (flagship.length > 0) output.push(...flagship.map(({ binding, app_id, remote }) => {
|
|
45295
45310
|
return {
|
|
45296
45311
|
name: binding,
|
|
45297
45312
|
type: getBindingTypeFriendlyName("flagship"),
|
|
45298
45313
|
value: app_id,
|
|
45299
|
-
mode: getMode({ isSimulatedLocally:
|
|
45314
|
+
mode: getMode({ isSimulatedLocally: context.remoteBindingsDisabled || !remote })
|
|
45300
45315
|
};
|
|
45301
45316
|
}));
|
|
45302
45317
|
if (services.length > 0) output.push(...services.map(({ binding, service, entrypoint, remote, dev }) => {
|
|
@@ -61058,7 +61073,7 @@ __name$1(createWorkerUploadForm, "createWorkerUploadForm");
|
|
|
61058
61073
|
//#endregion
|
|
61059
61074
|
//#region ../remote-bindings/dist/index.mjs
|
|
61060
61075
|
var import_undici = require_undici();
|
|
61061
|
-
var version = "0.0.
|
|
61076
|
+
var version = "0.0.28";
|
|
61062
61077
|
var NoDefaultValueProvided = class extends UserError$1 {
|
|
61063
61078
|
constructor() {
|
|
61064
61079
|
super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
|
|
@@ -62284,14 +62299,14 @@ const ContainerObservabilityBaseSchema = z$1.strictObject({
|
|
|
62284
62299
|
enabled: z$1.boolean().optional(),
|
|
62285
62300
|
logs: z$1.strictObject({ enabled: z$1.boolean().optional() }).optional()
|
|
62286
62301
|
});
|
|
62287
|
-
const
|
|
62302
|
+
const StandardContainerObservabilitySchema = z$1.union([ContainerObservabilityBaseSchema.extend({ targetInstancePercentage: z$1.number().min(0).max(100).optional() }), ContainerObservabilityBaseSchema.extend({ targetInstanceCount: z$1.number().int().nonnegative().optional() })]);
|
|
62288
62303
|
const BaseContainerSchema = z$1.strictObject({
|
|
62289
62304
|
type: z$1.literal("container"),
|
|
62290
62305
|
name: z$1.string().min(1),
|
|
62291
|
-
observability: ContainerObservabilitySchema.optional(),
|
|
62292
62306
|
unsafe: z$1.record(z$1.string(), z$1.unknown()).optional()
|
|
62293
62307
|
});
|
|
62294
62308
|
const StandardContainerBaseSchema = BaseContainerSchema.extend({
|
|
62309
|
+
observability: StandardContainerObservabilitySchema.optional(),
|
|
62295
62310
|
maxInstances: z$1.number().int().nonnegative().default(20),
|
|
62296
62311
|
instanceType: z$1.union([z$1.enum([
|
|
62297
62312
|
"basic",
|
|
@@ -62338,7 +62353,10 @@ const StandardContainerBaseSchema = BaseContainerSchema.extend({
|
|
|
62338
62353
|
activeGracePeriod: z$1.number().nonnegative().optional()
|
|
62339
62354
|
}).optional()
|
|
62340
62355
|
});
|
|
62341
|
-
const DurableObjectContainerBaseSchema = BaseContainerSchema.extend({
|
|
62356
|
+
const DurableObjectContainerBaseSchema = BaseContainerSchema.extend({
|
|
62357
|
+
schedulingPolicy: z$1.literal("durable-object"),
|
|
62358
|
+
observability: ContainerObservabilityBaseSchema.optional()
|
|
62359
|
+
});
|
|
62342
62360
|
/**
|
|
62343
62361
|
* Input Container schema — validates user-authored `cloudflare.config.ts`
|
|
62344
62362
|
* Container exports. Dockerfiles are built by the consuming build tool.
|
|
@@ -62403,6 +62421,7 @@ const ObservabilitySchema = z$1.strictObject({
|
|
|
62403
62421
|
enabled: z$1.boolean().optional(),
|
|
62404
62422
|
headSamplingRate: z$1.number().optional(),
|
|
62405
62423
|
redactQueryString: z$1.boolean().optional(),
|
|
62424
|
+
issues: z$1.strictObject({ enabled: z$1.boolean().optional() }).optional(),
|
|
62406
62425
|
logs: z$1.strictObject({
|
|
62407
62426
|
enabled: z$1.boolean().optional(),
|
|
62408
62427
|
headSamplingRate: z$1.number().optional(),
|
|
@@ -62525,9 +62544,12 @@ const InputSettingsSchema = z$1.strictObject({
|
|
|
62525
62544
|
});
|
|
62526
62545
|
/**
|
|
62527
62546
|
* Output settings schema — the shape of the top-level `config.json` in the
|
|
62528
|
-
* Build Output Specification. Adds the
|
|
62547
|
+
* Build Output Specification. Adds the build mode and Preview intent.
|
|
62529
62548
|
*/
|
|
62530
|
-
const OutputSettingsSchema = InputSettingsSchema.extend({
|
|
62549
|
+
const OutputSettingsSchema = InputSettingsSchema.extend({
|
|
62550
|
+
isPreview: z$1.boolean().optional(),
|
|
62551
|
+
mode: z$1.string().optional()
|
|
62552
|
+
});
|
|
62531
62553
|
const DEFAULT_EXPORT_NAME = "default";
|
|
62532
62554
|
const SETTINGS_EXPORT_NAME = "settings";
|
|
62533
62555
|
const SUPPORTED_EXPORT_TYPES = new Set([
|
|
@@ -62740,10 +62762,14 @@ function convertToWranglerConfig(workerConfig, settingsConfig, containerExports
|
|
|
62740
62762
|
return result;
|
|
62741
62763
|
}
|
|
62742
62764
|
function convertContainer(container) {
|
|
62743
|
-
if (container.schedulingPolicy === "durable-object") throw new UserError("Durable Object-managed Containers are not currently supported by `convertToWranglerConfig()`.", { telemetryMessage: false });
|
|
62744
62765
|
const converted = { name: container.name };
|
|
62745
62766
|
if (container.observability !== void 0) converted.observability = convertContainerObservability(container.observability);
|
|
62746
62767
|
if (container.unsafe !== void 0) converted.unsafe = container.unsafe;
|
|
62768
|
+
if (container.schedulingPolicy === "durable-object") {
|
|
62769
|
+
converted.scheduling_policy = "durable_object";
|
|
62770
|
+
if (container.images !== void 0) converted.images = Object.fromEntries(Object.entries(container.images).map(([name, image]) => [name, convertDurableObjectContainerImage(image)]));
|
|
62771
|
+
return converted;
|
|
62772
|
+
}
|
|
62747
62773
|
converted.image = "dockerfile" in container.image ? container.image.dockerfile : container.image.reference;
|
|
62748
62774
|
converted.max_instances = container.maxInstances;
|
|
62749
62775
|
if ("dockerfile" in container.image) {
|
|
@@ -62772,6 +62798,13 @@ function convertContainer(container) {
|
|
|
62772
62798
|
}
|
|
62773
62799
|
return converted;
|
|
62774
62800
|
}
|
|
62801
|
+
function convertDurableObjectContainerImage(image) {
|
|
62802
|
+
if ("reference" in image) return { image: image.reference };
|
|
62803
|
+
const converted = { dockerfile: image.dockerfile };
|
|
62804
|
+
if (image.buildContext !== void 0) converted.build_context = image.buildContext;
|
|
62805
|
+
if (image.buildVars !== void 0) converted.build_vars = image.buildVars;
|
|
62806
|
+
return converted;
|
|
62807
|
+
}
|
|
62775
62808
|
function convertContainerObservability(observability) {
|
|
62776
62809
|
const converted = {};
|
|
62777
62810
|
if (observability.enabled !== void 0) converted.enabled = observability.enabled;
|
|
@@ -62817,6 +62850,7 @@ function convertObservability(observability) {
|
|
|
62817
62850
|
if (observability.enabled !== void 0) out.enabled = observability.enabled;
|
|
62818
62851
|
if (observability.headSamplingRate !== void 0) out.head_sampling_rate = observability.headSamplingRate;
|
|
62819
62852
|
if (observability.redactQueryString !== void 0) out.redact_query_string = observability.redactQueryString;
|
|
62853
|
+
if (observability.issues !== void 0) out.issues = { enabled: observability.issues.enabled };
|
|
62820
62854
|
if (observability.logs !== void 0) {
|
|
62821
62855
|
const logs = {};
|
|
62822
62856
|
const { logs: src$2 } = observability;
|
|
@@ -63684,7 +63718,10 @@ const NEW_CONFIG_FILENAME = "cloudflare.config.ts";
|
|
|
63684
63718
|
*/
|
|
63685
63719
|
async function loadNewConfig(configPath, mode) {
|
|
63686
63720
|
if (!existsSync(configPath)) throw new TypeError(`\`experimental.newConfig\` is enabled but no \`${NEW_CONFIG_FILENAME}\` was found at ${configPath}.`);
|
|
63687
|
-
const { result } = await loadAndValidateConfig(configPath, {
|
|
63721
|
+
const { result } = await loadAndValidateConfig(configPath, {
|
|
63722
|
+
isPreview: false,
|
|
63723
|
+
mode
|
|
63724
|
+
});
|
|
63688
63725
|
if (!result.success) throw new TypeError(`Invalid \`${NEW_CONFIG_FILENAME}\`:\n${result.error.message}`);
|
|
63689
63726
|
const worker = result.data.default?.type === "worker" ? result.data.default : void 0;
|
|
63690
63727
|
if (worker === void 0) throw new TypeError(`\`${NEW_CONFIG_FILENAME}\` must have a default worker export.`);
|