wrangler 3.114.3 → 3.114.5

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.
@@ -74,8 +74,7 @@
74
74
  "Text",
75
75
  "Data",
76
76
  "PythonModule",
77
- "PythonRequirement",
78
- "NodeJsCompatModule"
77
+ "PythonRequirement"
79
78
  ],
80
79
  "type": "string"
81
80
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.114.3",
3
+ "version": "3.114.5",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -57,14 +57,14 @@
57
57
  "esbuild": "0.17.19",
58
58
  "path-to-regexp": "6.3.0",
59
59
  "unenv": "2.0.0-rc.14",
60
- "workerd": "1.20250310.0",
61
- "miniflare": "3.20250310.1",
60
+ "workerd": "1.20250408.0",
61
+ "miniflare": "3.20250408.0",
62
62
  "@cloudflare/kv-asset-handler": "0.3.4"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@aws-sdk/client-s3": "^3.721.0",
66
66
  "@cloudflare/types": "6.18.4",
67
- "@cloudflare/workers-types": "^4.20250310.0",
67
+ "@cloudflare/workers-types": "^4.20250408.0",
68
68
  "@cspotcode/source-map-support": "0.8.1",
69
69
  "@iarna/toml": "^3.0.0",
70
70
  "@microsoft/api-extractor": "^7.47.0",
@@ -137,14 +137,14 @@
137
137
  "xdg-app-paths": "^8.3.0",
138
138
  "xxhash-wasm": "^1.0.1",
139
139
  "yargs": "^17.7.2",
140
- "@cloudflare/eslint-config-worker": "1.1.0",
141
- "@cloudflare/pages-shared": "0.13.14",
142
140
  "@cloudflare/cli": "1.1.1",
143
- "@cloudflare/workers-tsconfig": "0.0.0",
144
- "@cloudflare/workers-shared": "0.15.0"
141
+ "@cloudflare/eslint-config-worker": "1.1.0",
142
+ "@cloudflare/workers-shared": "0.15.0",
143
+ "@cloudflare/pages-shared": "0.13.16",
144
+ "@cloudflare/workers-tsconfig": "0.0.0"
145
145
  },
146
146
  "peerDependencies": {
147
- "@cloudflare/workers-types": "^4.20250310.0"
147
+ "@cloudflare/workers-types": "^4.20250408.0"
148
148
  },
149
149
  "peerDependenciesMeta": {
150
150
  "@cloudflare/workers-types": {
@@ -680,7 +680,7 @@ declare interface CfModule {
680
680
  /**
681
681
  * A module type.
682
682
  */
683
- declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement" | "nodejs-compat-module";
683
+ declare type CfModuleType = "esm" | "commonjs" | "compiled-wasm" | "text" | "buffer" | "python" | "python-requirement";
684
684
 
685
685
  declare interface CfMTlsCertificate {
686
686
  binding: string;
@@ -1045,7 +1045,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
1045
1045
  /**
1046
1046
  * The possible types for a `Rule`.
1047
1047
  */
1048
- declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement" | "NodeJsCompatModule";
1048
+ declare type ConfigModuleRuleType = "ESModule" | "CommonJS" | "CompiledWasm" | "Text" | "Data" | "PythonModule" | "PythonRequirement";
1049
1049
 
1050
1050
  declare type ConfigUpdateEvent = {
1051
1051
  type: "configUpdate";
@@ -1176,6 +1176,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1176
1176
  build_image_major_version: number;
1177
1177
  kv_namespaces?: any;
1178
1178
  source?: {
1179
+ type: "github" | "gitlab";
1179
1180
  config: {
1180
1181
  owner: string;
1181
1182
  repo_name: string;
@@ -1187,7 +1188,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1187
1188
  preview_branch_includes?: string[] | undefined;
1188
1189
  preview_branch_excludes?: string[] | undefined;
1189
1190
  };
1190
- type: "github" | "gitlab";
1191
1191
  } | undefined;
1192
1192
  env_vars?: any;
1193
1193
  durable_object_namespaces?: any;
@@ -81450,7 +81450,7 @@ var import_undici3 = __toESM(require_undici());
81450
81450
 
81451
81451
  // package.json
81452
81452
  var name = "wrangler";
81453
- var version = "3.114.3";
81453
+ var version = "3.114.5";
81454
81454
 
81455
81455
  // src/environment-variables/misc-variables.ts
81456
81456
  init_import_meta_url();
@@ -90767,11 +90767,14 @@ function hasCursor(result_info) {
90767
90767
  }
90768
90768
  __name(hasCursor, "hasCursor");
90769
90769
  function renderError(err, level = 0) {
90770
+ const indent = " ".repeat(level);
90770
90771
  const chainedMessages = err.error_chain?.map(
90771
90772
  (chainedError) => `
90772
- ${" ".repeat(level)}- ${renderError(chainedError, level + 1)}`
90773
+
90774
+ ${indent}- ${renderError(chainedError, level + 1)}`
90773
90775
  ).join("\n") ?? "";
90774
- return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + chainedMessages;
90776
+ return (err.code ? `${err.message} [code: ${err.code}]` : err.message) + (err.documentation_url ? `
90777
+ ${indent}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
90775
90778
  }
90776
90779
  __name(renderError, "renderError");
90777
90780
 
@@ -92183,8 +92186,7 @@ var RuleTypeToModuleType = {
92183
92186
  Data: "buffer",
92184
92187
  Text: "text",
92185
92188
  PythonModule: "python",
92186
- PythonRequirement: "python-requirement",
92187
- NodeJsCompatModule: "nodejs-compat-module"
92189
+ PythonRequirement: "python-requirement"
92188
92190
  };
92189
92191
  var ModuleTypeToRuleType = flipObject(RuleTypeToModuleType);
92190
92192
  var modulesWatchRegexp = /^wrangler:modules-watch$/;
@@ -104382,8 +104384,7 @@ var moduleTypeMimeType = {
104382
104384
  buffer: "application/octet-stream",
104383
104385
  text: "text/plain",
104384
104386
  python: "text/x-python",
104385
- "python-requirement": "text/x-python-requirement",
104386
- "nodejs-compat-module": void 0
104387
+ "python-requirement": "text/x-python-requirement"
104387
104388
  };
104388
104389
  function toMimeType(type) {
104389
104390
  const mimeType = moduleTypeMimeType[type];
@@ -120083,12 +120084,7 @@ async function getEntry(args, config, command2) {
120083
120084
  args.format ?? config.build?.upload?.format,
120084
120085
  config.tsconfig
120085
120086
  );
120086
- const { localBindings, remoteBindings } = partitionDurableObjectBindings(config);
120087
- if (command2 === "dev" && remoteBindings.length > 0) {
120088
- logger.warn(
120089
- "WARNING: You have Durable Object bindings that are not defined locally in the worker being developed.\nBe aware that changes to the data stored in these Durable Objects will be permanent and affect the live instances.\nRemote Durable Objects that are affected:\n" + remoteBindings.map((b6) => `- ${JSON.stringify(b6)}`).join("\n")
120090
- );
120091
- }
120087
+ const { localBindings } = partitionDurableObjectBindings(config);
120092
120088
  if (format11 === "service-worker" && localBindings.length > 0) {
120093
120089
  const errorMessage = "You seem to be trying to use Durable Objects in a Worker written as a service-worker.";
120094
120090
  const addScriptName = `You can use Durable Objects defined in other Workers by specifying a \`script_name\` in your ${configFileName(config.configPath)} file, where \`script_name\` is the name of the Worker that implements that Durable Object. For example:`;
@@ -120117,7 +120113,7 @@ function partitionDurableObjectBindings(config) {
120117
120113
  const localBindings = [];
120118
120114
  const remoteBindings = [];
120119
120115
  for (const binding of config.durable_objects.bindings) {
120120
- if (binding.script_name === void 0) {
120116
+ if (binding.script_name === void 0 || binding.script_name === config.name) {
120121
120117
  localBindings.push(binding);
120122
120118
  } else {
120123
120119
  remoteBindings.push(binding);
@@ -122456,6 +122452,31 @@ __name(handler6, "handler");
122456
122452
 
122457
122453
  // src/hyperdrive/list.ts
122458
122454
  init_import_meta_url();
122455
+
122456
+ // src/hyperdrive/shared.ts
122457
+ init_import_meta_url();
122458
+ function formatCachingOptions(cachingOptions) {
122459
+ switch (cachingOptions?.disabled) {
122460
+ case false: {
122461
+ if (cachingOptions.stale_while_revalidate === 0) {
122462
+ return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: disabled`;
122463
+ } else {
122464
+ return `max_age: ${cachingOptions.max_age}, stale_while_revalidate: ${cachingOptions.stale_while_revalidate}`;
122465
+ }
122466
+ }
122467
+ case void 0: {
122468
+ return "enabled";
122469
+ }
122470
+ case true: {
122471
+ return "disabled";
122472
+ }
122473
+ default:
122474
+ return JSON.stringify(cachingOptions);
122475
+ }
122476
+ }
122477
+ __name(formatCachingOptions, "formatCachingOptions");
122478
+
122479
+ // src/hyperdrive/list.ts
122459
122480
  function options7(yargs) {
122460
122481
  return yargs;
122461
122482
  }
@@ -122472,7 +122493,7 @@ async function handler7(args) {
122472
122493
  host: database.origin.host ?? "",
122473
122494
  port: database.origin.port?.toString() ?? "",
122474
122495
  database: database.origin.database ?? "",
122475
- caching: JSON.stringify(database.caching)
122496
+ caching: formatCachingOptions(database.caching)
122476
122497
  }))
122477
122498
  );
122478
122499
  }
@@ -128822,9 +128843,8 @@ var secretBulkCommand = createCommand({
128822
128843
  logger.log(`\u2728 ${upsertBindings.length} secrets successfully uploaded`);
128823
128844
  } catch (err) {
128824
128845
  logger.log("");
128825
- logger.log("Finished processing secrets JSON file:");
128826
- logger.log(`\u2728 0 secrets successfully uploaded`);
128827
- throw new Error(`\u{1F6A8} ${upsertBindings.length} secrets failed to upload`);
128846
+ logger.log(`\u{1F6A8} Secrets failed to upload`);
128847
+ throw err;
128828
128848
  }
128829
128849
  }
128830
128850
  });
@@ -129057,11 +129077,8 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
129057
129077
  `\u2728 ${Object.keys(upsertBindings).length} secrets successfully uploaded`
129058
129078
  );
129059
129079
  } catch (err) {
129060
- logger.log("Finished processing secrets file:");
129061
- logger.log(`\u2728 0 secrets successfully uploaded`);
129062
- throw new FatalError(
129063
- `\u{1F6A8} ${Object.keys(upsertBindings).length} secrets failed to upload`
129064
- );
129080
+ logger.log(`\u{1F6A8} Secrets failed to upload`);
129081
+ throw err;
129065
129082
  }
129066
129083
  }
129067
129084
  ).command(
@@ -158071,13 +158088,26 @@ async function getPlatformProxy(options32 = {}) {
158071
158088
  __name(getPlatformProxy, "getPlatformProxy");
158072
158089
  async function getMiniflareOptionsFromConfig(rawConfig, env6, options32) {
158073
158090
  const bindings = getBindings2(rawConfig, env6, true, {});
158091
+ if (rawConfig["durable_objects"]) {
158092
+ const { localBindings } = partitionDurableObjectBindings(rawConfig);
158093
+ if (localBindings.length > 0) {
158094
+ logger.warn(dedent2`
158095
+ You have defined bindings to the following internal Durable Objects:
158096
+ ${localBindings.map((b6) => `- ${JSON.stringify(b6)}`).join("\n")}
158097
+ These will not work in local development, but they should work in production.
158098
+
158099
+ If you want to develop these locally, you can define your DO in a separate Worker, with a separate configuration file.
158100
+ For detailed instructions, refer to the Durable Objects section here: https://developers.cloudflare.com/workers/wrangler/api#supported-bindings
158101
+ `);
158102
+ }
158103
+ }
158074
158104
  const workerDefinitions = await getBoundRegisteredWorkers({
158075
158105
  name: rawConfig.name,
158076
158106
  services: bindings.services,
158077
158107
  durableObjects: rawConfig["durable_objects"]
158078
158108
  });
158079
158109
  const { bindingOptions, externalWorkers } = buildMiniflareBindingOptions({
158080
- name: void 0,
158110
+ name: rawConfig.name,
158081
158111
  bindings,
158082
158112
  workerDefinitions,
158083
158113
  queueConsumers: void 0,
@@ -158093,6 +158123,7 @@ async function getMiniflareOptionsFromConfig(rawConfig, env6, options32) {
158093
158123
  {
158094
158124
  script: "",
158095
158125
  modules: true,
158126
+ name: rawConfig.name,
158096
158127
  ...bindingOptions,
158097
158128
  serviceBindings: {
158098
158129
  ...serviceBindings,