@depup/cloudflare__vite-plugin 1.54.6-depup.0 → 1.54.7-depup.0

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/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/cloudflare__vite-plugin
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.54.6 |
17
- | Processed | 2026-09-09 |
16
+ | Original | [@cloudflare/vite-plugin](https://www.npmjs.com/package/@cloudflare/vite-plugin) @ 1.54.7 |
17
+ | Processed | 2026-09-10 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 1 |
20
20
 
package/changes.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "to": "^8.21.3"
6
6
  }
7
7
  },
8
- "timestamp": "2026-09-09T00:33:02.742Z",
8
+ "timestamp": "2026-09-10T16:09:10.813Z",
9
9
  "totalUpdated": 1
10
10
  }
package/dist/index.mjs CHANGED
@@ -137,7 +137,7 @@ function createFatalError$1(message, isJson, options) {
137
137
  __name$5(createFatalError$1, "createFatalError");
138
138
 
139
139
  //#endregion
140
- //#region ../workers-utils/dist/chunk-V6JSHOVJ.mjs
140
+ //#region ../workers-utils/dist/chunk-IQDQ5WRD.mjs
141
141
  function hasKnownExportType(entry) {
142
142
  const type = entry?.type;
143
143
  return type === "durable-object" || type === "worker";
@@ -164,6 +164,15 @@ function hasDurableObjectExports(exports$1) {
164
164
  return Object.keys(getDurableObjectExports(exports$1)).length > 0;
165
165
  }
166
166
  __name$5(hasDurableObjectExports, "hasDurableObjectExports");
167
+ var CONTAINER_IMAGES_BINDING = "EXPERIMENTAL_CLOUDFLARE_CONTAINER_IMAGES";
168
+ function isDurableObjectContainerApp(container) {
169
+ return container.scheduling_policy === "durable_object";
170
+ }
171
+ __name$5(isDurableObjectContainerApp, "isDurableObjectContainerApp");
172
+ function getDurableObjectContainerApps(containers) {
173
+ return Array.isArray(containers) ? containers.filter(isDurableObjectContainerApp) : [];
174
+ }
175
+ __name$5(getDurableObjectContainerApps, "getDurableObjectContainerApps");
167
176
  function getContainerNameToClassNameMap(exports$1) {
168
177
  const containerNameToClassName = /* @__PURE__ */ new Map();
169
178
  for (const [className, entry] of Object.entries(getDurableObjectExports(exports$1))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
@@ -2548,8 +2557,8 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
2548
2557
  __name$5(formatConfigSnippet, "formatConfigSnippet");
2549
2558
 
2550
2559
  //#endregion
2551
- //#region ../workers-utils/dist/chunk-CDB2RWUW.mjs
2552
- var DEFAULT_COMPAT_DATE = "2026-09-08";
2560
+ //#region ../workers-utils/dist/chunk-S3ANQ67D.mjs
2561
+ var DEFAULT_COMPAT_DATE = "2026-09-10";
2553
2562
  function assertNever(_value) {}
2554
2563
  __name$5(assertNever, "assertNever");
2555
2564
  function mapWorkerMetadataBindings(bindings) {
@@ -3042,7 +3051,7 @@ function getGlobalWranglerCachePath() {
3042
3051
  __name$5(getGlobalWranglerCachePath, "getGlobalWranglerCachePath");
3043
3052
 
3044
3053
  //#endregion
3045
- //#region ../workers-utils/dist/chunk-XUGGRRBO.mjs
3054
+ //#region ../workers-utils/dist/chunk-IYSONYTF.mjs
3046
3055
  var getC3CommandFromEnv = getEnvironmentVariableFactory({
3047
3056
  variableName: "WRANGLER_C3_COMMAND",
3048
3057
  defaultValue: /* @__PURE__ */ __name$5(() => "create cloudflare", "defaultValue")
@@ -3093,6 +3102,11 @@ function getComplianceRegionSubdomain(complianceConfig) {
3093
3102
  return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
3094
3103
  }
3095
3104
  __name$5(getComplianceRegionSubdomain, "getComplianceRegionSubdomain");
3105
+ function getCloudflareContainerRegistry(complianceConfig = COMPLIANCE_REGION_CONFIG_UNKNOWN) {
3106
+ if (process.env.CLOUDFLARE_CONTAINER_REGISTRY) return process.env.CLOUDFLARE_CONTAINER_REGISTRY;
3107
+ return `${process.env.WRANGLER_API_ENVIRONMENT === "staging" ? "staging." : ""}registry${getComplianceRegionSubdomain(complianceConfig)}.cloudflare.com`;
3108
+ }
3109
+ __name$5(getCloudflareContainerRegistry, "getCloudflareContainerRegistry");
3096
3110
  function getStagingSubdomain() {
3097
3111
  return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
3098
3112
  }
@@ -41829,7 +41843,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
41829
41843
  exports: inheritable(diagnostics, topLevelEnv, rawEnv, "exports", validateExports, {}),
41830
41844
  kv_namespaces: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "kv_namespaces", validateBindingArray(envName, validateKVBinding), []),
41831
41845
  cloudchamber: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "cloudchamber", validateCloudchamberConfig, {}),
41832
- containers: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "containers", validateContainerApp(envName, rawEnv.name ?? rawConfig?.name, configPath), void 0),
41846
+ containers: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "containers", validateContainerApp(envName, rawEnv.name ?? rawConfig?.name, configPath, { complianceConfig: { compliance_region: rawEnv.compliance_region ?? topLevelEnv?.compliance_region } }), void 0),
41833
41847
  send_email: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "send_email", validateBindingArray(envName, validateSendEmailBinding), []),
41834
41848
  queues: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "queues", validateQueues(envName), {
41835
41849
  producers: [],
@@ -42450,6 +42464,11 @@ function validatePreviewsContainers(envName, configPath) {
42450
42464
  const innerValidator = validateContainerApp(envName, void 0, configPath, { generateDefaultName: false });
42451
42465
  return (diagnostics, field, value, config2) => {
42452
42466
  if (Array.isArray(value)) {
42467
+ const durableObjectPolicyFields = [...value.entries()].filter(([, entry]) => entry && typeof entry === "object" && entry.scheduling_policy === "durable_object").map(([index]) => `"${field}[${index}].scheduling_policy"`);
42468
+ if (durableObjectPolicyFields.length > 0) {
42469
+ diagnostics.errors.push(`${durableObjectPolicyFields.join(", ")} cannot be "durable_object". Durable Object-managed Containers are configured only in the top-level "containers" array.`);
42470
+ return false;
42471
+ }
42453
42472
  const nameFields = [...value.entries()].filter(([, entry]) => entry && typeof entry === "object" && "name" in entry).map(([index]) => `"${field}[${index}].name"`);
42454
42473
  if (nameFields.length > 0) {
42455
42474
  diagnostics.errors.push(`${nameFields.join(", ")} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`);
@@ -42474,6 +42493,63 @@ function validatePreviewsContainers(envName, configPath) {
42474
42493
  };
42475
42494
  }
42476
42495
  __name$5(validatePreviewsContainers, "validatePreviewsContainers");
42496
+ function validateDurableObjectContainerImages(diagnostics, field, images, complianceConfig) {
42497
+ if (images === void 0) return true;
42498
+ if (typeof images !== "object" || images === null || Array.isArray(images) || Object.keys(images).length === 0) {
42499
+ diagnostics.errors.push(`"${field}" must be a non-empty object when present.`);
42500
+ return false;
42501
+ }
42502
+ let valid$2 = true;
42503
+ const entries = Object.entries(images);
42504
+ if (entries.length > 100) {
42505
+ diagnostics.errors.push(`"${field}" must contain at most 100 images.`);
42506
+ valid$2 = false;
42507
+ }
42508
+ for (const [imageName, imageValue] of entries) {
42509
+ const imageField = `${field}.${imageName}`;
42510
+ if (imageName.length === 0 || imageName.length > 128) {
42511
+ diagnostics.errors.push(`"${field}" image names must be between 1 and 128 characters.`);
42512
+ valid$2 = false;
42513
+ }
42514
+ if (typeof imageValue !== "object" || imageValue === null || Array.isArray(imageValue)) {
42515
+ diagnostics.errors.push(`"${imageField}" must be an object with either a "dockerfile" or "image" field.`);
42516
+ valid$2 = false;
42517
+ continue;
42518
+ }
42519
+ const image = imageValue;
42520
+ const hasDockerfile = image.dockerfile !== void 0;
42521
+ const hasImage = image.image !== void 0;
42522
+ if (hasDockerfile === hasImage) {
42523
+ diagnostics.errors.push(`"${imageField}" must specify exactly one of "dockerfile" or "image".`);
42524
+ valid$2 = false;
42525
+ }
42526
+ if (hasDockerfile && (typeof image.dockerfile !== "string" || image.dockerfile.length === 0)) {
42527
+ diagnostics.errors.push(`"${imageField}.dockerfile" must be a non-empty string.`);
42528
+ valid$2 = false;
42529
+ }
42530
+ if (hasImage && (typeof image.image !== "string" || image.image.length === 0)) {
42531
+ diagnostics.errors.push(`"${imageField}.image" must be a non-empty string.`);
42532
+ valid$2 = false;
42533
+ }
42534
+ if (typeof image.image === "string" && image.image.length > 0) {
42535
+ const registry2 = getCloudflareContainerRegistry(complianceConfig);
42536
+ const prefix = `${registry2}/`;
42537
+ const reference = image.image.slice(prefix.length);
42538
+ const digestReference = reference.match(/^[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|-+)[a-z0-9]+)*)+@sha256:[a-f0-9]{64}$/);
42539
+ if (!image.image.startsWith(prefix) || digestReference?.[0] !== reference) {
42540
+ diagnostics.errors.push(`"${imageField}.image" must be a digest-pinned image in the managed registry, in the form "${registry2}/<account-id>/<repository>@sha256:<64 lowercase hex characters>".`);
42541
+ valid$2 = false;
42542
+ }
42543
+ }
42544
+ const unsupportedFields = Object.keys(image).filter((property) => property !== "dockerfile" && property !== "image");
42545
+ if (unsupportedFields.length > 0) {
42546
+ diagnostics.errors.push(`Unexpected fields found in ${imageField} field: ${unsupportedFields.map((property) => `"${property}"`).join(", ")}`);
42547
+ valid$2 = false;
42548
+ }
42549
+ }
42550
+ return valid$2;
42551
+ }
42552
+ __name$5(validateDurableObjectContainerImages, "validateDurableObjectContainerImages");
42477
42553
  function validateContainerApp(envName, topLevelName, configPath, options = {}) {
42478
42554
  const { generateDefaultName = true } = options;
42479
42555
  return (diagnostics, field, value, config2) => {
@@ -42483,15 +42559,30 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
42483
42559
  return false;
42484
42560
  }
42485
42561
  for (const containerAppOptional of value) {
42486
- validateOptionalProperty(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
42562
+ const isDurableObjectManaged = containerAppOptional.scheduling_policy === "durable_object";
42563
+ const hasValidDurableObjectClassName = typeof containerAppOptional.class_name === "string" && containerAppOptional.class_name.length > 0;
42564
+ if (isDurableObjectManaged) {
42565
+ if (!hasValidDurableObjectClassName) diagnostics.errors.push(`"containers.class_name" must be a non-empty string when "containers.scheduling_policy" is "durable_object".`);
42566
+ } else validateOptionalProperty(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
42487
42567
  validateOptionalProperty(diagnostics, field, "name", containerAppOptional.name, "string");
42488
- if (generateDefaultName && !containerAppOptional.name) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
42568
+ if (generateDefaultName && !containerAppOptional.name && (!isDurableObjectManaged || hasValidDurableObjectClassName)) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
42489
42569
  else if (!topLevelName) diagnostics.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);
42490
42570
  else {
42491
42571
  let name = `${topLevelName}-${containerAppOptional.class_name}`;
42492
42572
  name += config2 === void 0 ? "" : `-${envName}`;
42493
42573
  containerAppOptional.name = name.toLowerCase().replace(/ /g, "-");
42494
42574
  }
42575
+ if (isDurableObjectManaged) {
42576
+ validateDurableObjectContainerImages(diagnostics, `${field}.images`, containerAppOptional.images, options.complianceConfig);
42577
+ const unsupportedFields = Object.keys(containerAppOptional).filter((key) => ![
42578
+ "name",
42579
+ "class_name",
42580
+ "scheduling_policy",
42581
+ "images"
42582
+ ].includes(key));
42583
+ if (unsupportedFields.length > 0) diagnostics.errors.push(`Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", and "images" are supported.`);
42584
+ continue;
42585
+ }
42495
42586
  if (!containerAppOptional.configuration?.image && !containerAppOptional.image) diagnostics.errors.push(`"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`);
42496
42587
  if ("configuration" in containerAppOptional) {
42497
42588
  diagnostics.warnings.push(`"containers.configuration" is deprecated. Use top level "containers" fields instead. "configuration.image" should be "image", limits should be set via "instance_type".`);
@@ -43066,6 +43157,7 @@ var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name$5((diagnostics, con
43066
43157
  const bindingNamesArray = Object.entries(friendlyBindingNames);
43067
43158
  const bindingsGroupedByType = Object.fromEntries(bindingNamesArray.map(([bindingType, binding]) => [binding, getBindingNames(bindingType === "queues" ? config2[bindingType]?.producers : config2[bindingType])]));
43068
43159
  bindingsGroupedByType["Secret"] = config2.secrets?.required ?? [];
43160
+ bindingsGroupedByType["Container images"] = [CONTAINER_IMAGES_BINDING];
43069
43161
  const bindingsGroupedByName = {};
43070
43162
  for (const bindingType in bindingsGroupedByType) {
43071
43163
  const bindingNames = bindingsGroupedByType[bindingType];
@@ -45102,7 +45194,7 @@ ${allTailConsumers.map(({ service, streaming }) => {
45102
45194
  let containersTitle = "The following containers are available:";
45103
45195
  if (context.name && isMultiWorker) containersTitle = `The following containers are available from ${source_default.blue(context.name)}:`;
45104
45196
  log$1(`${containersTitle}
45105
- ${containers.map((c$1) => `- ${c$1.name} (${c$1.image})`).join("\n")}`);
45197
+ ${containers.map((container) => container.scheduling_policy === "durable_object" ? `- ${container.class_name} (durable_object)` : `- ${container.name} (${container.image})`).join("\n")}`);
45106
45198
  log$1("");
45107
45199
  }
45108
45200
  if (context.unsafeMetadata) {
@@ -69825,16 +69917,6 @@ const MF_DEV_CONTAINER_PREFIX = "cloudflare-dev";
69825
69917
 
69826
69918
  //#endregion
69827
69919
  //#region ../containers-shared/src/knobs.ts
69828
- /**
69829
- * Returns the managed container registry for the configured API environment and compliance region.
69830
- *
69831
- * @param complianceConfig - Compliance configuration used to select the public or FedRAMP registry.
69832
- * @returns The managed registry hostname, respecting `CLOUDFLARE_CONTAINER_REGISTRY` and `WRANGLER_API_ENVIRONMENT`.
69833
- */
69834
- const getCloudflareContainerRegistry = (complianceConfig = COMPLIANCE_REGION_CONFIG_UNKNOWN) => {
69835
- if (process.env.CLOUDFLARE_CONTAINER_REGISTRY) return process.env.CLOUDFLARE_CONTAINER_REGISTRY;
69836
- return `${process.env.WRANGLER_API_ENVIRONMENT === "staging" ? "staging." : ""}registry${getComplianceRegionSubdomain(complianceConfig)}.cloudflare.com`;
69837
- };
69838
69920
  /** Prefixes with the cloudflare-dev namespace. The name should be the container's DO classname, and the tag a build uuid. */
69839
69921
  const getDevContainerImageName = (name, tag) => {
69840
69922
  return `${MF_DEV_CONTAINER_PREFIX}/${name.toLowerCase()}:${tag}`;
@@ -70000,6 +70082,7 @@ function getContainerOptions(options) {
70000
70082
  const { containersConfig, exports: exports$1, containerBuildId, configPath } = options;
70001
70083
  if (!containersConfig?.length) return;
70002
70084
  return containersConfig.map((container) => {
70085
+ if (isDurableObjectContainerApp(container) || container.image === void 0) return;
70003
70086
  const className = resolveContainerClassName(container, exports$1);
70004
70087
  if (className === void 0) return;
70005
70088
  const image_tag = getDevContainerImageName(className, containerBuildId);
@@ -76973,7 +77056,7 @@ var require_command_exists = /* @__PURE__ */ __commonJS$2({ "../../node_modules/
76973
77056
  }) });
76974
77057
 
76975
77058
  //#endregion
76976
- //#region ../deploy-helpers/dist/chunk-PXVCTRCA.mjs
77059
+ //#region ../deploy-helpers/dist/chunk-3G6JZQDH.mjs
76977
77060
  var import_undici$1 = require_undici();
76978
77061
  var import_command_exists = require_command_exists();
76979
77062
  function handleUnsafeCapnp(capnp) {
@@ -77497,7 +77580,8 @@ function createWorkerUploadForm(worker, bindings, options) {
77497
77580
  bindings: metadataBindings,
77498
77581
  containers: worker.containers === void 0 ? void 0 : worker.containers.map((c$1) => ({
77499
77582
  ...c$1.name !== void 0 && { name: c$1.name },
77500
- ...c$1.class_name !== void 0 && { class_name: c$1.class_name }
77583
+ ...c$1.class_name !== void 0 && { class_name: c$1.class_name },
77584
+ ...c$1.images !== void 0 && { images: c$1.images }
77501
77585
  })),
77502
77586
  ...compatibility_date && { compatibility_date },
77503
77587
  ...compatibility_flags && { compatibility_flags },
@@ -77532,7 +77616,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
77532
77616
  //#endregion
77533
77617
  //#region ../remote-bindings/dist/index.mjs
77534
77618
  var import_undici = require_undici();
77535
- var version$2 = "0.0.21";
77619
+ var version$2 = "0.0.22";
77536
77620
  var NoDefaultValueProvided = class extends UserError {
77537
77621
  constructor() {
77538
77622
  super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });