wrangler 4.68.1 → 4.70.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
@@ -54,24 +54,10 @@ For more detailed information about configuration, refer to the [documentation](
54
54
 
55
55
  ## Commands
56
56
 
57
- ### Workers
57
+ The `wrangler` CLI offers various commands, the most popular being:
58
58
 
59
- #### `wrangler dev`
59
+ - `wrangler dev` to start a local development server, with live reloading and devtools.
60
60
 
61
- Start a local development server, with live reloading and devtools.
61
+ - `wrangler deploy` to deploy a Worker to the Cloudflare's global network.
62
62
 
63
- #### `wrangler deploy`
64
-
65
- Publish the given script to Cloudflare's global network.
66
-
67
- For more commands and options, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/).
68
-
69
- ### Pages
70
-
71
- #### `wrangler pages dev [directory]`
72
-
73
- Serves a static build asset directory.
74
-
75
- Builds and runs functions from a `./functions` directory or uses a `_worker.js` file inside the static build asset directory.
76
-
77
- For more commands and options, refer to the [documentation](https://developers.cloudflare.com/pages/platform/functions#develop-and-preview-locally) or run `wrangler pages dev --help`.
63
+ There are many more commands and options available, for a full list refer to the [official Cloudflare documentation](https://developers.cloudflare.com/workers/wrangler/commands/).
@@ -345,6 +345,20 @@
345
345
  "description": "A map of environment variables to set when deploying your Worker.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables",
346
346
  "default": {}
347
347
  },
348
+ "secrets": {
349
+ "type": "object",
350
+ "properties": {
351
+ "required": {
352
+ "type": "array",
353
+ "items": {
354
+ "type": "string"
355
+ },
356
+ "description": "List of secret names that are required by your Worker. When defined, this property:\n- Replaces .dev.vars/.env/process.env inference for type generation\n- Enables local dev validation with warnings for missing secrets"
357
+ }
358
+ },
359
+ "additionalProperties": false,
360
+ "description": "Secrets configuration (experimental).\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment."
361
+ },
348
362
  "durable_objects": {
349
363
  "type": "object",
350
364
  "properties": {
@@ -1594,6 +1608,20 @@
1594
1608
  "description": "A map of environment variables to set when deploying your Worker.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.\n\nFor reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables",
1595
1609
  "default": {}
1596
1610
  },
1611
+ "secrets": {
1612
+ "type": "object",
1613
+ "properties": {
1614
+ "required": {
1615
+ "type": "array",
1616
+ "items": {
1617
+ "type": "string"
1618
+ },
1619
+ "description": "List of secret names that are required by your Worker. When defined, this property:\n- Replaces .dev.vars/.env/process.env inference for type generation\n- Enables local dev validation with warnings for missing secrets"
1620
+ }
1621
+ },
1622
+ "additionalProperties": false,
1623
+ "description": "Secrets configuration (experimental).\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment."
1624
+ },
1597
1625
  "durable_objects": {
1598
1626
  "type": "object",
1599
1627
  "properties": {
@@ -2801,6 +2829,17 @@
2801
2829
  "remote": {
2802
2830
  "type": "boolean",
2803
2831
  "description": "Whether the Workflow should be remote or not in local development"
2832
+ },
2833
+ "limits": {
2834
+ "type": "object",
2835
+ "properties": {
2836
+ "steps": {
2837
+ "type": "number",
2838
+ "description": "Maximum number of steps a Workflow instance can execute"
2839
+ }
2840
+ },
2841
+ "additionalProperties": false,
2842
+ "description": "Optional limits for the Workflow"
2804
2843
  }
2805
2844
  },
2806
2845
  "required": [
@@ -3167,6 +3206,10 @@
3167
3206
  "socketPath": {
3168
3207
  "type": "string",
3169
3208
  "description": "Socket used by miniflare to communicate with Docker"
3209
+ },
3210
+ "containerEgressInterceptorImage": {
3211
+ "type": "string",
3212
+ "description": "Docker image name for the container egress interceptor sidecar"
3170
3213
  }
3171
3214
  },
3172
3215
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.68.1",
3
+ "version": "4.70.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -54,16 +54,16 @@
54
54
  "esbuild": "0.27.3",
55
55
  "path-to-regexp": "6.3.0",
56
56
  "unenv": "2.0.0-rc.24",
57
- "workerd": "1.20260302.0",
57
+ "workerd": "1.20260301.1",
58
58
  "@cloudflare/kv-asset-handler": "0.4.2",
59
59
  "@cloudflare/unenv-preset": "2.14.0",
60
- "miniflare": "4.20260302.0"
60
+ "miniflare": "4.20260301.1"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@bomb.sh/tab": "^0.0.12",
65
65
  "@cloudflare/types": "6.18.4",
66
- "@cloudflare/workers-types": "^4.20260302.0",
66
+ "@cloudflare/workers-types": "^4.20260226.1",
67
67
  "@cspotcode/source-map-support": "0.8.1",
68
68
  "@netlify/build-info": "^10.2.0",
69
69
  "@sentry/node": "^7.86.0",
@@ -148,16 +148,16 @@
148
148
  "yaml": "^2.8.1",
149
149
  "yargs": "^17.7.2",
150
150
  "@cloudflare/cli": "1.2.1",
151
- "@cloudflare/containers-shared": "0.9.0",
151
+ "@cloudflare/containers-shared": "0.10.0",
152
152
  "@cloudflare/eslint-config-shared": "1.2.1",
153
- "@cloudflare/pages-shared": "^0.13.110",
154
- "@cloudflare/workers-tsconfig": "0.0.0",
153
+ "@cloudflare/pages-shared": "^0.13.112",
155
154
  "@cloudflare/workers-shared": "0.19.0",
156
- "@cloudflare/workers-utils": "0.11.2",
157
- "@cloudflare/workflows-shared": "0.4.0"
155
+ "@cloudflare/workers-tsconfig": "0.0.0",
156
+ "@cloudflare/workers-utils": "0.12.0",
157
+ "@cloudflare/workflows-shared": "0.5.0"
158
158
  },
159
159
  "peerDependencies": {
160
- "@cloudflare/workers-types": "^4.20260302.0"
160
+ "@cloudflare/workers-types": "^4.20260226.1"
161
161
  },
162
162
  "peerDependenciesMeta": {
163
163
  "@cloudflare/workers-types": {
@@ -3,18 +3,6 @@ import { EmailMessage } from "cloudflare:email";
3
3
 
4
4
  interface Env extends Record<string, unknown> {}
5
5
 
6
- /**
7
- * List of RPC methods exposed by the raw AI binding that need proxying
8
- * through a plain-object wrapper. The raw AI binding (deployed with raw:true)
9
- * has a non-standard prototype that capnweb's typeForRpc() doesn't recognise,
10
- * causing "RPC stub points at a non-serializable type". By wrapping only the
11
- * allowed RPC methods in a plain object we give capnweb an Object.prototype
12
- * target it can navigate.
13
- *
14
- * Add new AI RPC method names here as they are introduced.
15
- */
16
- const AI_RPC_METHODS = ["aiSearch"] as const;
17
-
18
6
  class BindingNotFoundError extends Error {
19
7
  constructor(name?: string) {
20
8
  super(`Binding ${name ? `"${name}"` : ""} not found`);
@@ -33,11 +21,6 @@ class BindingNotFoundError extends Error {
33
21
  * can't emulate that over an async boundary, we mock it locally and _actually_
34
22
  * perform the .get() remotely at the first appropriate async point. See
35
23
  * packages/miniflare/src/workers/dispatch-namespace/dispatch-namespace.worker.ts
36
- * - AI bindings (raw:true / minimal_mode) have a workerd-internal prototype
37
- * that capnweb's typeForRpc() classifies as "unsupported", causing
38
- * "RPC stub points at a non-serializable type". We wrap the binding in a
39
- * plain object that delegates only the allowed RPC methods (AI_RPC_METHODS)
40
- * so capnweb gets an Object.prototype target it can navigate.
41
24
  *
42
25
  * getExposedJSRPCBinding() and getExposedFetcher() perform the logic for figuring out
43
26
  * which binding is being accessed, dependending on the request. Note: Both have logic
@@ -77,19 +60,6 @@ function getExposedJSRPCBinding(request: Request, env: Env) {
77
60
  };
78
61
  }
79
62
 
80
- if (url.searchParams.get("MF-Binding-Type") === "ai") {
81
- const wrapper: Record<string, (...args: unknown[]) => unknown> = {};
82
- for (const method of AI_RPC_METHODS) {
83
- if (typeof (targetBinding as any)[method] === "function") {
84
- wrapper[method] = (...args: unknown[]) =>
85
- (targetBinding as any)[method](...args);
86
- }
87
- }
88
- if (Object.keys(wrapper).length > 0) {
89
- return wrapper;
90
- }
91
- }
92
-
93
63
  if (url.searchParams.has("MF-Dispatch-Namespace-Options")) {
94
64
  const { name, args, options } = JSON.parse(
95
65
  url.searchParams.get("MF-Dispatch-Namespace-Options")!
@@ -3214,7 +3214,6 @@ async function newWorkersRpcResponse(request, localMain) {
3214
3214
 
3215
3215
  // templates/remoteBindings/ProxyServerWorker.ts
3216
3216
  import { EmailMessage } from "cloudflare:email";
3217
- var AI_RPC_METHODS = ["aiSearch"];
3218
3217
  var BindingNotFoundError = class extends Error {
3219
3218
  constructor(name) {
3220
3219
  super(`Binding ${name ? `"${name}"` : ""} not found`);
@@ -3246,17 +3245,6 @@ function getExposedJSRPCBinding(request, env) {
3246
3245
  }
3247
3246
  };
3248
3247
  }
3249
- if (url.searchParams.get("MF-Binding-Type") === "ai") {
3250
- const wrapper = {};
3251
- for (const method of AI_RPC_METHODS) {
3252
- if (typeof targetBinding[method] === "function") {
3253
- wrapper[method] = (...args) => targetBinding[method](...args);
3254
- }
3255
- }
3256
- if (Object.keys(wrapper).length > 0) {
3257
- return wrapper;
3258
- }
3259
- }
3260
3248
  if (url.searchParams.has("MF-Dispatch-Namespace-Options")) {
3261
3249
  const { name, args, options } = JSON.parse(
3262
3250
  url.searchParams.get("MF-Dispatch-Namespace-Options")
@@ -1364,6 +1364,13 @@ interface EnvironmentInheritable {
1364
1364
  * @inheritable
1365
1365
  */
1366
1366
  observability: Observability | undefined;
1367
+ /**
1368
+ * Specify the cache behavior of the Worker.
1369
+ *
1370
+ * @inheritable
1371
+ * @hidden
1372
+ */
1373
+ cache: CacheOptions | undefined;
1367
1374
  /**
1368
1375
  * Specify the compliance region mode of the Worker.
1369
1376
  *
@@ -1408,6 +1415,11 @@ type WorkflowBinding = {
1408
1415
  script_name?: string;
1409
1416
  /** Whether the Workflow should be remote or not in local development */
1410
1417
  remote?: boolean;
1418
+ /** Optional limits for the Workflow */
1419
+ limits?: {
1420
+ /** Maximum number of steps a Workflow instance can execute */
1421
+ steps?: number;
1422
+ };
1411
1423
  };
1412
1424
  /**
1413
1425
  * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
@@ -1439,6 +1451,23 @@ interface EnvironmentNonInheritable {
1439
1451
  * @nonInheritable
1440
1452
  */
1441
1453
  vars: Record<string, string | Json>;
1454
+ /**
1455
+ * Secrets configuration (experimental).
1456
+ *
1457
+ * NOTE: This field is not automatically inherited from the top level environment,
1458
+ * and so must be specified in every named environment.
1459
+ *
1460
+ * @nonInheritable
1461
+ */
1462
+ secrets?: {
1463
+ /**
1464
+ * List of secret names that are required by your Worker.
1465
+ * When defined, this property:
1466
+ * - Replaces .dev.vars/.env/process.env inference for type generation
1467
+ * - Enables local dev validation with warnings for missing secrets
1468
+ */
1469
+ required?: string[];
1470
+ };
1442
1471
  /**
1443
1472
  * A list of durable objects that your Worker should be bound to.
1444
1473
  *
@@ -2088,9 +2117,15 @@ interface Observability {
2088
2117
  destinations?: string[];
2089
2118
  };
2090
2119
  }
2120
+ interface CacheOptions {
2121
+ /** If cache is enabled for this Worker */
2122
+ enabled: boolean;
2123
+ }
2091
2124
  type DockerConfiguration = {
2092
2125
  /** Socket used by miniflare to communicate with Docker */
2093
2126
  socketPath: string;
2127
+ /** Docker image name for the container egress interceptor sidecar */
2128
+ containerEgressInterceptorImage?: string;
2094
2129
  };
2095
2130
  type ContainerEngine = {
2096
2131
  localDocker: DockerConfiguration;
@@ -2367,15 +2402,20 @@ type VarBinding = Extract<Binding, {
2367
2402
  * Any values in these files (all formatted like `.env` files) will add to or override `vars`
2368
2403
  * bindings provided in the Wrangler configuration file.
2369
2404
  *
2405
+ * When `secrets` is defined in the config, only the declared secret keys are loaded from
2406
+ * `.dev.vars`/`.env`/`process.env`. All other keys in those files are excluded. A warning
2407
+ * is emitted for any required secrets that are missing.
2408
+ *
2370
2409
  * @param configPath - The path to the Wrangler configuration file, if defined.
2371
2410
  * @param envFiles - An array of paths to .env files to load; if `undefined` the default .env files will be used (see `getDefaultEnvFiles()`).
2372
2411
  * The `envFiles` paths are resolved against the directory of the Wrangler configuration file, if there is one, otherwise against the current working directory.
2373
2412
  * @param vars - The existing `vars` bindings from the Wrangler configuration.
2374
2413
  * @param env - The specific environment name (e.g., "staging") or `undefined` if no specific environment is set.
2375
2414
  * @param silent - If true, will not log any messages about the loaded .dev.vars files or .env files.
2415
+ * @param secrets - If defined, only the declared secret keys are loaded from `.dev.vars` or `.env`/`process.env`.
2376
2416
  * @returns The merged `vars` as typed bindings. Config vars are `plain_text`/`json`, while `.dev.vars`/`.env` vars are `secret_text`.
2377
2417
  */
2378
- declare function getVarsForDev(configPath: string | undefined, envFiles: string[] | undefined, vars: Config$1["vars"], env: string | undefined, silent?: boolean): Record<string, VarBinding>;
2418
+ declare function getVarsForDev(configPath: string | undefined, envFiles: string[] | undefined, vars: Config$1["vars"], env: string | undefined, silent?: boolean, secrets?: Config$1["secrets"]): Record<string, VarBinding>;
2379
2419
 
2380
2420
  interface PackageManager {
2381
2421
  type: "npm" | "yarn" | "pnpm" | "bun";