wrangler 3.57.1 → 3.57.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/bin/wrangler.js +0 -28
- package/package.json +11 -43
- package/templates/facade.d.ts +2 -2
- package/templates/middleware/loader-modules.ts +14 -13
- package/wrangler-dist/cli.d.ts +25 -0
- package/wrangler-dist/cli.js +205 -202
- package/Cloudflare_CA.pem +0 -18
- package/wrangler-dist/cli.js.map +0 -7
package/wrangler-dist/cli.js
CHANGED
@@ -477,7 +477,7 @@ var require_util = __commonJS({
|
|
477
477
|
var { InvalidArgumentError } = require_errors();
|
478
478
|
var { Blob: Blob6 } = require("buffer");
|
479
479
|
var nodeUtil = require("util");
|
480
|
-
var { stringify } = require("querystring");
|
480
|
+
var { stringify: stringify2 } = require("querystring");
|
481
481
|
var { headerNameLowerCasedRecord } = require_constants();
|
482
482
|
var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2));
|
483
483
|
function nop() {
|
@@ -495,7 +495,7 @@ var require_util = __commonJS({
|
|
495
495
|
if (url4.includes("?") || url4.includes("#")) {
|
496
496
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
497
497
|
}
|
498
|
-
const stringified =
|
498
|
+
const stringified = stringify2(queryParams);
|
499
499
|
if (stringified) {
|
500
500
|
url4 += "?" + stringified;
|
501
501
|
}
|
@@ -15494,7 +15494,7 @@ var require_util6 = __commonJS({
|
|
15494
15494
|
}
|
15495
15495
|
}
|
15496
15496
|
__name(validateCookieMaxAge, "validateCookieMaxAge");
|
15497
|
-
function
|
15497
|
+
function stringify2(cookie) {
|
15498
15498
|
if (cookie.name.length === 0) {
|
15499
15499
|
return null;
|
15500
15500
|
}
|
@@ -15542,7 +15542,7 @@ var require_util6 = __commonJS({
|
|
15542
15542
|
}
|
15543
15543
|
return out.join("; ");
|
15544
15544
|
}
|
15545
|
-
__name(
|
15545
|
+
__name(stringify2, "stringify");
|
15546
15546
|
var kHeadersListNode;
|
15547
15547
|
function getHeadersList(headers) {
|
15548
15548
|
if (headers[kHeadersList]) {
|
@@ -15561,7 +15561,7 @@ var require_util6 = __commonJS({
|
|
15561
15561
|
__name(getHeadersList, "getHeadersList");
|
15562
15562
|
module3.exports = {
|
15563
15563
|
isCTLExcludingHtab,
|
15564
|
-
stringify,
|
15564
|
+
stringify: stringify2,
|
15565
15565
|
getHeadersList
|
15566
15566
|
};
|
15567
15567
|
}
|
@@ -15716,7 +15716,7 @@ var require_cookies = __commonJS({
|
|
15716
15716
|
"use strict";
|
15717
15717
|
init_import_meta_url();
|
15718
15718
|
var { parseSetCookie } = require_parse();
|
15719
|
-
var { stringify, getHeadersList } = require_util6();
|
15719
|
+
var { stringify: stringify2, getHeadersList } = require_util6();
|
15720
15720
|
var { webidl } = require_webidl();
|
15721
15721
|
var { Headers: Headers5 } = require_headers();
|
15722
15722
|
function getCookies(headers) {
|
@@ -15761,9 +15761,9 @@ var require_cookies = __commonJS({
|
|
15761
15761
|
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
|
15762
15762
|
webidl.brandCheck(headers, Headers5, { strict: false });
|
15763
15763
|
cookie = webidl.converters.Cookie(cookie);
|
15764
|
-
const str =
|
15764
|
+
const str = stringify2(cookie);
|
15765
15765
|
if (str) {
|
15766
|
-
headers.append("Set-Cookie",
|
15766
|
+
headers.append("Set-Cookie", stringify2(cookie));
|
15767
15767
|
}
|
15768
15768
|
}
|
15769
15769
|
__name(setCookie, "setCookie");
|
@@ -53219,18 +53219,18 @@ var require_Box = __commonJS({
|
|
53219
53219
|
};
|
53220
53220
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
53221
53221
|
var react_1 = __importStar(require_react());
|
53222
|
-
var
|
53222
|
+
var Box6 = react_1.forwardRef((_a2, ref) => {
|
53223
53223
|
var { children } = _a2, style = __rest(_a2, ["children"]);
|
53224
53224
|
const transformedStyle = Object.assign(Object.assign({}, style), { marginLeft: style.marginLeft || style.marginX || style.margin || 0, marginRight: style.marginRight || style.marginX || style.margin || 0, marginTop: style.marginTop || style.marginY || style.margin || 0, marginBottom: style.marginBottom || style.marginY || style.margin || 0, paddingLeft: style.paddingLeft || style.paddingX || style.padding || 0, paddingRight: style.paddingRight || style.paddingX || style.padding || 0, paddingTop: style.paddingTop || style.paddingY || style.padding || 0, paddingBottom: style.paddingBottom || style.paddingY || style.padding || 0 });
|
53225
53225
|
return react_1.default.createElement("ink-box", { ref, style: transformedStyle }, children);
|
53226
53226
|
});
|
53227
|
-
|
53228
|
-
|
53227
|
+
Box6.displayName = "Box";
|
53228
|
+
Box6.defaultProps = {
|
53229
53229
|
flexDirection: "row",
|
53230
53230
|
flexGrow: 0,
|
53231
53231
|
flexShrink: 1
|
53232
53232
|
};
|
53233
|
-
exports2.default =
|
53233
|
+
exports2.default = Box6;
|
53234
53234
|
}
|
53235
53235
|
});
|
53236
53236
|
|
@@ -53246,7 +53246,7 @@ var require_Text = __commonJS({
|
|
53246
53246
|
var react_1 = __importDefault(require_react());
|
53247
53247
|
var chalk_1 = __importDefault(require_source());
|
53248
53248
|
var colorize_1 = __importDefault(require_colorize());
|
53249
|
-
var
|
53249
|
+
var Text11 = /* @__PURE__ */ __name(({ color, backgroundColor, dimColor, bold: bold2, italic, underline, strikethrough, inverse, wrap: wrap4, children }) => {
|
53250
53250
|
if (children === void 0 || children === null) {
|
53251
53251
|
return null;
|
53252
53252
|
}
|
@@ -53279,8 +53279,8 @@ var require_Text = __commonJS({
|
|
53279
53279
|
}, "transform");
|
53280
53280
|
return react_1.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: "row", textWrap: wrap4 }, internal_transform: transform }, children);
|
53281
53281
|
}, "Text");
|
53282
|
-
|
53283
|
-
|
53282
|
+
Text11.displayName = "Text";
|
53283
|
+
Text11.defaultProps = {
|
53284
53284
|
dimColor: false,
|
53285
53285
|
bold: false,
|
53286
53286
|
italic: false,
|
@@ -53288,7 +53288,7 @@ var require_Text = __commonJS({
|
|
53288
53288
|
strikethrough: false,
|
53289
53289
|
wrap: "wrap"
|
53290
53290
|
};
|
53291
|
-
exports2.default =
|
53291
|
+
exports2.default = Text11;
|
53292
53292
|
}
|
53293
53293
|
});
|
53294
53294
|
|
@@ -60263,9 +60263,9 @@ var require_stringify = __commonJS({
|
|
60263
60263
|
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js"(exports2, module3) {
|
60264
60264
|
"use strict";
|
60265
60265
|
init_import_meta_url();
|
60266
|
-
module3.exports =
|
60266
|
+
module3.exports = stringify2;
|
60267
60267
|
module3.exports.value = stringifyInline;
|
60268
|
-
function
|
60268
|
+
function stringify2(obj) {
|
60269
60269
|
if (obj === null)
|
60270
60270
|
throw typeError("null");
|
60271
60271
|
if (obj === void 0)
|
@@ -60281,7 +60281,7 @@ var require_stringify = __commonJS({
|
|
60281
60281
|
throw typeError(type);
|
60282
60282
|
return stringifyObject("", "", obj);
|
60283
60283
|
}
|
60284
|
-
__name(
|
60284
|
+
__name(stringify2, "stringify");
|
60285
60285
|
function typeError(type) {
|
60286
60286
|
return new Error("Can only stringify objects, not " + type);
|
60287
60287
|
}
|
@@ -86841,7 +86841,7 @@ var require_stringify2 = __commonJS({
|
|
86841
86841
|
return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean" || typeof v2 === "symbol" || typeof v2 === "bigint";
|
86842
86842
|
}, "isNonNullishPrimitive");
|
86843
86843
|
var sentinel = {};
|
86844
|
-
var
|
86844
|
+
var stringify2 = /* @__PURE__ */ __name(function stringify3(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, format10, formatter, encodeValuesOnly, charset, sideChannel) {
|
86845
86845
|
var obj = object;
|
86846
86846
|
var tmpSc = sideChannel;
|
86847
86847
|
var step = 0;
|
@@ -86916,7 +86916,7 @@ var require_stringify2 = __commonJS({
|
|
86916
86916
|
sideChannel.set(object, step);
|
86917
86917
|
var valueSideChannel = getSideChannel();
|
86918
86918
|
valueSideChannel.set(sentinel, sideChannel);
|
86919
|
-
pushToArray(values,
|
86919
|
+
pushToArray(values, stringify3(
|
86920
86920
|
value,
|
86921
86921
|
keyPrefix,
|
86922
86922
|
generateArrayPrefix,
|
@@ -87014,7 +87014,7 @@ var require_stringify2 = __commonJS({
|
|
87014
87014
|
if (options29.skipNulls && obj[key] === null) {
|
87015
87015
|
continue;
|
87016
87016
|
}
|
87017
|
-
pushToArray(keys,
|
87017
|
+
pushToArray(keys, stringify2(
|
87018
87018
|
obj[key],
|
87019
87019
|
key,
|
87020
87020
|
generateArrayPrefix,
|
@@ -87254,13 +87254,13 @@ var require_lib3 = __commonJS({
|
|
87254
87254
|
"../../node_modules/.pnpm/qs@6.10.3/node_modules/qs/lib/index.js"(exports2, module3) {
|
87255
87255
|
"use strict";
|
87256
87256
|
init_import_meta_url();
|
87257
|
-
var
|
87257
|
+
var stringify2 = require_stringify2();
|
87258
87258
|
var parse7 = require_parse4();
|
87259
87259
|
var formats = require_formats();
|
87260
87260
|
module3.exports = {
|
87261
87261
|
formats,
|
87262
87262
|
parse: parse7,
|
87263
|
-
stringify
|
87263
|
+
stringify: stringify2
|
87264
87264
|
};
|
87265
87265
|
}
|
87266
87266
|
});
|
@@ -92471,7 +92471,7 @@ var require_response2 = __commonJS({
|
|
92471
92471
|
var escape2 = app.get("json escape");
|
92472
92472
|
var replacer2 = app.get("json replacer");
|
92473
92473
|
var spaces = app.get("json spaces");
|
92474
|
-
var body =
|
92474
|
+
var body = stringify2(val, replacer2, spaces, escape2);
|
92475
92475
|
if (!this.get("Content-Type")) {
|
92476
92476
|
this.set("Content-Type", "application/json");
|
92477
92477
|
}
|
@@ -92493,7 +92493,7 @@ var require_response2 = __commonJS({
|
|
92493
92493
|
var escape2 = app.get("json escape");
|
92494
92494
|
var replacer2 = app.get("json replacer");
|
92495
92495
|
var spaces = app.get("json spaces");
|
92496
|
-
var body =
|
92496
|
+
var body = stringify2(val, replacer2, spaces, escape2);
|
92497
92497
|
var callback = this.req.query[app.get("jsonp callback name")];
|
92498
92498
|
if (!this.get("Content-Type")) {
|
92499
92499
|
this.set("X-Content-Type-Options", "nosniff");
|
@@ -92851,7 +92851,7 @@ var require_response2 = __commonJS({
|
|
92851
92851
|
file.pipe(res2);
|
92852
92852
|
}
|
92853
92853
|
__name(sendfile, "sendfile");
|
92854
|
-
function
|
92854
|
+
function stringify2(value, replacer2, spaces, escape2) {
|
92855
92855
|
var json = replacer2 || spaces ? JSON.stringify(value, replacer2, spaces) : JSON.stringify(value);
|
92856
92856
|
if (escape2 && typeof json === "string") {
|
92857
92857
|
json = json.replace(/[<>&]/g, function(c2) {
|
@@ -92869,7 +92869,7 @@ var require_response2 = __commonJS({
|
|
92869
92869
|
}
|
92870
92870
|
return json;
|
92871
92871
|
}
|
92872
|
-
__name(
|
92872
|
+
__name(stringify2, "stringify");
|
92873
92873
|
}
|
92874
92874
|
});
|
92875
92875
|
|
@@ -95043,7 +95043,7 @@ var require_fast_json_stable_stringify = __commonJS({
|
|
95043
95043
|
};
|
95044
95044
|
}(opts.cmp);
|
95045
95045
|
var seen = [];
|
95046
|
-
return (/* @__PURE__ */ __name(function
|
95046
|
+
return (/* @__PURE__ */ __name(function stringify2(node2) {
|
95047
95047
|
if (node2 && node2.toJSON && typeof node2.toJSON === "function") {
|
95048
95048
|
node2 = node2.toJSON();
|
95049
95049
|
}
|
@@ -95059,7 +95059,7 @@ var require_fast_json_stable_stringify = __commonJS({
|
|
95059
95059
|
for (i = 0; i < node2.length; i++) {
|
95060
95060
|
if (i)
|
95061
95061
|
out += ",";
|
95062
|
-
out +=
|
95062
|
+
out += stringify2(node2[i]) || "null";
|
95063
95063
|
}
|
95064
95064
|
return out + "]";
|
95065
95065
|
}
|
@@ -95075,7 +95075,7 @@ var require_fast_json_stable_stringify = __commonJS({
|
|
95075
95075
|
out = "";
|
95076
95076
|
for (i = 0; i < keys.length; i++) {
|
95077
95077
|
var key = keys[i];
|
95078
|
-
var value =
|
95078
|
+
var value = stringify2(node2[key]);
|
95079
95079
|
if (!value)
|
95080
95080
|
continue;
|
95081
95081
|
if (out)
|
@@ -103322,10 +103322,10 @@ function $asStringSmall (str) {
|
|
103322
103322
|
var require_fast_safe_stringify = __commonJS({
|
103323
103323
|
"../../node_modules/.pnpm/fast-safe-stringify@2.1.1/node_modules/fast-safe-stringify/index.js"(exports2, module3) {
|
103324
103324
|
init_import_meta_url();
|
103325
|
-
module3.exports =
|
103326
|
-
|
103327
|
-
|
103328
|
-
|
103325
|
+
module3.exports = stringify2;
|
103326
|
+
stringify2.default = stringify2;
|
103327
|
+
stringify2.stable = deterministicStringify;
|
103328
|
+
stringify2.stableStringify = deterministicStringify;
|
103329
103329
|
var LIMIT_REPLACE_NODE = "[...]";
|
103330
103330
|
var CIRCULAR_REPLACE_NODE = "[Circular]";
|
103331
103331
|
var arr = [];
|
@@ -103337,7 +103337,7 @@ var require_fast_safe_stringify = __commonJS({
|
|
103337
103337
|
};
|
103338
103338
|
}
|
103339
103339
|
__name(defaultOptions, "defaultOptions");
|
103340
|
-
function
|
103340
|
+
function stringify2(obj, replacer2, spacer, options29) {
|
103341
103341
|
if (typeof options29 === "undefined") {
|
103342
103342
|
options29 = defaultOptions();
|
103343
103343
|
}
|
@@ -103363,7 +103363,7 @@ var require_fast_safe_stringify = __commonJS({
|
|
103363
103363
|
}
|
103364
103364
|
return res;
|
103365
103365
|
}
|
103366
|
-
__name(
|
103366
|
+
__name(stringify2, "stringify");
|
103367
103367
|
function setReplace(replace, val, k2, parent) {
|
103368
103368
|
var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k2);
|
103369
103369
|
if (propertyDescriptor.get !== void 0) {
|
@@ -112176,7 +112176,7 @@ var require_util12 = __commonJS({
|
|
112176
112176
|
var { InvalidArgumentError } = require_errors2();
|
112177
112177
|
var { Blob: Blob6 } = require("buffer");
|
112178
112178
|
var nodeUtil = require("util");
|
112179
|
-
var { stringify } = require("querystring");
|
112179
|
+
var { stringify: stringify2 } = require("querystring");
|
112180
112180
|
var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2));
|
112181
112181
|
function nop() {
|
112182
112182
|
}
|
@@ -112193,7 +112193,7 @@ var require_util12 = __commonJS({
|
|
112193
112193
|
if (url4.includes("?") || url4.includes("#")) {
|
112194
112194
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
112195
112195
|
}
|
112196
|
-
const stringified =
|
112196
|
+
const stringified = stringify2(queryParams);
|
112197
112197
|
if (stringified) {
|
112198
112198
|
url4 += "?" + stringified;
|
112199
112199
|
}
|
@@ -125116,7 +125116,7 @@ var require_util17 = __commonJS({
|
|
125116
125116
|
}
|
125117
125117
|
}
|
125118
125118
|
__name(validateCookieMaxAge, "validateCookieMaxAge");
|
125119
|
-
function
|
125119
|
+
function stringify2(cookie) {
|
125120
125120
|
if (cookie.name.length === 0) {
|
125121
125121
|
return null;
|
125122
125122
|
}
|
@@ -125164,7 +125164,7 @@ var require_util17 = __commonJS({
|
|
125164
125164
|
}
|
125165
125165
|
return out.join("; ");
|
125166
125166
|
}
|
125167
|
-
__name(
|
125167
|
+
__name(stringify2, "stringify");
|
125168
125168
|
var kHeadersListNode;
|
125169
125169
|
function getHeadersList(headers) {
|
125170
125170
|
if (headers[kHeadersList]) {
|
@@ -125183,7 +125183,7 @@ var require_util17 = __commonJS({
|
|
125183
125183
|
__name(getHeadersList, "getHeadersList");
|
125184
125184
|
module3.exports = {
|
125185
125185
|
isCTLExcludingHtab,
|
125186
|
-
stringify,
|
125186
|
+
stringify: stringify2,
|
125187
125187
|
getHeadersList
|
125188
125188
|
};
|
125189
125189
|
}
|
@@ -125338,7 +125338,7 @@ var require_cookies2 = __commonJS({
|
|
125338
125338
|
"use strict";
|
125339
125339
|
init_import_meta_url();
|
125340
125340
|
var { parseSetCookie } = require_parse7();
|
125341
|
-
var { stringify, getHeadersList } = require_util17();
|
125341
|
+
var { stringify: stringify2, getHeadersList } = require_util17();
|
125342
125342
|
var { webidl } = require_webidl2();
|
125343
125343
|
var { Headers: Headers5 } = require_headers2();
|
125344
125344
|
function getCookies(headers) {
|
@@ -125383,9 +125383,9 @@ var require_cookies2 = __commonJS({
|
|
125383
125383
|
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
|
125384
125384
|
webidl.brandCheck(headers, Headers5, { strict: false });
|
125385
125385
|
cookie = webidl.converters.Cookie(cookie);
|
125386
|
-
const str =
|
125386
|
+
const str = stringify2(cookie);
|
125387
125387
|
if (str) {
|
125388
|
-
headers.append("Set-Cookie",
|
125388
|
+
headers.append("Set-Cookie", stringify2(cookie));
|
125389
125389
|
}
|
125390
125390
|
}
|
125391
125391
|
__name(setCookie, "setCookie");
|
@@ -133938,9 +133938,9 @@ var require_stringify3 = __commonJS({
|
|
133938
133938
|
"../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/stringify.js"(exports2, module3) {
|
133939
133939
|
"use strict";
|
133940
133940
|
init_import_meta_url();
|
133941
|
-
module3.exports =
|
133941
|
+
module3.exports = stringify2;
|
133942
133942
|
module3.exports.value = stringifyInline;
|
133943
|
-
function
|
133943
|
+
function stringify2(obj) {
|
133944
133944
|
if (obj === null)
|
133945
133945
|
throw typeError("null");
|
133946
133946
|
if (obj === void 0)
|
@@ -133956,7 +133956,7 @@ var require_stringify3 = __commonJS({
|
|
133956
133956
|
throw typeError(type);
|
133957
133957
|
return stringifyObject("", "", obj);
|
133958
133958
|
}
|
133959
|
-
__name(
|
133959
|
+
__name(stringify2, "stringify");
|
133960
133960
|
function typeError(type) {
|
133961
133961
|
return new Error("Can only stringify objects, not " + type);
|
133962
133962
|
}
|
@@ -139695,7 +139695,14 @@ async function generateHandler({
|
|
139695
139695
|
if (responseWithoutHeaders.status >= 500) {
|
139696
139696
|
return responseWithoutHeaders;
|
139697
139697
|
}
|
139698
|
-
|
139698
|
+
const responseWithHeaders = await attachHeaders(responseWithoutHeaders);
|
139699
|
+
if (responseWithHeaders.status === 404) {
|
139700
|
+
if (responseWithHeaders.headers.has("cache-control")) {
|
139701
|
+
responseWithHeaders.headers.delete("cache-control");
|
139702
|
+
}
|
139703
|
+
responseWithHeaders.headers.append("cache-control", "no-store");
|
139704
|
+
}
|
139705
|
+
return responseWithHeaders;
|
139699
139706
|
async function serveAsset(servingAssetEntry, options29 = { preserve: true }) {
|
139700
139707
|
let content;
|
139701
139708
|
try {
|
@@ -141079,10 +141086,10 @@ var require_Indicator = __commonJS({
|
|
141079
141086
|
"use strict";
|
141080
141087
|
init_import_meta_url();
|
141081
141088
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141082
|
-
var
|
141089
|
+
var React18 = require_react();
|
141083
141090
|
var ink_1 = require_build2();
|
141084
141091
|
var figures = require_figures3();
|
141085
|
-
var Indicator = /* @__PURE__ */ __name(({ isSelected = false }) =>
|
141092
|
+
var Indicator = /* @__PURE__ */ __name(({ isSelected = false }) => React18.createElement(ink_1.Box, { marginRight: 1 }, isSelected ? React18.createElement(ink_1.Text, { color: "blue" }, figures.pointer) : React18.createElement(ink_1.Text, null, " ")), "Indicator");
|
141086
141093
|
exports2.default = Indicator;
|
141087
141094
|
}
|
141088
141095
|
});
|
@@ -141093,9 +141100,9 @@ var require_Item = __commonJS({
|
|
141093
141100
|
"use strict";
|
141094
141101
|
init_import_meta_url();
|
141095
141102
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141096
|
-
var
|
141103
|
+
var React18 = require_react();
|
141097
141104
|
var ink_1 = require_build2();
|
141098
|
-
var Item = /* @__PURE__ */ __name(({ isSelected = false, label }) =>
|
141105
|
+
var Item = /* @__PURE__ */ __name(({ isSelected = false, label }) => React18.createElement(ink_1.Text, { color: isSelected ? "blue" : void 0 }, label), "Item");
|
141099
141106
|
exports2.default = Item;
|
141100
141107
|
}
|
141101
141108
|
});
|
@@ -141106,7 +141113,7 @@ var require_SelectInput = __commonJS({
|
|
141106
141113
|
"use strict";
|
141107
141114
|
init_import_meta_url();
|
141108
141115
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141109
|
-
var
|
141116
|
+
var React18 = require_react();
|
141110
141117
|
var react_1 = require_react();
|
141111
141118
|
var isEqual = require_lodash2();
|
141112
141119
|
var arrayRotate = require_arr_rotate();
|
@@ -141168,14 +141175,14 @@ var require_SelectInput = __commonJS({
|
|
141168
141175
|
onHighlight
|
141169
141176
|
]), { isActive: isFocused });
|
141170
141177
|
const slicedItems = hasLimit ? arrayRotate(items, rotateIndex).slice(0, limit) : items;
|
141171
|
-
return
|
141178
|
+
return React18.createElement(ink_1.Box, { flexDirection: "column" }, slicedItems.map((item, index) => {
|
141172
141179
|
var _a2;
|
141173
141180
|
const isSelected = index === selectedIndex;
|
141174
|
-
return
|
141181
|
+
return React18.createElement(
|
141175
141182
|
ink_1.Box,
|
141176
141183
|
{ key: (_a2 = item.key) !== null && _a2 !== void 0 ? _a2 : item.value },
|
141177
|
-
|
141178
|
-
|
141184
|
+
React18.createElement(indicatorComponent, { isSelected }),
|
141185
|
+
React18.createElement(itemComponent, { ...item, isSelected })
|
141179
141186
|
);
|
141180
141187
|
}));
|
141181
141188
|
}
|
@@ -144043,7 +144050,7 @@ var require_build4 = __commonJS({
|
|
144043
144050
|
"use strict";
|
144044
144051
|
init_import_meta_url();
|
144045
144052
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
144046
|
-
var
|
144053
|
+
var React18 = require_react();
|
144047
144054
|
var react_1 = require_react();
|
144048
144055
|
var ink_1 = require_build2();
|
144049
144056
|
var spinners = require_cli_spinners();
|
@@ -144061,7 +144068,7 @@ var require_build4 = __commonJS({
|
|
144061
144068
|
clearInterval(timer);
|
144062
144069
|
};
|
144063
144070
|
}, [spinner2]);
|
144064
|
-
return
|
144071
|
+
return React18.createElement(ink_1.Text, null, spinner2.frames[frame]);
|
144065
144072
|
}, "Spinner");
|
144066
144073
|
exports2.default = Spinner2;
|
144067
144074
|
}
|
@@ -150169,6 +150176,7 @@ __export(cli_exports2, {
|
|
150169
150176
|
getPlatformProxy: () => getPlatformProxy,
|
150170
150177
|
unstable_DevEnv: () => DevEnv,
|
150171
150178
|
unstable_dev: () => unstable_dev,
|
150179
|
+
unstable_generateASSETSBinding: () => generateASSETSBinding2,
|
150172
150180
|
unstable_getMiniflareWorkerOptions: () => unstable_getMiniflareWorkerOptions,
|
150173
150181
|
unstable_pages: () => unstable_pages,
|
150174
150182
|
unstable_splitSqlQuery: () => splitSqlQuery,
|
@@ -152025,8 +152033,8 @@ async function getPorts(options29) {
|
|
152025
152033
|
__name(getPorts, "getPorts");
|
152026
152034
|
|
152027
152035
|
// src/dev.tsx
|
152028
|
-
var
|
152029
|
-
var
|
152036
|
+
var import_ink13 = __toESM(require_build2());
|
152037
|
+
var import_react19 = __toESM(require_react());
|
152030
152038
|
|
152031
152039
|
// src/config/index.ts
|
152032
152040
|
init_import_meta_url();
|
@@ -152598,7 +152606,7 @@ var Logger = class {
|
|
152598
152606
|
}
|
152599
152607
|
doLog(messageLevel, args) {
|
152600
152608
|
const message = this.formatMessage(messageLevel, (0, import_node_util.format)(...args));
|
152601
|
-
const inUnitTests = typeof
|
152609
|
+
const inUnitTests = typeof vitest !== "undefined";
|
152602
152610
|
if (!inUnitTests) {
|
152603
152611
|
void appendToDebugLogFile(messageLevel, message);
|
152604
152612
|
}
|
@@ -152646,7 +152654,7 @@ init_import_meta_url();
|
|
152646
152654
|
init_import_meta_url();
|
152647
152655
|
|
152648
152656
|
// package.json
|
152649
|
-
var version = "3.57.
|
152657
|
+
var version = "3.57.2";
|
152650
152658
|
var package_default = {
|
152651
152659
|
name: "wrangler",
|
152652
152660
|
version,
|
@@ -152696,7 +152704,6 @@ var package_default = {
|
|
152696
152704
|
"wrangler-dist",
|
152697
152705
|
"templates",
|
152698
152706
|
"kv-asset-handler.js",
|
152699
|
-
"Cloudflare_CA.pem",
|
152700
152707
|
"config-schema.json"
|
152701
152708
|
],
|
152702
152709
|
scripts: {
|
@@ -152711,41 +152718,13 @@ var package_default = {
|
|
152711
152718
|
"generate-json-schema": "pnpm exec ts-json-schema-generator --no-type-check --path src/config/config.ts --type RawConfig --out config-schema.json",
|
152712
152719
|
prepublishOnly: "SOURCEMAPS=false pnpm run -w build",
|
152713
152720
|
start: "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/wrangler.js",
|
152714
|
-
test: "pnpm run assert-git-version &&
|
152715
|
-
"test:ci": "pnpm run test",
|
152721
|
+
test: "pnpm run assert-git-version && vitest",
|
152722
|
+
"test:ci": "pnpm run test run",
|
152716
152723
|
"test:debug": "pnpm run test --silent=false --verbose=true",
|
152717
152724
|
"test:e2e": "vitest -c ./e2e/vitest.config.ts",
|
152718
152725
|
"test:watch": "pnpm run test --testTimeout=50000 --watch",
|
152719
152726
|
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
|
152720
152727
|
},
|
152721
|
-
jest: {
|
152722
|
-
moduleNameMapper: {
|
152723
|
-
clipboardy: "<rootDir>/src/__tests__/helpers/clipboardy-mock.js",
|
152724
|
-
"miniflare/cli": "<rootDir>/../../node_modules/miniflare/dist/src/cli.js"
|
152725
|
-
},
|
152726
|
-
restoreMocks: true,
|
152727
|
-
setupFilesAfterEnv: [
|
152728
|
-
"<rootDir>/src/__tests__/jest.setup.ts"
|
152729
|
-
],
|
152730
|
-
testRegex: "src/__tests__/.*\\.(test|spec)\\.[jt]sx?$",
|
152731
|
-
testTimeout: 5e4,
|
152732
|
-
transform: {
|
152733
|
-
"^.+\\.c?(t|j)sx?$": [
|
152734
|
-
"esbuild-jest",
|
152735
|
-
{
|
152736
|
-
sourcemap: true
|
152737
|
-
}
|
152738
|
-
]
|
152739
|
-
},
|
152740
|
-
transformIgnorePatterns: [
|
152741
|
-
"node_modules/.pnpm/(?!find-up|locate-path|p-locate|p-limit|p-timeout|p-queue|yocto-queue|path-exists|execa|strip-final-newline|npm-run-path|path-key|onetime|mimic-fn|human-signals|is-stream|get-port|supports-color|pretty-bytes|strip-ansi|ansi-regex)"
|
152742
|
-
],
|
152743
|
-
snapshotFormat: {
|
152744
|
-
escapeString: true,
|
152745
|
-
printBasicPrototype: true
|
152746
|
-
},
|
152747
|
-
prettierPath: null
|
152748
|
-
},
|
152749
152728
|
dependencies: {
|
152750
152729
|
"@cloudflare/kv-asset-handler": "workspace:*",
|
152751
152730
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
@@ -152768,7 +152747,7 @@ var package_default = {
|
|
152768
152747
|
"@cloudflare/pages-shared": "workspace:^",
|
152769
152748
|
"@cloudflare/types": "^6.18.4",
|
152770
152749
|
"@cloudflare/workers-tsconfig": "workspace:*",
|
152771
|
-
"@cloudflare/workers-types": "^4.
|
152750
|
+
"@cloudflare/workers-types": "^4.20240524.0",
|
152772
152751
|
"@cspotcode/source-map-support": "0.8.1",
|
152773
152752
|
"@iarna/toml": "^3.0.0",
|
152774
152753
|
"@microsoft/api-extractor": "^7.28.3",
|
@@ -152781,7 +152760,6 @@ var package_default = {
|
|
152781
152760
|
"@types/glob-to-regexp": "0.4.1",
|
152782
152761
|
"@types/is-ci": "^3.0.0",
|
152783
152762
|
"@types/javascript-time-ago": "^2.0.3",
|
152784
|
-
"@types/jest": "^29.5.5",
|
152785
152763
|
"@types/mime": "^2.0.3",
|
152786
152764
|
"@types/minimatch": "^5.1.2",
|
152787
152765
|
"@types/prompts": "^2.0.14",
|
@@ -152805,7 +152783,6 @@ var package_default = {
|
|
152805
152783
|
"devtools-protocol": "^0.0.955664",
|
152806
152784
|
dotenv: "^16.0.0",
|
152807
152785
|
"es-module-lexer": "^1.3.0",
|
152808
|
-
"esbuild-jest": "0.5.0",
|
152809
152786
|
execa: "^6.1.0",
|
152810
152787
|
express: "^4.18.1",
|
152811
152788
|
"find-up": "^6.3.0",
|
@@ -152820,13 +152797,11 @@ var package_default = {
|
|
152820
152797
|
"ink-table": "^3.0.0",
|
152821
152798
|
"is-ci": "^3.0.1",
|
152822
152799
|
"javascript-time-ago": "^2.5.4",
|
152823
|
-
jest: "^29.7.0",
|
152824
|
-
"jest-fetch-mock": "^3.0.3",
|
152825
|
-
"jest-websocket-mock": "^2.5.0",
|
152826
152800
|
"md5-file": "5.0.0",
|
152827
152801
|
mime: "^3.0.0",
|
152828
152802
|
minimatch: "^5.1.0",
|
152829
|
-
|
152803
|
+
"mock-socket": "^9.3.1",
|
152804
|
+
msw: "^2.3.0",
|
152830
152805
|
open: "^8.4.0",
|
152831
152806
|
"p-queue": "^7.2.0",
|
152832
152807
|
"patch-console": "^1.0.0",
|
@@ -152848,6 +152823,7 @@ var package_default = {
|
|
152848
152823
|
undici: "5.28.4",
|
152849
152824
|
"update-check": "^1.5.4",
|
152850
152825
|
vitest: "^1.6.0",
|
152826
|
+
"vitest-websocket-mock": "^0.3.0",
|
152851
152827
|
ws: "^8.5.0",
|
152852
152828
|
"xdg-app-paths": "^8.3.0",
|
152853
152829
|
yargs: "^17.7.2",
|
@@ -152857,7 +152833,7 @@ var package_default = {
|
|
152857
152833
|
fsevents: "~2.3.2"
|
152858
152834
|
},
|
152859
152835
|
peerDependencies: {
|
152860
|
-
"@cloudflare/workers-types": "^4.
|
152836
|
+
"@cloudflare/workers-types": "^4.20240524.0"
|
152861
152837
|
},
|
152862
152838
|
peerDependenciesMeta: {
|
152863
152839
|
"@cloudflare/workers-types": {
|
@@ -153985,6 +153961,7 @@ var ParseError = class extends UserError {
|
|
153985
153961
|
__name(ParseError, "ParseError");
|
153986
153962
|
var APIError = class extends ParseError {
|
153987
153963
|
#status;
|
153964
|
+
code;
|
153988
153965
|
constructor({ status: status2, ...rest }) {
|
153989
153966
|
super(rest);
|
153990
153967
|
this.name = this.constructor.name;
|
@@ -155585,6 +155562,9 @@ function hasMorePages(result_info) {
|
|
155585
155562
|
}
|
155586
155563
|
__name(hasMorePages, "hasMorePages");
|
155587
155564
|
function throwFetchError(resource, response) {
|
155565
|
+
if (typeof vitest !== "undefined" && !("errors" in response)) {
|
155566
|
+
throw response;
|
155567
|
+
}
|
155588
155568
|
for (const error3 of response.errors) {
|
155589
155569
|
maybeThrowFriendlyError(error3);
|
155590
155570
|
}
|
@@ -159258,20 +159238,20 @@ async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
159258
159238
|
)}";`
|
159259
159239
|
)
|
159260
159240
|
).join("\n");
|
159261
|
-
const middlewareFns = middlewareIdentifiers.map(([m2]) => `${m2}.default`);
|
159241
|
+
const middlewareFns = middlewareIdentifiers.map(([m2]) => `${m2}.default`).join(",");
|
159262
159242
|
if (entry.format === "modules") {
|
159263
159243
|
await fs6.promises.writeFile(
|
159264
159244
|
dynamicFacadePath,
|
159265
159245
|
dedent`
|
159266
159246
|
import worker, * as OTHER_EXPORTS from "${prepareFilePath(entry.file)}";
|
159267
159247
|
${imports}
|
159268
|
-
|
159269
|
-
worker.middleware = [
|
159270
|
-
${middlewareFns.join(",")},
|
159271
|
-
...(worker.middleware ?? []),
|
159272
|
-
].filter(Boolean);
|
159273
|
-
|
159248
|
+
|
159274
159249
|
export * from "${prepareFilePath(entry.file)}";
|
159250
|
+
|
159251
|
+
export const __INTERNAL_WRANGLER_MIDDLEWARE__ = [
|
159252
|
+
...(OTHER_EXPORTS.__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__ ?? []),
|
159253
|
+
${middlewareFns}
|
159254
|
+
]
|
159275
159255
|
export default worker;
|
159276
159256
|
`
|
159277
159257
|
);
|
@@ -160756,8 +160736,8 @@ var clipboardy_default = clipboard5;
|
|
160756
160736
|
|
160757
160737
|
// src/dev/dev.tsx
|
160758
160738
|
var import_command_exists2 = __toESM(require_command_exists2());
|
160759
|
-
var
|
160760
|
-
var
|
160739
|
+
var import_ink12 = __toESM(require_build2());
|
160740
|
+
var import_react18 = __toESM(require_react());
|
160761
160741
|
|
160762
160742
|
// ../../node_modules/.pnpm/react-error-boundary@3.1.4_react@17.0.2/node_modules/react-error-boundary/dist/react-error-boundary.esm.js
|
160763
160743
|
init_import_meta_url();
|
@@ -162531,8 +162511,8 @@ async function localPropsToConfigBundle(props) {
|
|
162531
162511
|
(0, import_node_assert10.default)(props.bundle !== void 0);
|
162532
162512
|
const serviceBindings = {};
|
162533
162513
|
if (props.enablePagesAssetsServiceBinding !== void 0) {
|
162534
|
-
const
|
162535
|
-
serviceBindings.ASSETS = await
|
162514
|
+
const generateASSETSBinding3 = (init_assets(), __toCommonJS(assets_exports)).default;
|
162515
|
+
serviceBindings.ASSETS = await generateASSETSBinding3({
|
162536
162516
|
log: logger,
|
162537
162517
|
...props.enablePagesAssetsServiceBinding
|
162538
162518
|
});
|
@@ -162700,9 +162680,9 @@ __name(useLocalWorker, "useLocalWorker");
|
|
162700
162680
|
// src/dev/remote.tsx
|
162701
162681
|
init_import_meta_url();
|
162702
162682
|
var import_node_path54 = __toESM(require("node:path"));
|
162703
|
-
var
|
162683
|
+
var import_ink10 = __toESM(require_build2());
|
162704
162684
|
var import_ink_select_input3 = __toESM(require_build3());
|
162705
|
-
var
|
162685
|
+
var import_react16 = __toESM(require_react());
|
162706
162686
|
|
162707
162687
|
// src/deploy/deploy.ts
|
162708
162688
|
init_import_meta_url();
|
@@ -163247,7 +163227,7 @@ __name(stripPrefix, "stripPrefix");
|
|
163247
163227
|
// src/deployments.ts
|
163248
163228
|
init_import_meta_url();
|
163249
163229
|
var import_url8 = require("url");
|
163250
|
-
var
|
163230
|
+
var import_toml8 = __toESM(require_toml());
|
163251
163231
|
var import_chalk19 = __toESM(require_chalk());
|
163252
163232
|
var import_undici23 = __toESM(require_undici());
|
163253
163233
|
|
@@ -163256,7 +163236,7 @@ init_import_meta_url();
|
|
163256
163236
|
var fs26 = __toESM(require("node:fs"));
|
163257
163237
|
var import_promises20 = require("node:fs/promises");
|
163258
163238
|
var import_node_path52 = __toESM(require("node:path"));
|
163259
|
-
var
|
163239
|
+
var import_toml7 = __toESM(require_toml());
|
163260
163240
|
init_execa();
|
163261
163241
|
|
163262
163242
|
// src/git-client.ts
|
@@ -163578,7 +163558,7 @@ __name(parse6, "parse");
|
|
163578
163558
|
init_import_meta_url();
|
163579
163559
|
var import_node_module3 = __toESM(require("node:module"));
|
163580
163560
|
var import_node_os8 = __toESM(require("node:os"));
|
163581
|
-
var
|
163561
|
+
var import_toml6 = __toESM(require_toml());
|
163582
163562
|
var import_chalk18 = __toESM(require_chalk());
|
163583
163563
|
var import_undici22 = __toESM(require_undici());
|
163584
163564
|
|
@@ -175250,7 +175230,8 @@ function prettyBytes(number, options29) {
|
|
175250
175230
|
__name(prettyBytes, "prettyBytes");
|
175251
175231
|
|
175252
175232
|
// src/d1/formatTimeAgo.ts
|
175253
|
-
TimeAgo.
|
175233
|
+
TimeAgo.addLocale(en_json_default);
|
175234
|
+
TimeAgo.setDefaultLocale("en");
|
175254
175235
|
var timeAgo = new TimeAgo("en-US");
|
175255
175236
|
var formatTimeAgo = /* @__PURE__ */ __name((date) => {
|
175256
175237
|
const result = timeAgo.format(date);
|
@@ -182657,6 +182638,9 @@ var upload = /* @__PURE__ */ __name(async (args) => {
|
|
182657
182638
|
);
|
182658
182639
|
}, "upload");
|
182659
182640
|
function isJwtExpired(token) {
|
182641
|
+
if (typeof vitest !== "undefined" && (token === "<<funfetti-auth-jwt>>" || token === "<<funfetti-auth-jwt2>>")) {
|
182642
|
+
return false;
|
182643
|
+
}
|
182660
182644
|
try {
|
182661
182645
|
const decodedJwt = JSON.parse(
|
182662
182646
|
Buffer.from(token.split(".")[1], "base64").toString()
|
@@ -188087,6 +188071,7 @@ init_import_meta_url();
|
|
188087
188071
|
var import_node_path49 = __toESM(require("node:path"));
|
188088
188072
|
var import_node_readline3 = __toESM(require("node:readline"));
|
188089
188073
|
var import_undici17 = __toESM(require_undici());
|
188074
|
+
var VERSION_NOT_DEPLOYED_ERR_CODE = 10215;
|
188090
188075
|
function isMissingWorkerError(e3) {
|
188091
188076
|
return typeof e3 === "object" && e3 !== null && e3.code === 10007;
|
188092
188077
|
}
|
@@ -188193,15 +188178,25 @@ var secret2 = /* @__PURE__ */ __name((secretYargs) => {
|
|
188193
188178
|
);
|
188194
188179
|
async function submitSecret() {
|
188195
188180
|
const url4 = !args.env || isLegacyEnv(config) ? `/accounts/${accountId}/workers/scripts/${scriptName}/secrets` : `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/secrets`;
|
188196
|
-
|
188197
|
-
|
188198
|
-
|
188199
|
-
|
188200
|
-
|
188201
|
-
|
188202
|
-
|
188203
|
-
|
188204
|
-
|
188181
|
+
try {
|
188182
|
+
return await fetchResult(url4, {
|
188183
|
+
method: "PUT",
|
188184
|
+
headers: { "Content-Type": "application/json" },
|
188185
|
+
body: JSON.stringify({
|
188186
|
+
name: args.key,
|
188187
|
+
text: secretValue,
|
188188
|
+
type: "secret_text"
|
188189
|
+
})
|
188190
|
+
});
|
188191
|
+
} catch (e3) {
|
188192
|
+
if (e3 instanceof APIError && e3.code === VERSION_NOT_DEPLOYED_ERR_CODE) {
|
188193
|
+
throw new UserError(
|
188194
|
+
"Secret edit failed. You attempted to modify a secret, but the latest version of your Worker isn't currently deployed. Please ensure that the latest version of your Worker is fully deployed (wrangler versions deploy --x-versions) before modifying secrets. Alternatively, you can use the Cloudflare dashboard to modify secrets and deploy the version.\n\nNote: This limitation will be addressed in an upcoming release."
|
188195
|
+
);
|
188196
|
+
} else {
|
188197
|
+
throw e3;
|
188198
|
+
}
|
188199
|
+
}
|
188205
188200
|
}
|
188206
188201
|
__name(submitSecret, "submitSecret");
|
188207
188202
|
try {
|
@@ -198586,8 +198581,7 @@ var vectorizeBetaWarning = `--------------------
|
|
198586
198581
|
|
198587
198582
|
// src/vectorize/create.tsx
|
198588
198583
|
init_import_meta_url();
|
198589
|
-
var
|
198590
|
-
var import_react15 = __toESM(require_react());
|
198584
|
+
var import_toml5 = __toESM(require_toml());
|
198591
198585
|
|
198592
198586
|
// src/vectorize/client.ts
|
198593
198587
|
init_import_meta_url();
|
@@ -198720,9 +198714,21 @@ async function handler25(args) {
|
|
198720
198714
|
return;
|
198721
198715
|
}
|
198722
198716
|
logger.log(
|
198723
|
-
|
198724
|
-
|
198725
|
-
|
198717
|
+
`\u2705 Successfully created a new Vectorize index: '${indexResult.name}'`
|
198718
|
+
);
|
198719
|
+
logger.log(
|
198720
|
+
`\u{1F4CB} To start querying from a Worker, add the following binding configuration into 'wrangler.toml':
|
198721
|
+
`
|
198722
|
+
);
|
198723
|
+
logger.log(
|
198724
|
+
(0, import_toml5.stringify)({
|
198725
|
+
vectorize: [
|
198726
|
+
{
|
198727
|
+
binding: "VECTORIZE_INDEX",
|
198728
|
+
index_name: indexResult.name
|
198729
|
+
}
|
198730
|
+
]
|
198731
|
+
})
|
198726
198732
|
);
|
198727
198733
|
}
|
198728
198734
|
__name(handler25, "handler");
|
@@ -199970,14 +199976,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
199970
199976
|
"workers/tag": props.tag
|
199971
199977
|
}
|
199972
199978
|
};
|
199973
|
-
|
199979
|
+
await printBundleSize(
|
199974
199980
|
{ name: import_node_path50.default.basename(resolvedEntryPointPath), content },
|
199975
199981
|
modules
|
199976
199982
|
);
|
199977
|
-
if (process.env.JEST_WORKER_ID !== void 0) {
|
199978
|
-
await bundleSizePromise;
|
199979
|
-
} else {
|
199980
|
-
}
|
199981
199983
|
const withoutStaticAssets = {
|
199982
199984
|
...bindings,
|
199983
199985
|
kv_namespaces: config.kv_namespaces,
|
@@ -200764,7 +200766,7 @@ function getRules(config) {
|
|
200764
200766
|
logger.warn(
|
200765
200767
|
`Deprecation: The \`build.upload.rules\` config field is no longer used, the rules should be specified via the \`rules\` config field. Delete the \`build.upload\` field from the configuration file, and add this:
|
200766
200768
|
|
200767
|
-
${
|
200769
|
+
${import_toml6.default.stringify({ rules: config.build.upload.rules })}`
|
200768
200770
|
);
|
200769
200771
|
}
|
200770
200772
|
return rules;
|
@@ -201319,7 +201321,7 @@ ${tryRunningItIn}${oneOfThese}`
|
|
201319
201321
|
throw e3;
|
201320
201322
|
} finally {
|
201321
201323
|
try {
|
201322
|
-
if (typeof
|
201324
|
+
if (typeof vitest === "undefined") {
|
201323
201325
|
process.disconnect?.();
|
201324
201326
|
}
|
201325
201327
|
await closeSentry();
|
@@ -201514,7 +201516,7 @@ The \`init\` command will be removed in a future version.`
|
|
201514
201516
|
try {
|
201515
201517
|
await (0, import_promises20.writeFile)(
|
201516
201518
|
wranglerTomlDestination,
|
201517
|
-
|
201519
|
+
import_toml7.default.stringify({
|
201518
201520
|
name: workerName,
|
201519
201521
|
compatibility_date: compatibilityDate
|
201520
201522
|
}) + "\n"
|
@@ -201671,7 +201673,7 @@ ${err.message ?? err}`
|
|
201671
201673
|
compatibility_date: parsedWranglerToml.compatibility_date,
|
201672
201674
|
...extraToml
|
201673
201675
|
};
|
201674
|
-
fs26.writeFileSync(wranglerTomlDestination,
|
201676
|
+
fs26.writeFileSync(wranglerTomlDestination, import_toml7.default.stringify(newToml));
|
201675
201677
|
}
|
201676
201678
|
const isNamedWorker = isCreatingWranglerToml && import_node_path52.default.dirname(packagePath) !== process.cwd();
|
201677
201679
|
const isAddingTestScripts = isAddingTests && !packageJsonContent.scripts?.test;
|
@@ -202460,7 +202462,7 @@ Author ID: ${deploymentDetails.metadata.author_id}
|
|
202460
202462
|
Usage Model: ${deploymentDetails.resources.script_runtime.usage_model}
|
202461
202463
|
Handlers: ${deploymentDetails.resources.script.handlers}${compatDateStr}${compatFlagsStr}
|
202462
202464
|
--------------------------bindings--------------------------
|
202463
|
-
${bindings.length > 0 ?
|
202465
|
+
${bindings.length > 0 ? import_toml8.default.stringify(mapBindings(bindings)) : `None`}
|
202464
202466
|
`;
|
202465
202467
|
logger.log(version3);
|
202466
202468
|
logVersionIdChange();
|
@@ -202917,14 +202919,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
202917
202919
|
tail_consumers: config.tail_consumers,
|
202918
202920
|
limits: config.limits
|
202919
202921
|
};
|
202920
|
-
|
202922
|
+
await printBundleSize(
|
202921
202923
|
{ name: import_node_path53.default.basename(resolvedEntryPointPath), content },
|
202922
202924
|
modules
|
202923
202925
|
);
|
202924
|
-
if (process.env.JEST_WORKER_ID !== void 0) {
|
202925
|
-
await bundleSizePromise;
|
202926
|
-
} else {
|
202927
|
-
}
|
202928
202926
|
const withoutStaticAssets = {
|
202929
202927
|
...bindings,
|
202930
202928
|
kv_namespaces: config.kv_namespaces,
|
@@ -203419,7 +203417,7 @@ var import_node_http22 = require("node:http2");
|
|
203419
203417
|
var import_node_https = __toESM(require("node:https"));
|
203420
203418
|
var import_http_terminator2 = __toESM(require_src5());
|
203421
203419
|
var import_miniflare13 = require("miniflare");
|
203422
|
-
var
|
203420
|
+
var import_react15 = __toESM(require_react());
|
203423
203421
|
var import_serve_static = __toESM(require_serve_static());
|
203424
203422
|
function addCfPreviewTokenHeader(headers, previewTokenValue) {
|
203425
203423
|
headers["cf-workers-preview-token"] = previewTokenValue;
|
@@ -203808,9 +203806,9 @@ __name(waitForPortToBeAvailable, "waitForPortToBeAvailable");
|
|
203808
203806
|
|
203809
203807
|
// src/dev/remote.tsx
|
203810
203808
|
function Remote(props) {
|
203811
|
-
const [accountId, setAccountId] = (0,
|
203812
|
-
const accountChoicesRef = (0,
|
203813
|
-
const [accountChoices, setAccountChoices] = (0,
|
203809
|
+
const [accountId, setAccountId] = (0, import_react16.useState)(props.accountId);
|
203810
|
+
const accountChoicesRef = (0, import_react16.useRef)();
|
203811
|
+
const [accountChoices, setAccountChoices] = (0, import_react16.useState)();
|
203814
203812
|
useWorker({
|
203815
203813
|
name: props.name,
|
203816
203814
|
bundle: props.bundle,
|
@@ -203832,7 +203830,7 @@ function Remote(props) {
|
|
203832
203830
|
port: props.port
|
203833
203831
|
});
|
203834
203832
|
const errorHandler = useErrorHandler();
|
203835
|
-
(0,
|
203833
|
+
(0, import_react16.useEffect)(() => {
|
203836
203834
|
if (accountChoicesRef.current !== void 0 || props.accountId !== void 0) {
|
203837
203835
|
return;
|
203838
203836
|
}
|
@@ -203854,7 +203852,7 @@ function Remote(props) {
|
|
203854
203852
|
}
|
203855
203853
|
);
|
203856
203854
|
});
|
203857
|
-
return accountId === void 0 && accountChoices !== void 0 ? /* @__PURE__ */
|
203855
|
+
return accountId === void 0 && accountChoices !== void 0 ? /* @__PURE__ */ import_react16.default.createElement(
|
203858
203856
|
ChooseAccount,
|
203859
203857
|
{
|
203860
203858
|
accounts: accountChoices,
|
@@ -203868,12 +203866,12 @@ function Remote(props) {
|
|
203868
203866
|
}
|
203869
203867
|
__name(Remote, "Remote");
|
203870
203868
|
function useWorker(props) {
|
203871
|
-
const [session, setSession] = (0,
|
203872
|
-
const [token, setToken] = (0,
|
203873
|
-
const [restartCounter, setRestartCounter] = (0,
|
203874
|
-
const startedRef = (0,
|
203869
|
+
const [session, setSession] = (0, import_react16.useState)();
|
203870
|
+
const [token, setToken] = (0, import_react16.useState)();
|
203871
|
+
const [restartCounter, setRestartCounter] = (0, import_react16.useState)(0);
|
203872
|
+
const startedRef = (0, import_react16.useRef)(false);
|
203875
203873
|
const { onReady } = props;
|
203876
|
-
(0,
|
203874
|
+
(0, import_react16.useEffect)(() => {
|
203877
203875
|
const abortController = new AbortController();
|
203878
203876
|
async function start() {
|
203879
203877
|
if (props.accountId === void 0) {
|
@@ -203929,7 +203927,7 @@ For more details, refer to https://developers.cloudflare.com/workers/configurati
|
|
203929
203927
|
props.sendMetrics,
|
203930
203928
|
restartCounter
|
203931
203929
|
]);
|
203932
|
-
(0,
|
203930
|
+
(0, import_react16.useEffect)(() => {
|
203933
203931
|
const abortController = new AbortController();
|
203934
203932
|
async function start() {
|
203935
203933
|
if (props.accountId === void 0) {
|
@@ -204276,7 +204274,7 @@ async function getWorkerAccountAndContext(props) {
|
|
204276
204274
|
}
|
204277
204275
|
__name(getWorkerAccountAndContext, "getWorkerAccountAndContext");
|
204278
204276
|
function ChooseAccount(props) {
|
204279
|
-
return /* @__PURE__ */
|
204277
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_ink10.Text, { bold: true }, "Select an account from below:"), /* @__PURE__ */ import_react16.default.createElement(
|
204280
204278
|
import_ink_select_input3.default,
|
204281
204279
|
{
|
204282
204280
|
items: props.accounts.map((item) => ({
|
@@ -204329,8 +204327,8 @@ init_import_meta_url();
|
|
204329
204327
|
var import_node_assert18 = __toESM(require("node:assert"));
|
204330
204328
|
var import_node_path55 = __toESM(require("node:path"));
|
204331
204329
|
var import_chokidar3 = require("chokidar");
|
204332
|
-
var
|
204333
|
-
var
|
204330
|
+
var import_ink11 = __toESM(require_build2());
|
204331
|
+
var import_react17 = __toESM(require_react());
|
204334
204332
|
function useEsbuild({
|
204335
204333
|
entry,
|
204336
204334
|
destination,
|
@@ -204359,9 +204357,9 @@ function useEsbuild({
|
|
204359
204357
|
onStart,
|
204360
204358
|
defineNavigatorUserAgent
|
204361
204359
|
}) {
|
204362
|
-
const [bundle, setBundle] = (0,
|
204363
|
-
const { exit: exit6 } = (0,
|
204364
|
-
(0,
|
204360
|
+
const [bundle, setBundle] = (0, import_react17.useState)();
|
204361
|
+
const { exit: exit6 } = (0, import_ink11.useApp)();
|
204362
|
+
(0, import_react17.useEffect)(() => {
|
204365
204363
|
let stopWatching = void 0;
|
204366
204364
|
const entryDirectory = import_node_path55.default.dirname(entry.file);
|
204367
204365
|
const moduleCollector = noBundle ? noopModuleCollector : createModuleCollector({
|
@@ -204554,9 +204552,9 @@ __name(validateDevProps, "validateDevProps");
|
|
204554
204552
|
|
204555
204553
|
// src/dev/dev.tsx
|
204556
204554
|
function useDevRegistry(name, services, durableObjects, mode) {
|
204557
|
-
const [workers, setWorkers] = (0,
|
204558
|
-
const hasFailedToFetch = (0,
|
204559
|
-
(0,
|
204555
|
+
const [workers, setWorkers] = (0, import_react18.useState)({});
|
204556
|
+
const hasFailedToFetch = (0, import_react18.useRef)(false);
|
204557
|
+
(0, import_react18.useEffect)(() => {
|
204560
204558
|
startWorkerRegistry().catch((err) => {
|
204561
204559
|
logger.error("failed to start worker registry", err);
|
204562
204560
|
});
|
@@ -204617,8 +204615,8 @@ function useDevRegistry(name, services, durableObjects, mode) {
|
|
204617
204615
|
__name(useDevRegistry, "useDevRegistry");
|
204618
204616
|
function DevImplementation(props) {
|
204619
204617
|
validateDevProps(props);
|
204620
|
-
const { isRawModeSupported } = (0,
|
204621
|
-
return props.showInteractiveDevSession ?? isRawModeSupported ? /* @__PURE__ */
|
204618
|
+
const { isRawModeSupported } = (0, import_ink12.useStdin)();
|
204619
|
+
return props.showInteractiveDevSession ?? isRawModeSupported ? /* @__PURE__ */ import_react18.default.createElement(InteractiveDevSession, { ...props }) : /* @__PURE__ */ import_react18.default.createElement(DevSession, { ...props, local: props.initialMode === "local" });
|
204622
204620
|
}
|
204623
204621
|
__name(DevImplementation, "DevImplementation");
|
204624
204622
|
var ip;
|
@@ -204651,17 +204649,17 @@ function InteractiveDevSession(props) {
|
|
204651
204649
|
port = newPort;
|
204652
204650
|
props.onReady?.(newIp, newPort, proxyData);
|
204653
204651
|
}, "onReady");
|
204654
|
-
return /* @__PURE__ */
|
204652
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(DevSession, { ...props, local: toggles.local, onReady }), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Box, { borderStyle: "round", paddingLeft: 1, paddingRight: 1 }, /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, { bold: true }, "[b]"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, " open a browser, "), props.inspect ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, { bold: true }, "[d]"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, " open Devtools, ")) : null, !props.forceLocal ? /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, { bold: true }, "[l]"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, " ", toggles.local ? "turn off" : "turn on", " local mode, ")) : null, /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, { bold: true }, "[c]"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, " clear console, "), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, { bold: true }, "[x]"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, " to exit")));
|
204655
204653
|
}
|
204656
204654
|
__name(InteractiveDevSession, "InteractiveDevSession");
|
204657
204655
|
function DevSession(props) {
|
204658
|
-
const [devEnv] = (0,
|
204659
|
-
(0,
|
204656
|
+
const [devEnv] = (0, import_react18.useState)(() => new DevEnv());
|
204657
|
+
(0, import_react18.useEffect)(() => {
|
204660
204658
|
return () => {
|
204661
204659
|
void devEnv.teardown();
|
204662
204660
|
};
|
204663
204661
|
}, [devEnv]);
|
204664
|
-
const startDevWorkerOptions = (0,
|
204662
|
+
const startDevWorkerOptions = (0, import_react18.useMemo)(
|
204665
204663
|
() => ({
|
204666
204664
|
name: props.name ?? "worker",
|
204667
204665
|
script: { contents: "" },
|
@@ -204695,16 +204693,16 @@ function DevSession(props) {
|
|
204695
204693
|
props.liveReload
|
204696
204694
|
]
|
204697
204695
|
);
|
204698
|
-
const onBundleStart = (0,
|
204696
|
+
const onBundleStart = (0, import_react18.useCallback)(() => {
|
204699
204697
|
devEnv.proxy.onBundleStart({
|
204700
204698
|
type: "bundleStart",
|
204701
204699
|
config: startDevWorkerOptions
|
204702
204700
|
});
|
204703
204701
|
}, [devEnv, startDevWorkerOptions]);
|
204704
|
-
const esbuildStartTimeoutRef = (0,
|
204705
|
-
const latestReloadCompleteEvent = (0,
|
204706
|
-
const bundle = (0,
|
204707
|
-
const onCustomBuildEnd = (0,
|
204702
|
+
const esbuildStartTimeoutRef = (0, import_react18.useRef)();
|
204703
|
+
const latestReloadCompleteEvent = (0, import_react18.useRef)();
|
204704
|
+
const bundle = (0, import_react18.useRef)();
|
204705
|
+
const onCustomBuildEnd = (0, import_react18.useCallback)(() => {
|
204708
204706
|
const TIMEOUT = 300;
|
204709
204707
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204710
204708
|
esbuildStartTimeoutRef.current = setTimeout(() => {
|
@@ -204716,11 +204714,11 @@ function DevSession(props) {
|
|
204716
204714
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204717
204715
|
};
|
204718
204716
|
}, [devEnv, latestReloadCompleteEvent]);
|
204719
|
-
const onEsbuildStart = (0,
|
204717
|
+
const onEsbuildStart = (0, import_react18.useCallback)(() => {
|
204720
204718
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204721
204719
|
onBundleStart();
|
204722
204720
|
}, [esbuildStartTimeoutRef, onBundleStart]);
|
204723
|
-
const onReloadStart = (0,
|
204721
|
+
const onReloadStart = (0, import_react18.useCallback)(
|
204724
204722
|
(esbuildBundle) => {
|
204725
204723
|
devEnv.proxy.onReloadStart({
|
204726
204724
|
type: "reloadStart",
|
@@ -204738,7 +204736,7 @@ function DevSession(props) {
|
|
204738
204736
|
props.bindings.durable_objects,
|
204739
204737
|
props.local ? "local" : "remote"
|
204740
204738
|
);
|
204741
|
-
(0,
|
204739
|
+
(0, import_react18.useEffect)(() => {
|
204742
204740
|
devEnv.proxy.onConfigUpdate({
|
204743
204741
|
type: "configUpdate",
|
204744
204742
|
config: startDevWorkerOptions
|
@@ -204778,7 +204776,7 @@ function DevSession(props) {
|
|
204778
204776
|
props.compatibilityFlags
|
204779
204777
|
)
|
204780
204778
|
});
|
204781
|
-
(0,
|
204779
|
+
(0, import_react18.useEffect)(() => {
|
204782
204780
|
if (bundle.current) {
|
204783
204781
|
onReloadStart(bundle.current);
|
204784
204782
|
}
|
@@ -204823,7 +204821,7 @@ function DevSession(props) {
|
|
204823
204821
|
props.onReady(finalIp, finalPort, proxyData);
|
204824
204822
|
}
|
204825
204823
|
}, "announceAndOnReady");
|
204826
|
-
return props.local ? /* @__PURE__ */
|
204824
|
+
return props.local ? /* @__PURE__ */ import_react18.default.createElement(
|
204827
204825
|
Local,
|
204828
204826
|
{
|
204829
204827
|
name: props.name,
|
@@ -204855,7 +204853,7 @@ function DevSession(props) {
|
|
204855
204853
|
sourceMapPath: bundle.current?.sourceMapPath,
|
204856
204854
|
services: props.bindings.services
|
204857
204855
|
}
|
204858
|
-
) : /* @__PURE__ */
|
204856
|
+
) : /* @__PURE__ */ import_react18.default.createElement(
|
204859
204857
|
Remote,
|
204860
204858
|
{
|
204861
204859
|
name: props.name,
|
@@ -204887,9 +204885,9 @@ function DevSession(props) {
|
|
204887
204885
|
}
|
204888
204886
|
__name(DevSession, "DevSession");
|
204889
204887
|
function useTmpDir(projectRoot) {
|
204890
|
-
const [directory, setDirectory] = (0,
|
204888
|
+
const [directory, setDirectory] = (0, import_react18.useState)();
|
204891
204889
|
const handleError = useErrorHandler();
|
204892
|
-
(0,
|
204890
|
+
(0, import_react18.useEffect)(() => {
|
204893
204891
|
let dir;
|
204894
204892
|
try {
|
204895
204893
|
dir = getWranglerTmpDir(projectRoot, "dev");
|
@@ -204907,7 +204905,7 @@ function useTmpDir(projectRoot) {
|
|
204907
204905
|
}
|
204908
204906
|
__name(useTmpDir, "useTmpDir");
|
204909
204907
|
function useCustomBuild(expectedEntry, build5, onStart, onEnd) {
|
204910
|
-
(0,
|
204908
|
+
(0, import_react18.useEffect)(() => {
|
204911
204909
|
if (!build5.command) {
|
204912
204910
|
return;
|
204913
204911
|
}
|
@@ -204955,9 +204953,9 @@ async function findTunnelHostname() {
|
|
204955
204953
|
}
|
204956
204954
|
__name(findTunnelHostname, "findTunnelHostname");
|
204957
204955
|
function useTunnel(toggle) {
|
204958
|
-
const tunnel = (0,
|
204959
|
-
const removeSignalExitListener = (0,
|
204960
|
-
(0,
|
204956
|
+
const tunnel = (0, import_react18.useRef)();
|
204957
|
+
const removeSignalExitListener = (0, import_react18.useRef)();
|
204958
|
+
(0, import_react18.useEffect)(() => {
|
204961
204959
|
async function startTunnel() {
|
204962
204960
|
if (toggle) {
|
204963
204961
|
try {
|
@@ -205009,9 +205007,9 @@ function useTunnel(toggle) {
|
|
205009
205007
|
__name(useTunnel, "useTunnel");
|
205010
205008
|
function useHotkeys(props) {
|
205011
205009
|
const { initial, inspectorPort, inspect: inspect2, localProtocol, forceLocal } = props;
|
205012
|
-
const [toggles, setToggles] = (0,
|
205013
|
-
const { exit: exit6 } = (0,
|
205014
|
-
(0,
|
205010
|
+
const [toggles, setToggles] = (0, import_react18.useState)(initial);
|
205011
|
+
const { exit: exit6 } = (0, import_ink12.useApp)();
|
205012
|
+
(0, import_ink12.useInput)(
|
205015
205013
|
async (input, key) => {
|
205016
205014
|
switch (input.toLowerCase()) {
|
205017
205015
|
case "c":
|
@@ -205065,9 +205063,9 @@ function useHotkeys(props) {
|
|
205065
205063
|
}
|
205066
205064
|
__name(useHotkeys, "useHotkeys");
|
205067
205065
|
function ErrorFallback(props) {
|
205068
|
-
const { exit: exit6 } = (0,
|
205069
|
-
(0,
|
205070
|
-
return /* @__PURE__ */
|
205066
|
+
const { exit: exit6 } = (0, import_ink12.useApp)();
|
205067
|
+
(0, import_react18.useEffect)(() => exit6(props.error));
|
205068
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, "Something went wrong:"), /* @__PURE__ */ import_react18.default.createElement(import_ink12.Text, null, props.error.stack));
|
205071
205069
|
}
|
205072
205070
|
__name(ErrorFallback, "ErrorFallback");
|
205073
205071
|
var dev_default = withErrorBoundary(DevImplementation, {
|
@@ -205727,7 +205725,7 @@ async function startDev(args) {
|
|
205727
205725
|
args,
|
205728
205726
|
configParam
|
205729
205727
|
);
|
205730
|
-
return /* @__PURE__ */
|
205728
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
205731
205729
|
dev_default,
|
205732
205730
|
{
|
205733
205731
|
name: getScriptName({ name: args.name, env: args.env }, configParam),
|
@@ -205787,7 +205785,7 @@ async function startDev(args) {
|
|
205787
205785
|
);
|
205788
205786
|
}
|
205789
205787
|
__name(getDevReactElement, "getDevReactElement");
|
205790
|
-
const devReactElement = (0,
|
205788
|
+
const devReactElement = (0, import_ink13.render)(await getDevReactElement(config));
|
205791
205789
|
rerender = devReactElement.rerender;
|
205792
205790
|
return {
|
205793
205791
|
devReactElement,
|
@@ -207437,18 +207435,23 @@ async function getBindingsProxy(options29 = {}) {
|
|
207437
207435
|
__name(getBindingsProxy, "getBindingsProxy");
|
207438
207436
|
|
207439
207437
|
// src/cli.ts
|
207440
|
-
if (typeof
|
207438
|
+
if (typeof vitest === "undefined" && require.main === module) {
|
207441
207439
|
main(hideBin(import_process6.default.argv)).catch((e3) => {
|
207442
207440
|
const exitCode = e3 instanceof FatalError && e3.code || 1;
|
207443
207441
|
import_process6.default.exit(exitCode);
|
207444
207442
|
});
|
207445
207443
|
}
|
207444
|
+
var generateASSETSBinding2 = (
|
207445
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
207446
|
+
(init_assets(), __toCommonJS(assets_exports)).default
|
207447
|
+
);
|
207446
207448
|
// Annotate the CommonJS export names for ESM import in node:
|
207447
207449
|
0 && (module.exports = {
|
207448
207450
|
getBindingsProxy,
|
207449
207451
|
getPlatformProxy,
|
207450
207452
|
unstable_DevEnv,
|
207451
207453
|
unstable_dev,
|
207454
|
+
unstable_generateASSETSBinding,
|
207452
207455
|
unstable_getMiniflareWorkerOptions,
|
207453
207456
|
unstable_pages,
|
207454
207457
|
unstable_splitSqlQuery,
|