Drive Wrangler types from a non-secret example env file with fixed argument ordering and non-literal vars so clean CI and local generation produce the same bindings.
- commit
- 33cf949577fb1f9abba240cd885f9825cc3057ae
- parent
- 6b2bcd0fd5358397865cdc20208aba21234b9478
- author
- Dami <dami.etoile@gmail.com>
| A | worker/ | 2 | ++ |
| M | worker/ | 4 | ++-- |
| M | worker/ | 10 | +++++----- |
@@ -7,11 +7,11 @@
77 "dev:local": "wrangler dev --config wrangler.local.jsonc",88 "deploy": "wrangler deploy",99 "deploy:local": "wrangler deploy --config wrangler.local.jsonc",10- "check": "tsc --noEmit && wrangler types --check --include-runtime false worker-configuration.d.ts",10+ "check": "tsc --noEmit && wrangler types worker-configuration.d.ts --check --include-runtime false --strict-vars false --env-file .dev.vars.example",1111 "test": "npm run test:unit && npm run test:runtime",1212 "test:unit": "node --experimental-strip-types --test test/*.test.mjs",1313 "test:runtime": "vitest run",14- "types": "wrangler types --include-runtime false worker-configuration.d.ts"14+ "types": "wrangler types worker-configuration.d.ts --include-runtime false --strict-vars false --env-file .dev.vars.example"1515 },1616 "devDependencies": {1717 "@cloudflare/vitest-pool-workers": "^0.18.4",@@ -1,5 +1,5 @@
11 /* eslint-disable */2-// Generated by Wrangler by running `wrangler types --include-runtime=false` (hash: 990c104e67727cf0d631159dadc2a132)2+// Generated by Wrangler by running `wrangler types --env-file=.dev.vars.example --include-runtime=false --strict-vars=false` (hash: 3bd3218662632ec1c405b5eb1a134078)33 interface __BaseEnv_Env {44 CONTENT: R2Bucket;55 DB: D1Database;@@ -8,10 +8,10 @@ interface __BaseEnv_Env {
88 RL_UNLOCK: RateLimit;99 RL_OBSERVE: RateLimit;1010 RL_SIGNAL: RateLimit;11- ALERT_EMAIL_TO: "operator@example.com";12- ALERT_EMAIL_FROM: "alerts@share.example.com";13- NZIP_TOKEN: string;1411 PUBLIC_BASE: string;12+ ALERT_EMAIL_TO: string;13+ ALERT_EMAIL_FROM: string;14+ NZIP_TOKEN: string;1515 }1616 declare namespace Cloudflare {1717 interface GlobalProps {@@ -24,5 +24,5 @@ type StringifyValues<EnvType extends Record<string, unknown>> = {
2424 [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;2525 };2626 declare namespace NodeJS {27- interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "ALERT_EMAIL_TO" | "ALERT_EMAIL_FROM" | "NZIP_TOKEN" | "PUBLIC_BASE">> {}27+ interface ProcessEnv extends StringifyValues<Pick<Cloudflare.Env, "PUBLIC_BASE" | "ALERT_EMAIL_TO" | "ALERT_EMAIL_FROM" | "NZIP_TOKEN">> {}2828 }