wrangler 3.53.0 → 3.55.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 +3 -3
- package/wrangler-dist/cli.js +300 -101
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.55.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wrangler",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"source-map": "0.6.1",
|
|
92
92
|
"xxhash-wasm": "^1.0.1",
|
|
93
93
|
"@cloudflare/kv-asset-handler": "0.3.2",
|
|
94
|
-
"miniflare": "3.20240419.
|
|
94
|
+
"miniflare": "3.20240419.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@cloudflare/eslint-config-worker": "*",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"yargs": "^17.7.2",
|
|
178
178
|
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
|
|
179
179
|
"@cloudflare/cli": "1.1.1",
|
|
180
|
-
"@cloudflare/pages-shared": "^0.11.
|
|
180
|
+
"@cloudflare/pages-shared": "^0.11.34",
|
|
181
181
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
182
182
|
},
|
|
183
183
|
"optionalDependencies": {
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -139209,12 +139209,15 @@ var init_rulesEngine = __esm({
|
|
|
139209
139209
|
var handler_exports = {};
|
|
139210
139210
|
__export(handler_exports, {
|
|
139211
139211
|
ANALYTICS_VERSION: () => ANALYTICS_VERSION2,
|
|
139212
|
-
|
|
139212
|
+
ASSET_PRESERVATION_CACHE_V1: () => ASSET_PRESERVATION_CACHE_V1,
|
|
139213
|
+
ASSET_PRESERVATION_CACHE_V2: () => ASSET_PRESERVATION_CACHE_V2,
|
|
139213
139214
|
CACHE_CONTROL_BROWSER: () => CACHE_CONTROL_BROWSER,
|
|
139215
|
+
CACHE_PRESERVATION_WRITE_FREQUENCY: () => CACHE_PRESERVATION_WRITE_FREQUENCY,
|
|
139214
139216
|
HEADERS_VERSION: () => HEADERS_VERSION2,
|
|
139215
139217
|
HEADERS_VERSION_V1: () => HEADERS_VERSION_V1,
|
|
139216
139218
|
REDIRECTS_VERSION: () => REDIRECTS_VERSION2,
|
|
139217
139219
|
generateHandler: () => generateHandler,
|
|
139220
|
+
isPreservationCacheResponseExpiring: () => isPreservationCacheResponseExpiring,
|
|
139218
139221
|
normaliseHeaders: () => normaliseHeaders,
|
|
139219
139222
|
parseQualityWeightedList: () => parseQualityWeightedList
|
|
139220
139223
|
});
|
|
@@ -139371,6 +139374,10 @@ async function generateHandler({
|
|
|
139371
139374
|
}
|
|
139372
139375
|
}
|
|
139373
139376
|
__name(generateResponse, "generateResponse");
|
|
139377
|
+
function isNullBodyStatus(status2) {
|
|
139378
|
+
return [101, 204, 205, 304].includes(status2);
|
|
139379
|
+
}
|
|
139380
|
+
__name(isNullBodyStatus, "isNullBodyStatus");
|
|
139374
139381
|
async function attachHeaders(response) {
|
|
139375
139382
|
const existingHeaders = new Headers(response.headers);
|
|
139376
139383
|
const extraHeaders = new Headers({
|
|
@@ -139485,7 +139492,7 @@ async function generateHandler({
|
|
|
139485
139492
|
});
|
|
139486
139493
|
});
|
|
139487
139494
|
return new Response(
|
|
139488
|
-
|
|
139495
|
+
isNullBodyStatus(response.status) ? null : response.body,
|
|
139489
139496
|
{
|
|
139490
139497
|
headers,
|
|
139491
139498
|
status: response.status,
|
|
@@ -139541,25 +139548,31 @@ async function generateHandler({
|
|
|
139541
139548
|
if (isPreview(new URL(request3.url))) {
|
|
139542
139549
|
response.headers.set("x-robots-tag", "noindex");
|
|
139543
139550
|
}
|
|
139544
|
-
if (options29.preserve) {
|
|
139545
|
-
|
|
139546
|
-
|
|
139547
|
-
|
|
139548
|
-
|
|
139549
|
-
|
|
139550
|
-
|
|
139551
|
-
|
|
139552
|
-
|
|
139553
|
-
|
|
139554
|
-
|
|
139555
|
-
|
|
139556
|
-
|
|
139557
|
-
|
|
139558
|
-
|
|
139551
|
+
if (options29.preserve && waitUntil && caches) {
|
|
139552
|
+
waitUntil(
|
|
139553
|
+
(async () => {
|
|
139554
|
+
try {
|
|
139555
|
+
const assetPreservationCacheV2 = await caches.open(
|
|
139556
|
+
ASSET_PRESERVATION_CACHE_V2
|
|
139557
|
+
);
|
|
139558
|
+
const match = await assetPreservationCacheV2.match(request3);
|
|
139559
|
+
if (!match || assetKey !== await match.text() || isPreservationCacheResponseExpiring(match)) {
|
|
139560
|
+
const preservedResponse = new Response(assetKey, response);
|
|
139561
|
+
preservedResponse.headers.set(
|
|
139562
|
+
"cache-control",
|
|
139563
|
+
CACHE_CONTROL_PRESERVATION
|
|
139564
|
+
);
|
|
139565
|
+
preservedResponse.headers.set("x-robots-tag", "noindex");
|
|
139566
|
+
await assetPreservationCacheV2.put(
|
|
139567
|
+
request3.url,
|
|
139568
|
+
preservedResponse
|
|
139569
|
+
);
|
|
139570
|
+
}
|
|
139571
|
+
} catch (err) {
|
|
139559
139572
|
logError(err);
|
|
139560
|
-
}
|
|
139561
|
-
)
|
|
139562
|
-
|
|
139573
|
+
}
|
|
139574
|
+
})()
|
|
139575
|
+
);
|
|
139563
139576
|
}
|
|
139564
139577
|
if (isHTMLContentType(asset.contentType) && metadata.analytics?.version === ANALYTICS_VERSION2) {
|
|
139565
139578
|
return new HTMLRewriter().on("body", {
|
|
@@ -139580,17 +139593,55 @@ async function generateHandler({
|
|
|
139580
139593
|
__name(serveAsset, "serveAsset");
|
|
139581
139594
|
async function notFound() {
|
|
139582
139595
|
if (caches) {
|
|
139583
|
-
|
|
139584
|
-
|
|
139585
|
-
|
|
139586
|
-
|
|
139587
|
-
|
|
139588
|
-
|
|
139589
|
-
|
|
139590
|
-
|
|
139591
|
-
|
|
139592
|
-
|
|
139593
|
-
|
|
139596
|
+
try {
|
|
139597
|
+
const assetPreservationCacheV2 = await caches.open(
|
|
139598
|
+
ASSET_PRESERVATION_CACHE_V2
|
|
139599
|
+
);
|
|
139600
|
+
let preservedResponse = await assetPreservationCacheV2.match(
|
|
139601
|
+
request3.url
|
|
139602
|
+
);
|
|
139603
|
+
const cutoffDate = /* @__PURE__ */ new Date("2024-05-17");
|
|
139604
|
+
if (!preservedResponse && Date.now() < cutoffDate.getTime()) {
|
|
139605
|
+
const assetPreservationCacheV1 = await caches.open(
|
|
139606
|
+
ASSET_PRESERVATION_CACHE_V1
|
|
139607
|
+
);
|
|
139608
|
+
preservedResponse = await assetPreservationCacheV1.match(request3.url);
|
|
139609
|
+
if (preservedResponse) {
|
|
139610
|
+
if (setMetrics) {
|
|
139611
|
+
setMetrics({ preservationCacheResult: "checked-hit" });
|
|
139612
|
+
}
|
|
139613
|
+
return preservedResponse;
|
|
139614
|
+
}
|
|
139615
|
+
}
|
|
139616
|
+
if (preservedResponse) {
|
|
139617
|
+
if (setMetrics) {
|
|
139618
|
+
setMetrics({ preservationCacheResult: "checked-hit" });
|
|
139619
|
+
}
|
|
139620
|
+
const assetKey = await preservedResponse.text();
|
|
139621
|
+
if (isNullBodyStatus(preservedResponse.status)) {
|
|
139622
|
+
return new Response(null, preservedResponse);
|
|
139623
|
+
}
|
|
139624
|
+
if (assetKey) {
|
|
139625
|
+
const asset = await fetchAsset(assetKey);
|
|
139626
|
+
if (asset) {
|
|
139627
|
+
return new Response(asset.body, preservedResponse);
|
|
139628
|
+
} else {
|
|
139629
|
+
logError(
|
|
139630
|
+
new Error(
|
|
139631
|
+
`preservation cache contained assetKey that does not exist in storage: ${assetKey}`
|
|
139632
|
+
)
|
|
139633
|
+
);
|
|
139634
|
+
}
|
|
139635
|
+
} else {
|
|
139636
|
+
logError(new Error(`cached response had no assetKey: ${assetKey}`));
|
|
139637
|
+
}
|
|
139638
|
+
} else {
|
|
139639
|
+
if (setMetrics) {
|
|
139640
|
+
setMetrics({ preservationCacheResult: "checked-miss" });
|
|
139641
|
+
}
|
|
139642
|
+
}
|
|
139643
|
+
} catch (err) {
|
|
139644
|
+
logError(err);
|
|
139594
139645
|
}
|
|
139595
139646
|
} else {
|
|
139596
139647
|
if (setMetrics)
|
|
@@ -139643,17 +139694,33 @@ function isPreview(url4) {
|
|
|
139643
139694
|
}
|
|
139644
139695
|
return false;
|
|
139645
139696
|
}
|
|
139697
|
+
function isPreservationCacheResponseExpiring(response) {
|
|
139698
|
+
const ageHeader = response.headers.get("age");
|
|
139699
|
+
if (!ageHeader)
|
|
139700
|
+
return false;
|
|
139701
|
+
try {
|
|
139702
|
+
const age = parseInt(ageHeader);
|
|
139703
|
+
const jitter = Math.floor(Math.random() * 43200);
|
|
139704
|
+
if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter)
|
|
139705
|
+
return true;
|
|
139706
|
+
} catch {
|
|
139707
|
+
return false;
|
|
139708
|
+
}
|
|
139709
|
+
return false;
|
|
139710
|
+
}
|
|
139646
139711
|
function isHTMLContentType(contentType) {
|
|
139647
139712
|
return contentType?.toLowerCase().startsWith("text/html") || false;
|
|
139648
139713
|
}
|
|
139649
|
-
var
|
|
139714
|
+
var ASSET_PRESERVATION_CACHE_V1, ASSET_PRESERVATION_CACHE_V2, CACHE_CONTROL_PRESERVATION, CACHE_PRESERVATION_WRITE_FREQUENCY, CACHE_CONTROL_BROWSER, REDIRECTS_VERSION2, HEADERS_VERSION2, HEADERS_VERSION_V1, ANALYTICS_VERSION2, ALLOWED_EARLY_HINT_LINK_ATTRIBUTES;
|
|
139650
139715
|
var init_handler = __esm({
|
|
139651
139716
|
"../pages-shared/asset-server/handler.ts"() {
|
|
139652
139717
|
init_import_meta_url();
|
|
139653
139718
|
init_responses();
|
|
139654
139719
|
init_rulesEngine();
|
|
139655
|
-
|
|
139720
|
+
ASSET_PRESERVATION_CACHE_V1 = "assetPreservationCache";
|
|
139721
|
+
ASSET_PRESERVATION_CACHE_V2 = "assetPreservationCacheV2";
|
|
139656
139722
|
CACHE_CONTROL_PRESERVATION = "public, s-maxage=604800";
|
|
139723
|
+
CACHE_PRESERVATION_WRITE_FREQUENCY = 86400;
|
|
139657
139724
|
CACHE_CONTROL_BROWSER = "public, max-age=0, must-revalidate";
|
|
139658
139725
|
REDIRECTS_VERSION2 = 1;
|
|
139659
139726
|
HEADERS_VERSION2 = 2;
|
|
@@ -139665,6 +139732,7 @@ var init_handler = __esm({
|
|
|
139665
139732
|
__name(parseQualityWeightedList, "parseQualityWeightedList");
|
|
139666
139733
|
__name(isCacheable, "isCacheable");
|
|
139667
139734
|
__name(isPreview, "isPreview");
|
|
139735
|
+
__name(isPreservationCacheResponseExpiring, "isPreservationCacheResponseExpiring");
|
|
139668
139736
|
__name(isHTMLContentType, "isHTMLContentType");
|
|
139669
139737
|
}
|
|
139670
139738
|
});
|
|
@@ -152336,7 +152404,7 @@ init_import_meta_url();
|
|
|
152336
152404
|
init_import_meta_url();
|
|
152337
152405
|
|
|
152338
152406
|
// package.json
|
|
152339
|
-
var version = "3.
|
|
152407
|
+
var version = "3.55.0";
|
|
152340
152408
|
var package_default = {
|
|
152341
152409
|
name: "wrangler",
|
|
152342
152410
|
version,
|
|
@@ -157253,6 +157321,12 @@ var validateDurableObjectBinding = /* @__PURE__ */ __name((diagnostics, field, v
|
|
|
157253
157321
|
);
|
|
157254
157322
|
isValid = false;
|
|
157255
157323
|
}
|
|
157324
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157325
|
+
"class_name",
|
|
157326
|
+
"environment",
|
|
157327
|
+
"name",
|
|
157328
|
+
"script_name"
|
|
157329
|
+
]);
|
|
157256
157330
|
return isValid;
|
|
157257
157331
|
}, "validateDurableObjectBinding");
|
|
157258
157332
|
var validateCflogfwdrObject = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, topLevelEnv) => {
|
|
@@ -157289,6 +157363,10 @@ var validateCflogfwdrBinding = /* @__PURE__ */ __name((diagnostics, field, value
|
|
|
157289
157363
|
);
|
|
157290
157364
|
isValid = false;
|
|
157291
157365
|
}
|
|
157366
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157367
|
+
"destination",
|
|
157368
|
+
"name"
|
|
157369
|
+
]);
|
|
157292
157370
|
return isValid;
|
|
157293
157371
|
}, "validateCflogfwdrBinding");
|
|
157294
157372
|
var validateBrowserBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {
|
|
@@ -157306,6 +157384,9 @@ var validateBrowserBinding = /* @__PURE__ */ __name((envName) => (diagnostics, f
|
|
|
157306
157384
|
diagnostics.errors.push(`binding should have a string "binding" field.`);
|
|
157307
157385
|
isValid = false;
|
|
157308
157386
|
}
|
|
157387
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157388
|
+
"binding"
|
|
157389
|
+
]);
|
|
157309
157390
|
return isValid;
|
|
157310
157391
|
}, "validateBrowserBinding");
|
|
157311
157392
|
var validateAIBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {
|
|
@@ -157480,6 +157561,11 @@ var validateKVBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
|
157480
157561
|
);
|
|
157481
157562
|
isValid = false;
|
|
157482
157563
|
}
|
|
157564
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157565
|
+
"binding",
|
|
157566
|
+
"id",
|
|
157567
|
+
"preview_id"
|
|
157568
|
+
]);
|
|
157483
157569
|
return isValid;
|
|
157484
157570
|
}, "validateKVBinding");
|
|
157485
157571
|
var validateSendEmailBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157522,6 +157608,12 @@ var validateSendEmailBinding = /* @__PURE__ */ __name((diagnostics, field, value
|
|
|
157522
157608
|
);
|
|
157523
157609
|
isValid = false;
|
|
157524
157610
|
}
|
|
157611
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157612
|
+
"allowed_destination_addresses",
|
|
157613
|
+
"destination_address",
|
|
157614
|
+
"name",
|
|
157615
|
+
"binding"
|
|
157616
|
+
]);
|
|
157525
157617
|
return isValid;
|
|
157526
157618
|
}, "validateSendEmailBinding");
|
|
157527
157619
|
var validateQueueBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157608,6 +157700,12 @@ var validateR2Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
|
157608
157700
|
);
|
|
157609
157701
|
isValid = false;
|
|
157610
157702
|
}
|
|
157703
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157704
|
+
"binding",
|
|
157705
|
+
"bucket_name",
|
|
157706
|
+
"preview_bucket_name",
|
|
157707
|
+
"jurisdiction"
|
|
157708
|
+
]);
|
|
157611
157709
|
return isValid;
|
|
157612
157710
|
}, "validateR2Binding");
|
|
157613
157711
|
var validateD1Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157648,6 +157746,15 @@ var validateD1Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
|
157648
157746
|
);
|
|
157649
157747
|
isValid = false;
|
|
157650
157748
|
}
|
|
157749
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157750
|
+
"binding",
|
|
157751
|
+
"database_id",
|
|
157752
|
+
"database_internal_env",
|
|
157753
|
+
"database_name",
|
|
157754
|
+
"migrations_dir",
|
|
157755
|
+
"migrations_table",
|
|
157756
|
+
"preview_database_id"
|
|
157757
|
+
]);
|
|
157651
157758
|
return isValid;
|
|
157652
157759
|
}, "validateD1Binding");
|
|
157653
157760
|
var validateVectorizeBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157674,6 +157781,10 @@ var validateVectorizeBinding = /* @__PURE__ */ __name((diagnostics, field, value
|
|
|
157674
157781
|
);
|
|
157675
157782
|
isValid = false;
|
|
157676
157783
|
}
|
|
157784
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157785
|
+
"binding",
|
|
157786
|
+
"index_name"
|
|
157787
|
+
]);
|
|
157677
157788
|
return isValid;
|
|
157678
157789
|
}, "validateVectorizeBinding");
|
|
157679
157790
|
var validateConstellationBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157707,6 +157818,10 @@ var validateConstellationBinding = /* @__PURE__ */ __name((diagnostics, field, v
|
|
|
157707
157818
|
"Constellation Bindings are currently in beta to allow the API to evolve before general availability.\nPlease report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose\nNote: Run this command with the environment variable NO_CONSTELLATION_WARNING=true to hide this message\n\nFor example: `export NO_CONSTELLATION_WARNING=true && wrangler <YOUR COMMAND HERE>`"
|
|
157708
157819
|
);
|
|
157709
157820
|
}
|
|
157821
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157822
|
+
"binding",
|
|
157823
|
+
"project_id"
|
|
157824
|
+
]);
|
|
157710
157825
|
return isValid;
|
|
157711
157826
|
}, "validateConstellationBinding");
|
|
157712
157827
|
var validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157735,6 +157850,11 @@ var validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, valu
|
|
|
157735
157850
|
);
|
|
157736
157851
|
isValid = false;
|
|
157737
157852
|
}
|
|
157853
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157854
|
+
"binding",
|
|
157855
|
+
"id",
|
|
157856
|
+
"localConnectionString"
|
|
157857
|
+
]);
|
|
157738
157858
|
return isValid;
|
|
157739
157859
|
}, "validateHyperdriveBinding");
|
|
157740
157860
|
var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, {
|
|
@@ -157875,6 +157995,10 @@ var validateAnalyticsEngineBinding = /* @__PURE__ */ __name((diagnostics, field,
|
|
|
157875
157995
|
);
|
|
157876
157996
|
isValid = false;
|
|
157877
157997
|
}
|
|
157998
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
157999
|
+
"binding",
|
|
158000
|
+
"dataset"
|
|
158001
|
+
]);
|
|
157878
158002
|
return isValid;
|
|
157879
158003
|
}, "validateAnalyticsEngineBinding");
|
|
157880
158004
|
var validateWorkerNamespaceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
@@ -157970,6 +158094,10 @@ var validateMTlsCertificateBinding = /* @__PURE__ */ __name((diagnostics, field,
|
|
|
157970
158094
|
);
|
|
157971
158095
|
isValid = false;
|
|
157972
158096
|
}
|
|
158097
|
+
validateAdditionalProperties(diagnostics, field, Object.keys(value), [
|
|
158098
|
+
"binding",
|
|
158099
|
+
"certificate_id"
|
|
158100
|
+
]);
|
|
157973
158101
|
return isValid;
|
|
157974
158102
|
}, "validateMTlsCertificateBinding");
|
|
157975
158103
|
function validateQueues(envName) {
|
|
@@ -161616,7 +161744,10 @@ function d1DatabaseEntry(db) {
|
|
|
161616
161744
|
}
|
|
161617
161745
|
__name(d1DatabaseEntry, "d1DatabaseEntry");
|
|
161618
161746
|
function queueProducerEntry(queue) {
|
|
161619
|
-
return [
|
|
161747
|
+
return [
|
|
161748
|
+
queue.binding,
|
|
161749
|
+
{ queueName: queue.queue_name, deliveryDelay: queue.delivery_delay }
|
|
161750
|
+
];
|
|
161620
161751
|
}
|
|
161621
161752
|
__name(queueProducerEntry, "queueProducerEntry");
|
|
161622
161753
|
function hyperdriveEntry(hyperdrive2) {
|
|
@@ -161632,7 +161763,8 @@ function queueConsumerEntry(consumer) {
|
|
|
161632
161763
|
maxBatchSize: consumer.max_batch_size,
|
|
161633
161764
|
maxBatchTimeout: consumer.max_batch_timeout,
|
|
161634
161765
|
maxRetires: consumer.max_retries,
|
|
161635
|
-
deadLetterQueue: consumer.dead_letter_queue
|
|
161766
|
+
deadLetterQueue: consumer.dead_letter_queue,
|
|
161767
|
+
retryDelay: consumer.retry_delay
|
|
161636
161768
|
};
|
|
161637
161769
|
return [consumer.queue, options29];
|
|
161638
161770
|
}
|
|
@@ -162416,11 +162548,12 @@ function createWorkerUploadForm(worker) {
|
|
|
162416
162548
|
});
|
|
162417
162549
|
}
|
|
162418
162550
|
);
|
|
162419
|
-
bindings.queues?.forEach(({ binding, queue_name }) => {
|
|
162551
|
+
bindings.queues?.forEach(({ binding, queue_name, delivery_delay }) => {
|
|
162420
162552
|
metadataBindings.push({
|
|
162421
162553
|
type: "queue",
|
|
162422
162554
|
name: binding,
|
|
162423
|
-
queue_name
|
|
162555
|
+
queue_name,
|
|
162556
|
+
delivery_delay
|
|
162424
162557
|
});
|
|
162425
162558
|
});
|
|
162426
162559
|
bindings.r2_buckets?.forEach(({ binding, bucket_name, jurisdiction }) => {
|
|
@@ -162704,18 +162837,18 @@ function loadSourceMap({ name, filePath }, sourceMapPath, { entryDirectory }) {
|
|
|
162704
162837
|
return [];
|
|
162705
162838
|
}
|
|
162706
162839
|
const map = JSON.parse(
|
|
162707
|
-
import_node_fs16.default.readFileSync(sourceMapPath, "utf8")
|
|
162840
|
+
import_node_fs16.default.readFileSync(import_node_path25.default.join(entryDirectory, sourceMapPath), "utf8")
|
|
162708
162841
|
);
|
|
162709
162842
|
map.file = name;
|
|
162710
162843
|
if (map.sourceRoot) {
|
|
162711
162844
|
const sourceRootPath = import_node_path25.default.dirname(
|
|
162712
162845
|
import_node_path25.default.join(entryDirectory, sourceMapPath)
|
|
162713
162846
|
);
|
|
162714
|
-
map.sourceRoot =
|
|
162847
|
+
map.sourceRoot = import_node_path25.default.relative(sourceRootPath, map.sourceRoot);
|
|
162715
162848
|
}
|
|
162716
162849
|
map.sources = map.sources.map((source) => {
|
|
162717
162850
|
const originalPath = import_node_path25.default.join(import_node_path25.default.dirname(filePath), source);
|
|
162718
|
-
return
|
|
162851
|
+
return import_node_path25.default.relative(entryDirectory, originalPath);
|
|
162719
162852
|
});
|
|
162720
162853
|
return [
|
|
162721
162854
|
{
|
|
@@ -162768,13 +162901,6 @@ function cleanPathPrefix(filePath) {
|
|
|
162768
162901
|
);
|
|
162769
162902
|
}
|
|
162770
162903
|
__name(cleanPathPrefix, "cleanPathPrefix");
|
|
162771
|
-
function stripPathPrefix(prefix, filePath) {
|
|
162772
|
-
return stripPrefix(
|
|
162773
|
-
prefix,
|
|
162774
|
-
stripPrefix(prefix + "\\", stripPrefix(prefix + "/", filePath))
|
|
162775
|
-
);
|
|
162776
|
-
}
|
|
162777
|
-
__name(stripPathPrefix, "stripPathPrefix");
|
|
162778
162904
|
function stripPrefix(prefix, input) {
|
|
162779
162905
|
let stripped = input;
|
|
162780
162906
|
while (stripped.startsWith(prefix)) {
|
|
@@ -178157,7 +178283,6 @@ async function getWorkerNamespaceInfo(accountId, name) {
|
|
|
178157
178283
|
}
|
|
178158
178284
|
__name(getWorkerNamespaceInfo, "getWorkerNamespaceInfo");
|
|
178159
178285
|
async function renameWorkerNamespace(accountId, oldName, newName) {
|
|
178160
|
-
void printWranglerBanner();
|
|
178161
178286
|
await fetchResult(
|
|
178162
178287
|
`/accounts/${accountId}/workers/dispatch/namespaces/${oldName}`,
|
|
178163
178288
|
{
|
|
@@ -197570,6 +197695,31 @@ async function typesHandler(args) {
|
|
|
197570
197695
|
);
|
|
197571
197696
|
}
|
|
197572
197697
|
__name(typesHandler, "typesHandler");
|
|
197698
|
+
function isValidIdentifier2(key) {
|
|
197699
|
+
return /^[a-zA-Z_$][\w$]*$/.test(key);
|
|
197700
|
+
}
|
|
197701
|
+
__name(isValidIdentifier2, "isValidIdentifier");
|
|
197702
|
+
function constructTypeKey(key) {
|
|
197703
|
+
if (isValidIdentifier2(key)) {
|
|
197704
|
+
return `${key}`;
|
|
197705
|
+
}
|
|
197706
|
+
return `"${key}"`;
|
|
197707
|
+
}
|
|
197708
|
+
__name(constructTypeKey, "constructTypeKey");
|
|
197709
|
+
function constructType(key, value, useRawVal = true) {
|
|
197710
|
+
const typeKey = constructTypeKey(key);
|
|
197711
|
+
if (typeof value === "string") {
|
|
197712
|
+
if (useRawVal) {
|
|
197713
|
+
return `${typeKey}: ${value};`;
|
|
197714
|
+
}
|
|
197715
|
+
return `${typeKey}: "${value.replace(/"/g, '\\"')}";`;
|
|
197716
|
+
}
|
|
197717
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
197718
|
+
return `${typeKey}: ${value};`;
|
|
197719
|
+
}
|
|
197720
|
+
return `${typeKey}: unknown;`;
|
|
197721
|
+
}
|
|
197722
|
+
__name(constructType, "constructType");
|
|
197573
197723
|
async function generateTypes(configToDTS, config, envInterface, outputPath) {
|
|
197574
197724
|
const configContainsEntryPoint = config.main !== void 0 || !!config.site?.["entry-point"];
|
|
197575
197725
|
const entrypointFormat = configContainsEntryPoint ? (await getEntry({}, config, "types")).format : "modules";
|
|
@@ -197582,7 +197732,7 @@ async function generateTypes(configToDTS, config, envInterface, outputPath) {
|
|
|
197582
197732
|
const envTypeStructure = [];
|
|
197583
197733
|
if (configToDTS.kv_namespaces) {
|
|
197584
197734
|
for (const kvNamespace2 of configToDTS.kv_namespaces) {
|
|
197585
|
-
envTypeStructure.push(
|
|
197735
|
+
envTypeStructure.push(constructType(kvNamespace2.binding, "KVNamespace"));
|
|
197586
197736
|
}
|
|
197587
197737
|
}
|
|
197588
197738
|
if (configToDTS.vars) {
|
|
@@ -197591,103 +197741,111 @@ async function generateTypes(configToDTS, config, envInterface, outputPath) {
|
|
|
197591
197741
|
);
|
|
197592
197742
|
for (const [varName, varValue] of vars) {
|
|
197593
197743
|
if (typeof varValue === "string" || typeof varValue === "number" || typeof varValue === "boolean") {
|
|
197594
|
-
envTypeStructure.push(
|
|
197744
|
+
envTypeStructure.push(constructType(varName, varValue, false));
|
|
197595
197745
|
}
|
|
197596
197746
|
if (typeof varValue === "object" && varValue !== null) {
|
|
197597
|
-
envTypeStructure.push(
|
|
197747
|
+
envTypeStructure.push(
|
|
197748
|
+
constructType(varName, JSON.stringify(varValue), true)
|
|
197749
|
+
);
|
|
197598
197750
|
}
|
|
197599
197751
|
}
|
|
197600
197752
|
}
|
|
197601
197753
|
for (const secretName in configToDTS.secrets) {
|
|
197602
|
-
envTypeStructure.push(
|
|
197754
|
+
envTypeStructure.push(constructType(secretName, "string", true));
|
|
197603
197755
|
}
|
|
197604
197756
|
if (configToDTS.durable_objects?.bindings) {
|
|
197605
197757
|
for (const durableObject of configToDTS.durable_objects.bindings) {
|
|
197606
|
-
envTypeStructure.push(
|
|
197758
|
+
envTypeStructure.push(
|
|
197759
|
+
constructType(durableObject.name, "DurableObjectNamespace")
|
|
197760
|
+
);
|
|
197607
197761
|
}
|
|
197608
197762
|
}
|
|
197609
197763
|
if (configToDTS.r2_buckets) {
|
|
197610
197764
|
for (const R2Bucket of configToDTS.r2_buckets) {
|
|
197611
|
-
envTypeStructure.push(
|
|
197765
|
+
envTypeStructure.push(constructType(R2Bucket.binding, "R2Bucket"));
|
|
197612
197766
|
}
|
|
197613
197767
|
}
|
|
197614
197768
|
if (configToDTS.d1_databases) {
|
|
197615
197769
|
for (const d12 of configToDTS.d1_databases) {
|
|
197616
|
-
envTypeStructure.push(
|
|
197770
|
+
envTypeStructure.push(constructType(d12.binding, "D1Database"));
|
|
197617
197771
|
}
|
|
197618
197772
|
}
|
|
197619
197773
|
if (configToDTS.services) {
|
|
197620
197774
|
for (const service of configToDTS.services) {
|
|
197621
|
-
envTypeStructure.push(
|
|
197775
|
+
envTypeStructure.push(constructType(service.binding, "Fetcher"));
|
|
197622
197776
|
}
|
|
197623
197777
|
}
|
|
197624
197778
|
if (configToDTS.constellation) {
|
|
197625
197779
|
for (const service of configToDTS.constellation) {
|
|
197626
|
-
envTypeStructure.push(
|
|
197780
|
+
envTypeStructure.push(constructType(service.binding, "Fetcher"));
|
|
197627
197781
|
}
|
|
197628
197782
|
}
|
|
197629
197783
|
if (configToDTS.analytics_engine_datasets) {
|
|
197630
197784
|
for (const analyticsEngine of configToDTS.analytics_engine_datasets) {
|
|
197631
197785
|
envTypeStructure.push(
|
|
197632
|
-
|
|
197786
|
+
constructType(analyticsEngine.binding, "AnalyticsEngineDataset")
|
|
197633
197787
|
);
|
|
197634
197788
|
}
|
|
197635
197789
|
}
|
|
197636
197790
|
if (configToDTS.dispatch_namespaces) {
|
|
197637
197791
|
for (const namespace of configToDTS.dispatch_namespaces) {
|
|
197638
|
-
envTypeStructure.push(
|
|
197792
|
+
envTypeStructure.push(
|
|
197793
|
+
constructType(namespace.binding, "DispatchNamespace")
|
|
197794
|
+
);
|
|
197639
197795
|
}
|
|
197640
197796
|
}
|
|
197641
197797
|
if (configToDTS.logfwdr?.bindings?.length) {
|
|
197642
|
-
envTypeStructure.push(
|
|
197798
|
+
envTypeStructure.push(constructType("LOGFWDR_SCHEMA", "any"));
|
|
197643
197799
|
}
|
|
197644
197800
|
if (configToDTS.data_blobs) {
|
|
197645
197801
|
for (const dataBlobs in configToDTS.data_blobs) {
|
|
197646
|
-
envTypeStructure.push(
|
|
197802
|
+
envTypeStructure.push(constructType(dataBlobs, "ArrayBuffer"));
|
|
197647
197803
|
}
|
|
197648
197804
|
}
|
|
197649
197805
|
if (configToDTS.text_blobs) {
|
|
197650
197806
|
for (const textBlobs in configToDTS.text_blobs) {
|
|
197651
|
-
envTypeStructure.push(
|
|
197807
|
+
envTypeStructure.push(constructType(textBlobs, "string"));
|
|
197652
197808
|
}
|
|
197653
197809
|
}
|
|
197654
197810
|
if (configToDTS.unsafe?.bindings) {
|
|
197655
197811
|
for (const unsafe of configToDTS.unsafe.bindings) {
|
|
197656
|
-
envTypeStructure.push(
|
|
197812
|
+
envTypeStructure.push(constructType(unsafe.name, "any"));
|
|
197657
197813
|
}
|
|
197658
197814
|
}
|
|
197659
197815
|
if (configToDTS.queues) {
|
|
197660
197816
|
if (configToDTS.queues.producers) {
|
|
197661
197817
|
for (const queue of configToDTS.queues.producers) {
|
|
197662
|
-
envTypeStructure.push(
|
|
197818
|
+
envTypeStructure.push(constructType(queue.binding, "Queue"));
|
|
197663
197819
|
}
|
|
197664
197820
|
}
|
|
197665
197821
|
}
|
|
197666
197822
|
if (configToDTS.send_email) {
|
|
197667
197823
|
for (const sendEmail of configToDTS.send_email) {
|
|
197668
|
-
envTypeStructure.push(
|
|
197824
|
+
envTypeStructure.push(constructType(sendEmail.name, "SendEmail"));
|
|
197669
197825
|
}
|
|
197670
197826
|
}
|
|
197671
197827
|
if (configToDTS.vectorize) {
|
|
197672
197828
|
for (const vectorize2 of configToDTS.vectorize) {
|
|
197673
|
-
envTypeStructure.push(
|
|
197829
|
+
envTypeStructure.push(constructType(vectorize2.binding, "VectorizeIndex"));
|
|
197674
197830
|
}
|
|
197675
197831
|
}
|
|
197676
197832
|
if (configToDTS.hyperdrive) {
|
|
197677
197833
|
for (const hyperdrive2 of configToDTS.hyperdrive) {
|
|
197678
|
-
envTypeStructure.push(
|
|
197834
|
+
envTypeStructure.push(constructType(hyperdrive2.binding, "Hyperdrive"));
|
|
197679
197835
|
}
|
|
197680
197836
|
}
|
|
197681
197837
|
if (configToDTS.mtls_certificates) {
|
|
197682
197838
|
for (const mtlsCertificate of configToDTS.mtls_certificates) {
|
|
197683
|
-
envTypeStructure.push(
|
|
197839
|
+
envTypeStructure.push(constructType(mtlsCertificate.binding, "Fetcher"));
|
|
197684
197840
|
}
|
|
197685
197841
|
}
|
|
197686
197842
|
if (configToDTS.browser) {
|
|
197687
|
-
envTypeStructure.push(
|
|
197843
|
+
envTypeStructure.push(
|
|
197844
|
+
constructType(configToDTS.browser.binding, "Fetcher")
|
|
197845
|
+
);
|
|
197688
197846
|
}
|
|
197689
197847
|
if (configToDTS.ai) {
|
|
197690
|
-
envTypeStructure.push(
|
|
197848
|
+
envTypeStructure.push(constructType(configToDTS.ai.binding, "unknown"));
|
|
197691
197849
|
}
|
|
197692
197850
|
if (configToDTS.version_metadata) {
|
|
197693
197851
|
envTypeStructure.push(
|
|
@@ -200490,10 +200648,7 @@ ${tryRunningItIn}${oneOfThese}`
|
|
|
200490
200648
|
} else {
|
|
200491
200649
|
logger.error(e3 instanceof Error ? e3.message : e3);
|
|
200492
200650
|
if (!(e3 instanceof UserError)) {
|
|
200493
|
-
|
|
200494
|
-
`${fgGreenColor}%s${resetColor}`,
|
|
200495
|
-
"If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
|
|
200496
|
-
);
|
|
200651
|
+
await logPossibleBugMessage();
|
|
200497
200652
|
}
|
|
200498
200653
|
}
|
|
200499
200654
|
if (
|
|
@@ -200540,6 +200695,19 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for
|
|
|
200540
200695
|
return compatibilityDate ?? currentDate;
|
|
200541
200696
|
}
|
|
200542
200697
|
__name(getDevCompatibilityDate, "getDevCompatibilityDate");
|
|
200698
|
+
async function logPossibleBugMessage() {
|
|
200699
|
+
logger.log(
|
|
200700
|
+
`${fgGreenColor}%s${resetColor}`,
|
|
200701
|
+
"If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
|
|
200702
|
+
);
|
|
200703
|
+
const latestVersion = await updateCheck();
|
|
200704
|
+
if (latestVersion) {
|
|
200705
|
+
logger.log(
|
|
200706
|
+
`Note that there is a newer version of Wrangler available (${latestVersion}). Consider checking whether upgrading resolves this error.`
|
|
200707
|
+
);
|
|
200708
|
+
}
|
|
200709
|
+
}
|
|
200710
|
+
__name(logPossibleBugMessage, "logPossibleBugMessage");
|
|
200543
200711
|
|
|
200544
200712
|
// src/init.ts
|
|
200545
200713
|
function initOptions(yargs) {
|
|
@@ -201429,7 +201597,7 @@ function logVersionIdChange() {
|
|
|
201429
201597
|
logger.log(
|
|
201430
201598
|
`
|
|
201431
201599
|
|
|
201432
|
-
|
|
201600
|
+
Note: Deployment ID has been renamed to Version ID. Deployment ID is present to maintain compatibility with the previous behavior of this command. This output will change in a future version of Wrangler. To learn more visit: ${docsLink}`
|
|
201433
201601
|
);
|
|
201434
201602
|
}
|
|
201435
201603
|
__name(logVersionIdChange, "logVersionIdChange");
|
|
@@ -201458,6 +201626,7 @@ async function deployments(accountId, scriptName, { send_metrics: sendMetrics }
|
|
|
201458
201626
|
)} from ${formatSource2(versions.metadata.source)}` : `${formatSource2(versions.metadata.source)}`;
|
|
201459
201627
|
let version3 = `
|
|
201460
201628
|
Deployment ID: ${versions.id}
|
|
201629
|
+
Version ID: ${versions.id}
|
|
201461
201630
|
Created on: ${versions.metadata.created_on}
|
|
201462
201631
|
Author: ${versions.metadata.author_email}
|
|
201463
201632
|
Source: ${triggerStr}`;
|
|
@@ -201547,7 +201716,7 @@ async function rollbackDeployment(accountId, scriptName, { send_metrics: sendMet
|
|
|
201547
201716
|
{ defaultValue: "" }
|
|
201548
201717
|
);
|
|
201549
201718
|
}
|
|
201550
|
-
let
|
|
201719
|
+
let rollbackVersion = await rollbackRequest(
|
|
201551
201720
|
accountId,
|
|
201552
201721
|
scriptName,
|
|
201553
201722
|
deploymentId,
|
|
@@ -201561,10 +201730,11 @@ async function rollbackDeployment(accountId, scriptName, { send_metrics: sendMet
|
|
|
201561
201730
|
}
|
|
201562
201731
|
);
|
|
201563
201732
|
deploymentId = addHyphens(deploymentId) ?? deploymentId;
|
|
201564
|
-
|
|
201733
|
+
rollbackVersion = addHyphens(rollbackVersion) ?? rollbackVersion;
|
|
201565
201734
|
logger.log(`
|
|
201566
201735
|
Successfully rolled back to Deployment ID: ${deploymentId}`);
|
|
201567
|
-
logger.log("Current Deployment ID:",
|
|
201736
|
+
logger.log("Current Deployment ID:", rollbackVersion);
|
|
201737
|
+
logger.log("Current Version ID:", rollbackVersion);
|
|
201568
201738
|
logVersionIdChange();
|
|
201569
201739
|
}
|
|
201570
201740
|
__name(rollbackDeployment, "rollbackDeployment");
|
|
@@ -201621,6 +201791,7 @@ Compatibility Flags: ${deploymentDetails.resources.script_runtime?.compatibility
|
|
|
201621
201791
|
const bindings = deploymentDetails.resources.bindings;
|
|
201622
201792
|
const version3 = `
|
|
201623
201793
|
Deployment ID: ${deploymentDetails.id}
|
|
201794
|
+
Version ID: ${deploymentDetails.id}
|
|
201624
201795
|
Created on: ${deploymentDetails.metadata.created_on}
|
|
201625
201796
|
Author: ${deploymentDetails.metadata.author_email}
|
|
201626
201797
|
Source: ${triggerStr}${rollbackStr}${reasonStr}
|
|
@@ -202179,12 +202350,14 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
202179
202350
|
}
|
|
202180
202351
|
await triggersDeploy(props);
|
|
202181
202352
|
logger.log("Current Deployment ID:", deploymentId);
|
|
202353
|
+
logger.log("Current Version ID:", deploymentId);
|
|
202182
202354
|
logVersionIdChange();
|
|
202183
202355
|
}
|
|
202184
202356
|
__name(deploy, "deploy");
|
|
202185
202357
|
function deployWfpUserWorker(dispatchNamespace, deploymentId) {
|
|
202186
202358
|
logger.log(" Dispatch Namespace:", dispatchNamespace);
|
|
202187
202359
|
logger.log("Current Deployment ID:", deploymentId);
|
|
202360
|
+
logger.log("Current Version ID:", deploymentId);
|
|
202188
202361
|
logVersionIdChange();
|
|
202189
202362
|
}
|
|
202190
202363
|
__name(deployWfpUserWorker, "deployWfpUserWorker");
|
|
@@ -203506,7 +203679,7 @@ function useEsbuild({
|
|
|
203506
203679
|
testScheduled,
|
|
203507
203680
|
experimentalLocal,
|
|
203508
203681
|
projectRoot,
|
|
203509
|
-
|
|
203682
|
+
onStart,
|
|
203510
203683
|
defineNavigatorUserAgent
|
|
203511
203684
|
}) {
|
|
203512
203685
|
const [bundle, setBundle] = (0, import_react18.useState)();
|
|
@@ -203550,7 +203723,7 @@ function useEsbuild({
|
|
|
203550
203723
|
name: "on-end",
|
|
203551
203724
|
setup(b2) {
|
|
203552
203725
|
b2.onStart(() => {
|
|
203553
|
-
|
|
203726
|
+
onStart();
|
|
203554
203727
|
});
|
|
203555
203728
|
b2.onEnd(async (result) => {
|
|
203556
203729
|
const errors = result.errors;
|
|
@@ -203662,7 +203835,7 @@ function useEsbuild({
|
|
|
203662
203835
|
testScheduled,
|
|
203663
203836
|
experimentalLocal,
|
|
203664
203837
|
projectRoot,
|
|
203665
|
-
|
|
203838
|
+
onStart,
|
|
203666
203839
|
defineNavigatorUserAgent
|
|
203667
203840
|
]);
|
|
203668
203841
|
return bundle;
|
|
@@ -203849,17 +204022,36 @@ function DevSession(props) {
|
|
|
203849
204022
|
config: startDevWorkerOptions
|
|
203850
204023
|
});
|
|
203851
204024
|
}, [devEnv, startDevWorkerOptions]);
|
|
204025
|
+
const esbuildStartTimeoutRef = (0, import_react19.useRef)();
|
|
204026
|
+
const latestReloadCompleteEvent = (0, import_react19.useRef)();
|
|
204027
|
+
const bundle = (0, import_react19.useRef)();
|
|
204028
|
+
const onCustomBuildEnd = (0, import_react19.useCallback)(() => {
|
|
204029
|
+
const TIMEOUT = 300;
|
|
204030
|
+
clearTimeout(esbuildStartTimeoutRef.current);
|
|
204031
|
+
esbuildStartTimeoutRef.current = setTimeout(() => {
|
|
204032
|
+
if (latestReloadCompleteEvent.current) {
|
|
204033
|
+
devEnv.proxy.onReloadComplete(latestReloadCompleteEvent.current);
|
|
204034
|
+
}
|
|
204035
|
+
}, TIMEOUT);
|
|
204036
|
+
return () => {
|
|
204037
|
+
clearTimeout(esbuildStartTimeoutRef.current);
|
|
204038
|
+
};
|
|
204039
|
+
}, [devEnv, latestReloadCompleteEvent]);
|
|
204040
|
+
const onEsbuildStart = (0, import_react19.useCallback)(() => {
|
|
204041
|
+
clearTimeout(esbuildStartTimeoutRef.current);
|
|
204042
|
+
onBundleStart();
|
|
204043
|
+
}, [esbuildStartTimeoutRef, onBundleStart]);
|
|
203852
204044
|
const onReloadStart = (0, import_react19.useCallback)(
|
|
203853
|
-
(
|
|
204045
|
+
(esbuildBundle) => {
|
|
203854
204046
|
devEnv.proxy.onReloadStart({
|
|
203855
204047
|
type: "reloadStart",
|
|
203856
204048
|
config: startDevWorkerOptions,
|
|
203857
|
-
bundle:
|
|
204049
|
+
bundle: esbuildBundle
|
|
203858
204050
|
});
|
|
203859
204051
|
},
|
|
203860
204052
|
[devEnv, startDevWorkerOptions]
|
|
203861
204053
|
);
|
|
203862
|
-
useCustomBuild(props.entry, props.build, onBundleStart);
|
|
204054
|
+
useCustomBuild(props.entry, props.build, onBundleStart, onCustomBuildEnd);
|
|
203863
204055
|
const directory = useTmpDir(props.projectRoot);
|
|
203864
204056
|
const workerDefinitions = useDevRegistry(
|
|
203865
204057
|
props.name,
|
|
@@ -203873,7 +204065,7 @@ function DevSession(props) {
|
|
|
203873
204065
|
config: startDevWorkerOptions
|
|
203874
204066
|
});
|
|
203875
204067
|
}, [devEnv, startDevWorkerOptions]);
|
|
203876
|
-
|
|
204068
|
+
bundle.current = useEsbuild({
|
|
203877
204069
|
entry: props.entry,
|
|
203878
204070
|
destination: directory,
|
|
203879
204071
|
jsxFactory: props.jsxFactory,
|
|
@@ -203901,15 +204093,15 @@ function DevSession(props) {
|
|
|
203901
204093
|
testScheduled: props.testScheduled ?? false,
|
|
203902
204094
|
experimentalLocal: props.experimentalLocal,
|
|
203903
204095
|
projectRoot: props.projectRoot,
|
|
203904
|
-
|
|
204096
|
+
onStart: onEsbuildStart,
|
|
203905
204097
|
defineNavigatorUserAgent: isNavigatorDefined(
|
|
203906
204098
|
props.compatibilityDate,
|
|
203907
204099
|
props.compatibilityFlags
|
|
203908
204100
|
)
|
|
203909
204101
|
});
|
|
203910
204102
|
(0, import_react19.useEffect)(() => {
|
|
203911
|
-
if (bundle)
|
|
203912
|
-
onReloadStart(bundle);
|
|
204103
|
+
if (bundle.current)
|
|
204104
|
+
onReloadStart(bundle.current);
|
|
203913
204105
|
}, [onReloadStart, bundle]);
|
|
203914
204106
|
if (!props.local && (props.bindings.queues?.length || props.queueConsumers?.length)) {
|
|
203915
204107
|
logger.warn(
|
|
@@ -203943,13 +204135,14 @@ function DevSession(props) {
|
|
|
203943
204135
|
})
|
|
203944
204136
|
);
|
|
203945
204137
|
}
|
|
203946
|
-
if (bundle) {
|
|
203947
|
-
|
|
204138
|
+
if (bundle.current) {
|
|
204139
|
+
latestReloadCompleteEvent.current = {
|
|
203948
204140
|
type: "reloadComplete",
|
|
203949
204141
|
config: startDevWorkerOptions,
|
|
203950
|
-
bundle,
|
|
204142
|
+
bundle: bundle.current,
|
|
203951
204143
|
proxyData
|
|
203952
|
-
}
|
|
204144
|
+
};
|
|
204145
|
+
devEnv.proxy.onReloadComplete(latestReloadCompleteEvent.current);
|
|
203953
204146
|
}
|
|
203954
204147
|
if (props.onReady) {
|
|
203955
204148
|
props.onReady(finalIp, finalPort, proxyData);
|
|
@@ -203959,7 +204152,7 @@ function DevSession(props) {
|
|
|
203959
204152
|
Local,
|
|
203960
204153
|
{
|
|
203961
204154
|
name: props.name,
|
|
203962
|
-
bundle,
|
|
204155
|
+
bundle: bundle.current,
|
|
203963
204156
|
format: props.entry.format,
|
|
203964
204157
|
compatibilityDate: props.compatibilityDate,
|
|
203965
204158
|
compatibilityFlags: props.compatibilityFlags,
|
|
@@ -203984,14 +204177,14 @@ function DevSession(props) {
|
|
|
203984
204177
|
inspect: props.inspect,
|
|
203985
204178
|
onReady: announceAndOnReady,
|
|
203986
204179
|
enablePagesAssetsServiceBinding: props.enablePagesAssetsServiceBinding,
|
|
203987
|
-
sourceMapPath: bundle?.sourceMapPath,
|
|
204180
|
+
sourceMapPath: bundle.current?.sourceMapPath,
|
|
203988
204181
|
services: props.bindings.services
|
|
203989
204182
|
}
|
|
203990
204183
|
) : /* @__PURE__ */ import_react19.default.createElement(
|
|
203991
204184
|
Remote,
|
|
203992
204185
|
{
|
|
203993
204186
|
name: props.name,
|
|
203994
|
-
bundle,
|
|
204187
|
+
bundle: bundle.current,
|
|
203995
204188
|
format: props.entry.format,
|
|
203996
204189
|
accountId: props.accountId,
|
|
203997
204190
|
bindings: props.bindings,
|
|
@@ -204012,7 +204205,7 @@ function DevSession(props) {
|
|
|
204012
204205
|
host: props.host,
|
|
204013
204206
|
routes: props.routes,
|
|
204014
204207
|
onReady: announceAndOnReady,
|
|
204015
|
-
sourceMapPath: bundle?.sourceMapPath,
|
|
204208
|
+
sourceMapPath: bundle.current?.sourceMapPath,
|
|
204016
204209
|
sendMetrics: props.sendMetrics
|
|
204017
204210
|
}
|
|
204018
204211
|
);
|
|
@@ -204038,7 +204231,7 @@ function useTmpDir(projectRoot) {
|
|
|
204038
204231
|
return directory;
|
|
204039
204232
|
}
|
|
204040
204233
|
__name(useTmpDir, "useTmpDir");
|
|
204041
|
-
function useCustomBuild(expectedEntry, build5,
|
|
204234
|
+
function useCustomBuild(expectedEntry, build5, onStart, onEnd) {
|
|
204042
204235
|
(0, import_react19.useEffect)(() => {
|
|
204043
204236
|
if (!build5.command)
|
|
204044
204237
|
return;
|
|
@@ -204050,16 +204243,18 @@ function useCustomBuild(expectedEntry, build5, onBundleStart) {
|
|
|
204050
204243
|
}).on("all", (_event, filePath) => {
|
|
204051
204244
|
const relativeFile = path61.relative(expectedEntry.directory, expectedEntry.file) || ".";
|
|
204052
204245
|
logger.log(`The file ${filePath} changed, restarting build...`);
|
|
204053
|
-
|
|
204246
|
+
onStart();
|
|
204054
204247
|
runCustomBuild(expectedEntry.file, relativeFile, build5).catch((err) => {
|
|
204055
204248
|
logger.error("Custom build failed:", err);
|
|
204249
|
+
}).finally(() => {
|
|
204250
|
+
onEnd();
|
|
204056
204251
|
});
|
|
204057
204252
|
});
|
|
204058
204253
|
}
|
|
204059
204254
|
return () => {
|
|
204060
204255
|
void watcher?.close();
|
|
204061
204256
|
};
|
|
204062
|
-
}, [build5, expectedEntry,
|
|
204257
|
+
}, [build5, expectedEntry, onStart, onEnd]);
|
|
204063
204258
|
}
|
|
204064
204259
|
__name(useCustomBuild, "useCustomBuild");
|
|
204065
204260
|
function sleep3(period) {
|
|
@@ -205277,7 +205472,11 @@ function getBindings(configParam, env5, local, args) {
|
|
|
205277
205472
|
});
|
|
205278
205473
|
const queuesBindings = [
|
|
205279
205474
|
...(configParam.queues.producers || []).map((queue) => {
|
|
205280
|
-
return {
|
|
205475
|
+
return {
|
|
205476
|
+
binding: queue.binding,
|
|
205477
|
+
queue_name: queue.queue,
|
|
205478
|
+
delivery_delay: queue.delivery_delay
|
|
205479
|
+
};
|
|
205281
205480
|
})
|
|
205282
205481
|
];
|
|
205283
205482
|
const bindings = {
|