wrangler 4.10.0 → 4.11.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.
@@ -27,14 +27,14 @@
27
27
  },
28
28
  "compatibility_date": {
29
29
  "type": "string",
30
- "description": "A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.\n\nMore details at https://developers.cloudflare.com/workers/platform/compatibility-dates"
30
+ "description": "A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.\n\nMore details at https://developers.cloudflare.com/workers/configuration/compatibility-dates"
31
31
  },
32
32
  "compatibility_flags": {
33
33
  "type": "array",
34
34
  "items": {
35
35
  "type": "string"
36
36
  },
37
- "description": "A list of flags that enable features from upcoming features of the Workers runtime, usually used together with compatibility_date.\n\nMore details at https://developers.cloudflare.com/workers/platform/compatibility-flags",
37
+ "description": "A list of flags that enable features from upcoming features of the Workers runtime, usually used together with compatibility_date.\n\nMore details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/",
38
38
  "default": []
39
39
  },
40
40
  "main": {
@@ -954,14 +954,14 @@
954
954
  },
955
955
  "compatibility_date": {
956
956
  "type": "string",
957
- "description": "A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.\n\nMore details at https://developers.cloudflare.com/workers/platform/compatibility-dates"
957
+ "description": "A date in the form yyyy-mm-dd, which will be used to determine which version of the Workers runtime is used.\n\nMore details at https://developers.cloudflare.com/workers/configuration/compatibility-dates"
958
958
  },
959
959
  "compatibility_flags": {
960
960
  "type": "array",
961
961
  "items": {
962
962
  "type": "string"
963
963
  },
964
- "description": "A list of flags that enable features from upcoming features of the Workers runtime, usually used together with compatibility_date.\n\nMore details at https://developers.cloudflare.com/workers/platform/compatibility-flags",
964
+ "description": "A list of flags that enable features from upcoming features of the Workers runtime, usually used together with compatibility_date.\n\nMore details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/",
965
965
  "default": []
966
966
  },
967
967
  "main": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -52,17 +52,17 @@
52
52
  "dependencies": {
53
53
  "@cloudflare/unenv-preset": "2.3.1",
54
54
  "blake3-wasm": "2.1.5",
55
- "esbuild": "0.24.2",
55
+ "esbuild": "0.25.2",
56
56
  "path-to-regexp": "6.3.0",
57
57
  "unenv": "2.0.0-rc.15",
58
- "workerd": "1.20250409.0",
58
+ "workerd": "1.20250410.0",
59
59
  "@cloudflare/kv-asset-handler": "0.4.0",
60
- "miniflare": "4.20250409.0"
60
+ "miniflare": "4.20250410.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@cloudflare/types": "6.18.4",
65
- "@cloudflare/workers-types": "^4.20250409.0",
65
+ "@cloudflare/workers-types": "^4.20250410.0",
66
66
  "@cspotcode/source-map-support": "0.8.1",
67
67
  "@iarna/toml": "^3.0.0",
68
68
  "@microsoft/api-extractor": "^7.47.0",
@@ -137,12 +137,12 @@
137
137
  "yargs": "^17.7.2",
138
138
  "@cloudflare/cli": "1.1.1",
139
139
  "@cloudflare/eslint-config-worker": "1.1.0",
140
- "@cloudflare/pages-shared": "^0.13.26",
140
+ "@cloudflare/pages-shared": "^0.13.27",
141
141
  "@cloudflare/workers-shared": "0.17.1",
142
142
  "@cloudflare/workers-tsconfig": "0.0.0"
143
143
  },
144
144
  "peerDependencies": {
145
- "@cloudflare/workers-types": "^4.20250409.0"
145
+ "@cloudflare/workers-types": "^4.20250410.0"
146
146
  },
147
147
  "peerDependenciesMeta": {
148
148
  "@cloudflare/workers-types": {
@@ -1626,7 +1626,7 @@ declare interface EnvironmentInheritable {
1626
1626
  * A date in the form yyyy-mm-dd, which will be used to determine
1627
1627
  * which version of the Workers runtime is used.
1628
1628
  *
1629
- * More details at https://developers.cloudflare.com/workers/platform/compatibility-dates
1629
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
1630
1630
  *
1631
1631
  * @inheritable
1632
1632
  */
@@ -1635,7 +1635,7 @@ declare interface EnvironmentInheritable {
1635
1635
  * A list of flags that enable features from upcoming features of
1636
1636
  * the Workers runtime, usually used together with compatibility_date.
1637
1637
  *
1638
- * More details at https://developers.cloudflare.com/workers/platform/compatibility-flags
1638
+ * More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
1639
1639
  *
1640
1640
  * @default []
1641
1641
  * @inheritable
@@ -81185,7 +81185,7 @@ var import_undici3 = __toESM(require_undici());
81185
81185
 
81186
81186
  // package.json
81187
81187
  var name = "wrangler";
81188
- var version = "4.10.0";
81188
+ var version = "4.11.0";
81189
81189
 
81190
81190
  // src/environment-variables/misc-variables.ts
81191
81191
  init_import_meta_url();
@@ -84788,11 +84788,13 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args)
84788
84788
  let activeEnv = topLevelEnv;
84789
84789
  if (envName !== void 0) {
84790
84790
  if (isRedirectedConfig) {
84791
- diagnostics.errors.push(dedent`
84792
- You have specified the environment "${envName}", but are using a redirected configuration, produced by a build tool such as Vite.
84793
- You need to set the environment in your build tool, rather than via Wrangler.
84794
- For example, if you are using Vite, refer to these docs: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/
84795
- `);
84791
+ if (!isPagesConfig(rawConfig)) {
84792
+ diagnostics.errors.push(dedent`
84793
+ You have specified the environment "${envName}", but are using a redirected configuration, produced by a build tool such as Vite.
84794
+ You need to set the environment in your build tool, rather than via Wrangler.
84795
+ For example, if you are using Vite, refer to these docs: https://developers.cloudflare.com/workers/vite-plugin/reference/cloudflare-environments/
84796
+ `);
84797
+ }
84796
84798
  } else {
84797
84799
  const envDiagnostics = new Diagnostics(
84798
84800
  `"env.${envName}" environment configuration`
@@ -120040,7 +120042,7 @@ function blockWorkerJsImports(nodejsCompatMode) {
120040
120042
  return {
120041
120043
  name: "block-worker-js-imports",
120042
120044
  setup(build5) {
120043
- build5.onResolve({ filter: /.*/g }, (args) => {
120045
+ build5.onResolve({ filter: /.*/ }, (args) => {
120044
120046
  if (args.kind === "entry-point") {
120045
120047
  return {
120046
120048
  path: args.path
@@ -123140,6 +123142,7 @@ async function ListHandler3({ projectName, environment }) {
123140
123142
  }, "getStatus");
123141
123143
  const data = deployments.map((deployment) => {
123142
123144
  return {
123145
+ Id: deployment.id,
123143
123146
  Environment: titleCase(deployment.environment),
123144
123147
  Branch: deployment.deployment_trigger.metadata.branch,
123145
123148
  Source: shortSha(deployment.deployment_trigger.metadata.commit_hash),
@@ -123172,7 +123175,7 @@ function esbuildAliasExternalPlugin(aliases2) {
123172
123175
  return {
123173
123176
  name: "external-alias-imports",
123174
123177
  setup(build5) {
123175
- build5.onResolve({ filter: /.*/g }, (args) => {
123178
+ build5.onResolve({ filter: /.*/ }, (args) => {
123176
123179
  if (args.kind === "entry-point") {
123177
123180
  return {
123178
123181
  path: args.path
@@ -151705,6 +151708,7 @@ init_hash();
151705
151708
  var BULK_UPLOAD_CONCURRENCY2 = 3;
151706
151709
  var MAX_UPLOAD_ATTEMPTS2 = 5;
151707
151710
  var MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
151711
+ var MAX_DIFF_LINES2 = 100;
151708
151712
  var syncAssets = /* @__PURE__ */ __name(async (accountId, assetDirectory, scriptName, dispatchNamespace) => {
151709
151713
  (0, import_node_assert24.default)(accountId, "Missing accountId");
151710
151714
  logger.info("\u{1F300} Building list of assets...");
@@ -151727,7 +151731,9 @@ var syncAssets = /* @__PURE__ */ __name(async (accountId, assetDirectory, script
151727
151731
  { telemetryMessage: true }
151728
151732
  );
151729
151733
  }
151730
- logger.info(`No files to upload. Proceeding with deployment...`);
151734
+ logger.info(
151735
+ `No updated asset files to upload. Proceeding with deployment...`
151736
+ );
151731
151737
  return initializeAssetsResponse.jwt;
151732
151738
  }
151733
151739
  const numberFilesToUpload = initializeAssetsResponse.buckets.flat().length;
@@ -151759,14 +151765,16 @@ var syncAssets = /* @__PURE__ */ __name(async (accountId, assetDirectory, script
151759
151765
  let attempts = 0;
151760
151766
  const start = Date.now();
151761
151767
  let completionJwt = "";
151762
- let assetUploadCount = 0;
151768
+ let uploadedAssetsCount = 0;
151763
151769
  for (const [bucketIndex, bucket] of assetBuckets.entries()) {
151764
151770
  attempts = 0;
151765
151771
  let gatewayErrors = 0;
151766
151772
  const doUpload = /* @__PURE__ */ __name(async () => {
151767
151773
  const payload = new import_undici22.FormData();
151774
+ const uploadedFiles = [];
151768
151775
  for (const manifestEntry of bucket) {
151769
151776
  const absFilePath = path62.join(assetDirectory, manifestEntry[0]);
151777
+ uploadedFiles.push(manifestEntry[0]);
151770
151778
  payload.append(
151771
151779
  manifestEntry[1].hash,
151772
151780
  new import_undici22.File(
@@ -151794,9 +151802,11 @@ var syncAssets = /* @__PURE__ */ __name(async (accountId, assetDirectory, script
151794
151802
  body: payload
151795
151803
  }
151796
151804
  );
151797
- assetUploadCount += bucket.length;
151798
- logger.info(
151799
- `Uploaded ${assetUploadCount} of ${numberFilesToUpload} assets`
151805
+ uploadedAssetsCount += bucket.length;
151806
+ logAssetsUploadStatus(
151807
+ numberFilesToUpload,
151808
+ uploadedAssetsCount,
151809
+ uploadedFiles
151800
151810
  );
151801
151811
  return res;
151802
151812
  } catch (e7) {
@@ -151863,6 +151873,7 @@ Assets already uploaded have been saved, so the next attempt will automatically
151863
151873
  }, "syncAssets");
151864
151874
  var buildAssetManifest = /* @__PURE__ */ __name(async (dir) => {
151865
151875
  const files = await (0, import_promises37.readdir)(dir, { recursive: true });
151876
+ logReadFilesFromDirectory(dir, files);
151866
151877
  const manifest = {};
151867
151878
  let counter = 0;
151868
151879
  const { assetsIgnoreFunction, assetsIgnoreFilePresent } = await createAssetsIgnoreFunction(dir);
@@ -151917,7 +151928,6 @@ Ensure all assets in your assets directory "${dir}" conform with the Workers max
151917
151928
  );
151918
151929
  return manifest;
151919
151930
  }, "buildAssetManifest");
151920
- var MAX_DIFF_LINES2 = 100;
151921
151931
  function logAssetUpload(line, diffCount) {
151922
151932
  const level = logger.loggerLevel;
151923
151933
  if (LOGGER_LEVELS[level] >= LOGGER_LEVELS.debug) {
@@ -151931,6 +151941,20 @@ function logAssetUpload(line, diffCount) {
151931
151941
  return diffCount++;
151932
151942
  }
151933
151943
  __name(logAssetUpload, "logAssetUpload");
151944
+ function logAssetsUploadStatus(numberFilesToUpload, uploadedAssetsCount, uploadedAssetFiles) {
151945
+ logger.info(
151946
+ `Uploaded ${uploadedAssetsCount} of ${numberFilesToUpload} assets`
151947
+ );
151948
+ uploadedAssetFiles.forEach((file) => logger.debug(`\u2728 ${file}`));
151949
+ }
151950
+ __name(logAssetsUploadStatus, "logAssetsUploadStatus");
151951
+ function logReadFilesFromDirectory(directory, assetFiles) {
151952
+ logger.info(
151953
+ `\u2728 Read ${assetFiles.length} file${assetFiles.length === 1 ? "" : "s"} from the assets directory ${directory}`
151954
+ );
151955
+ assetFiles.forEach((file) => logger.debug(`/${file}`));
151956
+ }
151957
+ __name(logReadFilesFromDirectory, "logReadFilesFromDirectory");
151934
151958
  function getAssetsBasePath(config, assetsCommandLineArg) {
151935
151959
  return assetsCommandLineArg ? process.cwd() : path62.resolve(path62.dirname(config.configPath ?? "wrangler.toml"));
151936
151960
  }