wrangler 3.63.1 → 3.63.2
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 +2 -2
- package/wrangler-dist/cli.js +118 -55
- package/wrangler-dist/cli.js.map +7 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "3.63.
|
3
|
+
"version": "3.63.2",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -151,8 +151,8 @@
|
|
151
151
|
"xdg-app-paths": "^8.3.0",
|
152
152
|
"yargs": "^17.7.2",
|
153
153
|
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
|
154
|
-
"@cloudflare/cli": "1.1.1",
|
155
154
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
155
|
+
"@cloudflare/cli": "1.1.1",
|
156
156
|
"@cloudflare/pages-shared": "^0.11.46",
|
157
157
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
158
158
|
},
|
package/wrangler-dist/cli.js
CHANGED
@@ -152612,7 +152612,7 @@ init_import_meta_url();
|
|
152612
152612
|
init_import_meta_url();
|
152613
152613
|
|
152614
152614
|
// package.json
|
152615
|
-
var version = "3.63.
|
152615
|
+
var version = "3.63.2";
|
152616
152616
|
var package_default = {
|
152617
152617
|
name: "wrangler",
|
152618
152618
|
version,
|
@@ -185593,24 +185593,40 @@ init_import_meta_url();
|
|
185593
185593
|
var import_fs9 = require("fs");
|
185594
185594
|
var import_promises20 = require("node:fs/promises");
|
185595
185595
|
var import_toml4 = __toESM(require_toml());
|
185596
|
-
|
185596
|
+
var import_miniflare11 = require("miniflare");
|
185597
|
+
async function toEnvironment(deploymentConfig, accountId) {
|
185597
185598
|
const configObj = {};
|
185598
|
-
configObj.compatibility_date =
|
185599
|
-
if (
|
185600
|
-
configObj.
|
185599
|
+
configObj.compatibility_date = deploymentConfig.compatibility_date ?? (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
|
185600
|
+
if (deploymentConfig.always_use_latest_compatibility_date) {
|
185601
|
+
configObj.compatibility_date = import_miniflare11.supportedCompatibilityDate;
|
185602
|
+
}
|
185603
|
+
if (deploymentConfig.compatibility_flags?.length) {
|
185604
|
+
configObj.compatibility_flags = deploymentConfig.compatibility_flags;
|
185605
|
+
}
|
185606
|
+
if (deploymentConfig.placement) {
|
185607
|
+
configObj.placement = deploymentConfig.placement;
|
185608
|
+
} else {
|
185609
|
+
configObj.placement = { mode: "off" };
|
185601
185610
|
}
|
185602
|
-
|
185611
|
+
if (deploymentConfig.limits) {
|
185612
|
+
configObj.limits = deploymentConfig.limits;
|
185613
|
+
}
|
185614
|
+
for (const [name, envVar] of Object.entries(
|
185615
|
+
deploymentConfig.env_vars ?? {}
|
185616
|
+
)) {
|
185603
185617
|
if (envVar?.value && envVar?.type == "plain_text") {
|
185604
185618
|
configObj.vars ??= {};
|
185605
185619
|
configObj.vars[name] = envVar?.value;
|
185606
185620
|
}
|
185607
185621
|
}
|
185608
|
-
for (const [name, namespace] of Object.entries(
|
185622
|
+
for (const [name, namespace] of Object.entries(
|
185623
|
+
deploymentConfig.kv_namespaces ?? {}
|
185624
|
+
)) {
|
185609
185625
|
configObj.kv_namespaces ??= [];
|
185610
185626
|
configObj.kv_namespaces.push({ id: namespace.namespace_id, binding: name });
|
185611
185627
|
}
|
185612
185628
|
for (const [name, ns] of Object.entries(
|
185613
|
-
|
185629
|
+
deploymentConfig.durable_object_namespaces ?? {}
|
185614
185630
|
)) {
|
185615
185631
|
configObj.durable_objects ??= { bindings: [] };
|
185616
185632
|
if (ns.class_name && ns.class_name !== "") {
|
@@ -185632,7 +185648,9 @@ async function toEnvironment(project, accountId) {
|
|
185632
185648
|
});
|
185633
185649
|
}
|
185634
185650
|
}
|
185635
|
-
for (const [name, namespace] of Object.entries(
|
185651
|
+
for (const [name, namespace] of Object.entries(
|
185652
|
+
deploymentConfig.d1_databases ?? {}
|
185653
|
+
)) {
|
185636
185654
|
configObj.d1_databases ??= [];
|
185637
185655
|
configObj.d1_databases.push({
|
185638
185656
|
database_id: namespace.id,
|
@@ -185640,7 +185658,9 @@ async function toEnvironment(project, accountId) {
|
|
185640
185658
|
database_name: name
|
185641
185659
|
});
|
185642
185660
|
}
|
185643
|
-
for (const [name, bucket] of Object.entries(
|
185661
|
+
for (const [name, bucket] of Object.entries(
|
185662
|
+
deploymentConfig.r2_buckets ?? {}
|
185663
|
+
)) {
|
185644
185664
|
configObj.r2_buckets ??= [];
|
185645
185665
|
configObj.r2_buckets.push({
|
185646
185666
|
bucket_name: bucket.name,
|
@@ -185648,7 +185668,7 @@ async function toEnvironment(project, accountId) {
|
|
185648
185668
|
});
|
185649
185669
|
}
|
185650
185670
|
for (const [name, { service, environment }] of Object.entries(
|
185651
|
-
|
185671
|
+
deploymentConfig.services ?? {}
|
185652
185672
|
)) {
|
185653
185673
|
configObj.services ??= [];
|
185654
185674
|
configObj.services.push({
|
@@ -185657,7 +185677,9 @@ async function toEnvironment(project, accountId) {
|
|
185657
185677
|
environment
|
185658
185678
|
});
|
185659
185679
|
}
|
185660
|
-
for (const [name, queue] of Object.entries(
|
185680
|
+
for (const [name, queue] of Object.entries(
|
185681
|
+
deploymentConfig.queue_producers ?? {}
|
185682
|
+
)) {
|
185661
185683
|
configObj.queues ??= { producers: [] };
|
185662
185684
|
configObj.queues?.producers?.push({
|
185663
185685
|
binding: name,
|
@@ -185665,7 +185687,7 @@ async function toEnvironment(project, accountId) {
|
|
185665
185687
|
});
|
185666
185688
|
}
|
185667
185689
|
for (const [name, { dataset }] of Object.entries(
|
185668
|
-
|
185690
|
+
deploymentConfig.analytics_engine_datasets ?? {}
|
185669
185691
|
)) {
|
185670
185692
|
configObj.analytics_engine_datasets ??= [];
|
185671
185693
|
configObj.analytics_engine_datasets.push({
|
@@ -185673,36 +185695,70 @@ async function toEnvironment(project, accountId) {
|
|
185673
185695
|
dataset
|
185674
185696
|
});
|
185675
185697
|
}
|
185676
|
-
for (const [name] of Object.entries(
|
185698
|
+
for (const [name] of Object.entries(deploymentConfig.ai_bindings ?? {})) {
|
185677
185699
|
configObj.ai = { binding: name };
|
185678
185700
|
}
|
185679
185701
|
return configObj;
|
185680
185702
|
}
|
185681
185703
|
__name(toEnvironment, "toEnvironment");
|
185682
185704
|
async function writeWranglerToml(toml) {
|
185705
|
+
let tomlString = import_toml4.default.stringify(toml);
|
185706
|
+
tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
|
185683
185707
|
await (0, import_promises20.writeFile)(
|
185684
185708
|
"wrangler.toml",
|
185685
|
-
|
185686
|
-
|
185687
|
-
import_toml4.default.stringify(toml)
|
185688
|
-
].join("\n")
|
185709
|
+
`# Generated by Wrangler on ${/* @__PURE__ */ new Date()}
|
185710
|
+
${tomlString}`
|
185689
185711
|
);
|
185690
185712
|
}
|
185691
185713
|
__name(writeWranglerToml, "writeWranglerToml");
|
185714
|
+
function simplifyEnvironments(preview, production) {
|
185715
|
+
const topLevel = { ...preview };
|
185716
|
+
if (preview.compatibility_date === production.compatibility_date) {
|
185717
|
+
delete production.compatibility_date;
|
185718
|
+
delete preview.compatibility_date;
|
185719
|
+
}
|
185720
|
+
if (JSON.stringify(preview.compatibility_flags) === JSON.stringify(production.compatibility_flags)) {
|
185721
|
+
delete production.compatibility_flags;
|
185722
|
+
delete preview.compatibility_date;
|
185723
|
+
}
|
185724
|
+
if (JSON.stringify(preview.placement) === JSON.stringify(production.placement)) {
|
185725
|
+
delete production.placement;
|
185726
|
+
delete preview.placement;
|
185727
|
+
if (topLevel.placement?.mode === "off") {
|
185728
|
+
delete topLevel.placement;
|
185729
|
+
}
|
185730
|
+
}
|
185731
|
+
if (JSON.stringify(preview.limits) === JSON.stringify(production.limits)) {
|
185732
|
+
delete production.limits;
|
185733
|
+
delete preview.limits;
|
185734
|
+
return { topLevel, production };
|
185735
|
+
} else if (preview.limits && !production.limits) {
|
185736
|
+
delete topLevel.limits;
|
185737
|
+
return { topLevel, production, preview };
|
185738
|
+
}
|
185739
|
+
return { topLevel, production };
|
185740
|
+
}
|
185741
|
+
__name(simplifyEnvironments, "simplifyEnvironments");
|
185692
185742
|
async function downloadProject(accountId, projectName) {
|
185693
185743
|
const project = await fetchResult(
|
185694
185744
|
`/accounts/${accountId}/pages/projects/${projectName}`
|
185695
185745
|
);
|
185696
185746
|
logger.debug(JSON.stringify(project, null, 2));
|
185747
|
+
const { topLevel, preview, production } = simplifyEnvironments(
|
185748
|
+
await toEnvironment(project.deployment_configs.preview, accountId),
|
185749
|
+
await toEnvironment(project.deployment_configs.production, accountId)
|
185750
|
+
);
|
185697
185751
|
return {
|
185698
185752
|
name: project.name,
|
185699
185753
|
pages_build_output_dir: project.build_config.destination_dir,
|
185700
|
-
...
|
185701
|
-
|
185702
|
-
|
185703
|
-
|
185704
|
-
|
185705
|
-
|
185754
|
+
...topLevel,
|
185755
|
+
...{
|
185756
|
+
env: preview ? {
|
185757
|
+
preview,
|
185758
|
+
production
|
185759
|
+
} : {
|
185760
|
+
production
|
185761
|
+
}
|
185706
185762
|
}
|
185707
185763
|
};
|
185708
185764
|
}
|
@@ -187467,7 +187523,7 @@ var MAX_UPLOAD_SIZE = 300 * 1024 * 1024;
|
|
187467
187523
|
|
187468
187524
|
// src/r2/helpers.ts
|
187469
187525
|
init_import_meta_url();
|
187470
|
-
var
|
187526
|
+
var import_miniflare12 = require("miniflare");
|
187471
187527
|
async function listR2Buckets(accountId, jurisdiction) {
|
187472
187528
|
const headers = {};
|
187473
187529
|
if (jurisdiction !== void 0) {
|
@@ -187594,7 +187650,7 @@ __name(deleteR2Object, "deleteR2Object");
|
|
187594
187650
|
async function usingLocalBucket(persistTo, configPath, bucketName, closure) {
|
187595
187651
|
const persist = getLocalPersistencePath(persistTo, configPath);
|
187596
187652
|
const persistOptions = buildPersistOptions(persist);
|
187597
|
-
const mf = new
|
187653
|
+
const mf = new import_miniflare12.Miniflare({
|
187598
187654
|
modules: true,
|
187599
187655
|
// TODO(soon): import `reduceError()` from `miniflare:shared`
|
187600
187656
|
script: `
|
@@ -204720,7 +204776,7 @@ var import_node_http3 = require("node:http");
|
|
204720
204776
|
var import_node_http22 = require("node:http2");
|
204721
204777
|
var import_node_https = __toESM(require("node:https"));
|
204722
204778
|
var import_http_terminator2 = __toESM(require_src5());
|
204723
|
-
var
|
204779
|
+
var import_miniflare15 = require("miniflare");
|
204724
204780
|
var import_react2 = __toESM(require_react());
|
204725
204781
|
var import_serve_static = __toESM(require_serve_static());
|
204726
204782
|
|
@@ -204728,7 +204784,7 @@ var import_serve_static = __toESM(require_serve_static());
|
|
204728
204784
|
init_import_meta_url();
|
204729
204785
|
var fs25 = __toESM(require("node:fs"));
|
204730
204786
|
var path61 = __toESM(require("node:path"));
|
204731
|
-
var
|
204787
|
+
var import_miniflare14 = require("miniflare");
|
204732
204788
|
var CERT_EXPIRY_DAYS = 30;
|
204733
204789
|
var ONE_DAY_IN_MS = 864e5;
|
204734
204790
|
function getHttpsOptions(customHttpsKeyPath, customHttpsCertPath) {
|
@@ -204822,7 +204878,7 @@ function generateCertificate() {
|
|
204822
204878
|
name: "subjectAltName",
|
204823
204879
|
altNames: [
|
204824
204880
|
{ type: 2, value: "localhost" },
|
204825
|
-
...(0,
|
204881
|
+
...(0, import_miniflare14.getAccessibleHosts)(false).map((ip2) => ({ type: 7, ip: ip2 }))
|
204826
204882
|
]
|
204827
204883
|
}
|
204828
204884
|
]
|
@@ -204933,7 +204989,7 @@ async function startPreviewServer({
|
|
204933
204989
|
logger.log(`\u2B23 Listening at ${localProtocol}://${ip2}:${usedPort}`);
|
204934
204990
|
const accessibleHosts = [];
|
204935
204991
|
if (ip2 === "::" || ip2 === "*" || ip2 === "0.0.0.0") {
|
204936
|
-
accessibleHosts.push(...(0,
|
204992
|
+
accessibleHosts.push(...(0, import_miniflare15.getAccessibleHosts)(true));
|
204937
204993
|
if (ip2 !== "0.0.0.0") {
|
204938
204994
|
accessibleHosts.push("localhost");
|
204939
204995
|
accessibleHosts.push("[::1]");
|
@@ -206760,7 +206816,7 @@ init_import_meta_url();
|
|
206760
206816
|
// src/cli-hotkeys.ts
|
206761
206817
|
init_import_meta_url();
|
206762
206818
|
var import_readline2 = __toESM(require("readline"));
|
206763
|
-
var
|
206819
|
+
var import_miniflare16 = require("miniflare");
|
206764
206820
|
|
206765
206821
|
// src/utils/onKeyPress.ts
|
206766
206822
|
init_import_meta_url();
|
@@ -206840,16 +206896,16 @@ function cli_hotkeys_default(options29) {
|
|
206840
206896
|
__name(printInstructions, "printInstructions");
|
206841
206897
|
Logger.registerBeforeLogHook(clearPreviousInstructions);
|
206842
206898
|
Logger.registerAfterLogHook(printInstructions);
|
206843
|
-
|
206844
|
-
|
206899
|
+
import_miniflare16.Log.unstable_registerBeforeLogHook(clearPreviousInstructions);
|
206900
|
+
import_miniflare16.Log.unstable_registerAfterLogHook(printInstructions);
|
206845
206901
|
printInstructions();
|
206846
206902
|
return () => {
|
206847
206903
|
unregisterKeyPress();
|
206848
206904
|
clearPreviousInstructions();
|
206849
206905
|
Logger.registerBeforeLogHook(void 0);
|
206850
206906
|
Logger.registerAfterLogHook(void 0);
|
206851
|
-
|
206852
|
-
|
206907
|
+
import_miniflare16.Log.unstable_registerBeforeLogHook(void 0);
|
206908
|
+
import_miniflare16.Log.unstable_registerAfterLogHook(void 0);
|
206853
206909
|
};
|
206854
206910
|
}
|
206855
206911
|
__name(cli_hotkeys_default, "default");
|
@@ -209258,7 +209314,7 @@ __name(ConfigController, "ConfigController");
|
|
209258
209314
|
init_import_meta_url();
|
209259
209315
|
var import_node_crypto8 = require("node:crypto");
|
209260
209316
|
var import_promises24 = require("node:fs/promises");
|
209261
|
-
var
|
209317
|
+
var import_miniflare18 = require("miniflare");
|
209262
209318
|
async function getBinaryFileContents2(file) {
|
209263
209319
|
if ("contents" in file) {
|
209264
209320
|
if (file.contents instanceof Buffer) {
|
@@ -209368,7 +209424,7 @@ var LocalRuntimeController = class extends RuntimeController {
|
|
209368
209424
|
// `buildMiniflareOptions()` is asynchronous, meaning if multiple bundle
|
209369
209425
|
// updates were submitted, the second may apply before the first. Therefore,
|
209370
209426
|
// wrap updates in a mutex, so they're always applied in invocation order.
|
209371
|
-
#mutex = new
|
209427
|
+
#mutex = new import_miniflare18.Mutex();
|
209372
209428
|
#mf;
|
209373
209429
|
onBundleStart(_3) {
|
209374
209430
|
}
|
@@ -209381,7 +209437,7 @@ var LocalRuntimeController = class extends RuntimeController {
|
|
209381
209437
|
);
|
209382
209438
|
if (this.#mf === void 0) {
|
209383
209439
|
logger.log(source_default.dim("\u2394 Starting local server..."));
|
209384
|
-
this.#mf = new
|
209440
|
+
this.#mf = new import_miniflare18.Miniflare(options29);
|
209385
209441
|
} else {
|
209386
209442
|
logger.log(source_default.dim("\u2394 Reloading local server..."));
|
209387
209443
|
await this.#mf.setOptions(options29);
|
@@ -209482,7 +209538,7 @@ var import_node_assert23 = __toESM(require("node:assert"));
|
|
209482
209538
|
var import_node_crypto9 = require("node:crypto");
|
209483
209539
|
var import_node_events4 = __toESM(require("node:events"));
|
209484
209540
|
var import_node_path65 = __toESM(require("node:path"));
|
209485
|
-
var
|
209541
|
+
var import_miniflare19 = require("miniflare");
|
209486
209542
|
|
209487
209543
|
// embed-worker:/home/runner/work/workers-sdk/workers-sdk/packages/wrangler/templates/startDevWorker/InspectorProxyWorker.ts
|
209488
209544
|
init_import_meta_url();
|
@@ -209537,7 +209593,7 @@ var ProxyController = class extends Controller {
|
|
209537
209593
|
PROXY_CONTROLLER: async (req) => {
|
209538
209594
|
const message = await req.json();
|
209539
209595
|
this.onProxyWorkerMessage(message);
|
209540
|
-
return new
|
209596
|
+
return new import_miniflare19.Response(null, { status: 204 });
|
209541
209597
|
}
|
209542
209598
|
},
|
209543
209599
|
bindings: {
|
@@ -209594,7 +209650,7 @@ var ProxyController = class extends Controller {
|
|
209594
209650
|
proxyWorkerOptions
|
209595
209651
|
);
|
209596
209652
|
const willInstantiateMiniflareInstance = !this.proxyWorker || proxyWorkerOptionsChanged;
|
209597
|
-
this.proxyWorker ??= new
|
209653
|
+
this.proxyWorker ??= new import_miniflare19.Miniflare(proxyWorkerOptions);
|
209598
209654
|
this.proxyWorkerOptions = proxyWorkerOptions;
|
209599
209655
|
if (proxyWorkerOptionsChanged) {
|
209600
209656
|
logger.debug("ProxyWorker miniflare options changed, reinstantiating...");
|
@@ -209667,7 +209723,7 @@ var ProxyController = class extends Controller {
|
|
209667
209723
|
this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
|
209668
209724
|
return webSocket;
|
209669
209725
|
}
|
209670
|
-
runtimeMessageMutex = new
|
209726
|
+
runtimeMessageMutex = new import_miniflare19.Mutex();
|
209671
209727
|
async sendMessageToProxyWorker(message, retries = 3) {
|
209672
209728
|
if (this._torndown) {
|
209673
209729
|
return;
|
@@ -209822,15 +209878,15 @@ var ProxyController = class extends Controller {
|
|
209822
209878
|
);
|
209823
209879
|
}
|
209824
209880
|
if (maybeContents === void 0) {
|
209825
|
-
return new
|
209881
|
+
return new import_miniflare19.Response(null, { status: 404 });
|
209826
209882
|
}
|
209827
|
-
return new
|
209883
|
+
return new import_miniflare19.Response(maybeContents);
|
209828
209884
|
}
|
209829
209885
|
default:
|
209830
209886
|
assertNever(message);
|
209831
|
-
return new
|
209887
|
+
return new import_miniflare19.Response(null, { status: 404 });
|
209832
209888
|
}
|
209833
|
-
return new
|
209889
|
+
return new import_miniflare19.Response(null, { status: 204 });
|
209834
209890
|
}
|
209835
209891
|
_torndown = false;
|
209836
209892
|
async teardown() {
|
@@ -209883,7 +209939,7 @@ var ProxyController = class extends Controller {
|
|
209883
209939
|
__name(ProxyController, "ProxyController");
|
209884
209940
|
var ProxyControllerLogger = class extends WranglerLog {
|
209885
209941
|
log(message) {
|
209886
|
-
if (message.includes("/cdn-cgi/") && this.level <
|
209942
|
+
if (message.includes("/cdn-cgi/") && this.level < import_miniflare19.LogLevel.DEBUG) {
|
209887
209943
|
return;
|
209888
209944
|
}
|
209889
209945
|
super.log(message);
|
@@ -209904,7 +209960,7 @@ __name(didMiniflareOptionsChange, "didMiniflareOptionsChange");
|
|
209904
209960
|
|
209905
209961
|
// src/api/startDevWorker/RemoteRuntimeController.ts
|
209906
209962
|
init_import_meta_url();
|
209907
|
-
var
|
209963
|
+
var import_miniflare21 = require("miniflare");
|
209908
209964
|
|
209909
209965
|
// src/api/startDevWorker/NotImplementedError.ts
|
209910
209966
|
init_import_meta_url();
|
@@ -209930,7 +209986,7 @@ __name(notImplemented, "notImplemented");
|
|
209930
209986
|
var RemoteRuntimeController = class extends RuntimeController {
|
209931
209987
|
#abortController = new AbortController();
|
209932
209988
|
#currentBundleId = 0;
|
209933
|
-
#mutex = new
|
209989
|
+
#mutex = new import_miniflare21.Mutex();
|
209934
209990
|
#session;
|
209935
209991
|
async #previewSession(props) {
|
209936
209992
|
try {
|
@@ -210311,7 +210367,7 @@ init_import_meta_url();
|
|
210311
210367
|
|
210312
210368
|
// src/api/integrations/platform/index.ts
|
210313
210369
|
init_import_meta_url();
|
210314
|
-
var
|
210370
|
+
var import_miniflare23 = require("miniflare");
|
210315
210371
|
|
210316
210372
|
// src/api/integrations/platform/caches.ts
|
210317
210373
|
init_import_meta_url();
|
@@ -210358,15 +210414,21 @@ init_import_meta_url();
|
|
210358
210414
|
var ExecutionContext = class {
|
210359
210415
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, unused-imports/no-unused-vars
|
210360
210416
|
waitUntil(promise) {
|
210417
|
+
if (!(this instanceof ExecutionContext)) {
|
210418
|
+
throw new Error("Illegal invocation");
|
210419
|
+
}
|
210361
210420
|
}
|
210362
210421
|
passThroughOnException() {
|
210422
|
+
if (!(this instanceof ExecutionContext)) {
|
210423
|
+
throw new Error("Illegal invocation");
|
210424
|
+
}
|
210363
210425
|
}
|
210364
210426
|
};
|
210365
210427
|
__name(ExecutionContext, "ExecutionContext");
|
210366
210428
|
|
210367
210429
|
// src/api/integrations/platform/services.ts
|
210368
210430
|
init_import_meta_url();
|
210369
|
-
var
|
210431
|
+
var import_miniflare22 = require("miniflare");
|
210370
210432
|
var import_undici27 = __toESM(require_undici());
|
210371
210433
|
async function getServiceBindings(services = []) {
|
210372
210434
|
if (services.length === 0) {
|
@@ -210418,9 +210480,9 @@ function getServiceBindingProxyFetch({
|
|
210418
210480
|
try {
|
210419
210481
|
const resp = await (0, import_undici27.fetch)(newUrl, request3);
|
210420
210482
|
const respBody = await resp.arrayBuffer();
|
210421
|
-
return new
|
210483
|
+
return new import_miniflare22.Response(respBody, resp);
|
210422
210484
|
} catch {
|
210423
|
-
return new
|
210485
|
+
return new import_miniflare22.Response(
|
210424
210486
|
`Error: Unable to fetch from external service (${serviceName} bound with ${bindingName} binding), please make sure that the service is still running with \`wrangler dev\``,
|
210425
210487
|
{ status: 500 }
|
210426
210488
|
);
|
@@ -210452,7 +210514,7 @@ async function getPlatformProxy(options29 = {}) {
|
|
210452
210514
|
},
|
210453
210515
|
() => getMiniflareOptionsFromConfig(rawConfig, env7, options29)
|
210454
210516
|
);
|
210455
|
-
const mf = new
|
210517
|
+
const mf = new import_miniflare23.Miniflare({
|
210456
210518
|
script: "",
|
210457
210519
|
modules: true,
|
210458
210520
|
...miniflareOptions
|
@@ -210558,7 +210620,7 @@ function unstable_getMiniflareWorkerOptions(configPath, env7) {
|
|
210558
210620
|
if (bindings.services !== void 0) {
|
210559
210621
|
bindingOptions.serviceBindings = Object.fromEntries(
|
210560
210622
|
bindings.services.map((binding) => {
|
210561
|
-
const name = binding.service === config.name ?
|
210623
|
+
const name = binding.service === config.name ? import_miniflare23.kCurrentWorker : binding.service;
|
210562
210624
|
return [binding.binding, { name, entrypoint: binding.entrypoint }];
|
210563
210625
|
})
|
210564
210626
|
);
|
@@ -211254,3 +211316,4 @@ yargs-parser/build/lib/index.js:
|
|
211254
211316
|
* SPDX-License-Identifier: ISC
|
211255
211317
|
*)
|
211256
211318
|
*/
|
211319
|
+
//# sourceMappingURL=cli.js.map
|