Skip to content

Commit 170d14f

Browse files
Brooooooklynclaude
andcommitted
chore(cli): stop naming wrangler where Void now runs the cf CLI
The provisioner and deploy steps run the `cf` CLI, but three provision errors still said "wrangler" and several comments still described wrangler 4.131. The CLI output rewrote the word before printing, so users saw the right text, but the source no longer matched what runs. The errors now name the Cloudflare config and Cloudflare tooling, and the comments describe current behaviour without the stale version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 04c23bd commit 170d14f

6 files changed

Lines changed: 27 additions & 25 deletions

File tree

‎packages/deploy-cloudflare/src/version.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export type CloudflareTriggerConfig = Readonly<{
5050
queueConsumers: ReadonlyArray<unknown>;
5151
workflows: ReadonlyArray<unknown>;
5252
/**
53-
* Email Routing addresses (`addresses` in Wrangler config). Wrangler 4.131 applies its
53+
* Email Routing addresses (`addresses` in Wrangler config). The Cloudflare CLI applies its
5454
* Email Routing plan inside `triggers deploy` — `undefined` skips the plan entirely, while
5555
* `[]` is a destructive plan that deletes every rule this Worker owns — so the two must stay
5656
* distinct through the snapshot. Absent from annotations written before this field existed.

‎packages/deploy-cloudflare/test/unit/version.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ describe('Cloudflare version activation', () => {
17131713
).not.toHaveProperty('contentHash');
17141714
});
17151715

1716-
// Wrangler 4.131 applies its Email Routing plan inside `triggers deploy`, reading the
1716+
// The Cloudflare CLI applies its Email Routing plan inside `triggers deploy`, reading the
17171717
// config's `addresses`. The trigger-only config Void hands it must therefore carry the
17181718
// snapshot's addresses verbatim — and carry NOTHING when the snapshot has none, because an
17191719
// absent key skips the plan while `[]` deletes every rule the Worker owns.

‎packages/void/src/cli/deploy-transport.ts‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ export function scrubManagedDeployBuildMarkers(env: NodeJS.ProcessEnv): NodeJS.P
4646
* top-level config this flow provisions + preflights. Scrubbed from every child env
4747
* and fenced in the project dotenv (see below), on top of the provisioner's transport
4848
* scrub/fence which owns the endpoint-redirect + `CLOUDFLARE_ENV` vars:
49-
* - `WRANGLER_CI_OVERRIDE_NAME` — wrangler 4.131 applies it AFTER config load
50-
* (`mergeSharedConfigArgs` → `getCIOverrideName()`), REPLACING the upload name, so a
51-
* bare `wrangler deploy` uploads a worker whose name the generated-config check never
52-
* validated.
49+
* - `WRANGLER_CI_OVERRIDE_NAME` — the Cloudflare tooling (wrangler and the `cf` CLI)
50+
* applies it AFTER config load (`getCIOverrideName()`), REPLACING the upload name, so a
51+
* bare deploy uploads a worker whose name the generated-config check never validated.
5352
* - `CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH` — the CF Vite plugin points the build at an
5453
* ALTERNATE wrangler config, flattening a different binding set into
5554
* `dist/ssr/wrangler.json`.
@@ -60,18 +59,20 @@ const DEPLOY_CONFIG_OVERRIDE_ENV_VARS = [
6059
] as const;
6160

6261
/**
63-
* The dotenv files wrangler 4.131 reloads into `process.env` (`override: true`) for
64-
* the orchestrator's `--env=` calls (`getDefaultEnvFiles("")`), so a repo dotenv here
65-
* would resurrect `WRANGLER_CI_OVERRIDE_NAME` at the DEPLOY step after the child-env
66-
* scrub removed it.
62+
* The dotenv files wrangler loads into `process.env` (`override: true`) when no
63+
* `--env` is named (`getDefaultEnvFiles("")`). Void runs its deploy steps through the
64+
* `cf` CLI, not wrangler, but this set is kept for a user who runs `wrangler deploy` on
65+
* the same config. It also covers the `.env` / `.env.local` files `cf` reads. A repo
66+
* dotenv here would bring back `WRANGLER_CI_OVERRIDE_NAME` after the child-env scrub
67+
* removed it.
6768
*/
6869
const DEPLOY_WRANGLER_DOTENV_FILES = ['.env', '.env.local', '.env.', '.env..local'];
6970

7071
/**
7172
* The dotenv files Vite's `loadEnv(mode, …)` reads for a production `vite build`
7273
* (`.env`, `.env.local`, `.env.production`, `.env.production.local`), where the CF Vite
7374
* plugin picks up `CLOUDFLARE_ENV` / `CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH` — a set
74-
* DISJOINT from wrangler's `--env=` files, so it is fenced separately for the build.
75+
* that differs from the wrangler dotenv files above, so it is fenced separately for the build.
7576
*/
7677
const DEPLOY_VITE_DOTENV_FILES = ['.env', '.env.local', '.env.production', '.env.production.local'];
7778

@@ -133,7 +134,7 @@ export function findWranglerCiOverrideDotenvFile(
133134
* FAIL CLOSED when the project's dotenv files declare a deploy-time config-override
134135
* selector. wrangler / Vite reload dotenv on every command, so a repo dotenv would
135136
* reintroduce a scrubbed var AFTER the child-env scrub — reselecting the upload worker
136-
* name (wrangler `--env=` files) or the build's wrangler config (Vite production files).
137+
* name (the wrangler dotenv files) or the build's wrangler config (Vite production files).
137138
* The provisioner's transport fence ({@link assertNoTransportRedirectInProjectDotenv})
138139
* owns `CLOUDFLARE_ENV` + the endpoint-redirect vars; this closes the deploy-specific
139140
* name/config-path selectors it does not cover, across BOTH consumers' file sets.
@@ -143,7 +144,7 @@ export function assertNoConfigOverrideInProjectDotenv(
143144
root: string,
144145
platform: NodeJS.Platform = process.platform,
145146
): void {
146-
// WRANGLER_CI_OVERRIDE_NAME reaches the DEPLOY step via wrangler's `--env=` dotenv reload.
147+
// WRANGLER_CI_OVERRIDE_NAME reaches a deploy through the wrangler dotenv reload.
147148
const ciOverrideFile = findWranglerCiOverrideDotenvFile(root, platform);
148149
if (ciOverrideFile) {
149150
throw new Error(
@@ -154,7 +155,7 @@ export function assertNoConfigOverrideInProjectDotenv(
154155
);
155156
}
156157
// CLOUDFLARE_ENV / CLOUDFLARE_VITE_WRANGLER_CONFIG_PATH reach the BUILD via Vite's
157-
// production `loadEnv`, whose file set is disjoint from wrangler's `--env=` files.
158+
// production `loadEnv`, whose file set differs from the wrangler dotenv files.
158159
for (const file of DEPLOY_VITE_DOTENV_FILES) {
159160
const offender = findDotenvDeclaration(
160161
root,

‎packages/void/src/cli/provision.ts‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ const defaultLogger: ProvisionLogger = {
267267
};
268268

269269
/**
270-
* Env vars that move wrangler's API transport to another endpoint or select another config
271-
* env. Provisioning pins one base ({@link provisionEnv}) and rejects them in project dotenv.
270+
* Env vars that move the Cloudflare CLI's API transport to another endpoint or select another
271+
* config env. Provisioning pins one base ({@link provisionEnv}) and rejects them in project
272+
* dotenv.
272273
*/
273274
const TRANSPORT_REDIRECT_ENV_VARS = [
274275
'CLOUDFLARE_API_BASE_URL',
@@ -289,7 +290,7 @@ const OUTPUT_FILE_ENV_VARS = [
289290

290291
/**
291292
* The one API base URL this provision uses, resolved like wrangler's `getCloudflareApiBaseUrl`
292-
* so the Hyperdrive REST lister and wrangler agree:
293+
* so the Hyperdrive REST lister and the Cloudflare CLI agree:
293294
* 1. a present `CLOUDFLARE_API_BASE_URL` (then `CF_API_BASE_URL`) is used as-is, even empty;
294295
* 2. otherwise the staging and compliance selectors derive it, and invalid values fail;
295296
* 3. the config's `compliance_region` is always validated.
@@ -300,7 +301,7 @@ export function resolvePinnedApiBaseUrl(
300301
): string {
301302
const configRegion =
302303
configComplianceRegion !== undefined
303-
? assertComplianceChoice(configComplianceRegion, 'the wrangler config "compliance_region"')
304+
? assertComplianceChoice(configComplianceRegion, 'the Cloudflare config "compliance_region"')
304305
: undefined;
305306
const direct =
306307
env.CLOUDFLARE_API_BASE_URL !== undefined ? env.CLOUDFLARE_API_BASE_URL : env.CF_API_BASE_URL;
@@ -322,8 +323,8 @@ function resolveApiEnvironment(env: NodeJS.ProcessEnv): 'production' | 'staging'
322323
if (raw !== 'production' && raw !== 'staging') {
323324
throw new Error(
324325
`provision: the WRANGLER_API_ENVIRONMENT environment variable must be one of ` +
325-
`"production" or "staging", got ${JSON.stringify(raw)}. wrangler rejects this value, so ` +
326-
`provisioning refuses to guess an endpoint; fix or unset it and retry.`,
326+
`"production" or "staging", got ${JSON.stringify(raw)}. The Cloudflare tooling rejects ` +
327+
`this value, so provisioning refuses to guess an endpoint; fix or unset it and retry.`,
327328
);
328329
}
329330
return raw;
@@ -358,9 +359,9 @@ function resolveComplianceRegion(
358359
throw new Error(
359360
`provision: the Cloudflare compliance region is set to conflicting values — the ` +
360361
`CLOUDFLARE_COMPLIANCE_REGION environment variable is ${JSON.stringify(envRegion)} but the ` +
361-
`wrangler config "compliance_region" is ${JSON.stringify(configRegion)}. wrangler refuses to ` +
362-
`run with a mismatched compliance region; reconcile them (remove one, or set them equal) and ` +
363-
`retry.`,
362+
`Cloudflare config "compliance_region" is ${JSON.stringify(configRegion)}. The Cloudflare ` +
363+
`tooling refuses to run with a mismatched compliance region; reconcile them (remove one, or ` +
364+
`set them equal) and retry.`,
364365
);
365366
}
366367
return envRegion ?? configRegion ?? 'public';

‎packages/void/test/unit/cloudflare-deploy.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8716,7 +8716,7 @@ describe('checkWranglerMigrationApplySet', () => {
87168716
});
87178717
});
87188718

8719-
describe('compareWranglerMigrationPaths (wrangler 4.131 numeric-prefix comparator)', () => {
8719+
describe('compareWranglerMigrationPaths (wrangler numeric-prefix comparator)', () => {
87208720
it('sorts by leading numeric prefix (2 before 10), matching wrangler', () => {
87218721
const sorted = ['10_b.sql', '2_a.sql', '1_z.sql'].sort(compareWranglerMigrationPaths);
87228722
expect(sorted).toEqual(['1_z.sql', '2_a.sql', '10_b.sql']);

‎packages/void/test/unit/provision-resources.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3096,7 +3096,7 @@ describe('provisionCloudflareResources — config compliance_region pins the tra
30963096

30973097
it('rejects an invalid config compliance_region value', () => {
30983098
expect(() => resolvePinnedApiBaseUrl({}, 'somewhere')).toThrow(
3099-
/one of "public" or "fedramp_high"/,
3099+
'the Cloudflare config "compliance_region" must be one of "public" or "fedramp_high"',
31003100
);
31013101
});
31023102

0 commit comments

Comments
 (0)