wrangler 4.9.1 → 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.
- package/config-schema.json +4 -4
- package/package.json +7 -7
- package/wrangler-dist/cli.d.ts +3 -3
- package/wrangler-dist/cli.js +50 -26
package/config-schema.json
CHANGED
@@ -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/
|
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/
|
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/
|
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/
|
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.
|
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.
|
55
|
+
"esbuild": "0.25.2",
|
56
56
|
"path-to-regexp": "6.3.0",
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
|
-
"workerd": "1.
|
58
|
+
"workerd": "1.20250410.0",
|
59
59
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
-
"miniflare": "4.
|
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.
|
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.
|
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.
|
145
|
+
"@cloudflare/workers-types": "^4.20250410.0"
|
146
146
|
},
|
147
147
|
"peerDependenciesMeta": {
|
148
148
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -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/
|
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/
|
1638
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
1639
1639
|
*
|
1640
1640
|
* @default []
|
1641
1641
|
* @inheritable
|
@@ -2724,7 +2724,7 @@ export declare type GetPlatformProxyOptions = {
|
|
2724
2724
|
configPath?: string;
|
2725
2725
|
/**
|
2726
2726
|
* Indicates if and where to persist the bindings data, if not present or `true` it defaults to the same location
|
2727
|
-
* used by wrangler
|
2727
|
+
* used by wrangler: `.wrangler/state/v3` (so that the same data can be easily used by the caller and wrangler).
|
2728
2728
|
* If `false` is specified no data is persisted on the filesystem.
|
2729
2729
|
*/
|
2730
2730
|
persist?: boolean | {
|
package/wrangler-dist/cli.js
CHANGED
@@ -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.
|
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
|
-
|
84792
|
-
|
84793
|
-
|
84794
|
-
|
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: /.*/
|
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: /.*/
|
123178
|
+
build5.onResolve({ filter: /.*/ }, (args) => {
|
123176
123179
|
if (args.kind === "entry-point") {
|
123177
123180
|
return {
|
123178
123181
|
path: args.path
|
@@ -148264,14 +148267,14 @@ var workflowsNamespace = createNamespace({
|
|
148264
148267
|
metadata: {
|
148265
148268
|
description: "\u{1F501} Manage Workflows",
|
148266
148269
|
owner: "Product: Workflows",
|
148267
|
-
status: "
|
148270
|
+
status: "stable"
|
148268
148271
|
}
|
148269
148272
|
});
|
148270
148273
|
var workflowsInstanceNamespace = createNamespace({
|
148271
148274
|
metadata: {
|
148272
148275
|
description: "Manage Workflow instances",
|
148273
148276
|
owner: "Product: Workflows",
|
148274
|
-
status: "
|
148277
|
+
status: "stable"
|
148275
148278
|
}
|
148276
148279
|
});
|
148277
148280
|
|
@@ -148281,7 +148284,7 @@ var workflowsDeleteCommand = createCommand({
|
|
148281
148284
|
metadata: {
|
148282
148285
|
description: "Delete workflow - when deleting a workflow, it will also delete it's own instances",
|
148283
148286
|
owner: "Product: Workflows",
|
148284
|
-
status: "
|
148287
|
+
status: "stable",
|
148285
148288
|
hidden: true
|
148286
148289
|
},
|
148287
148290
|
args: {
|
@@ -148310,7 +148313,7 @@ var workflowsDescribeCommand = createCommand({
|
|
148310
148313
|
metadata: {
|
148311
148314
|
description: "Describe Workflow resource",
|
148312
148315
|
owner: "Product: Workflows",
|
148313
|
-
status: "
|
148316
|
+
status: "stable"
|
148314
148317
|
},
|
148315
148318
|
args: {
|
148316
148319
|
name: {
|
@@ -149156,7 +149159,7 @@ var workflowsInstancesDescribeCommand = createCommand({
|
|
149156
149159
|
metadata: {
|
149157
149160
|
description: "Describe a workflow instance - see its logs, retries and errors",
|
149158
149161
|
owner: "Product: Workflows",
|
149159
|
-
status: "
|
149162
|
+
status: "stable"
|
149160
149163
|
},
|
149161
149164
|
positionalArgs: ["name", "id"],
|
149162
149165
|
args: {
|
@@ -149351,7 +149354,7 @@ var workflowsInstancesListCommand = createCommand({
|
|
149351
149354
|
metadata: {
|
149352
149355
|
description: "Instance related commands (list, describe, terminate, pause, resume)",
|
149353
149356
|
owner: "Product: Workflows",
|
149354
|
-
status: "
|
149357
|
+
status: "stable"
|
149355
149358
|
},
|
149356
149359
|
positionalArgs: ["name"],
|
149357
149360
|
args: {
|
@@ -149423,7 +149426,7 @@ var workflowsInstancesPauseCommand = createCommand({
|
|
149423
149426
|
metadata: {
|
149424
149427
|
description: "Pause a workflow instance",
|
149425
149428
|
owner: "Product: Workflows",
|
149426
|
-
status: "
|
149429
|
+
status: "stable"
|
149427
149430
|
},
|
149428
149431
|
positionalArgs: ["name", "id"],
|
149429
149432
|
args: {
|
@@ -149475,7 +149478,7 @@ var workflowsInstancesResumeCommand = createCommand({
|
|
149475
149478
|
metadata: {
|
149476
149479
|
description: "Resume a workflow instance",
|
149477
149480
|
owner: "Product: Workflows",
|
149478
|
-
status: "
|
149481
|
+
status: "stable"
|
149479
149482
|
},
|
149480
149483
|
positionalArgs: ["name", "id"],
|
149481
149484
|
args: {
|
@@ -149527,7 +149530,7 @@ var workflowsInstancesTerminateCommand = createCommand({
|
|
149527
149530
|
metadata: {
|
149528
149531
|
description: "Terminate a workflow instance",
|
149529
149532
|
owner: "Product: Workflows",
|
149530
|
-
status: "
|
149533
|
+
status: "stable"
|
149531
149534
|
},
|
149532
149535
|
positionalArgs: ["name", "id"],
|
149533
149536
|
args: {
|
@@ -149579,7 +149582,7 @@ var workflowsInstancesTerminateAllCommand = createCommand({
|
|
149579
149582
|
metadata: {
|
149580
149583
|
description: "Terminate all workflow instances",
|
149581
149584
|
owner: "Product: Workflows",
|
149582
|
-
status: "
|
149585
|
+
status: "stable",
|
149583
149586
|
hidden: true
|
149584
149587
|
},
|
149585
149588
|
positionalArgs: ["name"],
|
@@ -149638,7 +149641,7 @@ var workflowsListCommand = createCommand({
|
|
149638
149641
|
metadata: {
|
149639
149642
|
description: "List Workflows associated to account",
|
149640
149643
|
owner: "Product: Workflows",
|
149641
|
-
status: "
|
149644
|
+
status: "stable"
|
149642
149645
|
},
|
149643
149646
|
args: {
|
149644
149647
|
page: {
|
@@ -149687,7 +149690,7 @@ var workflowsTriggerCommand = createCommand({
|
|
149687
149690
|
metadata: {
|
149688
149691
|
description: "Trigger a workflow, creating a new instance. Can optionally take a JSON string to pass a parameter into the workflow instance",
|
149689
149692
|
owner: "Product: Workflows",
|
149690
|
-
status: "
|
149693
|
+
status: "stable"
|
149691
149694
|
},
|
149692
149695
|
args: {
|
149693
149696
|
name: {
|
@@ -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(
|
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
|
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
|
-
|
151798
|
-
|
151799
|
-
|
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
|
}
|