wrangler 4.69.0 → 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 +4 -18
- package/config-schema.json +19 -6
- package/package.json +10 -10
- package/templates/remoteBindings/ProxyServerWorker.ts +0 -30
- package/wrangler-dist/ProxyServerWorker.js +0 -12
- package/wrangler-dist/cli.d.ts +15 -5
- package/wrangler-dist/cli.js +732 -476
- package/wrangler-dist/metafile-cjs.json +1 -1
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
|
-
|
|
57
|
+
The `wrangler` CLI offers various commands, the most popular being:
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
- `wrangler dev` to start a local development server, with live reloading and devtools.
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
- `wrangler deploy` to deploy a Worker to the Cloudflare's global network.
|
|
62
62
|
|
|
63
|
-
|
|
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/).
|
package/config-schema.json
CHANGED
|
@@ -353,12 +353,11 @@
|
|
|
353
353
|
"items": {
|
|
354
354
|
"type": "string"
|
|
355
355
|
},
|
|
356
|
-
"description": "List of secret names that are required by your Worker. When defined, this property:\n- Replaces .dev.vars/.env inference for type generation\n- Enables
|
|
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
357
|
}
|
|
358
358
|
},
|
|
359
359
|
"additionalProperties": false,
|
|
360
|
-
"description": "Secrets configuration.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment."
|
|
361
|
-
"default": "undefined"
|
|
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."
|
|
362
361
|
},
|
|
363
362
|
"durable_objects": {
|
|
364
363
|
"type": "object",
|
|
@@ -1617,12 +1616,11 @@
|
|
|
1617
1616
|
"items": {
|
|
1618
1617
|
"type": "string"
|
|
1619
1618
|
},
|
|
1620
|
-
"description": "List of secret names that are required by your Worker. When defined, this property:\n- Replaces .dev.vars/.env inference for type generation\n- Enables
|
|
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"
|
|
1621
1620
|
}
|
|
1622
1621
|
},
|
|
1623
1622
|
"additionalProperties": false,
|
|
1624
|
-
"description": "Secrets configuration.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment."
|
|
1625
|
-
"default": "undefined"
|
|
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."
|
|
1626
1624
|
},
|
|
1627
1625
|
"durable_objects": {
|
|
1628
1626
|
"type": "object",
|
|
@@ -2831,6 +2829,17 @@
|
|
|
2831
2829
|
"remote": {
|
|
2832
2830
|
"type": "boolean",
|
|
2833
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"
|
|
2834
2843
|
}
|
|
2835
2844
|
},
|
|
2836
2845
|
"required": [
|
|
@@ -3197,6 +3206,10 @@
|
|
|
3197
3206
|
"socketPath": {
|
|
3198
3207
|
"type": "string",
|
|
3199
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"
|
|
3200
3213
|
}
|
|
3201
3214
|
},
|
|
3202
3215
|
"required": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.
|
|
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.
|
|
57
|
+
"workerd": "1.20260301.1",
|
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.2",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
59
|
+
"@cloudflare/unenv-preset": "2.14.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.
|
|
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.
|
|
151
|
+
"@cloudflare/containers-shared": "0.10.0",
|
|
152
152
|
"@cloudflare/eslint-config-shared": "1.2.1",
|
|
153
|
-
"@cloudflare/pages-shared": "^0.13.
|
|
153
|
+
"@cloudflare/pages-shared": "^0.13.112",
|
|
154
|
+
"@cloudflare/workers-shared": "0.19.0",
|
|
154
155
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
155
156
|
"@cloudflare/workers-utils": "0.12.0",
|
|
156
|
-
"@cloudflare/
|
|
157
|
-
"@cloudflare/workflows-shared": "0.4.0"
|
|
157
|
+
"@cloudflare/workflows-shared": "0.5.0"
|
|
158
158
|
},
|
|
159
159
|
"peerDependencies": {
|
|
160
|
-
"@cloudflare/workers-types": "^4.
|
|
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")
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -1415,6 +1415,11 @@ type WorkflowBinding = {
|
|
|
1415
1415
|
script_name?: string;
|
|
1416
1416
|
/** Whether the Workflow should be remote or not in local development */
|
|
1417
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
|
+
};
|
|
1418
1423
|
};
|
|
1419
1424
|
/**
|
|
1420
1425
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
|
@@ -1447,20 +1452,18 @@ interface EnvironmentNonInheritable {
|
|
|
1447
1452
|
*/
|
|
1448
1453
|
vars: Record<string, string | Json>;
|
|
1449
1454
|
/**
|
|
1450
|
-
* Secrets configuration.
|
|
1455
|
+
* Secrets configuration (experimental).
|
|
1451
1456
|
*
|
|
1452
1457
|
* NOTE: This field is not automatically inherited from the top level environment,
|
|
1453
1458
|
* and so must be specified in every named environment.
|
|
1454
1459
|
*
|
|
1455
|
-
* @default undefined
|
|
1456
1460
|
* @nonInheritable
|
|
1457
1461
|
*/
|
|
1458
1462
|
secrets?: {
|
|
1459
1463
|
/**
|
|
1460
1464
|
* List of secret names that are required by your Worker.
|
|
1461
1465
|
* When defined, this property:
|
|
1462
|
-
* - Replaces .dev.vars/.env inference for type generation
|
|
1463
|
-
* - Enables deploy-time validation to ensure secrets are configured
|
|
1466
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1464
1467
|
* - Enables local dev validation with warnings for missing secrets
|
|
1465
1468
|
*/
|
|
1466
1469
|
required?: string[];
|
|
@@ -2121,6 +2124,8 @@ interface CacheOptions {
|
|
|
2121
2124
|
type DockerConfiguration = {
|
|
2122
2125
|
/** Socket used by miniflare to communicate with Docker */
|
|
2123
2126
|
socketPath: string;
|
|
2127
|
+
/** Docker image name for the container egress interceptor sidecar */
|
|
2128
|
+
containerEgressInterceptorImage?: string;
|
|
2124
2129
|
};
|
|
2125
2130
|
type ContainerEngine = {
|
|
2126
2131
|
localDocker: DockerConfiguration;
|
|
@@ -2397,15 +2402,20 @@ type VarBinding = Extract<Binding, {
|
|
|
2397
2402
|
* Any values in these files (all formatted like `.env` files) will add to or override `vars`
|
|
2398
2403
|
* bindings provided in the Wrangler configuration file.
|
|
2399
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
|
+
*
|
|
2400
2409
|
* @param configPath - The path to the Wrangler configuration file, if defined.
|
|
2401
2410
|
* @param envFiles - An array of paths to .env files to load; if `undefined` the default .env files will be used (see `getDefaultEnvFiles()`).
|
|
2402
2411
|
* The `envFiles` paths are resolved against the directory of the Wrangler configuration file, if there is one, otherwise against the current working directory.
|
|
2403
2412
|
* @param vars - The existing `vars` bindings from the Wrangler configuration.
|
|
2404
2413
|
* @param env - The specific environment name (e.g., "staging") or `undefined` if no specific environment is set.
|
|
2405
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`.
|
|
2406
2416
|
* @returns The merged `vars` as typed bindings. Config vars are `plain_text`/`json`, while `.dev.vars`/`.env` vars are `secret_text`.
|
|
2407
2417
|
*/
|
|
2408
|
-
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>;
|
|
2409
2419
|
|
|
2410
2420
|
interface PackageManager {
|
|
2411
2421
|
type: "npm" | "yarn" | "pnpm" | "bun";
|