wrangler 3.57.0 → 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 +12 -44
- 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 +266 -242
- 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) {
|
@@ -105878,8 +105878,9 @@ function constructRedirects({
|
|
105878
105878
|
redirects,
|
105879
105879
|
logger: logger3
|
105880
105880
|
}) {
|
105881
|
-
if (!redirects)
|
105881
|
+
if (!redirects) {
|
105882
105882
|
return {};
|
105883
|
+
}
|
105883
105884
|
const num_valid = redirects.rules.length;
|
105884
105885
|
const num_invalid = redirects.invalid.length;
|
105885
105886
|
logger3.log(
|
@@ -105930,8 +105931,9 @@ function constructHeaders({
|
|
105930
105931
|
headers,
|
105931
105932
|
logger: logger3
|
105932
105933
|
}) {
|
105933
|
-
if (!headers)
|
105934
|
+
if (!headers) {
|
105934
105935
|
return {};
|
105936
|
+
}
|
105935
105937
|
const num_valid = headers.rules.length;
|
105936
105938
|
const num_invalid = headers.invalid.length;
|
105937
105939
|
logger3.log(
|
@@ -105969,8 +105971,9 @@ function constructHeaders({
|
|
105969
105971
|
function constructWebAnalytics({
|
105970
105972
|
webAnalyticsToken
|
105971
105973
|
}) {
|
105972
|
-
if (!webAnalyticsToken)
|
105974
|
+
if (!webAnalyticsToken) {
|
105973
105975
|
return {};
|
105976
|
+
}
|
105974
105977
|
return {
|
105975
105978
|
analytics: {
|
105976
105979
|
version: ANALYTICS_VERSION,
|
@@ -106012,8 +106015,9 @@ var init_validateURL = __esm({
|
|
106012
106015
|
"../pages-shared/metadata-generator/validateURL.ts"() {
|
106013
106016
|
init_import_meta_url();
|
106014
106017
|
extractPathname = /* @__PURE__ */ __name((path67 = "/", includeSearch, includeHash) => {
|
106015
|
-
if (!path67.startsWith("/"))
|
106018
|
+
if (!path67.startsWith("/")) {
|
106016
106019
|
path67 = `/${path67}`;
|
106020
|
+
}
|
106017
106021
|
const url4 = new URL(`//${path67}`, "relative://");
|
106018
106022
|
return `${url4.pathname}${includeSearch ? url4.search : ""}${includeHash ? url4.hash : ""}`;
|
106019
106023
|
}, "extractPathname");
|
@@ -106023,11 +106027,12 @@ var init_validateURL = __esm({
|
|
106023
106027
|
validateUrl = /* @__PURE__ */ __name((token, onlyRelative = false, disallowPorts = false, includeSearch = false, includeHash = false) => {
|
106024
106028
|
const host = URL_REGEX.exec(token);
|
106025
106029
|
if (host && host.groups && host.groups.host) {
|
106026
|
-
if (onlyRelative)
|
106030
|
+
if (onlyRelative) {
|
106027
106031
|
return [
|
106028
106032
|
void 0,
|
106029
106033
|
`Only relative URLs are allowed. Skipping absolute URL ${token}.`
|
106030
106034
|
];
|
106035
|
+
}
|
106031
106036
|
if (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) {
|
106032
106037
|
return [
|
106033
106038
|
void 0,
|
@@ -106043,8 +106048,9 @@ var init_validateURL = __esm({
|
|
106043
106048
|
void 0
|
106044
106049
|
];
|
106045
106050
|
} else {
|
106046
|
-
if (!token.startsWith("/") && onlyRelative)
|
106051
|
+
if (!token.startsWith("/") && onlyRelative) {
|
106047
106052
|
token = `/${token}`;
|
106053
|
+
}
|
106048
106054
|
const path67 = PATH_REGEX.exec(token);
|
106049
106055
|
if (path67) {
|
106050
106056
|
try {
|
@@ -106071,8 +106077,9 @@ function parseHeaders(input) {
|
|
106071
106077
|
let rule = void 0;
|
106072
106078
|
for (let i = 0; i < lines.length; i++) {
|
106073
106079
|
const line = lines[i].trim();
|
106074
|
-
if (line.length === 0 || line.startsWith("#"))
|
106080
|
+
if (line.length === 0 || line.startsWith("#")) {
|
106075
106081
|
continue;
|
106082
|
+
}
|
106076
106083
|
if (line.length > MAX_LINE_LENGTH) {
|
106077
106084
|
invalid.push({
|
106078
106085
|
message: `Ignoring line ${i + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
|
@@ -106219,8 +106226,9 @@ function parseRedirects(input) {
|
|
106219
106226
|
let canCreateStaticRule = true;
|
106220
106227
|
for (let i = 0; i < lines.length; i++) {
|
106221
106228
|
const line = lines[i].trim();
|
106222
|
-
if (line.length === 0 || line.startsWith("#"))
|
106229
|
+
if (line.length === 0 || line.startsWith("#")) {
|
106223
106230
|
continue;
|
106231
|
+
}
|
106224
106232
|
if (line.length > MAX_LINE_LENGTH) {
|
106225
106233
|
invalid.push({
|
106226
106234
|
message: `Ignoring line ${i + 1} as it exceeds the maximum allowed length of ${MAX_LINE_LENGTH}.`
|
@@ -112168,7 +112176,7 @@ var require_util12 = __commonJS({
|
|
112168
112176
|
var { InvalidArgumentError } = require_errors2();
|
112169
112177
|
var { Blob: Blob6 } = require("buffer");
|
112170
112178
|
var nodeUtil = require("util");
|
112171
|
-
var { stringify } = require("querystring");
|
112179
|
+
var { stringify: stringify2 } = require("querystring");
|
112172
112180
|
var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2));
|
112173
112181
|
function nop() {
|
112174
112182
|
}
|
@@ -112185,7 +112193,7 @@ var require_util12 = __commonJS({
|
|
112185
112193
|
if (url4.includes("?") || url4.includes("#")) {
|
112186
112194
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
112187
112195
|
}
|
112188
|
-
const stringified =
|
112196
|
+
const stringified = stringify2(queryParams);
|
112189
112197
|
if (stringified) {
|
112190
112198
|
url4 += "?" + stringified;
|
112191
112199
|
}
|
@@ -125108,7 +125116,7 @@ var require_util17 = __commonJS({
|
|
125108
125116
|
}
|
125109
125117
|
}
|
125110
125118
|
__name(validateCookieMaxAge, "validateCookieMaxAge");
|
125111
|
-
function
|
125119
|
+
function stringify2(cookie) {
|
125112
125120
|
if (cookie.name.length === 0) {
|
125113
125121
|
return null;
|
125114
125122
|
}
|
@@ -125156,7 +125164,7 @@ var require_util17 = __commonJS({
|
|
125156
125164
|
}
|
125157
125165
|
return out.join("; ");
|
125158
125166
|
}
|
125159
|
-
__name(
|
125167
|
+
__name(stringify2, "stringify");
|
125160
125168
|
var kHeadersListNode;
|
125161
125169
|
function getHeadersList(headers) {
|
125162
125170
|
if (headers[kHeadersList]) {
|
@@ -125175,7 +125183,7 @@ var require_util17 = __commonJS({
|
|
125175
125183
|
__name(getHeadersList, "getHeadersList");
|
125176
125184
|
module3.exports = {
|
125177
125185
|
isCTLExcludingHtab,
|
125178
|
-
stringify,
|
125186
|
+
stringify: stringify2,
|
125179
125187
|
getHeadersList
|
125180
125188
|
};
|
125181
125189
|
}
|
@@ -125330,7 +125338,7 @@ var require_cookies2 = __commonJS({
|
|
125330
125338
|
"use strict";
|
125331
125339
|
init_import_meta_url();
|
125332
125340
|
var { parseSetCookie } = require_parse7();
|
125333
|
-
var { stringify, getHeadersList } = require_util17();
|
125341
|
+
var { stringify: stringify2, getHeadersList } = require_util17();
|
125334
125342
|
var { webidl } = require_webidl2();
|
125335
125343
|
var { Headers: Headers5 } = require_headers2();
|
125336
125344
|
function getCookies(headers) {
|
@@ -125375,9 +125383,9 @@ var require_cookies2 = __commonJS({
|
|
125375
125383
|
webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" });
|
125376
125384
|
webidl.brandCheck(headers, Headers5, { strict: false });
|
125377
125385
|
cookie = webidl.converters.Cookie(cookie);
|
125378
|
-
const str =
|
125386
|
+
const str = stringify2(cookie);
|
125379
125387
|
if (str) {
|
125380
|
-
headers.append("Set-Cookie",
|
125388
|
+
headers.append("Set-Cookie", stringify2(cookie));
|
125381
125389
|
}
|
125382
125390
|
}
|
125383
125391
|
__name(setCookie, "setCookie");
|
@@ -133930,9 +133938,9 @@ var require_stringify3 = __commonJS({
|
|
133930
133938
|
"../../node_modules/.pnpm/@iarna+toml@2.2.5/node_modules/@iarna/toml/stringify.js"(exports2, module3) {
|
133931
133939
|
"use strict";
|
133932
133940
|
init_import_meta_url();
|
133933
|
-
module3.exports =
|
133941
|
+
module3.exports = stringify2;
|
133934
133942
|
module3.exports.value = stringifyInline;
|
133935
|
-
function
|
133943
|
+
function stringify2(obj) {
|
133936
133944
|
if (obj === null)
|
133937
133945
|
throw typeError("null");
|
133938
133946
|
if (obj === void 0)
|
@@ -133948,7 +133956,7 @@ var require_stringify3 = __commonJS({
|
|
133948
133956
|
throw typeError(type);
|
133949
133957
|
return stringifyObject("", "", obj);
|
133950
133958
|
}
|
133951
|
-
__name(
|
133959
|
+
__name(stringify2, "stringify");
|
133952
133960
|
function typeError(type) {
|
133953
133961
|
return new Error("Can only stringify objects, not " + type);
|
133954
133962
|
}
|
@@ -139347,8 +139355,9 @@ var init_rulesEngine = __esm({
|
|
139347
139355
|
return str;
|
139348
139356
|
}, "replacer");
|
139349
139357
|
generateRulesMatcher = /* @__PURE__ */ __name((rules, replacerFn = (match) => match) => {
|
139350
|
-
if (!rules)
|
139358
|
+
if (!rules) {
|
139351
139359
|
return () => [];
|
139360
|
+
}
|
139352
139361
|
const compiledRules = Object.entries(rules).map(([rule, match]) => {
|
139353
139362
|
const crossHost = rule.startsWith("https://");
|
139354
139363
|
rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
|
@@ -139574,38 +139583,44 @@ async function generateHandler({
|
|
139574
139583
|
const earlyHintsLinkHeader = earlyHintsResponse.headers.get("Link");
|
139575
139584
|
if (earlyHintsLinkHeader) {
|
139576
139585
|
headers.set("Link", earlyHintsLinkHeader);
|
139577
|
-
if (setMetrics)
|
139586
|
+
if (setMetrics) {
|
139578
139587
|
setMetrics({ earlyHintsResult: "used-hit" });
|
139588
|
+
}
|
139579
139589
|
} else {
|
139580
|
-
if (setMetrics)
|
139590
|
+
if (setMetrics) {
|
139581
139591
|
setMetrics({ earlyHintsResult: "notused-hit" });
|
139592
|
+
}
|
139582
139593
|
}
|
139583
139594
|
} else {
|
139584
|
-
if (setMetrics)
|
139595
|
+
if (setMetrics) {
|
139585
139596
|
setMetrics({ earlyHintsResult: "notused-miss" });
|
139597
|
+
}
|
139586
139598
|
const clonedResponse = response.clone();
|
139587
139599
|
if (waitUntil) {
|
139588
139600
|
waitUntil(
|
139589
139601
|
(async () => {
|
139590
139602
|
try {
|
139591
139603
|
const links = [];
|
139592
|
-
const transformedResponse = new HTMLRewriter().on(
|
139593
|
-
|
139594
|
-
|
139595
|
-
|
139596
|
-
|
139597
|
-
|
139598
|
-
|
139604
|
+
const transformedResponse = new HTMLRewriter().on(
|
139605
|
+
"link[rel~=preconnect],link[rel~=preload],link[rel~=modulepreload]",
|
139606
|
+
{
|
139607
|
+
element(element) {
|
139608
|
+
for (const [attributeName] of element.attributes) {
|
139609
|
+
if (!ALLOWED_EARLY_HINT_LINK_ATTRIBUTES.includes(
|
139610
|
+
attributeName.toLowerCase()
|
139611
|
+
)) {
|
139612
|
+
return;
|
139613
|
+
}
|
139614
|
+
}
|
139615
|
+
const href = element.getAttribute("href") || void 0;
|
139616
|
+
const rel = element.getAttribute("rel") || void 0;
|
139617
|
+
const as = element.getAttribute("as") || void 0;
|
139618
|
+
if (href && !href.startsWith("data:") && rel) {
|
139619
|
+
links.push({ href, rel, as });
|
139599
139620
|
}
|
139600
|
-
}
|
139601
|
-
const href = element.getAttribute("href") || void 0;
|
139602
|
-
const rel = element.getAttribute("rel") || void 0;
|
139603
|
-
const as = element.getAttribute("as") || void 0;
|
139604
|
-
if (href && !href.startsWith("data:") && rel) {
|
139605
|
-
links.push({ href, rel, as });
|
139606
139621
|
}
|
139607
139622
|
}
|
139608
|
-
|
139623
|
+
).transform(clonedResponse);
|
139609
139624
|
await transformedResponse.text();
|
139610
139625
|
links.forEach(({ href, rel, as }) => {
|
139611
139626
|
let link = `<${href}>; rel="${rel}"`;
|
@@ -139634,8 +139649,9 @@ async function generateHandler({
|
|
139634
139649
|
}
|
139635
139650
|
}
|
139636
139651
|
} else {
|
139637
|
-
if (setMetrics)
|
139652
|
+
if (setMetrics) {
|
139638
139653
|
setMetrics({ earlyHintsResult: "disabled" });
|
139654
|
+
}
|
139639
139655
|
}
|
139640
139656
|
const headersMatcher = generateRulesMatcher(
|
139641
139657
|
headerRules,
|
@@ -139679,7 +139695,14 @@ async function generateHandler({
|
|
139679
139695
|
if (responseWithoutHeaders.status >= 500) {
|
139680
139696
|
return responseWithoutHeaders;
|
139681
139697
|
}
|
139682
|
-
|
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;
|
139683
139706
|
async function serveAsset(servingAssetEntry, options29 = { preserve: true }) {
|
139684
139707
|
let content;
|
139685
139708
|
try {
|
@@ -139822,8 +139845,9 @@ async function generateHandler({
|
|
139822
139845
|
logError(err);
|
139823
139846
|
}
|
139824
139847
|
} else {
|
139825
|
-
if (setMetrics)
|
139848
|
+
if (setMetrics) {
|
139826
139849
|
setMetrics({ preservationCacheResult: "disabled" });
|
139850
|
+
}
|
139827
139851
|
}
|
139828
139852
|
let cwd2 = pathname;
|
139829
139853
|
while (cwd2) {
|
@@ -139874,13 +139898,15 @@ function isPreview(url4) {
|
|
139874
139898
|
}
|
139875
139899
|
function isPreservationCacheResponseExpiring(response) {
|
139876
139900
|
const ageHeader = response.headers.get("age");
|
139877
|
-
if (!ageHeader)
|
139901
|
+
if (!ageHeader) {
|
139878
139902
|
return false;
|
139903
|
+
}
|
139879
139904
|
try {
|
139880
139905
|
const age = parseInt(ageHeader);
|
139881
139906
|
const jitter = Math.floor(Math.random() * 43200);
|
139882
|
-
if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter)
|
139907
|
+
if (age > CACHE_PRESERVATION_WRITE_FREQUENCY + jitter) {
|
139883
139908
|
return true;
|
139909
|
+
}
|
139884
139910
|
} catch {
|
139885
139911
|
return false;
|
139886
139912
|
}
|
@@ -141060,10 +141086,10 @@ var require_Indicator = __commonJS({
|
|
141060
141086
|
"use strict";
|
141061
141087
|
init_import_meta_url();
|
141062
141088
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141063
|
-
var
|
141089
|
+
var React18 = require_react();
|
141064
141090
|
var ink_1 = require_build2();
|
141065
141091
|
var figures = require_figures3();
|
141066
|
-
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");
|
141067
141093
|
exports2.default = Indicator;
|
141068
141094
|
}
|
141069
141095
|
});
|
@@ -141074,9 +141100,9 @@ var require_Item = __commonJS({
|
|
141074
141100
|
"use strict";
|
141075
141101
|
init_import_meta_url();
|
141076
141102
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141077
|
-
var
|
141103
|
+
var React18 = require_react();
|
141078
141104
|
var ink_1 = require_build2();
|
141079
|
-
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");
|
141080
141106
|
exports2.default = Item;
|
141081
141107
|
}
|
141082
141108
|
});
|
@@ -141087,7 +141113,7 @@ var require_SelectInput = __commonJS({
|
|
141087
141113
|
"use strict";
|
141088
141114
|
init_import_meta_url();
|
141089
141115
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
141090
|
-
var
|
141116
|
+
var React18 = require_react();
|
141091
141117
|
var react_1 = require_react();
|
141092
141118
|
var isEqual = require_lodash2();
|
141093
141119
|
var arrayRotate = require_arr_rotate();
|
@@ -141149,14 +141175,14 @@ var require_SelectInput = __commonJS({
|
|
141149
141175
|
onHighlight
|
141150
141176
|
]), { isActive: isFocused });
|
141151
141177
|
const slicedItems = hasLimit ? arrayRotate(items, rotateIndex).slice(0, limit) : items;
|
141152
|
-
return
|
141178
|
+
return React18.createElement(ink_1.Box, { flexDirection: "column" }, slicedItems.map((item, index) => {
|
141153
141179
|
var _a2;
|
141154
141180
|
const isSelected = index === selectedIndex;
|
141155
|
-
return
|
141181
|
+
return React18.createElement(
|
141156
141182
|
ink_1.Box,
|
141157
141183
|
{ key: (_a2 = item.key) !== null && _a2 !== void 0 ? _a2 : item.value },
|
141158
|
-
|
141159
|
-
|
141184
|
+
React18.createElement(indicatorComponent, { isSelected }),
|
141185
|
+
React18.createElement(itemComponent, { ...item, isSelected })
|
141160
141186
|
);
|
141161
141187
|
}));
|
141162
141188
|
}
|
@@ -144024,7 +144050,7 @@ var require_build4 = __commonJS({
|
|
144024
144050
|
"use strict";
|
144025
144051
|
init_import_meta_url();
|
144026
144052
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
144027
|
-
var
|
144053
|
+
var React18 = require_react();
|
144028
144054
|
var react_1 = require_react();
|
144029
144055
|
var ink_1 = require_build2();
|
144030
144056
|
var spinners = require_cli_spinners();
|
@@ -144042,7 +144068,7 @@ var require_build4 = __commonJS({
|
|
144042
144068
|
clearInterval(timer);
|
144043
144069
|
};
|
144044
144070
|
}, [spinner2]);
|
144045
|
-
return
|
144071
|
+
return React18.createElement(ink_1.Text, null, spinner2.frames[frame]);
|
144046
144072
|
}, "Spinner");
|
144047
144073
|
exports2.default = Spinner2;
|
144048
144074
|
}
|
@@ -150150,6 +150176,7 @@ __export(cli_exports2, {
|
|
150150
150176
|
getPlatformProxy: () => getPlatformProxy,
|
150151
150177
|
unstable_DevEnv: () => DevEnv,
|
150152
150178
|
unstable_dev: () => unstable_dev,
|
150179
|
+
unstable_generateASSETSBinding: () => generateASSETSBinding2,
|
150153
150180
|
unstable_getMiniflareWorkerOptions: () => unstable_getMiniflareWorkerOptions,
|
150154
150181
|
unstable_pages: () => unstable_pages,
|
150155
150182
|
unstable_splitSqlQuery: () => splitSqlQuery,
|
@@ -152006,8 +152033,8 @@ async function getPorts(options29) {
|
|
152006
152033
|
__name(getPorts, "getPorts");
|
152007
152034
|
|
152008
152035
|
// src/dev.tsx
|
152009
|
-
var
|
152010
|
-
var
|
152036
|
+
var import_ink13 = __toESM(require_build2());
|
152037
|
+
var import_react19 = __toESM(require_react());
|
152011
152038
|
|
152012
152039
|
// src/config/index.ts
|
152013
152040
|
init_import_meta_url();
|
@@ -152579,7 +152606,7 @@ var Logger = class {
|
|
152579
152606
|
}
|
152580
152607
|
doLog(messageLevel, args) {
|
152581
152608
|
const message = this.formatMessage(messageLevel, (0, import_node_util.format)(...args));
|
152582
|
-
const inUnitTests = typeof
|
152609
|
+
const inUnitTests = typeof vitest !== "undefined";
|
152583
152610
|
if (!inUnitTests) {
|
152584
152611
|
void appendToDebugLogFile(messageLevel, message);
|
152585
152612
|
}
|
@@ -152627,7 +152654,7 @@ init_import_meta_url();
|
|
152627
152654
|
init_import_meta_url();
|
152628
152655
|
|
152629
152656
|
// package.json
|
152630
|
-
var version = "3.57.
|
152657
|
+
var version = "3.57.2";
|
152631
152658
|
var package_default = {
|
152632
152659
|
name: "wrangler",
|
152633
152660
|
version,
|
@@ -152677,7 +152704,6 @@ var package_default = {
|
|
152677
152704
|
"wrangler-dist",
|
152678
152705
|
"templates",
|
152679
152706
|
"kv-asset-handler.js",
|
152680
|
-
"Cloudflare_CA.pem",
|
152681
152707
|
"config-schema.json"
|
152682
152708
|
],
|
152683
152709
|
scripts: {
|
@@ -152692,41 +152718,13 @@ var package_default = {
|
|
152692
152718
|
"generate-json-schema": "pnpm exec ts-json-schema-generator --no-type-check --path src/config/config.ts --type RawConfig --out config-schema.json",
|
152693
152719
|
prepublishOnly: "SOURCEMAPS=false pnpm run -w build",
|
152694
152720
|
start: "pnpm run bundle && cross-env NODE_OPTIONS=--enable-source-maps ./bin/wrangler.js",
|
152695
|
-
test: "pnpm run assert-git-version &&
|
152696
|
-
"test:ci": "pnpm run test",
|
152721
|
+
test: "pnpm run assert-git-version && vitest",
|
152722
|
+
"test:ci": "pnpm run test run",
|
152697
152723
|
"test:debug": "pnpm run test --silent=false --verbose=true",
|
152698
152724
|
"test:e2e": "vitest -c ./e2e/vitest.config.ts",
|
152699
152725
|
"test:watch": "pnpm run test --testTimeout=50000 --watch",
|
152700
152726
|
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
|
152701
152727
|
},
|
152702
|
-
jest: {
|
152703
|
-
moduleNameMapper: {
|
152704
|
-
clipboardy: "<rootDir>/src/__tests__/helpers/clipboardy-mock.js",
|
152705
|
-
"miniflare/cli": "<rootDir>/../../node_modules/miniflare/dist/src/cli.js"
|
152706
|
-
},
|
152707
|
-
restoreMocks: true,
|
152708
|
-
setupFilesAfterEnv: [
|
152709
|
-
"<rootDir>/src/__tests__/jest.setup.ts"
|
152710
|
-
],
|
152711
|
-
testRegex: "src/__tests__/.*\\.(test|spec)\\.[jt]sx?$",
|
152712
|
-
testTimeout: 5e4,
|
152713
|
-
transform: {
|
152714
|
-
"^.+\\.c?(t|j)sx?$": [
|
152715
|
-
"esbuild-jest",
|
152716
|
-
{
|
152717
|
-
sourcemap: true
|
152718
|
-
}
|
152719
|
-
]
|
152720
|
-
},
|
152721
|
-
transformIgnorePatterns: [
|
152722
|
-
"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)"
|
152723
|
-
],
|
152724
|
-
snapshotFormat: {
|
152725
|
-
escapeString: true,
|
152726
|
-
printBasicPrototype: true
|
152727
|
-
},
|
152728
|
-
prettierPath: null
|
152729
|
-
},
|
152730
152728
|
dependencies: {
|
152731
152729
|
"@cloudflare/kv-asset-handler": "workspace:*",
|
152732
152730
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
@@ -152749,7 +152747,7 @@ var package_default = {
|
|
152749
152747
|
"@cloudflare/pages-shared": "workspace:^",
|
152750
152748
|
"@cloudflare/types": "^6.18.4",
|
152751
152749
|
"@cloudflare/workers-tsconfig": "workspace:*",
|
152752
|
-
"@cloudflare/workers-types": "^4.
|
152750
|
+
"@cloudflare/workers-types": "^4.20240524.0",
|
152753
152751
|
"@cspotcode/source-map-support": "0.8.1",
|
152754
152752
|
"@iarna/toml": "^3.0.0",
|
152755
152753
|
"@microsoft/api-extractor": "^7.28.3",
|
@@ -152762,7 +152760,6 @@ var package_default = {
|
|
152762
152760
|
"@types/glob-to-regexp": "0.4.1",
|
152763
152761
|
"@types/is-ci": "^3.0.0",
|
152764
152762
|
"@types/javascript-time-ago": "^2.0.3",
|
152765
|
-
"@types/jest": "^29.5.5",
|
152766
152763
|
"@types/mime": "^2.0.3",
|
152767
152764
|
"@types/minimatch": "^5.1.2",
|
152768
152765
|
"@types/prompts": "^2.0.14",
|
@@ -152786,7 +152783,6 @@ var package_default = {
|
|
152786
152783
|
"devtools-protocol": "^0.0.955664",
|
152787
152784
|
dotenv: "^16.0.0",
|
152788
152785
|
"es-module-lexer": "^1.3.0",
|
152789
|
-
"esbuild-jest": "0.5.0",
|
152790
152786
|
execa: "^6.1.0",
|
152791
152787
|
express: "^4.18.1",
|
152792
152788
|
"find-up": "^6.3.0",
|
@@ -152801,13 +152797,11 @@ var package_default = {
|
|
152801
152797
|
"ink-table": "^3.0.0",
|
152802
152798
|
"is-ci": "^3.0.1",
|
152803
152799
|
"javascript-time-ago": "^2.5.4",
|
152804
|
-
jest: "^29.7.0",
|
152805
|
-
"jest-fetch-mock": "^3.0.3",
|
152806
|
-
"jest-websocket-mock": "^2.5.0",
|
152807
152800
|
"md5-file": "5.0.0",
|
152808
152801
|
mime: "^3.0.0",
|
152809
152802
|
minimatch: "^5.1.0",
|
152810
|
-
|
152803
|
+
"mock-socket": "^9.3.1",
|
152804
|
+
msw: "^2.3.0",
|
152811
152805
|
open: "^8.4.0",
|
152812
152806
|
"p-queue": "^7.2.0",
|
152813
152807
|
"patch-console": "^1.0.0",
|
@@ -152829,6 +152823,7 @@ var package_default = {
|
|
152829
152823
|
undici: "5.28.4",
|
152830
152824
|
"update-check": "^1.5.4",
|
152831
152825
|
vitest: "^1.6.0",
|
152826
|
+
"vitest-websocket-mock": "^0.3.0",
|
152832
152827
|
ws: "^8.5.0",
|
152833
152828
|
"xdg-app-paths": "^8.3.0",
|
152834
152829
|
yargs: "^17.7.2",
|
@@ -152838,7 +152833,7 @@ var package_default = {
|
|
152838
152833
|
fsevents: "~2.3.2"
|
152839
152834
|
},
|
152840
152835
|
peerDependencies: {
|
152841
|
-
"@cloudflare/workers-types": "^4.
|
152836
|
+
"@cloudflare/workers-types": "^4.20240524.0"
|
152842
152837
|
},
|
152843
152838
|
peerDependenciesMeta: {
|
152844
152839
|
"@cloudflare/workers-types": {
|
@@ -153966,6 +153961,7 @@ var ParseError = class extends UserError {
|
|
153966
153961
|
__name(ParseError, "ParseError");
|
153967
153962
|
var APIError = class extends ParseError {
|
153968
153963
|
#status;
|
153964
|
+
code;
|
153969
153965
|
constructor({ status: status2, ...rest }) {
|
153970
153966
|
super(rest);
|
153971
153967
|
this.name = this.constructor.name;
|
@@ -155566,6 +155562,9 @@ function hasMorePages(result_info) {
|
|
155566
155562
|
}
|
155567
155563
|
__name(hasMorePages, "hasMorePages");
|
155568
155564
|
function throwFetchError(resource, response) {
|
155565
|
+
if (typeof vitest !== "undefined" && !("errors" in response)) {
|
155566
|
+
throw response;
|
155567
|
+
}
|
155569
155568
|
for (const error3 of response.errors) {
|
155570
155569
|
maybeThrowFriendlyError(error3);
|
155571
155570
|
}
|
@@ -159239,20 +159238,20 @@ async function applyMiddlewareLoaderFacade(entry, tmpDirPath, middleware) {
|
|
159239
159238
|
)}";`
|
159240
159239
|
)
|
159241
159240
|
).join("\n");
|
159242
|
-
const middlewareFns = middlewareIdentifiers.map(([m2]) => `${m2}.default`);
|
159241
|
+
const middlewareFns = middlewareIdentifiers.map(([m2]) => `${m2}.default`).join(",");
|
159243
159242
|
if (entry.format === "modules") {
|
159244
159243
|
await fs6.promises.writeFile(
|
159245
159244
|
dynamicFacadePath,
|
159246
159245
|
dedent`
|
159247
159246
|
import worker, * as OTHER_EXPORTS from "${prepareFilePath(entry.file)}";
|
159248
159247
|
${imports}
|
159249
|
-
|
159250
|
-
worker.middleware = [
|
159251
|
-
${middlewareFns.join(",")},
|
159252
|
-
...(worker.middleware ?? []),
|
159253
|
-
].filter(Boolean);
|
159254
|
-
|
159248
|
+
|
159255
159249
|
export * from "${prepareFilePath(entry.file)}";
|
159250
|
+
|
159251
|
+
export const __INTERNAL_WRANGLER_MIDDLEWARE__ = [
|
159252
|
+
...(OTHER_EXPORTS.__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__ ?? []),
|
159253
|
+
${middlewareFns}
|
159254
|
+
]
|
159256
159255
|
export default worker;
|
159257
159256
|
`
|
159258
159257
|
);
|
@@ -160737,8 +160736,8 @@ var clipboardy_default = clipboard5;
|
|
160737
160736
|
|
160738
160737
|
// src/dev/dev.tsx
|
160739
160738
|
var import_command_exists2 = __toESM(require_command_exists2());
|
160740
|
-
var
|
160741
|
-
var
|
160739
|
+
var import_ink12 = __toESM(require_build2());
|
160740
|
+
var import_react18 = __toESM(require_react());
|
160742
160741
|
|
160743
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
|
160744
160743
|
init_import_meta_url();
|
@@ -162322,6 +162321,9 @@ function handleRuntimeStdio(stdout2, stderr2) {
|
|
162322
162321
|
},
|
162323
162322
|
isWarning(chunk) {
|
162324
162323
|
return /\.c\+\+:\d+: warning:/.test(chunk);
|
162324
|
+
},
|
162325
|
+
isCodeMovedWarning(chunk) {
|
162326
|
+
return /CODE_MOVED for unknown code block/.test(chunk);
|
162325
162327
|
}
|
162326
162328
|
};
|
162327
162329
|
stdout2.on("data", (chunk) => {
|
@@ -162348,6 +162350,7 @@ function handleRuntimeStdio(stdout2, stderr2) {
|
|
162348
162350
|
logger.debug(chunk);
|
162349
162351
|
} else if (classifiers.isWarning(chunk)) {
|
162350
162352
|
logger.warn(chunk);
|
162353
|
+
} else if (classifiers.isCodeMovedWarning(chunk)) {
|
162351
162354
|
} else {
|
162352
162355
|
logger.error(getSourceMappedString(chunk));
|
162353
162356
|
}
|
@@ -162508,8 +162511,8 @@ async function localPropsToConfigBundle(props) {
|
|
162508
162511
|
(0, import_node_assert10.default)(props.bundle !== void 0);
|
162509
162512
|
const serviceBindings = {};
|
162510
162513
|
if (props.enablePagesAssetsServiceBinding !== void 0) {
|
162511
|
-
const
|
162512
|
-
serviceBindings.ASSETS = await
|
162514
|
+
const generateASSETSBinding3 = (init_assets(), __toCommonJS(assets_exports)).default;
|
162515
|
+
serviceBindings.ASSETS = await generateASSETSBinding3({
|
162513
162516
|
log: logger,
|
162514
162517
|
...props.enablePagesAssetsServiceBinding
|
162515
162518
|
});
|
@@ -162677,9 +162680,9 @@ __name(useLocalWorker, "useLocalWorker");
|
|
162677
162680
|
// src/dev/remote.tsx
|
162678
162681
|
init_import_meta_url();
|
162679
162682
|
var import_node_path54 = __toESM(require("node:path"));
|
162680
|
-
var
|
162683
|
+
var import_ink10 = __toESM(require_build2());
|
162681
162684
|
var import_ink_select_input3 = __toESM(require_build3());
|
162682
|
-
var
|
162685
|
+
var import_react16 = __toESM(require_react());
|
162683
162686
|
|
162684
162687
|
// src/deploy/deploy.ts
|
162685
162688
|
init_import_meta_url();
|
@@ -163224,7 +163227,7 @@ __name(stripPrefix, "stripPrefix");
|
|
163224
163227
|
// src/deployments.ts
|
163225
163228
|
init_import_meta_url();
|
163226
163229
|
var import_url8 = require("url");
|
163227
|
-
var
|
163230
|
+
var import_toml8 = __toESM(require_toml());
|
163228
163231
|
var import_chalk19 = __toESM(require_chalk());
|
163229
163232
|
var import_undici23 = __toESM(require_undici());
|
163230
163233
|
|
@@ -163233,7 +163236,7 @@ init_import_meta_url();
|
|
163233
163236
|
var fs26 = __toESM(require("node:fs"));
|
163234
163237
|
var import_promises20 = require("node:fs/promises");
|
163235
163238
|
var import_node_path52 = __toESM(require("node:path"));
|
163236
|
-
var
|
163239
|
+
var import_toml7 = __toESM(require_toml());
|
163237
163240
|
init_execa();
|
163238
163241
|
|
163239
163242
|
// src/git-client.ts
|
@@ -163555,7 +163558,7 @@ __name(parse6, "parse");
|
|
163555
163558
|
init_import_meta_url();
|
163556
163559
|
var import_node_module3 = __toESM(require("node:module"));
|
163557
163560
|
var import_node_os8 = __toESM(require("node:os"));
|
163558
|
-
var
|
163561
|
+
var import_toml6 = __toESM(require_toml());
|
163559
163562
|
var import_chalk18 = __toESM(require_chalk());
|
163560
163563
|
var import_undici22 = __toESM(require_undici());
|
163561
163564
|
|
@@ -175227,7 +175230,8 @@ function prettyBytes(number, options29) {
|
|
175227
175230
|
__name(prettyBytes, "prettyBytes");
|
175228
175231
|
|
175229
175232
|
// src/d1/formatTimeAgo.ts
|
175230
|
-
TimeAgo.
|
175233
|
+
TimeAgo.addLocale(en_json_default);
|
175234
|
+
TimeAgo.setDefaultLocale("en");
|
175231
175235
|
var timeAgo = new TimeAgo("en-US");
|
175232
175236
|
var formatTimeAgo = /* @__PURE__ */ __name((date) => {
|
175233
175237
|
const result = timeAgo.format(date);
|
@@ -182634,6 +182638,9 @@ var upload = /* @__PURE__ */ __name(async (args) => {
|
|
182634
182638
|
);
|
182635
182639
|
}, "upload");
|
182636
182640
|
function isJwtExpired(token) {
|
182641
|
+
if (typeof vitest !== "undefined" && (token === "<<funfetti-auth-jwt>>" || token === "<<funfetti-auth-jwt2>>")) {
|
182642
|
+
return false;
|
182643
|
+
}
|
182637
182644
|
try {
|
182638
182645
|
const decodedJwt = JSON.parse(
|
182639
182646
|
Buffer.from(token.split(".")[1], "base64").toString()
|
@@ -183543,9 +183550,12 @@ To silence this warning, pass in --commit-dirty=true`
|
|
183543
183550
|
const logs = await fetchResult(
|
183544
183551
|
`/accounts/${accountId}/pages/projects/${projectName}/deployments/${deploymentResponse.id}/history/logs?size=10000000`
|
183545
183552
|
);
|
183546
|
-
const failureMessage = logs.data[logs.total - 1].line;
|
183547
|
-
|
183548
|
-
|
183553
|
+
const failureMessage = logs.data[logs.total - 1].line.replace("Error:", "").trim();
|
183554
|
+
throw new FatalError(
|
183555
|
+
`Deployment failed!
|
183556
|
+
${failureMessage}`,
|
183557
|
+
1
|
183558
|
+
);
|
183549
183559
|
} else {
|
183550
183560
|
logger.log(
|
183551
183561
|
`\u2728 Deployment complete! However, we couldn't ascertain the final status of your deployment.
|
@@ -186639,7 +186649,7 @@ function createBody2(args) {
|
|
186639
186649
|
settings: {
|
186640
186650
|
batch_size: args.batchSize,
|
186641
186651
|
max_retries: args.messageRetries,
|
186642
|
-
max_wait_time_ms: args.batchTimeout ? 1e3 * args.batchTimeout : void 0,
|
186652
|
+
max_wait_time_ms: args.batchTimeout !== void 0 ? 1e3 * args.batchTimeout : void 0,
|
186643
186653
|
max_concurrency: args.maxConcurrency,
|
186644
186654
|
retry_delay: args.retryDelaySecs
|
186645
186655
|
},
|
@@ -188061,6 +188071,7 @@ init_import_meta_url();
|
|
188061
188071
|
var import_node_path49 = __toESM(require("node:path"));
|
188062
188072
|
var import_node_readline3 = __toESM(require("node:readline"));
|
188063
188073
|
var import_undici17 = __toESM(require_undici());
|
188074
|
+
var VERSION_NOT_DEPLOYED_ERR_CODE = 10215;
|
188064
188075
|
function isMissingWorkerError(e3) {
|
188065
188076
|
return typeof e3 === "object" && e3 !== null && e3.code === 10007;
|
188066
188077
|
}
|
@@ -188167,15 +188178,25 @@ var secret2 = /* @__PURE__ */ __name((secretYargs) => {
|
|
188167
188178
|
);
|
188168
188179
|
async function submitSecret() {
|
188169
188180
|
const url4 = !args.env || isLegacyEnv(config) ? `/accounts/${accountId}/workers/scripts/${scriptName}/secrets` : `/accounts/${accountId}/workers/services/${scriptName}/environments/${args.env}/secrets`;
|
188170
|
-
|
188171
|
-
|
188172
|
-
|
188173
|
-
|
188174
|
-
|
188175
|
-
|
188176
|
-
|
188177
|
-
|
188178
|
-
|
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
|
+
}
|
188179
188200
|
}
|
188180
188201
|
__name(submitSecret, "submitSecret");
|
188181
188202
|
try {
|
@@ -198560,8 +198581,7 @@ var vectorizeBetaWarning = `--------------------
|
|
198560
198581
|
|
198561
198582
|
// src/vectorize/create.tsx
|
198562
198583
|
init_import_meta_url();
|
198563
|
-
var
|
198564
|
-
var import_react15 = __toESM(require_react());
|
198584
|
+
var import_toml5 = __toESM(require_toml());
|
198565
198585
|
|
198566
198586
|
// src/vectorize/client.ts
|
198567
198587
|
init_import_meta_url();
|
@@ -198694,9 +198714,21 @@ async function handler25(args) {
|
|
198694
198714
|
return;
|
198695
198715
|
}
|
198696
198716
|
logger.log(
|
198697
|
-
|
198698
|
-
|
198699
|
-
|
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
|
+
})
|
198700
198732
|
);
|
198701
198733
|
}
|
198702
198734
|
__name(handler25, "handler");
|
@@ -199944,14 +199976,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
199944
199976
|
"workers/tag": props.tag
|
199945
199977
|
}
|
199946
199978
|
};
|
199947
|
-
|
199979
|
+
await printBundleSize(
|
199948
199980
|
{ name: import_node_path50.default.basename(resolvedEntryPointPath), content },
|
199949
199981
|
modules
|
199950
199982
|
);
|
199951
|
-
if (process.env.JEST_WORKER_ID !== void 0) {
|
199952
|
-
await bundleSizePromise;
|
199953
|
-
} else {
|
199954
|
-
}
|
199955
199983
|
const withoutStaticAssets = {
|
199956
199984
|
...bindings,
|
199957
199985
|
kv_namespaces: config.kv_namespaces,
|
@@ -200738,7 +200766,7 @@ function getRules(config) {
|
|
200738
200766
|
logger.warn(
|
200739
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:
|
200740
200768
|
|
200741
|
-
${
|
200769
|
+
${import_toml6.default.stringify({ rules: config.build.upload.rules })}`
|
200742
200770
|
);
|
200743
200771
|
}
|
200744
200772
|
return rules;
|
@@ -201293,7 +201321,7 @@ ${tryRunningItIn}${oneOfThese}`
|
|
201293
201321
|
throw e3;
|
201294
201322
|
} finally {
|
201295
201323
|
try {
|
201296
|
-
if (typeof
|
201324
|
+
if (typeof vitest === "undefined") {
|
201297
201325
|
process.disconnect?.();
|
201298
201326
|
}
|
201299
201327
|
await closeSentry();
|
@@ -201488,7 +201516,7 @@ The \`init\` command will be removed in a future version.`
|
|
201488
201516
|
try {
|
201489
201517
|
await (0, import_promises20.writeFile)(
|
201490
201518
|
wranglerTomlDestination,
|
201491
|
-
|
201519
|
+
import_toml7.default.stringify({
|
201492
201520
|
name: workerName,
|
201493
201521
|
compatibility_date: compatibilityDate
|
201494
201522
|
}) + "\n"
|
@@ -201645,7 +201673,7 @@ ${err.message ?? err}`
|
|
201645
201673
|
compatibility_date: parsedWranglerToml.compatibility_date,
|
201646
201674
|
...extraToml
|
201647
201675
|
};
|
201648
|
-
fs26.writeFileSync(wranglerTomlDestination,
|
201676
|
+
fs26.writeFileSync(wranglerTomlDestination, import_toml7.default.stringify(newToml));
|
201649
201677
|
}
|
201650
201678
|
const isNamedWorker = isCreatingWranglerToml && import_node_path52.default.dirname(packagePath) !== process.cwd();
|
201651
201679
|
const isAddingTestScripts = isAddingTests && !packageJsonContent.scripts?.test;
|
@@ -202434,7 +202462,7 @@ Author ID: ${deploymentDetails.metadata.author_id}
|
|
202434
202462
|
Usage Model: ${deploymentDetails.resources.script_runtime.usage_model}
|
202435
202463
|
Handlers: ${deploymentDetails.resources.script.handlers}${compatDateStr}${compatFlagsStr}
|
202436
202464
|
--------------------------bindings--------------------------
|
202437
|
-
${bindings.length > 0 ?
|
202465
|
+
${bindings.length > 0 ? import_toml8.default.stringify(mapBindings(bindings)) : `None`}
|
202438
202466
|
`;
|
202439
202467
|
logger.log(version3);
|
202440
202468
|
logVersionIdChange();
|
@@ -202891,14 +202919,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
202891
202919
|
tail_consumers: config.tail_consumers,
|
202892
202920
|
limits: config.limits
|
202893
202921
|
};
|
202894
|
-
|
202922
|
+
await printBundleSize(
|
202895
202923
|
{ name: import_node_path53.default.basename(resolvedEntryPointPath), content },
|
202896
202924
|
modules
|
202897
202925
|
);
|
202898
|
-
if (process.env.JEST_WORKER_ID !== void 0) {
|
202899
|
-
await bundleSizePromise;
|
202900
|
-
} else {
|
202901
|
-
}
|
202902
202926
|
const withoutStaticAssets = {
|
202903
202927
|
...bindings,
|
202904
202928
|
kv_namespaces: config.kv_namespaces,
|
@@ -203197,7 +203221,7 @@ async function updateQueueConsumers(config) {
|
|
203197
203221
|
settings: {
|
203198
203222
|
batch_size: consumer.max_batch_size,
|
203199
203223
|
max_retries: consumer.max_retries,
|
203200
|
-
max_wait_time_ms: consumer.max_batch_timeout ? 1e3 * consumer.max_batch_timeout : void 0,
|
203224
|
+
max_wait_time_ms: consumer.max_batch_timeout !== void 0 ? 1e3 * consumer.max_batch_timeout : void 0,
|
203201
203225
|
max_concurrency: consumer.max_concurrency,
|
203202
203226
|
retry_delay: consumer.retry_delay
|
203203
203227
|
}
|
@@ -203393,7 +203417,7 @@ var import_node_http22 = require("node:http2");
|
|
203393
203417
|
var import_node_https = __toESM(require("node:https"));
|
203394
203418
|
var import_http_terminator2 = __toESM(require_src5());
|
203395
203419
|
var import_miniflare13 = require("miniflare");
|
203396
|
-
var
|
203420
|
+
var import_react15 = __toESM(require_react());
|
203397
203421
|
var import_serve_static = __toESM(require_serve_static());
|
203398
203422
|
function addCfPreviewTokenHeader(headers, previewTokenValue) {
|
203399
203423
|
headers["cf-workers-preview-token"] = previewTokenValue;
|
@@ -203782,9 +203806,9 @@ __name(waitForPortToBeAvailable, "waitForPortToBeAvailable");
|
|
203782
203806
|
|
203783
203807
|
// src/dev/remote.tsx
|
203784
203808
|
function Remote(props) {
|
203785
|
-
const [accountId, setAccountId] = (0,
|
203786
|
-
const accountChoicesRef = (0,
|
203787
|
-
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)();
|
203788
203812
|
useWorker({
|
203789
203813
|
name: props.name,
|
203790
203814
|
bundle: props.bundle,
|
@@ -203806,7 +203830,7 @@ function Remote(props) {
|
|
203806
203830
|
port: props.port
|
203807
203831
|
});
|
203808
203832
|
const errorHandler = useErrorHandler();
|
203809
|
-
(0,
|
203833
|
+
(0, import_react16.useEffect)(() => {
|
203810
203834
|
if (accountChoicesRef.current !== void 0 || props.accountId !== void 0) {
|
203811
203835
|
return;
|
203812
203836
|
}
|
@@ -203828,7 +203852,7 @@ function Remote(props) {
|
|
203828
203852
|
}
|
203829
203853
|
);
|
203830
203854
|
});
|
203831
|
-
return accountId === void 0 && accountChoices !== void 0 ? /* @__PURE__ */
|
203855
|
+
return accountId === void 0 && accountChoices !== void 0 ? /* @__PURE__ */ import_react16.default.createElement(
|
203832
203856
|
ChooseAccount,
|
203833
203857
|
{
|
203834
203858
|
accounts: accountChoices,
|
@@ -203842,12 +203866,12 @@ function Remote(props) {
|
|
203842
203866
|
}
|
203843
203867
|
__name(Remote, "Remote");
|
203844
203868
|
function useWorker(props) {
|
203845
|
-
const [session, setSession] = (0,
|
203846
|
-
const [token, setToken] = (0,
|
203847
|
-
const [restartCounter, setRestartCounter] = (0,
|
203848
|
-
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);
|
203849
203873
|
const { onReady } = props;
|
203850
|
-
(0,
|
203874
|
+
(0, import_react16.useEffect)(() => {
|
203851
203875
|
const abortController = new AbortController();
|
203852
203876
|
async function start() {
|
203853
203877
|
if (props.accountId === void 0) {
|
@@ -203903,7 +203927,7 @@ For more details, refer to https://developers.cloudflare.com/workers/configurati
|
|
203903
203927
|
props.sendMetrics,
|
203904
203928
|
restartCounter
|
203905
203929
|
]);
|
203906
|
-
(0,
|
203930
|
+
(0, import_react16.useEffect)(() => {
|
203907
203931
|
const abortController = new AbortController();
|
203908
203932
|
async function start() {
|
203909
203933
|
if (props.accountId === void 0) {
|
@@ -204250,7 +204274,7 @@ async function getWorkerAccountAndContext(props) {
|
|
204250
204274
|
}
|
204251
204275
|
__name(getWorkerAccountAndContext, "getWorkerAccountAndContext");
|
204252
204276
|
function ChooseAccount(props) {
|
204253
|
-
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(
|
204254
204278
|
import_ink_select_input3.default,
|
204255
204279
|
{
|
204256
204280
|
items: props.accounts.map((item) => ({
|
@@ -204303,8 +204327,8 @@ init_import_meta_url();
|
|
204303
204327
|
var import_node_assert18 = __toESM(require("node:assert"));
|
204304
204328
|
var import_node_path55 = __toESM(require("node:path"));
|
204305
204329
|
var import_chokidar3 = require("chokidar");
|
204306
|
-
var
|
204307
|
-
var
|
204330
|
+
var import_ink11 = __toESM(require_build2());
|
204331
|
+
var import_react17 = __toESM(require_react());
|
204308
204332
|
function useEsbuild({
|
204309
204333
|
entry,
|
204310
204334
|
destination,
|
@@ -204333,9 +204357,9 @@ function useEsbuild({
|
|
204333
204357
|
onStart,
|
204334
204358
|
defineNavigatorUserAgent
|
204335
204359
|
}) {
|
204336
|
-
const [bundle, setBundle] = (0,
|
204337
|
-
const { exit: exit6 } = (0,
|
204338
|
-
(0,
|
204360
|
+
const [bundle, setBundle] = (0, import_react17.useState)();
|
204361
|
+
const { exit: exit6 } = (0, import_ink11.useApp)();
|
204362
|
+
(0, import_react17.useEffect)(() => {
|
204339
204363
|
let stopWatching = void 0;
|
204340
204364
|
const entryDirectory = import_node_path55.default.dirname(entry.file);
|
204341
204365
|
const moduleCollector = noBundle ? noopModuleCollector : createModuleCollector({
|
@@ -204528,9 +204552,9 @@ __name(validateDevProps, "validateDevProps");
|
|
204528
204552
|
|
204529
204553
|
// src/dev/dev.tsx
|
204530
204554
|
function useDevRegistry(name, services, durableObjects, mode) {
|
204531
|
-
const [workers, setWorkers] = (0,
|
204532
|
-
const hasFailedToFetch = (0,
|
204533
|
-
(0,
|
204555
|
+
const [workers, setWorkers] = (0, import_react18.useState)({});
|
204556
|
+
const hasFailedToFetch = (0, import_react18.useRef)(false);
|
204557
|
+
(0, import_react18.useEffect)(() => {
|
204534
204558
|
startWorkerRegistry().catch((err) => {
|
204535
204559
|
logger.error("failed to start worker registry", err);
|
204536
204560
|
});
|
@@ -204591,8 +204615,8 @@ function useDevRegistry(name, services, durableObjects, mode) {
|
|
204591
204615
|
__name(useDevRegistry, "useDevRegistry");
|
204592
204616
|
function DevImplementation(props) {
|
204593
204617
|
validateDevProps(props);
|
204594
|
-
const { isRawModeSupported } = (0,
|
204595
|
-
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" });
|
204596
204620
|
}
|
204597
204621
|
__name(DevImplementation, "DevImplementation");
|
204598
204622
|
var ip;
|
@@ -204625,17 +204649,17 @@ function InteractiveDevSession(props) {
|
|
204625
204649
|
port = newPort;
|
204626
204650
|
props.onReady?.(newIp, newPort, proxyData);
|
204627
204651
|
}, "onReady");
|
204628
|
-
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")));
|
204629
204653
|
}
|
204630
204654
|
__name(InteractiveDevSession, "InteractiveDevSession");
|
204631
204655
|
function DevSession(props) {
|
204632
|
-
const [devEnv] = (0,
|
204633
|
-
(0,
|
204656
|
+
const [devEnv] = (0, import_react18.useState)(() => new DevEnv());
|
204657
|
+
(0, import_react18.useEffect)(() => {
|
204634
204658
|
return () => {
|
204635
204659
|
void devEnv.teardown();
|
204636
204660
|
};
|
204637
204661
|
}, [devEnv]);
|
204638
|
-
const startDevWorkerOptions = (0,
|
204662
|
+
const startDevWorkerOptions = (0, import_react18.useMemo)(
|
204639
204663
|
() => ({
|
204640
204664
|
name: props.name ?? "worker",
|
204641
204665
|
script: { contents: "" },
|
@@ -204669,16 +204693,16 @@ function DevSession(props) {
|
|
204669
204693
|
props.liveReload
|
204670
204694
|
]
|
204671
204695
|
);
|
204672
|
-
const onBundleStart = (0,
|
204696
|
+
const onBundleStart = (0, import_react18.useCallback)(() => {
|
204673
204697
|
devEnv.proxy.onBundleStart({
|
204674
204698
|
type: "bundleStart",
|
204675
204699
|
config: startDevWorkerOptions
|
204676
204700
|
});
|
204677
204701
|
}, [devEnv, startDevWorkerOptions]);
|
204678
|
-
const esbuildStartTimeoutRef = (0,
|
204679
|
-
const latestReloadCompleteEvent = (0,
|
204680
|
-
const bundle = (0,
|
204681
|
-
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)(() => {
|
204682
204706
|
const TIMEOUT = 300;
|
204683
204707
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204684
204708
|
esbuildStartTimeoutRef.current = setTimeout(() => {
|
@@ -204690,11 +204714,11 @@ function DevSession(props) {
|
|
204690
204714
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204691
204715
|
};
|
204692
204716
|
}, [devEnv, latestReloadCompleteEvent]);
|
204693
|
-
const onEsbuildStart = (0,
|
204717
|
+
const onEsbuildStart = (0, import_react18.useCallback)(() => {
|
204694
204718
|
clearTimeout(esbuildStartTimeoutRef.current);
|
204695
204719
|
onBundleStart();
|
204696
204720
|
}, [esbuildStartTimeoutRef, onBundleStart]);
|
204697
|
-
const onReloadStart = (0,
|
204721
|
+
const onReloadStart = (0, import_react18.useCallback)(
|
204698
204722
|
(esbuildBundle) => {
|
204699
204723
|
devEnv.proxy.onReloadStart({
|
204700
204724
|
type: "reloadStart",
|
@@ -204712,7 +204736,7 @@ function DevSession(props) {
|
|
204712
204736
|
props.bindings.durable_objects,
|
204713
204737
|
props.local ? "local" : "remote"
|
204714
204738
|
);
|
204715
|
-
(0,
|
204739
|
+
(0, import_react18.useEffect)(() => {
|
204716
204740
|
devEnv.proxy.onConfigUpdate({
|
204717
204741
|
type: "configUpdate",
|
204718
204742
|
config: startDevWorkerOptions
|
@@ -204752,7 +204776,7 @@ function DevSession(props) {
|
|
204752
204776
|
props.compatibilityFlags
|
204753
204777
|
)
|
204754
204778
|
});
|
204755
|
-
(0,
|
204779
|
+
(0, import_react18.useEffect)(() => {
|
204756
204780
|
if (bundle.current) {
|
204757
204781
|
onReloadStart(bundle.current);
|
204758
204782
|
}
|
@@ -204762,11 +204786,6 @@ function DevSession(props) {
|
|
204762
204786
|
"Queues are currently in Beta and are not supported in wrangler dev remote mode."
|
204763
204787
|
);
|
204764
204788
|
}
|
204765
|
-
if (props.local && props.bindings.hyperdrive?.length) {
|
204766
|
-
logger.warn(
|
204767
|
-
"Hyperdrive does not currently support 'wrangler dev' in local mode at this stage of the beta. Use the '--remote' flag to test a Hyperdrive configuration before deploying."
|
204768
|
-
);
|
204769
|
-
}
|
204770
204789
|
const announceAndOnReady = /* @__PURE__ */ __name(async (finalIp, finalPort, proxyData) => {
|
204771
204790
|
const { proxyWorker } = await devEnv.proxy.ready.promise;
|
204772
204791
|
const url4 = await proxyWorker.ready;
|
@@ -204802,7 +204821,7 @@ function DevSession(props) {
|
|
204802
204821
|
props.onReady(finalIp, finalPort, proxyData);
|
204803
204822
|
}
|
204804
204823
|
}, "announceAndOnReady");
|
204805
|
-
return props.local ? /* @__PURE__ */
|
204824
|
+
return props.local ? /* @__PURE__ */ import_react18.default.createElement(
|
204806
204825
|
Local,
|
204807
204826
|
{
|
204808
204827
|
name: props.name,
|
@@ -204834,7 +204853,7 @@ function DevSession(props) {
|
|
204834
204853
|
sourceMapPath: bundle.current?.sourceMapPath,
|
204835
204854
|
services: props.bindings.services
|
204836
204855
|
}
|
204837
|
-
) : /* @__PURE__ */
|
204856
|
+
) : /* @__PURE__ */ import_react18.default.createElement(
|
204838
204857
|
Remote,
|
204839
204858
|
{
|
204840
204859
|
name: props.name,
|
@@ -204866,9 +204885,9 @@ function DevSession(props) {
|
|
204866
204885
|
}
|
204867
204886
|
__name(DevSession, "DevSession");
|
204868
204887
|
function useTmpDir(projectRoot) {
|
204869
|
-
const [directory, setDirectory] = (0,
|
204888
|
+
const [directory, setDirectory] = (0, import_react18.useState)();
|
204870
204889
|
const handleError = useErrorHandler();
|
204871
|
-
(0,
|
204890
|
+
(0, import_react18.useEffect)(() => {
|
204872
204891
|
let dir;
|
204873
204892
|
try {
|
204874
204893
|
dir = getWranglerTmpDir(projectRoot, "dev");
|
@@ -204886,7 +204905,7 @@ function useTmpDir(projectRoot) {
|
|
204886
204905
|
}
|
204887
204906
|
__name(useTmpDir, "useTmpDir");
|
204888
204907
|
function useCustomBuild(expectedEntry, build5, onStart, onEnd) {
|
204889
|
-
(0,
|
204908
|
+
(0, import_react18.useEffect)(() => {
|
204890
204909
|
if (!build5.command) {
|
204891
204910
|
return;
|
204892
204911
|
}
|
@@ -204934,9 +204953,9 @@ async function findTunnelHostname() {
|
|
204934
204953
|
}
|
204935
204954
|
__name(findTunnelHostname, "findTunnelHostname");
|
204936
204955
|
function useTunnel(toggle) {
|
204937
|
-
const tunnel = (0,
|
204938
|
-
const removeSignalExitListener = (0,
|
204939
|
-
(0,
|
204956
|
+
const tunnel = (0, import_react18.useRef)();
|
204957
|
+
const removeSignalExitListener = (0, import_react18.useRef)();
|
204958
|
+
(0, import_react18.useEffect)(() => {
|
204940
204959
|
async function startTunnel() {
|
204941
204960
|
if (toggle) {
|
204942
204961
|
try {
|
@@ -204988,9 +205007,9 @@ function useTunnel(toggle) {
|
|
204988
205007
|
__name(useTunnel, "useTunnel");
|
204989
205008
|
function useHotkeys(props) {
|
204990
205009
|
const { initial, inspectorPort, inspect: inspect2, localProtocol, forceLocal } = props;
|
204991
|
-
const [toggles, setToggles] = (0,
|
204992
|
-
const { exit: exit6 } = (0,
|
204993
|
-
(0,
|
205010
|
+
const [toggles, setToggles] = (0, import_react18.useState)(initial);
|
205011
|
+
const { exit: exit6 } = (0, import_ink12.useApp)();
|
205012
|
+
(0, import_ink12.useInput)(
|
204994
205013
|
async (input, key) => {
|
204995
205014
|
switch (input.toLowerCase()) {
|
204996
205015
|
case "c":
|
@@ -205044,9 +205063,9 @@ function useHotkeys(props) {
|
|
205044
205063
|
}
|
205045
205064
|
__name(useHotkeys, "useHotkeys");
|
205046
205065
|
function ErrorFallback(props) {
|
205047
|
-
const { exit: exit6 } = (0,
|
205048
|
-
(0,
|
205049
|
-
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));
|
205050
205069
|
}
|
205051
205070
|
__name(ErrorFallback, "ErrorFallback");
|
205052
205071
|
var dev_default = withErrorBoundary(DevImplementation, {
|
@@ -205706,7 +205725,7 @@ async function startDev(args) {
|
|
205706
205725
|
args,
|
205707
205726
|
configParam
|
205708
205727
|
);
|
205709
|
-
return /* @__PURE__ */
|
205728
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
205710
205729
|
dev_default,
|
205711
205730
|
{
|
205712
205731
|
name: getScriptName({ name: args.name, env: args.env }, configParam),
|
@@ -205766,7 +205785,7 @@ async function startDev(args) {
|
|
205766
205785
|
);
|
205767
205786
|
}
|
205768
205787
|
__name(getDevReactElement, "getDevReactElement");
|
205769
|
-
const devReactElement = (0,
|
205788
|
+
const devReactElement = (0, import_ink13.render)(await getDevReactElement(config));
|
205770
205789
|
rerender = devReactElement.rerender;
|
205771
205790
|
return {
|
205772
205791
|
devReactElement,
|
@@ -207416,18 +207435,23 @@ async function getBindingsProxy(options29 = {}) {
|
|
207416
207435
|
__name(getBindingsProxy, "getBindingsProxy");
|
207417
207436
|
|
207418
207437
|
// src/cli.ts
|
207419
|
-
if (typeof
|
207438
|
+
if (typeof vitest === "undefined" && require.main === module) {
|
207420
207439
|
main(hideBin(import_process6.default.argv)).catch((e3) => {
|
207421
207440
|
const exitCode = e3 instanceof FatalError && e3.code || 1;
|
207422
207441
|
import_process6.default.exit(exitCode);
|
207423
207442
|
});
|
207424
207443
|
}
|
207444
|
+
var generateASSETSBinding2 = (
|
207445
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
207446
|
+
(init_assets(), __toCommonJS(assets_exports)).default
|
207447
|
+
);
|
207425
207448
|
// Annotate the CommonJS export names for ESM import in node:
|
207426
207449
|
0 && (module.exports = {
|
207427
207450
|
getBindingsProxy,
|
207428
207451
|
getPlatformProxy,
|
207429
207452
|
unstable_DevEnv,
|
207430
207453
|
unstable_dev,
|
207454
|
+
unstable_generateASSETSBinding,
|
207431
207455
|
unstable_getMiniflareWorkerOptions,
|
207432
207456
|
unstable_pages,
|
207433
207457
|
unstable_splitSqlQuery,
|