wrangler 4.156.2 → 4.157.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 +17 -17
- package/wrangler-dist/cli.js +147 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.157.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assembly",
|
|
@@ -72,17 +72,17 @@
|
|
|
72
72
|
"esbuild": "0.28.2",
|
|
73
73
|
"path-to-regexp": "6.3.0",
|
|
74
74
|
"unenv": "2.0.0-rc.24",
|
|
75
|
-
"workerd": "1.
|
|
75
|
+
"workerd": "1.20261103.1",
|
|
76
76
|
"@cloudflare/kv-asset-handler": "0.5.0",
|
|
77
77
|
"@cloudflare/unenv-preset": "2.16.2",
|
|
78
|
-
"miniflare": "5.
|
|
78
|
+
"miniflare": "5.20261103.0-beta"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@aws-sdk/client-s3": "^3.721.0",
|
|
82
82
|
"@aws-sdk/s3-request-presigner": "^3.721.0",
|
|
83
83
|
"@bomb.sh/tab": "^0.0.12",
|
|
84
84
|
"@cloudflare/types": "6.18.4",
|
|
85
|
-
"@cloudflare/workers-types": "^5.
|
|
85
|
+
"@cloudflare/workers-types": "^5.20261103.1",
|
|
86
86
|
"@netlify/build-info": "10.5.1",
|
|
87
87
|
"@sentry/node": "^7.86.0",
|
|
88
88
|
"@sentry/types": "^7.86.0",
|
|
@@ -164,25 +164,25 @@
|
|
|
164
164
|
"yaml": "^2.8.1",
|
|
165
165
|
"yargs": "^17.7.2",
|
|
166
166
|
"zod": "4.6.6",
|
|
167
|
-
"@cloudflare/autoconfig": "0.9.
|
|
168
|
-
"@cloudflare/build-output-utils": "0.9.
|
|
169
|
-
"@cloudflare/cli-shared-helpers": "0.3.
|
|
170
|
-
"@cloudflare/config": "0.30.
|
|
171
|
-
"@cloudflare/containers-shared": "0.23.
|
|
172
|
-
"@cloudflare/deploy-helpers": "0.
|
|
173
|
-
"@cloudflare/pages-functions": "0.1.
|
|
174
|
-
"@cloudflare/pages-shared": "^0.13.
|
|
175
|
-
"@cloudflare/
|
|
176
|
-
"@cloudflare/
|
|
167
|
+
"@cloudflare/autoconfig": "0.9.2",
|
|
168
|
+
"@cloudflare/build-output-utils": "0.9.9",
|
|
169
|
+
"@cloudflare/cli-shared-helpers": "0.3.3",
|
|
170
|
+
"@cloudflare/config": "0.30.1",
|
|
171
|
+
"@cloudflare/containers-shared": "0.23.8",
|
|
172
|
+
"@cloudflare/deploy-helpers": "0.25.0",
|
|
173
|
+
"@cloudflare/pages-functions": "0.1.5",
|
|
174
|
+
"@cloudflare/pages-shared": "^0.13.208",
|
|
175
|
+
"@cloudflare/remote-bindings": "0.0.59",
|
|
176
|
+
"@cloudflare/runtime-types": "0.1.22",
|
|
177
177
|
"@cloudflare/shared-ast-primitives": "1.1.0",
|
|
178
|
-
"@cloudflare/workers-auth": "0.15.
|
|
178
|
+
"@cloudflare/workers-auth": "0.15.6",
|
|
179
179
|
"@cloudflare/workers-shared": "0.20.2",
|
|
180
180
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
181
|
-
"@cloudflare/workers-utils": "0.51.
|
|
181
|
+
"@cloudflare/workers-utils": "0.51.1",
|
|
182
182
|
"@cloudflare/workflows-shared": "0.15.3"
|
|
183
183
|
},
|
|
184
184
|
"peerDependencies": {
|
|
185
|
-
"@cloudflare/workers-types": "^5.
|
|
185
|
+
"@cloudflare/workers-types": "^5.20261103.1"
|
|
186
186
|
},
|
|
187
187
|
"peerDependenciesMeta": {
|
|
188
188
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -33019,7 +33019,7 @@ var DEFAULT_COMPAT_DATE;
|
|
|
33019
33019
|
var init_default_compat_date = __esm({
|
|
33020
33020
|
"../workers-utils/src/default-compat-date.ts"() {
|
|
33021
33021
|
init_import_meta_url();
|
|
33022
|
-
DEFAULT_COMPAT_DATE = "2026-11-
|
|
33022
|
+
DEFAULT_COMPAT_DATE = "2026-11-03";
|
|
33023
33023
|
}
|
|
33024
33024
|
});
|
|
33025
33025
|
|
|
@@ -68604,7 +68604,7 @@ var name, version2;
|
|
|
68604
68604
|
var init_package = __esm({
|
|
68605
68605
|
"package.json"() {
|
|
68606
68606
|
name = "wrangler";
|
|
68607
|
-
version2 = "4.
|
|
68607
|
+
version2 = "4.157.0";
|
|
68608
68608
|
}
|
|
68609
68609
|
});
|
|
68610
68610
|
|
|
@@ -146373,10 +146373,11 @@ function isDockerfileContainerConfig(container) {
|
|
|
146373
146373
|
return "dockerfile" in container;
|
|
146374
146374
|
}
|
|
146375
146375
|
async function constructBuildCommand(options) {
|
|
146376
|
+
const imageOutput = process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd" ? "type=docker,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true" : void 0;
|
|
146376
146377
|
const platform4 = options.platform ?? "linux/amd64";
|
|
146377
146378
|
const buildCmd = [
|
|
146378
146379
|
"build",
|
|
146379
|
-
"--load",
|
|
146380
|
+
...imageOutput ? ["--output", imageOutput] : ["--load"],
|
|
146380
146381
|
"-t",
|
|
146381
146382
|
options.tag,
|
|
146382
146383
|
"--platform",
|
|
@@ -146402,6 +146403,19 @@ async function startContainerBuild({
|
|
|
146402
146403
|
pathToDocker,
|
|
146403
146404
|
verifyDockerIsRunning
|
|
146404
146405
|
}) {
|
|
146406
|
+
if (process.env.WRANGLER_CONTAINER_IMAGE_COMPRESSION === "zstd") {
|
|
146407
|
+
const driverStatus = runDockerCmdWithOutput(pathToDocker, [
|
|
146408
|
+
"info",
|
|
146409
|
+
"--format",
|
|
146410
|
+
"{{json .DriverStatus}}"
|
|
146411
|
+
]);
|
|
146412
|
+
if (!driverStatus.includes("io.containerd.snapshotter.v1")) {
|
|
146413
|
+
throw new UserError(
|
|
146414
|
+
"Zstd compression requires Docker's containerd image store. Enable the containerd image store or unset WRANGLER_CONTAINER_IMAGE_COMPRESSION.",
|
|
146415
|
+
{ telemetryMessage: false }
|
|
146416
|
+
);
|
|
146417
|
+
}
|
|
146418
|
+
}
|
|
146405
146419
|
const { buildCmd, dockerfile } = await constructBuildCommand(build5);
|
|
146406
146420
|
return await dockerBuild(pathToDocker, {
|
|
146407
146421
|
buildCmd,
|
|
@@ -181719,10 +181733,7 @@ var init_deploy_confirm = __esm({
|
|
|
181719
181733
|
});
|
|
181720
181734
|
|
|
181721
181735
|
// ../deploy-helpers/src/deploy/helpers/download-worker-config.ts
|
|
181722
|
-
async function fetchWorkerConfig(complianceConfig, accountId, workerName, environment,
|
|
181723
|
-
const partitionedRoutes = localRoutes === void 0 ? void 0 : partitionRoutes(localRoutes);
|
|
181724
|
-
const fetchRoutes = partitionedRoutes === void 0 || partitionedRoutes.routesOnly.length > 0;
|
|
181725
|
-
const fetchCustomDomains = partitionedRoutes === void 0 || partitionedRoutes.customDomainsOnly.length > 0;
|
|
181736
|
+
async function fetchWorkerConfig(complianceConfig, accountId, workerName, environment, fetchRoutes, fetchCustomDomains) {
|
|
181726
181737
|
const [
|
|
181727
181738
|
bindings2,
|
|
181728
181739
|
routes,
|
|
@@ -181770,7 +181781,7 @@ async function fetchWorkerConfig(complianceConfig, accountId, workerName, enviro
|
|
|
181770
181781
|
cronTriggers
|
|
181771
181782
|
};
|
|
181772
181783
|
}
|
|
181773
|
-
async function downloadWorkerConfig(complianceConfig, workerName, environment, entrypoint, accountId,
|
|
181784
|
+
async function downloadWorkerConfig(complianceConfig, workerName, environment, entrypoint, accountId, fetchRoutes, fetchCustomDomains) {
|
|
181774
181785
|
const {
|
|
181775
181786
|
bindings: bindings2,
|
|
181776
181787
|
routes,
|
|
@@ -181783,7 +181794,8 @@ async function downloadWorkerConfig(complianceConfig, workerName, environment, e
|
|
|
181783
181794
|
accountId,
|
|
181784
181795
|
workerName,
|
|
181785
181796
|
environment,
|
|
181786
|
-
|
|
181797
|
+
fetchRoutes,
|
|
181798
|
+
fetchCustomDomains
|
|
181787
181799
|
);
|
|
181788
181800
|
return constructWranglerConfig({
|
|
181789
181801
|
name: workerName,
|
|
@@ -181809,7 +181821,6 @@ var init_download_worker_config = __esm({
|
|
|
181809
181821
|
init_import_meta_url();
|
|
181810
181822
|
init_src();
|
|
181811
181823
|
init_context();
|
|
181812
|
-
init_partition_routes();
|
|
181813
181824
|
__name(fetchWorkerConfig, "fetchWorkerConfig");
|
|
181814
181825
|
__name(downloadWorkerConfig, "downloadWorkerConfig");
|
|
181815
181826
|
}
|
|
@@ -182151,14 +182162,17 @@ async function preUploadApiChecks(props, config2, queueCreateCommand2) {
|
|
|
182151
182162
|
);
|
|
182152
182163
|
}
|
|
182153
182164
|
if (script.last_deployed_from === "dash") {
|
|
182154
|
-
const
|
|
182165
|
+
const { routesOnly, customDomainsOnly } = partitionRoutes(
|
|
182166
|
+
props.command === "deploy" ? props.routes : []
|
|
182167
|
+
);
|
|
182155
182168
|
const remoteWorkerConfig = await downloadWorkerConfig(
|
|
182156
182169
|
config2,
|
|
182157
182170
|
name2,
|
|
182158
182171
|
serviceMetaData.default_environment.environment,
|
|
182159
182172
|
props.entry.file,
|
|
182160
182173
|
accountId,
|
|
182161
|
-
|
|
182174
|
+
routesOnly.length > 0,
|
|
182175
|
+
customDomainsOnly.length > 0
|
|
182162
182176
|
);
|
|
182163
182177
|
const configForDiff = props.command === "deploy" ? {
|
|
182164
182178
|
...config2,
|
|
@@ -182259,6 +182273,7 @@ var init_validate_worker_props = __esm({
|
|
|
182259
182273
|
init_import_meta_url();
|
|
182260
182274
|
init_src();
|
|
182261
182275
|
init_context();
|
|
182276
|
+
init_partition_routes();
|
|
182262
182277
|
init_deploy();
|
|
182263
182278
|
init_queue_consumers();
|
|
182264
182279
|
init_subdomain2();
|
|
@@ -187618,7 +187633,7 @@ var init_dist14 = __esm({
|
|
|
187618
187633
|
init_wrapper();
|
|
187619
187634
|
init_create_worker_upload_form();
|
|
187620
187635
|
import_undici14 = __toESM(require_undici(), 1);
|
|
187621
|
-
version3 = "0.0.
|
|
187636
|
+
version3 = "0.0.59";
|
|
187622
187637
|
NoDefaultValueProvided2 = class extends UserError {
|
|
187623
187638
|
static {
|
|
187624
187639
|
__name(this, "NoDefaultValueProvided");
|
|
@@ -241594,6 +241609,100 @@ In-flight queries and transactions will be cancelled.
|
|
|
241594
241609
|
}, "handleRestore");
|
|
241595
241610
|
}
|
|
241596
241611
|
});
|
|
241612
|
+
|
|
241613
|
+
// src/containers/worker-applications.ts
|
|
241614
|
+
async function findWorkerContainerApplications(config2, accountId, scriptName) {
|
|
241615
|
+
initContainersSharedContext({ logger: logger2, fetchPagedListResult: fetchPagedListResult2, fetchResult: fetchResult2 });
|
|
241616
|
+
const namespaces = await listDurableObjects(config2, accountId);
|
|
241617
|
+
const ownedNamespaceIds = new Set(
|
|
241618
|
+
namespaces.filter(
|
|
241619
|
+
(namespace) => namespace.script === scriptName && namespace.preview === void 0 && namespace.dispatch_namespace === void 0
|
|
241620
|
+
).map((namespace) => namespace.id)
|
|
241621
|
+
);
|
|
241622
|
+
if (ownedNamespaceIds.size === 0) {
|
|
241623
|
+
return [];
|
|
241624
|
+
}
|
|
241625
|
+
await fillOpenAPIConfiguration(config2, containersScope);
|
|
241626
|
+
const applications = await ApplicationsService.listApplications();
|
|
241627
|
+
return applications.filter(
|
|
241628
|
+
(application) => application.durable_objects !== void 0 && ownedNamespaceIds.has(application.durable_objects.namespace_id)
|
|
241629
|
+
).map(({ id, name: name2 }) => ({ id, name: name2 }));
|
|
241630
|
+
}
|
|
241631
|
+
async function deleteContainerApplication(applicationId) {
|
|
241632
|
+
await ApplicationsService.deleteApplication(applicationId);
|
|
241633
|
+
}
|
|
241634
|
+
var init_worker_applications = __esm({
|
|
241635
|
+
"src/containers/worker-applications.ts"() {
|
|
241636
|
+
init_import_meta_url();
|
|
241637
|
+
init_dist9();
|
|
241638
|
+
init_cfetch2();
|
|
241639
|
+
init_common();
|
|
241640
|
+
init_logger2();
|
|
241641
|
+
init_containers3();
|
|
241642
|
+
__name(findWorkerContainerApplications, "findWorkerContainerApplications");
|
|
241643
|
+
__name(deleteContainerApplication, "deleteContainerApplication");
|
|
241644
|
+
}
|
|
241645
|
+
});
|
|
241646
|
+
async function tryFindWorkerContainerApplications(config2, accountId, scriptName) {
|
|
241647
|
+
try {
|
|
241648
|
+
return await findWorkerContainerApplications(config2, accountId, scriptName);
|
|
241649
|
+
} catch (error64) {
|
|
241650
|
+
logger2.warn(
|
|
241651
|
+
`Could not check whether "${scriptName}" owns any Cloudflare Container applications: ${error64 instanceof Error ? error64.message : String(error64)}
|
|
241652
|
+
If it deployed any, they will keep running and billing after this delete.`
|
|
241653
|
+
);
|
|
241654
|
+
return [];
|
|
241655
|
+
}
|
|
241656
|
+
}
|
|
241657
|
+
async function handleContainerApplications(scriptName, applications, force) {
|
|
241658
|
+
if (applications.length === 0) {
|
|
241659
|
+
return;
|
|
241660
|
+
}
|
|
241661
|
+
const count = applications.length;
|
|
241662
|
+
const noun = count === 1 ? "application" : "applications";
|
|
241663
|
+
const pronoun = count === 1 ? "it" : "them";
|
|
241664
|
+
const verb = count === 1 ? "keeps" : "keep";
|
|
241665
|
+
const summary = applications.map((application) => `- ${application.name} (${application.id})`).join("\n");
|
|
241666
|
+
if (force || isNonInteractiveOrCI()) {
|
|
241667
|
+
logger2.warn(
|
|
241668
|
+
`${scriptName} owned ${count} Cloudflare Container ${noun}, which ${verb} running and billing now that the Worker is gone:
|
|
241669
|
+
${summary}
|
|
241670
|
+
|
|
241671
|
+
Delete ${pronoun} with: wrangler containers delete <id>`
|
|
241672
|
+
);
|
|
241673
|
+
return;
|
|
241674
|
+
}
|
|
241675
|
+
const alsoDelete = await confirm2(
|
|
241676
|
+
`${scriptName} also created ${count} Cloudflare Container ${noun}, which will keep running and billing after the Worker is deleted:
|
|
241677
|
+
${summary}
|
|
241678
|
+
|
|
241679
|
+
Delete ${pronoun} as well?`,
|
|
241680
|
+
{ defaultValue: false }
|
|
241681
|
+
);
|
|
241682
|
+
if (!alsoDelete) {
|
|
241683
|
+
logger2.warn(
|
|
241684
|
+
`Left ${count} Container ${noun} running. Delete ${pronoun} with: wrangler containers delete <id>`
|
|
241685
|
+
);
|
|
241686
|
+
return;
|
|
241687
|
+
}
|
|
241688
|
+
let deleted = 0;
|
|
241689
|
+
for (const application of applications) {
|
|
241690
|
+
try {
|
|
241691
|
+
await deleteContainerApplication(application.id);
|
|
241692
|
+
deleted++;
|
|
241693
|
+
logger2.log(`\u{1F5D1}\uFE0F Deleted Container application "${application.name}"`);
|
|
241694
|
+
} catch (error64) {
|
|
241695
|
+
logger2.warn(
|
|
241696
|
+
`Could not delete Container application "${application.name}" (${application.id}): ${error64 instanceof Error ? error64.message : String(error64)}`
|
|
241697
|
+
);
|
|
241698
|
+
}
|
|
241699
|
+
}
|
|
241700
|
+
if (deleted > 0) {
|
|
241701
|
+
logger2.log(
|
|
241702
|
+
deleted === 1 ? "Deleted 1 Container application. Its instances may take a while to shut down." : `Deleted ${deleted} Container applications. Their instances may take a while to shut down.`
|
|
241703
|
+
);
|
|
241704
|
+
}
|
|
241705
|
+
}
|
|
241597
241706
|
async function deleteSiteNamespaceIfExisting(complianceConfig, scriptName, accountId) {
|
|
241598
241707
|
const title = `__${scriptName}-workers_sites_assets`;
|
|
241599
241708
|
const previewTitle = `__${scriptName}-workers_sites_assets_preview`;
|
|
@@ -241730,6 +241839,7 @@ var init_delete6 = __esm({
|
|
|
241730
241839
|
init_import_meta_url();
|
|
241731
241840
|
init_src();
|
|
241732
241841
|
init_cfetch2();
|
|
241842
|
+
init_worker_applications();
|
|
241733
241843
|
init_create_command();
|
|
241734
241844
|
init_dialogs();
|
|
241735
241845
|
init_helpers5();
|
|
@@ -241811,17 +241921,32 @@ var init_delete6 = __esm({
|
|
|
241811
241921
|
if (needsForceDelete === null) {
|
|
241812
241922
|
return;
|
|
241813
241923
|
}
|
|
241924
|
+
const containerApplications = await tryFindWorkerContainerApplications(
|
|
241925
|
+
config2,
|
|
241926
|
+
accountId,
|
|
241927
|
+
scriptName
|
|
241928
|
+
);
|
|
241814
241929
|
await fetchResult2(
|
|
241815
241930
|
config2,
|
|
241816
241931
|
`/accounts/${accountId}/workers/services/${scriptName}`,
|
|
241817
241932
|
{ method: "DELETE" },
|
|
241818
241933
|
new URLSearchParams({ force: needsForceDelete.toString() })
|
|
241819
241934
|
);
|
|
241820
|
-
|
|
241821
|
-
|
|
241935
|
+
try {
|
|
241936
|
+
await deleteSiteNamespaceIfExisting(config2, scriptName, accountId);
|
|
241937
|
+
logger2.log("Successfully deleted", scriptName);
|
|
241938
|
+
} finally {
|
|
241939
|
+
await handleContainerApplications(
|
|
241940
|
+
scriptName,
|
|
241941
|
+
containerApplications,
|
|
241942
|
+
Boolean(args.force)
|
|
241943
|
+
);
|
|
241944
|
+
}
|
|
241822
241945
|
}
|
|
241823
241946
|
}
|
|
241824
241947
|
});
|
|
241948
|
+
__name(tryFindWorkerContainerApplications, "tryFindWorkerContainerApplications");
|
|
241949
|
+
__name(handleContainerApplications, "handleContainerApplications");
|
|
241825
241950
|
__name(deleteSiteNamespaceIfExisting, "deleteSiteNamespaceIfExisting");
|
|
241826
241951
|
__name(isPermissionDeniedAPIError2, "isPermissionDeniedAPIError");
|
|
241827
241952
|
__name(renderScriptName, "renderScriptName");
|
|
@@ -304376,13 +304501,15 @@ var init_create_batches = __esm({
|
|
|
304376
304501
|
});
|
|
304377
304502
|
|
|
304378
304503
|
// src/utils/download-worker-config.ts
|
|
304379
|
-
async function downloadWorkerConfig2(complianceConfig, workerName, environment, entrypoint, accountId) {
|
|
304504
|
+
async function downloadWorkerConfig2(complianceConfig, workerName, environment, entrypoint, accountId, fetchRoutes, fetchCustomDomains) {
|
|
304380
304505
|
return downloadWorkerConfig(
|
|
304381
304506
|
complianceConfig,
|
|
304382
304507
|
workerName,
|
|
304383
304508
|
environment,
|
|
304384
304509
|
entrypoint,
|
|
304385
|
-
accountId
|
|
304510
|
+
accountId,
|
|
304511
|
+
fetchRoutes,
|
|
304512
|
+
fetchCustomDomains
|
|
304386
304513
|
);
|
|
304387
304514
|
}
|
|
304388
304515
|
var init_download_worker_config2 = __esm({
|
|
@@ -304866,7 +304993,9 @@ async function downloadWorker(accountId, workerName) {
|
|
|
304866
304993
|
workerName,
|
|
304867
304994
|
defaultEnvironment,
|
|
304868
304995
|
entrypoint,
|
|
304869
|
-
accountId
|
|
304996
|
+
accountId,
|
|
304997
|
+
true,
|
|
304998
|
+
true
|
|
304870
304999
|
);
|
|
304871
305000
|
if (config2.assets) {
|
|
304872
305001
|
throw new FatalError(
|