wrangler 4.32.0 → 4.33.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.32.0",
3
+ "version": "4.33.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.25.4",
55
55
  "path-to-regexp": "6.3.0",
56
56
  "unenv": "2.0.0-rc.19",
57
- "workerd": "1.20250816.0",
57
+ "workerd": "1.20250823.0",
58
58
  "@cloudflare/kv-asset-handler": "0.4.0",
59
- "@cloudflare/unenv-preset": "2.6.2",
60
- "miniflare": "4.20250816.1"
59
+ "@cloudflare/unenv-preset": "2.6.3",
60
+ "miniflare": "4.20250823.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@cloudflare/jsrpc": "link:../../vendor/jsrpc",
65
65
  "@cloudflare/types": "6.18.4",
66
- "@cloudflare/workers-types": "^4.20250816.0",
66
+ "@cloudflare/workers-types": "^4.20250823.0",
67
67
  "@cspotcode/source-map-support": "0.8.1",
68
68
  "@iarna/toml": "^3.0.0",
69
69
  "@sentry/node": "^7.86.0",
@@ -138,14 +138,14 @@
138
138
  "xxhash-wasm": "^1.0.1",
139
139
  "yargs": "^17.7.2",
140
140
  "@cloudflare/cli": "1.1.1",
141
- "@cloudflare/workers-tsconfig": "0.0.0",
141
+ "@cloudflare/containers-shared": "0.2.10",
142
142
  "@cloudflare/eslint-config-worker": "1.1.0",
143
143
  "@cloudflare/pages-shared": "^0.13.65",
144
144
  "@cloudflare/workers-shared": "0.18.6",
145
- "@cloudflare/containers-shared": "0.2.10"
145
+ "@cloudflare/workers-tsconfig": "0.0.0"
146
146
  },
147
147
  "peerDependencies": {
148
- "@cloudflare/workers-types": "^4.20250816.0"
148
+ "@cloudflare/workers-types": "^4.20250823.0"
149
149
  },
150
150
  "peerDependenciesMeta": {
151
151
  "@cloudflare/workers-types": {
@@ -1,7 +1,7 @@
1
1
  import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
2
2
  import * as undici from 'undici';
3
3
  import { RequestInfo, RequestInit, Response, FormData } from 'undici';
4
- import { CamelCaseKey, ArgumentsCamelCase, InferredOptionTypes, Alias, PositionalOptions, Options } from 'yargs';
4
+ import { CamelCaseKey, Argv, PositionalOptions, Options, ArgumentsCamelCase, InferredOptionTypes, Alias } from 'yargs';
5
5
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
6
6
  import { Metafile } from 'esbuild';
7
7
  import { EventEmitter } from 'node:events';
@@ -1086,6 +1086,239 @@ type ContainerEngine = {
1086
1086
  localDocker: DockerConfiguration;
1087
1087
  } | string;
1088
1088
 
1089
+ /**
1090
+ * A symbol to inherit a binding from the deployed worker.
1091
+ */
1092
+ declare const INHERIT_SYMBOL: unique symbol;
1093
+
1094
+ /**
1095
+ * The type of Worker
1096
+ */
1097
+ type CfScriptFormat = "modules" | "service-worker";
1098
+ /**
1099
+ * A module type.
1100
+ */
1101
+ type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
1102
+ /**
1103
+ * An imported module.
1104
+ */
1105
+ interface CfModule {
1106
+ /**
1107
+ * The module name.
1108
+ *
1109
+ * @example
1110
+ * './src/index.js'
1111
+ */
1112
+ name: string;
1113
+ /**
1114
+ * The absolute path of the module on disk, or `undefined` if this is a
1115
+ * virtual module. Used as the source URL for this module, so source maps are
1116
+ * correctly resolved.
1117
+ *
1118
+ * @example
1119
+ * '/path/to/src/index.js'
1120
+ */
1121
+ filePath: string | undefined;
1122
+ /**
1123
+ * The module content, usually JavaScript or WASM code.
1124
+ *
1125
+ * @example
1126
+ * export default {
1127
+ * async fetch(request) {
1128
+ * return new Response('Ok')
1129
+ * }
1130
+ * }
1131
+ */
1132
+ content: string | Buffer<ArrayBuffer>;
1133
+ /**
1134
+ * An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
1135
+ * if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
1136
+ * we need to also copy the relevant sourcemaps into the final out directory.
1137
+ */
1138
+ sourceMap?: CfWorkerSourceMap;
1139
+ /**
1140
+ * The module type.
1141
+ *
1142
+ * If absent, will default to the main module's type.
1143
+ */
1144
+ type?: CfModuleType;
1145
+ }
1146
+ /**
1147
+ * A KV namespace.
1148
+ */
1149
+ interface CfKvNamespace {
1150
+ binding: string;
1151
+ id?: string | typeof INHERIT_SYMBOL;
1152
+ experimental_remote?: boolean;
1153
+ raw?: boolean;
1154
+ }
1155
+ /**
1156
+ * A binding to send email.
1157
+ */
1158
+ type CfSendEmailBindings = {
1159
+ name: string;
1160
+ experimental_remote?: boolean;
1161
+ } & ({
1162
+ destination_address?: string;
1163
+ } | {
1164
+ allowed_destination_addresses?: string[];
1165
+ });
1166
+ /**
1167
+ * A binding to the AI project
1168
+ */
1169
+ interface CfAIBinding {
1170
+ binding: string;
1171
+ staging?: boolean;
1172
+ experimental_remote?: boolean;
1173
+ raw?: boolean;
1174
+ }
1175
+ /**
1176
+ * A Durable Object.
1177
+ */
1178
+ interface CfDurableObject {
1179
+ name: string;
1180
+ class_name: string;
1181
+ script_name?: string;
1182
+ environment?: string;
1183
+ }
1184
+ interface CfWorkflow {
1185
+ name: string;
1186
+ class_name: string;
1187
+ binding: string;
1188
+ script_name?: string;
1189
+ experimental_remote?: boolean;
1190
+ raw?: boolean;
1191
+ }
1192
+ interface CfQueue {
1193
+ binding: string;
1194
+ queue_name: string;
1195
+ delivery_delay?: number;
1196
+ experimental_remote?: boolean;
1197
+ raw?: boolean;
1198
+ }
1199
+ interface CfR2Bucket {
1200
+ binding: string;
1201
+ bucket_name?: string | typeof INHERIT_SYMBOL;
1202
+ jurisdiction?: string;
1203
+ experimental_remote?: boolean;
1204
+ raw?: boolean;
1205
+ }
1206
+ interface CfD1Database {
1207
+ binding: string;
1208
+ database_id?: string | typeof INHERIT_SYMBOL;
1209
+ database_name?: string;
1210
+ preview_database_id?: string;
1211
+ database_internal_env?: string;
1212
+ migrations_table?: string;
1213
+ migrations_dir?: string;
1214
+ experimental_remote?: boolean;
1215
+ raw?: boolean;
1216
+ }
1217
+ interface CfVectorize {
1218
+ binding: string;
1219
+ index_name: string;
1220
+ raw?: boolean;
1221
+ experimental_remote?: boolean;
1222
+ }
1223
+ interface CfSecretsStoreSecrets {
1224
+ binding: string;
1225
+ store_id: string;
1226
+ secret_name: string;
1227
+ }
1228
+ interface CfHelloWorld {
1229
+ binding: string;
1230
+ enable_timer?: boolean;
1231
+ }
1232
+ interface CfHyperdrive {
1233
+ binding: string;
1234
+ id: string;
1235
+ localConnectionString?: string;
1236
+ }
1237
+ interface CfService {
1238
+ binding: string;
1239
+ service: string;
1240
+ environment?: string;
1241
+ entrypoint?: string;
1242
+ props?: Record<string, unknown>;
1243
+ experimental_remote?: boolean;
1244
+ }
1245
+ interface CfAnalyticsEngineDataset {
1246
+ binding: string;
1247
+ dataset?: string;
1248
+ }
1249
+ interface CfDispatchNamespace {
1250
+ binding: string;
1251
+ namespace: string;
1252
+ outbound?: {
1253
+ service: string;
1254
+ environment?: string;
1255
+ parameters?: string[];
1256
+ };
1257
+ experimental_remote?: boolean;
1258
+ }
1259
+ interface CfMTlsCertificate {
1260
+ binding: string;
1261
+ certificate_id: string;
1262
+ experimental_remote?: boolean;
1263
+ }
1264
+ interface CfLogfwdrBinding {
1265
+ name: string;
1266
+ destination: string;
1267
+ }
1268
+ interface CfPipeline {
1269
+ binding: string;
1270
+ pipeline: string;
1271
+ experimental_remote?: boolean;
1272
+ }
1273
+ interface CfUnsafeBinding {
1274
+ name: string;
1275
+ type: string;
1276
+ }
1277
+ type CfUnsafeMetadata = Record<string, unknown>;
1278
+ type CfCapnp = {
1279
+ base_path?: never;
1280
+ source_schemas?: never;
1281
+ compiled_schema: string;
1282
+ } | {
1283
+ base_path: string;
1284
+ source_schemas: string[];
1285
+ compiled_schema?: never;
1286
+ };
1287
+ interface CfUnsafe {
1288
+ bindings: CfUnsafeBinding[] | undefined;
1289
+ metadata: CfUnsafeMetadata | undefined;
1290
+ capnp: CfCapnp | undefined;
1291
+ }
1292
+ interface CfTailConsumer {
1293
+ service: string;
1294
+ environment?: string;
1295
+ }
1296
+ interface CfWorkerSourceMap {
1297
+ /**
1298
+ * The name of the source map.
1299
+ *
1300
+ * @example
1301
+ * 'out.js.map'
1302
+ */
1303
+ name: string;
1304
+ /**
1305
+ * The content of the source map, which is a JSON object described by the v3
1306
+ * spec.
1307
+ *
1308
+ * @example
1309
+ * {
1310
+ * "version" : 3,
1311
+ * "file": "out.js",
1312
+ * "sourceRoot": "",
1313
+ * "sources": ["foo.js", "bar.js"],
1314
+ * "sourcesContent": [null, null],
1315
+ * "names": ["src", "maps", "are", "fun"],
1316
+ * "mappings": "A,AAAB;;ABCDE;"
1317
+ * }
1318
+ */
1319
+ content: string | Buffer;
1320
+ }
1321
+
1089
1322
  /**
1090
1323
  * This is the static type definition for the configuration object.
1091
1324
  *
@@ -1329,6 +1562,7 @@ interface CommonYargsOptions {
1329
1562
  "experimental-provision": boolean | undefined;
1330
1563
  "experimental-remote-bindings": boolean | undefined;
1331
1564
  }
1565
+ type CommonYargsArgv = Argv<CommonYargsOptions>;
1332
1566
  type RemoveIndex<T> = {
1333
1567
  [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
1334
1568
  };
@@ -1367,239 +1601,6 @@ declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, options?
1367
1601
  userConfigPath: string | undefined;
1368
1602
  };
1369
1603
 
1370
- /**
1371
- * A symbol to inherit a binding from the deployed worker.
1372
- */
1373
- declare const INHERIT_SYMBOL: unique symbol;
1374
-
1375
- /**
1376
- * The type of Worker
1377
- */
1378
- type CfScriptFormat = "modules" | "service-worker";
1379
- /**
1380
- * A module type.
1381
- */
1382
- type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
1383
- /**
1384
- * An imported module.
1385
- */
1386
- interface CfModule {
1387
- /**
1388
- * The module name.
1389
- *
1390
- * @example
1391
- * './src/index.js'
1392
- */
1393
- name: string;
1394
- /**
1395
- * The absolute path of the module on disk, or `undefined` if this is a
1396
- * virtual module. Used as the source URL for this module, so source maps are
1397
- * correctly resolved.
1398
- *
1399
- * @example
1400
- * '/path/to/src/index.js'
1401
- */
1402
- filePath: string | undefined;
1403
- /**
1404
- * The module content, usually JavaScript or WASM code.
1405
- *
1406
- * @example
1407
- * export default {
1408
- * async fetch(request) {
1409
- * return new Response('Ok')
1410
- * }
1411
- * }
1412
- */
1413
- content: string | Buffer<ArrayBuffer>;
1414
- /**
1415
- * An optional sourcemap for this module if it's of a ESM or CJS type, this will only be present
1416
- * if we're deploying with sourcemaps enabled. Since we copy extra modules that aren't bundled
1417
- * we need to also copy the relevant sourcemaps into the final out directory.
1418
- */
1419
- sourceMap?: CfWorkerSourceMap;
1420
- /**
1421
- * The module type.
1422
- *
1423
- * If absent, will default to the main module's type.
1424
- */
1425
- type?: CfModuleType;
1426
- }
1427
- /**
1428
- * A KV namespace.
1429
- */
1430
- interface CfKvNamespace {
1431
- binding: string;
1432
- id?: string | typeof INHERIT_SYMBOL;
1433
- experimental_remote?: boolean;
1434
- raw?: boolean;
1435
- }
1436
- /**
1437
- * A binding to send email.
1438
- */
1439
- type CfSendEmailBindings = {
1440
- name: string;
1441
- experimental_remote?: boolean;
1442
- } & ({
1443
- destination_address?: string;
1444
- } | {
1445
- allowed_destination_addresses?: string[];
1446
- });
1447
- /**
1448
- * A binding to the AI project
1449
- */
1450
- interface CfAIBinding {
1451
- binding: string;
1452
- staging?: boolean;
1453
- experimental_remote?: boolean;
1454
- raw?: boolean;
1455
- }
1456
- /**
1457
- * A Durable Object.
1458
- */
1459
- interface CfDurableObject {
1460
- name: string;
1461
- class_name: string;
1462
- script_name?: string;
1463
- environment?: string;
1464
- }
1465
- interface CfWorkflow {
1466
- name: string;
1467
- class_name: string;
1468
- binding: string;
1469
- script_name?: string;
1470
- experimental_remote?: boolean;
1471
- raw?: boolean;
1472
- }
1473
- interface CfQueue {
1474
- binding: string;
1475
- queue_name: string;
1476
- delivery_delay?: number;
1477
- experimental_remote?: boolean;
1478
- raw?: boolean;
1479
- }
1480
- interface CfR2Bucket {
1481
- binding: string;
1482
- bucket_name?: string | typeof INHERIT_SYMBOL;
1483
- jurisdiction?: string;
1484
- experimental_remote?: boolean;
1485
- raw?: boolean;
1486
- }
1487
- interface CfD1Database {
1488
- binding: string;
1489
- database_id?: string | typeof INHERIT_SYMBOL;
1490
- database_name?: string;
1491
- preview_database_id?: string;
1492
- database_internal_env?: string;
1493
- migrations_table?: string;
1494
- migrations_dir?: string;
1495
- experimental_remote?: boolean;
1496
- raw?: boolean;
1497
- }
1498
- interface CfVectorize {
1499
- binding: string;
1500
- index_name: string;
1501
- raw?: boolean;
1502
- experimental_remote?: boolean;
1503
- }
1504
- interface CfSecretsStoreSecrets {
1505
- binding: string;
1506
- store_id: string;
1507
- secret_name: string;
1508
- }
1509
- interface CfHelloWorld {
1510
- binding: string;
1511
- enable_timer?: boolean;
1512
- }
1513
- interface CfHyperdrive {
1514
- binding: string;
1515
- id: string;
1516
- localConnectionString?: string;
1517
- }
1518
- interface CfService {
1519
- binding: string;
1520
- service: string;
1521
- environment?: string;
1522
- entrypoint?: string;
1523
- props?: Record<string, unknown>;
1524
- experimental_remote?: boolean;
1525
- }
1526
- interface CfAnalyticsEngineDataset {
1527
- binding: string;
1528
- dataset?: string;
1529
- }
1530
- interface CfDispatchNamespace {
1531
- binding: string;
1532
- namespace: string;
1533
- outbound?: {
1534
- service: string;
1535
- environment?: string;
1536
- parameters?: string[];
1537
- };
1538
- experimental_remote?: boolean;
1539
- }
1540
- interface CfMTlsCertificate {
1541
- binding: string;
1542
- certificate_id: string;
1543
- experimental_remote?: boolean;
1544
- }
1545
- interface CfLogfwdrBinding {
1546
- name: string;
1547
- destination: string;
1548
- }
1549
- interface CfPipeline {
1550
- binding: string;
1551
- pipeline: string;
1552
- experimental_remote?: boolean;
1553
- }
1554
- interface CfUnsafeBinding {
1555
- name: string;
1556
- type: string;
1557
- }
1558
- type CfUnsafeMetadata = Record<string, unknown>;
1559
- type CfCapnp = {
1560
- base_path?: never;
1561
- source_schemas?: never;
1562
- compiled_schema: string;
1563
- } | {
1564
- base_path: string;
1565
- source_schemas: string[];
1566
- compiled_schema?: never;
1567
- };
1568
- interface CfUnsafe {
1569
- bindings: CfUnsafeBinding[] | undefined;
1570
- metadata: CfUnsafeMetadata | undefined;
1571
- capnp: CfCapnp | undefined;
1572
- }
1573
- interface CfTailConsumer {
1574
- service: string;
1575
- environment?: string;
1576
- }
1577
- interface CfWorkerSourceMap {
1578
- /**
1579
- * The name of the source map.
1580
- *
1581
- * @example
1582
- * 'out.js.map'
1583
- */
1584
- name: string;
1585
- /**
1586
- * The content of the source map, which is a JSON object described by the v3
1587
- * spec.
1588
- *
1589
- * @example
1590
- * {
1591
- * "version" : 3,
1592
- * "file": "out.js",
1593
- * "sourceRoot": "",
1594
- * "sources": ["foo.js", "bar.js"],
1595
- * "sourcesContent": [null, null],
1596
- * "names": ["src", "maps", "are", "fun"],
1597
- * "mappings": "A,AAAB;;ABCDE;"
1598
- * }
1599
- */
1600
- content: string | Buffer;
1601
- }
1602
-
1603
1604
  interface EnablePagesAssetsServiceBindingOptions {
1604
1605
  proxyPort?: number;
1605
1606
  directory?: string;
@@ -1798,6 +1799,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1798
1799
  modified_on: string;
1799
1800
  short_id: string;
1800
1801
  build_image_major_version: number;
1802
+ kv_namespaces?: any;
1801
1803
  source?: {
1802
1804
  type: "github" | "gitlab";
1803
1805
  config: {
@@ -1812,7 +1814,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1812
1814
  preview_branch_excludes?: string[] | undefined;
1813
1815
  };
1814
1816
  } | undefined;
1815
- kv_namespaces?: any;
1816
1817
  env_vars?: any;
1817
1818
  durable_object_namespaces?: any;
1818
1819
  is_skipped?: boolean | undefined;
@@ -2913,13 +2914,100 @@ type DefinitionTreeNode = {
2913
2914
  };
2914
2915
  type DefinitionTree = Map<string, DefinitionTreeNode>;
2915
2916
 
2917
+ type CreateCommandResult<NamedArgDefs extends NamedArgDefinitions> = DeepFlatten<{
2918
+ args: HandlerArgs<NamedArgDefs>;
2919
+ }>;
2920
+
2921
+ /**
2922
+ * Class responsible for registering and managing commands within a command registry.
2923
+ */
2924
+ declare class CommandRegistry {
2925
+ #private;
2926
+ /**
2927
+ * Initializes the command registry with the given command registration function.
2928
+ */
2929
+ constructor(registerCommand: RegisterCommand);
2930
+ /**
2931
+ * Defines multiple commands and their corresponding definitions.
2932
+ */
2933
+ define(defs: {
2934
+ command: Command;
2935
+ definition: AliasDefinition | CreateCommandResult<NamedArgDefinitions> | NamespaceDefinition;
2936
+ }[]): void;
2937
+ getDefinitionTreeRoot(): DefinitionTreeNode;
2938
+ /**
2939
+ * Registers all commands in the command registry, walking through the definition tree.
2940
+ */
2941
+ registerAll(): void;
2942
+ /**
2943
+ * Registers a specific namespace if not already registered.
2944
+ * TODO: Remove this once all commands use the command registry.
2945
+ * See https://github.com/cloudflare/workers-sdk/pull/7357#discussion_r1862138470 for more details.
2946
+ */
2947
+ registerNamespace(namespace: string): void;
2948
+ }
2949
+ /**
2950
+ * Type for the function used to register commands.
2951
+ */
2952
+ type RegisterCommand = (segment: string, def: InternalDefinition, registerSubTreeCallback: () => void) => void;
2953
+
2954
+ declare function createCLIParser(argv: string[]): {
2955
+ wrangler: CommonYargsArgv;
2956
+ registry: CommandRegistry;
2957
+ globalFlags: {
2958
+ readonly v: {
2959
+ readonly describe: "Show version number";
2960
+ readonly alias: "version";
2961
+ readonly type: "boolean";
2962
+ };
2963
+ readonly cwd: {
2964
+ readonly describe: "Run as if Wrangler was started in the specified directory instead of the current working directory";
2965
+ readonly type: "string";
2966
+ readonly requiresArg: true;
2967
+ };
2968
+ readonly config: {
2969
+ readonly alias: "c";
2970
+ readonly describe: "Path to Wrangler configuration file";
2971
+ readonly type: "string";
2972
+ readonly requiresArg: true;
2973
+ };
2974
+ readonly env: {
2975
+ readonly alias: "e";
2976
+ readonly describe: "Environment to use for operations, and for selecting .env and .dev.vars files";
2977
+ readonly type: "string";
2978
+ readonly requiresArg: true;
2979
+ };
2980
+ readonly "env-file": {
2981
+ readonly describe: "Path to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files";
2982
+ readonly type: "string";
2983
+ readonly array: true;
2984
+ readonly requiresArg: true;
2985
+ };
2986
+ readonly "experimental-remote-bindings": {
2987
+ readonly describe: "Experimental: Enable Remote Bindings";
2988
+ readonly type: "boolean";
2989
+ readonly hidden: true;
2990
+ readonly alias: readonly ["x-remote-bindings"];
2991
+ };
2992
+ readonly "experimental-provision": {
2993
+ readonly describe: "Experimental: Enable automatic resource provisioning";
2994
+ readonly type: "boolean";
2995
+ readonly hidden: true;
2996
+ readonly alias: readonly ["x-provision"];
2997
+ };
2998
+ };
2999
+ };
3000
+
2916
3001
  /**
2917
3002
  * EXPERIMENTAL: Get all registered Wrangler commands for documentation generation.
2918
3003
  * This API is experimental and may change without notice.
2919
3004
  *
2920
- * @returns The complete command tree structure with all metadata
3005
+ * @returns An object containing the command tree structure and global flags
2921
3006
  */
2922
- declare function experimental_getWranglerCommands(): DefinitionTreeNode;
3007
+ declare function experimental_getWranglerCommands(): {
3008
+ registry: DefinitionTreeNode;
3009
+ globalFlags: ReturnType<typeof createCLIParser>["globalFlags"];
3010
+ };
2923
3011
 
2924
3012
  interface Unstable_ASSETSBindingsOptions {
2925
3013
  log: Logger;