wrangler 4.61.1 → 4.62.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
@@ -39,12 +39,15 @@ To read more about Workers in general:
39
39
 
40
40
  ## Configuration
41
41
 
42
- Wrangler is configured via a `wrangler.toml` or `wrangler.json` file in the project root. An example configuration generated by `npx wrangler init` or `npx create cloudflare` is as follows:
43
-
44
- ```toml
45
- name = "my-worker"
46
- main = "./src/index.ts"
47
- compatibility_date = "YYYY-MM-DD"
42
+ Wrangler is configured via a `wrangler.jsonc` (recommended), `wrangler.json` or `wrangler.toml` file in the project root. An example configuration generated by `npx wrangler init` or `npx create cloudflare` is as follows:
43
+
44
+ ```jsonc
45
+ {
46
+ "$schema": "node_modules/wrangler/config-schema.json",
47
+ "name": "my-worker",
48
+ "main": "./src/index.ts",
49
+ "compatibility_date": "YYYY-MM-DD",
50
+ }
48
51
  ```
49
52
 
50
53
  For more detailed information about configuration, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/configuration/).
@@ -2561,11 +2561,12 @@
2561
2561
  "cpu_ms": {
2562
2562
  "type": "number",
2563
2563
  "description": "Maximum allowed CPU time for a Worker's invocation in milliseconds"
2564
+ },
2565
+ "subrequests": {
2566
+ "type": "number",
2567
+ "description": "Maximum allowed number of fetch requests that a Worker's invocation can execute"
2564
2568
  }
2565
2569
  },
2566
- "required": [
2567
- "cpu_ms"
2568
- ],
2569
2570
  "additionalProperties": false
2570
2571
  },
2571
2572
  "Rule": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.61.1",
3
+ "version": "4.62.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.0",
55
55
  "path-to-regexp": "6.3.0",
56
56
  "unenv": "2.0.0-rc.24",
57
- "workerd": "1.20260128.0",
57
+ "workerd": "1.20260131.0",
58
58
  "@cloudflare/kv-asset-handler": "0.4.2",
59
- "@cloudflare/unenv-preset": "2.12.0",
60
- "miniflare": "4.20260128.0"
59
+ "miniflare": "4.20260131.0",
60
+ "@cloudflare/unenv-preset": "2.12.0"
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.20260128.0",
66
+ "@cloudflare/workers-types": "^4.20260131.0",
67
67
  "@cspotcode/source-map-support": "0.8.1",
68
68
  "@netlify/build-info": "^10.2.0",
69
69
  "@sentry/node": "^7.86.0",
@@ -150,15 +150,15 @@
150
150
  "yargs": "^17.7.2",
151
151
  "@cloudflare/cli": "1.2.1",
152
152
  "@cloudflare/containers-shared": "0.8.0",
153
- "@cloudflare/eslint-config-shared": "1.2.0",
154
- "@cloudflare/pages-shared": "^0.13.103",
153
+ "@cloudflare/eslint-config-shared": "1.2.1",
154
+ "@cloudflare/pages-shared": "^0.13.104",
155
155
  "@cloudflare/workers-shared": "0.18.10",
156
156
  "@cloudflare/workers-tsconfig": "0.0.0",
157
- "@cloudflare/workers-utils": "0.8.1",
157
+ "@cloudflare/workers-utils": "0.9.0",
158
158
  "@cloudflare/workflows-shared": "0.4.0"
159
159
  },
160
160
  "peerDependencies": {
161
- "@cloudflare/workers-types": "^4.20260128.0"
161
+ "@cloudflare/workers-types": "^4.20260131.0"
162
162
  },
163
163
  "peerDependenciesMeta": {
164
164
  "@cloudflare/workers-types": {
@@ -180,7 +180,7 @@
180
180
  "scripts": {
181
181
  "assert-git-version": "node -r esbuild-register scripts/assert-git-version.ts",
182
182
  "build": "pnpm run clean && pnpm tsup && pnpm run generate-json-schema",
183
- "check:lint": "eslint . --max-warnings=0",
183
+ "check:lint": "eslint . --max-warnings=0 --cache",
184
184
  "check:type": "tsc -p ./tsconfig.json && tsc -p ./templates/tsconfig.json",
185
185
  "clean": "rimraf wrangler-dist miniflare-dist emitted-types",
186
186
  "dev": "pnpm run clean && concurrently -c black,blue --kill-others-on-fail false \"pnpm tsup --watch src --watch ../containers-shared/src --watch ../cli\" \"pnpm run check:type --watch --preserveWatchOutput\"",
@@ -2121,7 +2121,9 @@ interface DispatchNamespaceOutbound {
2121
2121
  }
2122
2122
  interface UserLimits {
2123
2123
  /** Maximum allowed CPU time for a Worker's invocation in milliseconds */
2124
- cpu_ms: number;
2124
+ cpu_ms?: number;
2125
+ /** Maximum allowed number of fetch requests that a Worker's invocation can execute */
2126
+ subrequests?: number;
2125
2127
  }
2126
2128
  type Assets = {
2127
2129
  /** Absolute path to assets directory */
@@ -2463,6 +2465,11 @@ interface EnvironmentMap {
2463
2465
  */
2464
2466
  declare function getVarsForDev(configPath: string | undefined, envFiles: string[] | undefined, vars: Config$1["vars"], env: string | undefined, silent?: boolean): Config$1["vars"];
2465
2467
 
2468
+ type FrameworkInfo = {
2469
+ id: string;
2470
+ name: string;
2471
+ };
2472
+
2466
2473
  type ConfigurationOptions = {
2467
2474
  outputDir: string;
2468
2475
  projectPath: string;
@@ -2475,13 +2482,17 @@ type PackageJsonScriptsOverrides = {
2475
2482
  typegen?: string;
2476
2483
  };
2477
2484
  type ConfigurationResults = {
2485
+ /** The wrangler configuration that the framework's `configure()` hook should generate. `null` if autoconfig should not create the wrangler file (in case an external tool already does that) */
2478
2486
  wranglerConfig: RawConfig$1;
2479
2487
  packageJsonScriptsOverrides?: PackageJsonScriptsOverrides;
2480
- buildCommand?: string;
2488
+ buildCommandOverride?: string;
2489
+ deployCommandOverride?: string;
2490
+ versionCommandOverride?: string;
2481
2491
  };
2482
2492
  declare abstract class Framework {
2483
- name: string;
2484
- constructor(name?: string);
2493
+ readonly id: string;
2494
+ readonly name: string;
2495
+ constructor(frameworkInfo: FrameworkInfo);
2485
2496
  isConfigured(_projectPath: string): boolean;
2486
2497
  abstract configure(options: ConfigurationOptions): Promise<ConfigurationResults> | ConfigurationResults;
2487
2498
  configurationDescription?: string;
@@ -2530,6 +2541,10 @@ type AutoConfigSummary = {
2530
2541
  wranglerConfig: RawConfig$1;
2531
2542
  frameworkConfiguration?: string;
2532
2543
  outputDir: string;
2544
+ frameworkId?: string;
2545
+ buildCommand?: string;
2546
+ deployCommand?: string;
2547
+ versionCommand?: string;
2533
2548
  };
2534
2549
 
2535
2550
  /**
@@ -2923,6 +2938,11 @@ type CommandDefinition<NamedArgDefs extends NamedArgDefinitions = NamedArgDefini
2923
2938
  * @default true
2924
2939
  */
2925
2940
  printBanner?: boolean | ((args: HandlerArgs<NamedArgDefs>) => boolean);
2941
+ /**
2942
+ * Opt-in to printing a metrics banner for this command.
2943
+ * @default false
2944
+ */
2945
+ printMetricsBanner?: boolean;
2926
2946
  /**
2927
2947
  * By default, wrangler will print warnings about the Wrangler configuration file.
2928
2948
  * Set this value to `false` to skip printing these warnings.
@@ -2952,6 +2972,11 @@ type CommandDefinition<NamedArgDefs extends NamedArgDefinitions = NamedArgDefini
2952
2972
  * using the `-e|--env` cli flag, show a warning suggesting that one should instead be specified.
2953
2973
  */
2954
2974
  warnIfMultipleEnvsConfiguredButNoneSpecified?: boolean;
2975
+ /**
2976
+ * Opt out of sending metrics for this command
2977
+ * @default true
2978
+ */
2979
+ sendMetrics?: boolean;
2955
2980
  };
2956
2981
  /**
2957
2982
  * A plain key-value object describing the CLI args for this command.
@@ -3039,15 +3064,26 @@ declare class CommandRegistry {
3039
3064
  * See https://github.com/cloudflare/workers-sdk/pull/7357#discussion_r1862138470 for more details.
3040
3065
  */
3041
3066
  registerNamespace(namespace: string): void;
3067
+ /**
3068
+ * Get a set of all top-level command names.
3069
+ *
3070
+ * Includes both registry-defined commands & legacy commands.
3071
+ */
3072
+ get topLevelCommands(): Set<string>;
3042
3073
  /**
3043
3074
  * Returns the map of categories to command segments, ordered according to
3044
3075
  * the category order. Commands within each category are sorted alphabetically.
3045
3076
  * Used for grouping commands in the help output.
3046
3077
  */
3047
3078
  get orderedCategories(): CategoryMap;
3079
+ /**
3080
+ * Registers a legacy command that doesn't use the `CommandRegistry` class.
3081
+ * This is used for hidden commands like `cloudchamber` that use the old yargs pattern.
3082
+ */
3083
+ registerLegacyCommand(command: string): void;
3048
3084
  /**
3049
3085
  * Registers a category for a legacy command that doesn't use the CommandRegistry.
3050
- * This is used for commands like `containers`, `pubsub`, etc, that use the old yargs pattern.
3086
+ * This is used for commands like `containers`, etc, that use the old yargs pattern.
3051
3087
  */
3052
3088
  registerLegacyCommandCategory(command: string, category: MetadataCategory): void;
3053
3089
  }