wrangler 2.12.0 → 2.12.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/miniflare-dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/__tests__/d1/execute.test.ts +1 -1
- package/src/__tests__/init.test.ts +1 -1
- package/src/__tests__/middleware.test.ts +2 -1
- package/src/__tests__/pages/functions-build.test.ts +44 -45
- package/src/__tests__/pages/publish.test.ts +136 -61
- package/src/__tests__/publish.test.ts +48 -7
- package/src/__tests__/tsconfig.tsbuildinfo +1 -1
- package/src/__tests__/user.test.ts +1 -1
- package/src/api/dev.ts +0 -1
- package/src/api/pages/publish.tsx +31 -51
- package/src/bundle.ts +4 -0
- package/src/dev/dev.tsx +0 -2
- package/src/dev/local.tsx +4 -15
- package/src/dev/start-server.ts +1 -4
- package/src/dev.tsx +0 -3
- package/src/miniflare-cli/index.ts +1 -1
- package/src/miniflare-cli/tsconfig.tsbuildinfo +1 -1
- package/src/pages/build.ts +262 -104
- package/src/pages/buildFunctions.ts +13 -6
- package/src/pages/dev.ts +4 -15
- package/src/pages/errors.ts +1 -0
- package/src/pages/functions/buildPlugin.ts +48 -33
- package/src/pages/functions/buildWorker.ts +20 -17
- package/src/pages/functions/tsconfig.tsbuildinfo +1 -1
- package/src/pages/publish.tsx +1 -10
- package/src/user/user.ts +1 -1
- package/templates/gitignore +1 -0
- package/templates/tsconfig.init.json +1 -2
- package/wrangler-dist/cli.d.ts +1 -9
- package/wrangler-dist/cli.js +528 -423
package/wrangler-dist/cli.js
CHANGED
|
@@ -22133,10 +22133,10 @@ var require_lodash = __commonJS({
|
|
|
22133
22133
|
}
|
|
22134
22134
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
22135
22135
|
});
|
|
22136
|
-
function
|
|
22136
|
+
function join12(array, separator) {
|
|
22137
22137
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
22138
22138
|
}
|
|
22139
|
-
__name(
|
|
22139
|
+
__name(join12, "join");
|
|
22140
22140
|
function last(array) {
|
|
22141
22141
|
var length = array == null ? 0 : array.length;
|
|
22142
22142
|
return length ? array[length - 1] : undefined2;
|
|
@@ -24259,7 +24259,7 @@ var require_lodash = __commonJS({
|
|
|
24259
24259
|
lodash.isUndefined = isUndefined;
|
|
24260
24260
|
lodash.isWeakMap = isWeakMap;
|
|
24261
24261
|
lodash.isWeakSet = isWeakSet;
|
|
24262
|
-
lodash.join =
|
|
24262
|
+
lodash.join = join12;
|
|
24263
24263
|
lodash.kebabCase = kebabCase;
|
|
24264
24264
|
lodash.last = last;
|
|
24265
24265
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -36449,7 +36449,7 @@ var require_extension = __commonJS({
|
|
|
36449
36449
|
dest[name].push(elem);
|
|
36450
36450
|
}
|
|
36451
36451
|
__name(push, "push");
|
|
36452
|
-
function
|
|
36452
|
+
function parse5(header) {
|
|
36453
36453
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
36454
36454
|
if (header === void 0 || header === "")
|
|
36455
36455
|
return offers;
|
|
@@ -36588,7 +36588,7 @@ var require_extension = __commonJS({
|
|
|
36588
36588
|
}
|
|
36589
36589
|
return offers;
|
|
36590
36590
|
}
|
|
36591
|
-
__name(
|
|
36591
|
+
__name(parse5, "parse");
|
|
36592
36592
|
function format8(extensions) {
|
|
36593
36593
|
return Object.keys(extensions).map((extension) => {
|
|
36594
36594
|
let configurations = extensions[extension];
|
|
@@ -36607,7 +36607,7 @@ var require_extension = __commonJS({
|
|
|
36607
36607
|
}).join(", ");
|
|
36608
36608
|
}
|
|
36609
36609
|
__name(format8, "format");
|
|
36610
|
-
module2.exports = { format: format8, parse:
|
|
36610
|
+
module2.exports = { format: format8, parse: parse5 };
|
|
36611
36611
|
}
|
|
36612
36612
|
});
|
|
36613
36613
|
|
|
@@ -36636,7 +36636,7 @@ var require_websocket2 = __commonJS({
|
|
|
36636
36636
|
NOOP
|
|
36637
36637
|
} = require_constants5();
|
|
36638
36638
|
var { addEventListener, removeEventListener } = require_event_target();
|
|
36639
|
-
var { format: format8, parse:
|
|
36639
|
+
var { format: format8, parse: parse5 } = require_extension();
|
|
36640
36640
|
var { toBuffer } = require_buffer_util();
|
|
36641
36641
|
var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
|
|
36642
36642
|
var protocolVersions = [8, 13];
|
|
@@ -37094,7 +37094,7 @@ var require_websocket2 = __commonJS({
|
|
|
37094
37094
|
}
|
|
37095
37095
|
let extensions;
|
|
37096
37096
|
try {
|
|
37097
|
-
extensions =
|
|
37097
|
+
extensions = parse5(secWebSocketExtensions);
|
|
37098
37098
|
} catch (err) {
|
|
37099
37099
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
37100
37100
|
abortHandshake(websocket, socket, message);
|
|
@@ -37414,7 +37414,7 @@ var require_websocket_server = __commonJS({
|
|
|
37414
37414
|
var { createHash } = require("crypto");
|
|
37415
37415
|
var PerMessageDeflate = require_permessage_deflate();
|
|
37416
37416
|
var WebSocket2 = require_websocket2();
|
|
37417
|
-
var { format: format8, parse:
|
|
37417
|
+
var { format: format8, parse: parse5 } = require_extension();
|
|
37418
37418
|
var { GUID, kWebSocket } = require_constants5();
|
|
37419
37419
|
var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
37420
37420
|
var RUNNING = 0;
|
|
@@ -37534,7 +37534,7 @@ var require_websocket_server = __commonJS({
|
|
|
37534
37534
|
this.options.maxPayload
|
|
37535
37535
|
);
|
|
37536
37536
|
try {
|
|
37537
|
-
const offers =
|
|
37537
|
+
const offers = parse5(req.headers["sec-websocket-extensions"]);
|
|
37538
37538
|
if (offers[PerMessageDeflate.extensionName]) {
|
|
37539
37539
|
perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);
|
|
37540
37540
|
extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
|
|
@@ -39911,8 +39911,8 @@ var require_backend = __commonJS({
|
|
|
39911
39911
|
re[i] = new RegExp(src[i]);
|
|
39912
39912
|
}
|
|
39913
39913
|
}
|
|
39914
|
-
exports3.parse =
|
|
39915
|
-
function
|
|
39914
|
+
exports3.parse = parse5;
|
|
39915
|
+
function parse5(version2, options6) {
|
|
39916
39916
|
if (!options6 || _typeof7(options6) !== "object") {
|
|
39917
39917
|
options6 = {
|
|
39918
39918
|
loose: !!options6,
|
|
@@ -39938,16 +39938,16 @@ var require_backend = __commonJS({
|
|
|
39938
39938
|
return null;
|
|
39939
39939
|
}
|
|
39940
39940
|
}
|
|
39941
|
-
__name(
|
|
39941
|
+
__name(parse5, "parse");
|
|
39942
39942
|
exports3.valid = valid;
|
|
39943
39943
|
function valid(version2, options6) {
|
|
39944
|
-
var v =
|
|
39944
|
+
var v = parse5(version2, options6);
|
|
39945
39945
|
return v ? v.version : null;
|
|
39946
39946
|
}
|
|
39947
39947
|
__name(valid, "valid");
|
|
39948
39948
|
exports3.clean = clean;
|
|
39949
39949
|
function clean(version2, options6) {
|
|
39950
|
-
var s =
|
|
39950
|
+
var s = parse5(version2.trim().replace(/^[=v]+/, ""), options6);
|
|
39951
39951
|
return s ? s.version : null;
|
|
39952
39952
|
}
|
|
39953
39953
|
__name(clean, "clean");
|
|
@@ -40182,8 +40182,8 @@ var require_backend = __commonJS({
|
|
|
40182
40182
|
if (eq(version1, version2)) {
|
|
40183
40183
|
return null;
|
|
40184
40184
|
} else {
|
|
40185
|
-
var v1 =
|
|
40186
|
-
var v2 =
|
|
40185
|
+
var v1 = parse5(version1);
|
|
40186
|
+
var v2 = parse5(version2);
|
|
40187
40187
|
var prefix = "";
|
|
40188
40188
|
if (v1.prerelease.length || v2.prerelease.length) {
|
|
40189
40189
|
prefix = "pre";
|
|
@@ -40929,7 +40929,7 @@ var require_backend = __commonJS({
|
|
|
40929
40929
|
__name(outside, "outside");
|
|
40930
40930
|
exports3.prerelease = prerelease;
|
|
40931
40931
|
function prerelease(version2, options6) {
|
|
40932
|
-
var parsed =
|
|
40932
|
+
var parsed = parse5(version2, options6);
|
|
40933
40933
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
40934
40934
|
}
|
|
40935
40935
|
__name(prerelease, "prerelease");
|
|
@@ -40968,7 +40968,7 @@ var require_backend = __commonJS({
|
|
|
40968
40968
|
if (match === null) {
|
|
40969
40969
|
return null;
|
|
40970
40970
|
}
|
|
40971
|
-
return
|
|
40971
|
+
return parse5(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options6);
|
|
40972
40972
|
}
|
|
40973
40973
|
__name(coerce, "coerce");
|
|
40974
40974
|
}).call(this, __webpack_require__(17));
|
|
@@ -55584,7 +55584,7 @@ var require_main = __commonJS({
|
|
|
55584
55584
|
var path42 = require("path");
|
|
55585
55585
|
var os10 = require("os");
|
|
55586
55586
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
55587
|
-
function
|
|
55587
|
+
function parse5(src) {
|
|
55588
55588
|
const obj = {};
|
|
55589
55589
|
let lines = src.toString();
|
|
55590
55590
|
lines = lines.replace(/\r\n?/mg, "\n");
|
|
@@ -55603,7 +55603,7 @@ var require_main = __commonJS({
|
|
|
55603
55603
|
}
|
|
55604
55604
|
return obj;
|
|
55605
55605
|
}
|
|
55606
|
-
__name(
|
|
55606
|
+
__name(parse5, "parse");
|
|
55607
55607
|
function _log(message) {
|
|
55608
55608
|
console.log(`[dotenv][DEBUG] ${message}`);
|
|
55609
55609
|
}
|
|
@@ -55654,7 +55654,7 @@ var require_main = __commonJS({
|
|
|
55654
55654
|
__name(config, "config");
|
|
55655
55655
|
var DotenvModule = {
|
|
55656
55656
|
config,
|
|
55657
|
-
parse:
|
|
55657
|
+
parse: parse5
|
|
55658
55658
|
};
|
|
55659
55659
|
module2.exports.config = DotenvModule.config;
|
|
55660
55660
|
module2.exports.parse = DotenvModule.parse;
|
|
@@ -59972,7 +59972,7 @@ var require_parse3 = __commonJS({
|
|
|
59972
59972
|
return parsed;
|
|
59973
59973
|
}
|
|
59974
59974
|
__name(parseNonShell, "parseNonShell");
|
|
59975
|
-
function
|
|
59975
|
+
function parse5(command2, args, options6) {
|
|
59976
59976
|
if (args && !Array.isArray(args)) {
|
|
59977
59977
|
options6 = args;
|
|
59978
59978
|
args = null;
|
|
@@ -59991,8 +59991,8 @@ var require_parse3 = __commonJS({
|
|
|
59991
59991
|
};
|
|
59992
59992
|
return options6.shell ? parsed : parseNonShell(parsed);
|
|
59993
59993
|
}
|
|
59994
|
-
__name(
|
|
59995
|
-
module2.exports =
|
|
59994
|
+
__name(parse5, "parse");
|
|
59995
|
+
module2.exports = parse5;
|
|
59996
59996
|
}
|
|
59997
59997
|
});
|
|
59998
59998
|
|
|
@@ -60057,17 +60057,17 @@ var require_cross_spawn = __commonJS({
|
|
|
60057
60057
|
"use strict";
|
|
60058
60058
|
init_import_meta_url();
|
|
60059
60059
|
var cp2 = require("child_process");
|
|
60060
|
-
var
|
|
60060
|
+
var parse5 = require_parse3();
|
|
60061
60061
|
var enoent = require_enoent();
|
|
60062
60062
|
function spawn3(command2, args, options6) {
|
|
60063
|
-
const parsed =
|
|
60063
|
+
const parsed = parse5(command2, args, options6);
|
|
60064
60064
|
const spawned = cp2.spawn(parsed.command, parsed.args, parsed.options);
|
|
60065
60065
|
enoent.hookChildProcess(spawned, parsed);
|
|
60066
60066
|
return spawned;
|
|
60067
60067
|
}
|
|
60068
60068
|
__name(spawn3, "spawn");
|
|
60069
60069
|
function spawnSync2(command2, args, options6) {
|
|
60070
|
-
const parsed =
|
|
60070
|
+
const parsed = parse5(command2, args, options6);
|
|
60071
60071
|
const result = cp2.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
60072
60072
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
60073
60073
|
return result;
|
|
@@ -60076,7 +60076,7 @@ var require_cross_spawn = __commonJS({
|
|
|
60076
60076
|
module2.exports = spawn3;
|
|
60077
60077
|
module2.exports.spawn = spawn3;
|
|
60078
60078
|
module2.exports.sync = spawnSync2;
|
|
60079
|
-
module2.exports._parse =
|
|
60079
|
+
module2.exports._parse = parse5;
|
|
60080
60080
|
module2.exports._enoent = enoent;
|
|
60081
60081
|
}
|
|
60082
60082
|
});
|
|
@@ -61517,9 +61517,9 @@ var require_command_exists = __commonJS({
|
|
|
61517
61517
|
cleanInput = /* @__PURE__ */ __name(function(s) {
|
|
61518
61518
|
var isPathName = /[\\]/.test(s);
|
|
61519
61519
|
if (isPathName) {
|
|
61520
|
-
var
|
|
61520
|
+
var dirname10 = '"' + path42.dirname(s) + '"';
|
|
61521
61521
|
var basename6 = '"' + path42.basename(s) + '"';
|
|
61522
|
-
return
|
|
61522
|
+
return dirname10 + ":" + basename6;
|
|
61523
61523
|
}
|
|
61524
61524
|
return '"' + s + '"';
|
|
61525
61525
|
}, "cleanInput");
|
|
@@ -62296,9 +62296,9 @@ var require_minimatch = __commonJS({
|
|
|
62296
62296
|
throw new TypeError("pattern is too long");
|
|
62297
62297
|
}
|
|
62298
62298
|
}, "assertValidPattern");
|
|
62299
|
-
Minimatch2.prototype.parse =
|
|
62299
|
+
Minimatch2.prototype.parse = parse5;
|
|
62300
62300
|
var SUBPARSE = {};
|
|
62301
|
-
function
|
|
62301
|
+
function parse5(pattern, isSub) {
|
|
62302
62302
|
assertValidPattern(pattern);
|
|
62303
62303
|
var options6 = this.options;
|
|
62304
62304
|
if (pattern === "**") {
|
|
@@ -62531,7 +62531,7 @@ var require_minimatch = __commonJS({
|
|
|
62531
62531
|
regExp._src = re;
|
|
62532
62532
|
return regExp;
|
|
62533
62533
|
}
|
|
62534
|
-
__name(
|
|
62534
|
+
__name(parse5, "parse");
|
|
62535
62535
|
minimatch.makeRe = function(pattern, options6) {
|
|
62536
62536
|
return new Minimatch2(pattern, options6 || {}).makeRe();
|
|
62537
62537
|
};
|
|
@@ -64708,7 +64708,7 @@ var require_tmp_promise = __commonJS({
|
|
|
64708
64708
|
var require_depd = __commonJS({
|
|
64709
64709
|
"../../node_modules/depd/index.js"(exports2, module2) {
|
|
64710
64710
|
init_import_meta_url();
|
|
64711
|
-
var
|
|
64711
|
+
var relative12 = require("path").relative;
|
|
64712
64712
|
module2.exports = depd;
|
|
64713
64713
|
var basePath = process.cwd();
|
|
64714
64714
|
function containsNamespace(str, namespace) {
|
|
@@ -64914,7 +64914,7 @@ var require_depd = __commonJS({
|
|
|
64914
64914
|
}
|
|
64915
64915
|
__name(formatColor, "formatColor");
|
|
64916
64916
|
function formatLocation(callSite) {
|
|
64917
|
-
return
|
|
64917
|
+
return relative12(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
64918
64918
|
}
|
|
64919
64919
|
__name(formatLocation, "formatLocation");
|
|
64920
64920
|
function getStack() {
|
|
@@ -65038,7 +65038,7 @@ var require_bytes = __commonJS({
|
|
|
65038
65038
|
init_import_meta_url();
|
|
65039
65039
|
module2.exports = bytes;
|
|
65040
65040
|
module2.exports.format = format8;
|
|
65041
|
-
module2.exports.parse =
|
|
65041
|
+
module2.exports.parse = parse5;
|
|
65042
65042
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
65043
65043
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
65044
65044
|
var map = {
|
|
@@ -65052,7 +65052,7 @@ var require_bytes = __commonJS({
|
|
|
65052
65052
|
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
|
65053
65053
|
function bytes(value, options6) {
|
|
65054
65054
|
if (typeof value === "string") {
|
|
65055
|
-
return
|
|
65055
|
+
return parse5(value);
|
|
65056
65056
|
}
|
|
65057
65057
|
if (typeof value === "number") {
|
|
65058
65058
|
return format8(value, options6);
|
|
@@ -65098,7 +65098,7 @@ var require_bytes = __commonJS({
|
|
|
65098
65098
|
return str + unitSeparator + unit;
|
|
65099
65099
|
}
|
|
65100
65100
|
__name(format8, "format");
|
|
65101
|
-
function
|
|
65101
|
+
function parse5(val) {
|
|
65102
65102
|
if (typeof val === "number" && !isNaN(val)) {
|
|
65103
65103
|
return val;
|
|
65104
65104
|
}
|
|
@@ -65120,7 +65120,7 @@ var require_bytes = __commonJS({
|
|
|
65120
65120
|
}
|
|
65121
65121
|
return Math.floor(map[unit] * floatValue);
|
|
65122
65122
|
}
|
|
65123
|
-
__name(
|
|
65123
|
+
__name(parse5, "parse");
|
|
65124
65124
|
}
|
|
65125
65125
|
});
|
|
65126
65126
|
|
|
@@ -65136,7 +65136,7 @@ var require_content_type = __commonJS({
|
|
|
65136
65136
|
var QUOTE_REGEXP = /([\\"])/g;
|
|
65137
65137
|
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
65138
65138
|
exports2.format = format8;
|
|
65139
|
-
exports2.parse =
|
|
65139
|
+
exports2.parse = parse5;
|
|
65140
65140
|
function format8(obj) {
|
|
65141
65141
|
if (!obj || typeof obj !== "object") {
|
|
65142
65142
|
throw new TypeError("argument obj is required");
|
|
@@ -65161,7 +65161,7 @@ var require_content_type = __commonJS({
|
|
|
65161
65161
|
return string;
|
|
65162
65162
|
}
|
|
65163
65163
|
__name(format8, "format");
|
|
65164
|
-
function
|
|
65164
|
+
function parse5(string) {
|
|
65165
65165
|
if (!string) {
|
|
65166
65166
|
throw new TypeError("argument string is required");
|
|
65167
65167
|
}
|
|
@@ -65198,7 +65198,7 @@ var require_content_type = __commonJS({
|
|
|
65198
65198
|
}
|
|
65199
65199
|
return obj;
|
|
65200
65200
|
}
|
|
65201
|
-
__name(
|
|
65201
|
+
__name(parse5, "parse");
|
|
65202
65202
|
function getcontenttype(obj) {
|
|
65203
65203
|
var header;
|
|
65204
65204
|
if (typeof obj.getHeader === "function") {
|
|
@@ -65607,7 +65607,7 @@ var require_ms = __commonJS({
|
|
|
65607
65607
|
options6 = options6 || {};
|
|
65608
65608
|
var type = typeof val;
|
|
65609
65609
|
if (type === "string" && val.length > 0) {
|
|
65610
|
-
return
|
|
65610
|
+
return parse5(val);
|
|
65611
65611
|
} else if (type === "number" && isNaN(val) === false) {
|
|
65612
65612
|
return options6.long ? fmtLong(val) : fmtShort(val);
|
|
65613
65613
|
}
|
|
@@ -65615,7 +65615,7 @@ var require_ms = __commonJS({
|
|
|
65615
65615
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
65616
65616
|
);
|
|
65617
65617
|
};
|
|
65618
|
-
function
|
|
65618
|
+
function parse5(str) {
|
|
65619
65619
|
str = String(str);
|
|
65620
65620
|
if (str.length > 100) {
|
|
65621
65621
|
return;
|
|
@@ -65667,7 +65667,7 @@ var require_ms = __commonJS({
|
|
|
65667
65667
|
return void 0;
|
|
65668
65668
|
}
|
|
65669
65669
|
}
|
|
65670
|
-
__name(
|
|
65670
|
+
__name(parse5, "parse");
|
|
65671
65671
|
function fmtShort(ms) {
|
|
65672
65672
|
if (ms >= d) {
|
|
65673
65673
|
return Math.round(ms / d) + "d";
|
|
@@ -70013,7 +70013,7 @@ var require_read = __commonJS({
|
|
|
70013
70013
|
var unpipe = require_unpipe();
|
|
70014
70014
|
var zlib = require("zlib");
|
|
70015
70015
|
module2.exports = read;
|
|
70016
|
-
function read(req, res, next,
|
|
70016
|
+
function read(req, res, next, parse5, debug, options6) {
|
|
70017
70017
|
var length;
|
|
70018
70018
|
var opts = options6;
|
|
70019
70019
|
var stream2;
|
|
@@ -70072,7 +70072,7 @@ var require_read = __commonJS({
|
|
|
70072
70072
|
try {
|
|
70073
70073
|
debug("parse body");
|
|
70074
70074
|
str = typeof body !== "string" && encoding !== null ? iconv.decode(body, encoding) : body;
|
|
70075
|
-
req.body =
|
|
70075
|
+
req.body = parse5(str);
|
|
70076
70076
|
} catch (err) {
|
|
70077
70077
|
next(createError(400, err, {
|
|
70078
70078
|
body: str,
|
|
@@ -70144,7 +70144,7 @@ var require_media_typer = __commonJS({
|
|
|
70144
70144
|
var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
|
70145
70145
|
var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
|
70146
70146
|
exports2.format = format8;
|
|
70147
|
-
exports2.parse =
|
|
70147
|
+
exports2.parse = parse5;
|
|
70148
70148
|
function format8(obj) {
|
|
70149
70149
|
if (!obj || typeof obj !== "object") {
|
|
70150
70150
|
throw new TypeError("argument obj is required");
|
|
@@ -70180,7 +70180,7 @@ var require_media_typer = __commonJS({
|
|
|
70180
70180
|
return string;
|
|
70181
70181
|
}
|
|
70182
70182
|
__name(format8, "format");
|
|
70183
|
-
function
|
|
70183
|
+
function parse5(string) {
|
|
70184
70184
|
if (!string) {
|
|
70185
70185
|
throw new TypeError("argument string is required");
|
|
70186
70186
|
}
|
|
@@ -70216,7 +70216,7 @@ var require_media_typer = __commonJS({
|
|
|
70216
70216
|
obj.parameters = params;
|
|
70217
70217
|
return obj;
|
|
70218
70218
|
}
|
|
70219
|
-
__name(
|
|
70219
|
+
__name(parse5, "parse");
|
|
70220
70220
|
function getcontenttype(obj) {
|
|
70221
70221
|
if (typeof obj.getHeader === "function") {
|
|
70222
70222
|
return obj.getHeader("content-type");
|
|
@@ -79029,7 +79029,7 @@ var require_json = __commonJS({
|
|
|
79029
79029
|
throw new TypeError("option verify must be function");
|
|
79030
79030
|
}
|
|
79031
79031
|
var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
|
|
79032
|
-
function
|
|
79032
|
+
function parse5(body) {
|
|
79033
79033
|
if (body.length === 0) {
|
|
79034
79034
|
return {};
|
|
79035
79035
|
}
|
|
@@ -79050,7 +79050,7 @@ var require_json = __commonJS({
|
|
|
79050
79050
|
});
|
|
79051
79051
|
}
|
|
79052
79052
|
}
|
|
79053
|
-
__name(
|
|
79053
|
+
__name(parse5, "parse");
|
|
79054
79054
|
return /* @__PURE__ */ __name(function jsonParser(req, res, next) {
|
|
79055
79055
|
if (req._body) {
|
|
79056
79056
|
debug("body already parsed");
|
|
@@ -79078,7 +79078,7 @@ var require_json = __commonJS({
|
|
|
79078
79078
|
}));
|
|
79079
79079
|
return;
|
|
79080
79080
|
}
|
|
79081
|
-
read(req, res, next,
|
|
79081
|
+
read(req, res, next, parse5, debug, {
|
|
79082
79082
|
encoding: charset,
|
|
79083
79083
|
inflate,
|
|
79084
79084
|
limit,
|
|
@@ -79156,10 +79156,10 @@ var require_raw = __commonJS({
|
|
|
79156
79156
|
throw new TypeError("option verify must be function");
|
|
79157
79157
|
}
|
|
79158
79158
|
var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
|
|
79159
|
-
function
|
|
79159
|
+
function parse5(buf) {
|
|
79160
79160
|
return buf;
|
|
79161
79161
|
}
|
|
79162
|
-
__name(
|
|
79162
|
+
__name(parse5, "parse");
|
|
79163
79163
|
return /* @__PURE__ */ __name(function rawParser(req, res, next) {
|
|
79164
79164
|
if (req._body) {
|
|
79165
79165
|
debug("body already parsed");
|
|
@@ -79178,7 +79178,7 @@ var require_raw = __commonJS({
|
|
|
79178
79178
|
next();
|
|
79179
79179
|
return;
|
|
79180
79180
|
}
|
|
79181
|
-
read(req, res, next,
|
|
79181
|
+
read(req, res, next, parse5, debug, {
|
|
79182
79182
|
encoding: null,
|
|
79183
79183
|
inflate,
|
|
79184
79184
|
limit,
|
|
@@ -79218,10 +79218,10 @@ var require_text = __commonJS({
|
|
|
79218
79218
|
throw new TypeError("option verify must be function");
|
|
79219
79219
|
}
|
|
79220
79220
|
var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
|
|
79221
|
-
function
|
|
79221
|
+
function parse5(buf) {
|
|
79222
79222
|
return buf;
|
|
79223
79223
|
}
|
|
79224
|
-
__name(
|
|
79224
|
+
__name(parse5, "parse");
|
|
79225
79225
|
return /* @__PURE__ */ __name(function textParser(req, res, next) {
|
|
79226
79226
|
if (req._body) {
|
|
79227
79227
|
debug("body already parsed");
|
|
@@ -79241,7 +79241,7 @@ var require_text = __commonJS({
|
|
|
79241
79241
|
return;
|
|
79242
79242
|
}
|
|
79243
79243
|
var charset = getCharset(req) || defaultCharset;
|
|
79244
|
-
read(req, res, next,
|
|
79244
|
+
read(req, res, next, parse5, debug, {
|
|
79245
79245
|
encoding: charset,
|
|
79246
79246
|
inflate,
|
|
79247
79247
|
limit,
|
|
@@ -81122,11 +81122,11 @@ var require_lib3 = __commonJS({
|
|
|
81122
81122
|
"use strict";
|
|
81123
81123
|
init_import_meta_url();
|
|
81124
81124
|
var stringify = require_stringify2();
|
|
81125
|
-
var
|
|
81125
|
+
var parse5 = require_parse4();
|
|
81126
81126
|
var formats = require_formats();
|
|
81127
81127
|
module2.exports = {
|
|
81128
81128
|
formats,
|
|
81129
|
-
parse:
|
|
81129
|
+
parse: parse5,
|
|
81130
81130
|
stringify
|
|
81131
81131
|
};
|
|
81132
81132
|
}
|
|
@@ -81161,10 +81161,10 @@ var require_urlencoded2 = __commonJS({
|
|
|
81161
81161
|
}
|
|
81162
81162
|
var queryparse = extended ? extendedparser(opts) : simpleparser(opts);
|
|
81163
81163
|
var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
|
|
81164
|
-
function
|
|
81164
|
+
function parse5(body) {
|
|
81165
81165
|
return body.length ? queryparse(body) : {};
|
|
81166
81166
|
}
|
|
81167
|
-
__name(
|
|
81167
|
+
__name(parse5, "parse");
|
|
81168
81168
|
return /* @__PURE__ */ __name(function urlencodedParser(req, res, next) {
|
|
81169
81169
|
if (req._body) {
|
|
81170
81170
|
debug("body already parsed");
|
|
@@ -81192,7 +81192,7 @@ var require_urlencoded2 = __commonJS({
|
|
|
81192
81192
|
}));
|
|
81193
81193
|
return;
|
|
81194
81194
|
}
|
|
81195
|
-
read(req, res, next,
|
|
81195
|
+
read(req, res, next, parse5, debug, {
|
|
81196
81196
|
debug,
|
|
81197
81197
|
encoding: charset,
|
|
81198
81198
|
inflate,
|
|
@@ -81204,7 +81204,7 @@ var require_urlencoded2 = __commonJS({
|
|
|
81204
81204
|
__name(urlencoded, "urlencoded");
|
|
81205
81205
|
function extendedparser(options6) {
|
|
81206
81206
|
var parameterLimit = options6.parameterLimit !== void 0 ? options6.parameterLimit : 1e3;
|
|
81207
|
-
var
|
|
81207
|
+
var parse5 = parser2("qs");
|
|
81208
81208
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
|
81209
81209
|
throw new TypeError("option parameterLimit must be a positive number");
|
|
81210
81210
|
}
|
|
@@ -81221,7 +81221,7 @@ var require_urlencoded2 = __commonJS({
|
|
|
81221
81221
|
}
|
|
81222
81222
|
var arrayLimit = Math.max(100, paramCount);
|
|
81223
81223
|
debug("parse extended urlencoding");
|
|
81224
|
-
return
|
|
81224
|
+
return parse5(body, {
|
|
81225
81225
|
allowPrototypes: true,
|
|
81226
81226
|
arrayLimit,
|
|
81227
81227
|
depth: Infinity,
|
|
@@ -81270,7 +81270,7 @@ var require_urlencoded2 = __commonJS({
|
|
|
81270
81270
|
__name(parser2, "parser");
|
|
81271
81271
|
function simpleparser(options6) {
|
|
81272
81272
|
var parameterLimit = options6.parameterLimit !== void 0 ? options6.parameterLimit : 1e3;
|
|
81273
|
-
var
|
|
81273
|
+
var parse5 = parser2("querystring");
|
|
81274
81274
|
if (isNaN(parameterLimit) || parameterLimit < 1) {
|
|
81275
81275
|
throw new TypeError("option parameterLimit must be a positive number");
|
|
81276
81276
|
}
|
|
@@ -81286,7 +81286,7 @@ var require_urlencoded2 = __commonJS({
|
|
|
81286
81286
|
});
|
|
81287
81287
|
}
|
|
81288
81288
|
debug("parse urlencoding");
|
|
81289
|
-
return
|
|
81289
|
+
return parse5(body, void 0, void 0, { maxKeys: parameterLimit });
|
|
81290
81290
|
}, "queryparse");
|
|
81291
81291
|
}
|
|
81292
81292
|
__name(simpleparser, "simpleparser");
|
|
@@ -81424,7 +81424,7 @@ var require_ms2 = __commonJS({
|
|
|
81424
81424
|
options6 = options6 || {};
|
|
81425
81425
|
var type = typeof val;
|
|
81426
81426
|
if (type === "string" && val.length > 0) {
|
|
81427
|
-
return
|
|
81427
|
+
return parse5(val);
|
|
81428
81428
|
} else if (type === "number" && isNaN(val) === false) {
|
|
81429
81429
|
return options6.long ? fmtLong(val) : fmtShort(val);
|
|
81430
81430
|
}
|
|
@@ -81432,7 +81432,7 @@ var require_ms2 = __commonJS({
|
|
|
81432
81432
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
81433
81433
|
);
|
|
81434
81434
|
};
|
|
81435
|
-
function
|
|
81435
|
+
function parse5(str) {
|
|
81436
81436
|
str = String(str);
|
|
81437
81437
|
if (str.length > 100) {
|
|
81438
81438
|
return;
|
|
@@ -81484,7 +81484,7 @@ var require_ms2 = __commonJS({
|
|
|
81484
81484
|
return void 0;
|
|
81485
81485
|
}
|
|
81486
81486
|
}
|
|
81487
|
-
__name(
|
|
81487
|
+
__name(parse5, "parse");
|
|
81488
81488
|
function fmtShort(ms) {
|
|
81489
81489
|
if (ms >= d) {
|
|
81490
81490
|
return Math.round(ms / d) + "d";
|
|
@@ -81941,7 +81941,7 @@ var require_parseurl = __commonJS({
|
|
|
81941
81941
|
"use strict";
|
|
81942
81942
|
init_import_meta_url();
|
|
81943
81943
|
var url3 = require("url");
|
|
81944
|
-
var
|
|
81944
|
+
var parse5 = url3.parse;
|
|
81945
81945
|
var Url = url3.Url;
|
|
81946
81946
|
module2.exports = parseurl;
|
|
81947
81947
|
module2.exports.original = originalurl;
|
|
@@ -81975,7 +81975,7 @@ var require_parseurl = __commonJS({
|
|
|
81975
81975
|
__name(originalurl, "originalurl");
|
|
81976
81976
|
function fastparse(str) {
|
|
81977
81977
|
if (typeof str !== "string" || str.charCodeAt(0) !== 47) {
|
|
81978
|
-
return
|
|
81978
|
+
return parse5(str);
|
|
81979
81979
|
}
|
|
81980
81980
|
var pathname = str;
|
|
81981
81981
|
var query = null;
|
|
@@ -81997,7 +81997,7 @@ var require_parseurl = __commonJS({
|
|
|
81997
81997
|
case 35:
|
|
81998
81998
|
case 160:
|
|
81999
81999
|
case 65279:
|
|
82000
|
-
return
|
|
82000
|
+
return parse5(str);
|
|
82001
82001
|
}
|
|
82002
82002
|
}
|
|
82003
82003
|
var url4 = Url !== void 0 ? new Url() : {};
|
|
@@ -82189,7 +82189,7 @@ var require_ms3 = __commonJS({
|
|
|
82189
82189
|
options6 = options6 || {};
|
|
82190
82190
|
var type = typeof val;
|
|
82191
82191
|
if (type === "string" && val.length > 0) {
|
|
82192
|
-
return
|
|
82192
|
+
return parse5(val);
|
|
82193
82193
|
} else if (type === "number" && isNaN(val) === false) {
|
|
82194
82194
|
return options6.long ? fmtLong(val) : fmtShort(val);
|
|
82195
82195
|
}
|
|
@@ -82197,7 +82197,7 @@ var require_ms3 = __commonJS({
|
|
|
82197
82197
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
82198
82198
|
);
|
|
82199
82199
|
};
|
|
82200
|
-
function
|
|
82200
|
+
function parse5(str) {
|
|
82201
82201
|
str = String(str);
|
|
82202
82202
|
if (str.length > 100) {
|
|
82203
82203
|
return;
|
|
@@ -82249,7 +82249,7 @@ var require_ms3 = __commonJS({
|
|
|
82249
82249
|
return void 0;
|
|
82250
82250
|
}
|
|
82251
82251
|
}
|
|
82252
|
-
__name(
|
|
82252
|
+
__name(parse5, "parse");
|
|
82253
82253
|
function fmtShort(ms) {
|
|
82254
82254
|
if (ms >= d) {
|
|
82255
82255
|
return Math.round(ms / d) + "d";
|
|
@@ -83489,10 +83489,10 @@ var require_view = __commonJS({
|
|
|
83489
83489
|
var debug = require_src4()("express:view");
|
|
83490
83490
|
var path42 = require("path");
|
|
83491
83491
|
var fs18 = require("fs");
|
|
83492
|
-
var
|
|
83492
|
+
var dirname10 = path42.dirname;
|
|
83493
83493
|
var basename6 = path42.basename;
|
|
83494
83494
|
var extname4 = path42.extname;
|
|
83495
|
-
var
|
|
83495
|
+
var join12 = path42.join;
|
|
83496
83496
|
var resolve16 = path42.resolve;
|
|
83497
83497
|
module2.exports = View;
|
|
83498
83498
|
function View(name, options6) {
|
|
@@ -83529,7 +83529,7 @@ var require_view = __commonJS({
|
|
|
83529
83529
|
for (var i = 0; i < roots.length && !path43; i++) {
|
|
83530
83530
|
var root = roots[i];
|
|
83531
83531
|
var loc = resolve16(root, name);
|
|
83532
|
-
var dir =
|
|
83532
|
+
var dir = dirname10(loc);
|
|
83533
83533
|
var file = basename6(loc);
|
|
83534
83534
|
path43 = this.resolve(dir, file);
|
|
83535
83535
|
}
|
|
@@ -83541,12 +83541,12 @@ var require_view = __commonJS({
|
|
|
83541
83541
|
}, "render");
|
|
83542
83542
|
View.prototype.resolve = /* @__PURE__ */ __name(function resolve17(dir, file) {
|
|
83543
83543
|
var ext = this.ext;
|
|
83544
|
-
var path43 =
|
|
83544
|
+
var path43 = join12(dir, file);
|
|
83545
83545
|
var stat3 = tryStat(path43);
|
|
83546
83546
|
if (stat3 && stat3.isFile()) {
|
|
83547
83547
|
return path43;
|
|
83548
83548
|
}
|
|
83549
|
-
path43 =
|
|
83549
|
+
path43 = join12(dir, basename6(file, ext), "index" + ext);
|
|
83550
83550
|
stat3 = tryStat(path43);
|
|
83551
83551
|
if (stat3 && stat3.isFile()) {
|
|
83552
83552
|
return path43;
|
|
@@ -83692,7 +83692,7 @@ var require_content_disposition = __commonJS({
|
|
|
83692
83692
|
"use strict";
|
|
83693
83693
|
init_import_meta_url();
|
|
83694
83694
|
module2.exports = contentDisposition;
|
|
83695
|
-
module2.exports.parse =
|
|
83695
|
+
module2.exports.parse = parse5;
|
|
83696
83696
|
var basename6 = require("path").basename;
|
|
83697
83697
|
var Buffer3 = require_safe_buffer2().Buffer;
|
|
83698
83698
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
@@ -83788,7 +83788,7 @@ var require_content_disposition = __commonJS({
|
|
|
83788
83788
|
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
|
83789
83789
|
}
|
|
83790
83790
|
__name(getlatin1, "getlatin1");
|
|
83791
|
-
function
|
|
83791
|
+
function parse5(string) {
|
|
83792
83792
|
if (!string || typeof string !== "string") {
|
|
83793
83793
|
throw new TypeError("argument string is required");
|
|
83794
83794
|
}
|
|
@@ -83833,7 +83833,7 @@ var require_content_disposition = __commonJS({
|
|
|
83833
83833
|
}
|
|
83834
83834
|
return new ContentDisposition(type, params);
|
|
83835
83835
|
}
|
|
83836
|
-
__name(
|
|
83836
|
+
__name(parse5, "parse");
|
|
83837
83837
|
function pdecode(str, hex) {
|
|
83838
83838
|
return String.fromCharCode(parseInt(hex, 16));
|
|
83839
83839
|
}
|
|
@@ -83874,7 +83874,7 @@ var require_ms4 = __commonJS({
|
|
|
83874
83874
|
options6 = options6 || {};
|
|
83875
83875
|
var type = typeof val;
|
|
83876
83876
|
if (type === "string" && val.length > 0) {
|
|
83877
|
-
return
|
|
83877
|
+
return parse5(val);
|
|
83878
83878
|
} else if (type === "number" && isNaN(val) === false) {
|
|
83879
83879
|
return options6.long ? fmtLong(val) : fmtShort(val);
|
|
83880
83880
|
}
|
|
@@ -83882,7 +83882,7 @@ var require_ms4 = __commonJS({
|
|
|
83882
83882
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
83883
83883
|
);
|
|
83884
83884
|
};
|
|
83885
|
-
function
|
|
83885
|
+
function parse5(str) {
|
|
83886
83886
|
str = String(str);
|
|
83887
83887
|
if (str.length > 100) {
|
|
83888
83888
|
return;
|
|
@@ -83934,7 +83934,7 @@ var require_ms4 = __commonJS({
|
|
|
83934
83934
|
return void 0;
|
|
83935
83935
|
}
|
|
83936
83936
|
}
|
|
83937
|
-
__name(
|
|
83937
|
+
__name(parse5, "parse");
|
|
83938
83938
|
function fmtShort(ms) {
|
|
83939
83939
|
if (ms >= d) {
|
|
83940
83940
|
return Math.round(ms / d) + "d";
|
|
@@ -84521,7 +84521,7 @@ var require_ms5 = __commonJS({
|
|
|
84521
84521
|
options6 = options6 || {};
|
|
84522
84522
|
var type = typeof val;
|
|
84523
84523
|
if (type === "string" && val.length > 0) {
|
|
84524
|
-
return
|
|
84524
|
+
return parse5(val);
|
|
84525
84525
|
} else if (type === "number" && isFinite(val)) {
|
|
84526
84526
|
return options6.long ? fmtLong(val) : fmtShort(val);
|
|
84527
84527
|
}
|
|
@@ -84529,7 +84529,7 @@ var require_ms5 = __commonJS({
|
|
|
84529
84529
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
84530
84530
|
);
|
|
84531
84531
|
};
|
|
84532
|
-
function
|
|
84532
|
+
function parse5(str) {
|
|
84533
84533
|
str = String(str);
|
|
84534
84534
|
if (str.length > 100) {
|
|
84535
84535
|
return;
|
|
@@ -84585,7 +84585,7 @@ var require_ms5 = __commonJS({
|
|
|
84585
84585
|
return void 0;
|
|
84586
84586
|
}
|
|
84587
84587
|
}
|
|
84588
|
-
__name(
|
|
84588
|
+
__name(parse5, "parse");
|
|
84589
84589
|
function fmtShort(ms) {
|
|
84590
84590
|
var msAbs = Math.abs(ms);
|
|
84591
84591
|
if (msAbs >= d) {
|
|
@@ -84739,7 +84739,7 @@ var require_send = __commonJS({
|
|
|
84739
84739
|
var Stream = require("stream");
|
|
84740
84740
|
var util3 = require("util");
|
|
84741
84741
|
var extname4 = path42.extname;
|
|
84742
|
-
var
|
|
84742
|
+
var join12 = path42.join;
|
|
84743
84743
|
var normalize2 = path42.normalize;
|
|
84744
84744
|
var resolve16 = path42.resolve;
|
|
84745
84745
|
var sep2 = path42.sep;
|
|
@@ -84960,7 +84960,7 @@ var require_send = __commonJS({
|
|
|
84960
84960
|
return res;
|
|
84961
84961
|
}
|
|
84962
84962
|
parts = path43.split(sep2);
|
|
84963
|
-
path43 = normalize2(
|
|
84963
|
+
path43 = normalize2(join12(root, path43));
|
|
84964
84964
|
} else {
|
|
84965
84965
|
if (UP_PATH_REGEXP.test(path43)) {
|
|
84966
84966
|
debug('malicious path "%s"', path43);
|
|
@@ -85102,7 +85102,7 @@ var require_send = __commonJS({
|
|
|
85102
85102
|
return self2.onStatError(err);
|
|
85103
85103
|
return self2.error(404);
|
|
85104
85104
|
}
|
|
85105
|
-
var p =
|
|
85105
|
+
var p = join12(path43, self2._index[i]);
|
|
85106
85106
|
debug('stat "%s"', p);
|
|
85107
85107
|
fs18.stat(p, function(err2, stat3) {
|
|
85108
85108
|
if (err2)
|
|
@@ -85300,7 +85300,7 @@ var require_forwarded = __commonJS({
|
|
|
85300
85300
|
if (!req) {
|
|
85301
85301
|
throw new TypeError("argument req is required");
|
|
85302
85302
|
}
|
|
85303
|
-
var proxyAddrs =
|
|
85303
|
+
var proxyAddrs = parse5(req.headers["x-forwarded-for"] || "");
|
|
85304
85304
|
var socketAddr = getSocketAddr(req);
|
|
85305
85305
|
var addrs = [socketAddr].concat(proxyAddrs);
|
|
85306
85306
|
return addrs;
|
|
@@ -85310,7 +85310,7 @@ var require_forwarded = __commonJS({
|
|
|
85310
85310
|
return req.socket ? req.socket.remoteAddress : req.connection.remoteAddress;
|
|
85311
85311
|
}
|
|
85312
85312
|
__name(getSocketAddr, "getSocketAddr");
|
|
85313
|
-
function
|
|
85313
|
+
function parse5(header) {
|
|
85314
85314
|
var end = header.length;
|
|
85315
85315
|
var list = [];
|
|
85316
85316
|
var start = header.length;
|
|
@@ -85337,7 +85337,7 @@ var require_forwarded = __commonJS({
|
|
|
85337
85337
|
}
|
|
85338
85338
|
return list;
|
|
85339
85339
|
}
|
|
85340
|
-
__name(
|
|
85340
|
+
__name(parse5, "parse");
|
|
85341
85341
|
}
|
|
85342
85342
|
});
|
|
85343
85343
|
|
|
@@ -87208,7 +87208,7 @@ var require_request3 = __commonJS({
|
|
|
87208
87208
|
var http3 = require("http");
|
|
87209
87209
|
var fresh = require_fresh();
|
|
87210
87210
|
var parseRange = require_range_parser();
|
|
87211
|
-
var
|
|
87211
|
+
var parse5 = require_parseurl();
|
|
87212
87212
|
var proxyaddr = require_proxy_addr();
|
|
87213
87213
|
var req = Object.create(http3.IncomingMessage.prototype);
|
|
87214
87214
|
module2.exports = req;
|
|
@@ -87318,7 +87318,7 @@ var require_request3 = __commonJS({
|
|
|
87318
87318
|
return subdomains2.slice(offset);
|
|
87319
87319
|
}, "subdomains"));
|
|
87320
87320
|
defineGetter(req, "path", /* @__PURE__ */ __name(function path42() {
|
|
87321
|
-
return
|
|
87321
|
+
return parse5(this).pathname;
|
|
87322
87322
|
}, "path"));
|
|
87323
87323
|
defineGetter(req, "hostname", /* @__PURE__ */ __name(function hostname() {
|
|
87324
87324
|
var trust = this.app.get("trust proxy fn");
|
|
@@ -87401,11 +87401,11 @@ var require_cookie = __commonJS({
|
|
|
87401
87401
|
"../../node_modules/express/node_modules/cookie/index.js"(exports2) {
|
|
87402
87402
|
"use strict";
|
|
87403
87403
|
init_import_meta_url();
|
|
87404
|
-
exports2.parse =
|
|
87404
|
+
exports2.parse = parse5;
|
|
87405
87405
|
exports2.serialize = serialize;
|
|
87406
87406
|
var __toString = Object.prototype.toString;
|
|
87407
87407
|
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
87408
|
-
function
|
|
87408
|
+
function parse5(str, options6) {
|
|
87409
87409
|
if (typeof str !== "string") {
|
|
87410
87410
|
throw new TypeError("argument str must be a string");
|
|
87411
87411
|
}
|
|
@@ -87437,7 +87437,7 @@ var require_cookie = __commonJS({
|
|
|
87437
87437
|
}
|
|
87438
87438
|
return obj;
|
|
87439
87439
|
}
|
|
87440
|
-
__name(
|
|
87440
|
+
__name(parse5, "parse");
|
|
87441
87441
|
function serialize(name, val, options6) {
|
|
87442
87442
|
var opt = options6 || {};
|
|
87443
87443
|
var enc = opt.encode || encode;
|
|
@@ -87560,7 +87560,7 @@ var require_vary = __commonJS({
|
|
|
87560
87560
|
if (!field) {
|
|
87561
87561
|
throw new TypeError("field argument is required");
|
|
87562
87562
|
}
|
|
87563
|
-
var fields = !Array.isArray(field) ?
|
|
87563
|
+
var fields = !Array.isArray(field) ? parse5(String(field)) : field;
|
|
87564
87564
|
for (var j = 0; j < fields.length; j++) {
|
|
87565
87565
|
if (!FIELD_NAME_REGEXP.test(fields[j])) {
|
|
87566
87566
|
throw new TypeError("field argument contains an invalid header name");
|
|
@@ -87570,7 +87570,7 @@ var require_vary = __commonJS({
|
|
|
87570
87570
|
return header;
|
|
87571
87571
|
}
|
|
87572
87572
|
var val = header;
|
|
87573
|
-
var vals =
|
|
87573
|
+
var vals = parse5(header.toLowerCase());
|
|
87574
87574
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) {
|
|
87575
87575
|
return "*";
|
|
87576
87576
|
}
|
|
@@ -87584,7 +87584,7 @@ var require_vary = __commonJS({
|
|
|
87584
87584
|
return val;
|
|
87585
87585
|
}
|
|
87586
87586
|
__name(append, "append");
|
|
87587
|
-
function
|
|
87587
|
+
function parse5(header) {
|
|
87588
87588
|
var end = 0;
|
|
87589
87589
|
var list = [];
|
|
87590
87590
|
var start = 0;
|
|
@@ -87607,7 +87607,7 @@ var require_vary = __commonJS({
|
|
|
87607
87607
|
list.push(header.substring(start, end));
|
|
87608
87608
|
return list;
|
|
87609
87609
|
}
|
|
87610
|
-
__name(
|
|
87610
|
+
__name(parse5, "parse");
|
|
87611
87611
|
function vary(res, field) {
|
|
87612
87612
|
if (!res || !res.getHeader || !res.setHeader) {
|
|
87613
87613
|
throw new TypeError("res argument is required");
|
|
@@ -89099,7 +89099,7 @@ var require_uri_all = __commonJS({
|
|
|
89099
89099
|
__name(_normalizeIPv6, "_normalizeIPv6");
|
|
89100
89100
|
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
|
|
89101
89101
|
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
|
|
89102
|
-
function
|
|
89102
|
+
function parse5(uriString) {
|
|
89103
89103
|
var options6 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
89104
89104
|
var components = {};
|
|
89105
89105
|
var protocol = options6.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
@@ -89166,7 +89166,7 @@ var require_uri_all = __commonJS({
|
|
|
89166
89166
|
}
|
|
89167
89167
|
return components;
|
|
89168
89168
|
}
|
|
89169
|
-
__name(
|
|
89169
|
+
__name(parse5, "parse");
|
|
89170
89170
|
function _recomposeAuthority(components, options6) {
|
|
89171
89171
|
var protocol = options6.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
89172
89172
|
var uriTokens = [];
|
|
@@ -89269,51 +89269,51 @@ var require_uri_all = __commonJS({
|
|
|
89269
89269
|
return uriTokens.join("");
|
|
89270
89270
|
}
|
|
89271
89271
|
__name(serialize, "serialize");
|
|
89272
|
-
function resolveComponents(base2,
|
|
89272
|
+
function resolveComponents(base2, relative12) {
|
|
89273
89273
|
var options6 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
89274
89274
|
var skipNormalization = arguments[3];
|
|
89275
89275
|
var target = {};
|
|
89276
89276
|
if (!skipNormalization) {
|
|
89277
|
-
base2 =
|
|
89278
|
-
|
|
89277
|
+
base2 = parse5(serialize(base2, options6), options6);
|
|
89278
|
+
relative12 = parse5(serialize(relative12, options6), options6);
|
|
89279
89279
|
}
|
|
89280
89280
|
options6 = options6 || {};
|
|
89281
|
-
if (!options6.tolerant &&
|
|
89282
|
-
target.scheme =
|
|
89283
|
-
target.userinfo =
|
|
89284
|
-
target.host =
|
|
89285
|
-
target.port =
|
|
89286
|
-
target.path = removeDotSegments(
|
|
89287
|
-
target.query =
|
|
89281
|
+
if (!options6.tolerant && relative12.scheme) {
|
|
89282
|
+
target.scheme = relative12.scheme;
|
|
89283
|
+
target.userinfo = relative12.userinfo;
|
|
89284
|
+
target.host = relative12.host;
|
|
89285
|
+
target.port = relative12.port;
|
|
89286
|
+
target.path = removeDotSegments(relative12.path || "");
|
|
89287
|
+
target.query = relative12.query;
|
|
89288
89288
|
} else {
|
|
89289
|
-
if (
|
|
89290
|
-
target.userinfo =
|
|
89291
|
-
target.host =
|
|
89292
|
-
target.port =
|
|
89293
|
-
target.path = removeDotSegments(
|
|
89294
|
-
target.query =
|
|
89289
|
+
if (relative12.userinfo !== void 0 || relative12.host !== void 0 || relative12.port !== void 0) {
|
|
89290
|
+
target.userinfo = relative12.userinfo;
|
|
89291
|
+
target.host = relative12.host;
|
|
89292
|
+
target.port = relative12.port;
|
|
89293
|
+
target.path = removeDotSegments(relative12.path || "");
|
|
89294
|
+
target.query = relative12.query;
|
|
89295
89295
|
} else {
|
|
89296
|
-
if (!
|
|
89296
|
+
if (!relative12.path) {
|
|
89297
89297
|
target.path = base2.path;
|
|
89298
|
-
if (
|
|
89299
|
-
target.query =
|
|
89298
|
+
if (relative12.query !== void 0) {
|
|
89299
|
+
target.query = relative12.query;
|
|
89300
89300
|
} else {
|
|
89301
89301
|
target.query = base2.query;
|
|
89302
89302
|
}
|
|
89303
89303
|
} else {
|
|
89304
|
-
if (
|
|
89305
|
-
target.path = removeDotSegments(
|
|
89304
|
+
if (relative12.path.charAt(0) === "/") {
|
|
89305
|
+
target.path = removeDotSegments(relative12.path);
|
|
89306
89306
|
} else {
|
|
89307
89307
|
if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
|
|
89308
|
-
target.path = "/" +
|
|
89308
|
+
target.path = "/" + relative12.path;
|
|
89309
89309
|
} else if (!base2.path) {
|
|
89310
|
-
target.path =
|
|
89310
|
+
target.path = relative12.path;
|
|
89311
89311
|
} else {
|
|
89312
|
-
target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) +
|
|
89312
|
+
target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative12.path;
|
|
89313
89313
|
}
|
|
89314
89314
|
target.path = removeDotSegments(target.path);
|
|
89315
89315
|
}
|
|
89316
|
-
target.query =
|
|
89316
|
+
target.query = relative12.query;
|
|
89317
89317
|
}
|
|
89318
89318
|
target.userinfo = base2.userinfo;
|
|
89319
89319
|
target.host = base2.host;
|
|
@@ -89321,32 +89321,32 @@ var require_uri_all = __commonJS({
|
|
|
89321
89321
|
}
|
|
89322
89322
|
target.scheme = base2.scheme;
|
|
89323
89323
|
}
|
|
89324
|
-
target.fragment =
|
|
89324
|
+
target.fragment = relative12.fragment;
|
|
89325
89325
|
return target;
|
|
89326
89326
|
}
|
|
89327
89327
|
__name(resolveComponents, "resolveComponents");
|
|
89328
89328
|
function resolve16(baseURI, relativeURI, options6) {
|
|
89329
89329
|
var schemelessOptions = assign({ scheme: "null" }, options6);
|
|
89330
|
-
return serialize(resolveComponents(
|
|
89330
|
+
return serialize(resolveComponents(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
89331
89331
|
}
|
|
89332
89332
|
__name(resolve16, "resolve");
|
|
89333
89333
|
function normalize2(uri, options6) {
|
|
89334
89334
|
if (typeof uri === "string") {
|
|
89335
|
-
uri = serialize(
|
|
89335
|
+
uri = serialize(parse5(uri, options6), options6);
|
|
89336
89336
|
} else if (typeOf(uri) === "object") {
|
|
89337
|
-
uri =
|
|
89337
|
+
uri = parse5(serialize(uri, options6), options6);
|
|
89338
89338
|
}
|
|
89339
89339
|
return uri;
|
|
89340
89340
|
}
|
|
89341
89341
|
__name(normalize2, "normalize");
|
|
89342
89342
|
function equal(uriA, uriB, options6) {
|
|
89343
89343
|
if (typeof uriA === "string") {
|
|
89344
|
-
uriA = serialize(
|
|
89344
|
+
uriA = serialize(parse5(uriA, options6), options6);
|
|
89345
89345
|
} else if (typeOf(uriA) === "object") {
|
|
89346
89346
|
uriA = serialize(uriA, options6);
|
|
89347
89347
|
}
|
|
89348
89348
|
if (typeof uriB === "string") {
|
|
89349
|
-
uriB = serialize(
|
|
89349
|
+
uriB = serialize(parse5(uriB, options6), options6);
|
|
89350
89350
|
} else if (typeOf(uriB) === "object") {
|
|
89351
89351
|
uriB = serialize(uriB, options6);
|
|
89352
89352
|
}
|
|
@@ -89364,7 +89364,7 @@ var require_uri_all = __commonJS({
|
|
|
89364
89364
|
var handler7 = {
|
|
89365
89365
|
scheme: "http",
|
|
89366
89366
|
domainHost: true,
|
|
89367
|
-
parse: /* @__PURE__ */ __name(function
|
|
89367
|
+
parse: /* @__PURE__ */ __name(function parse6(components, options6) {
|
|
89368
89368
|
if (!components.host) {
|
|
89369
89369
|
components.error = components.error || "HTTP URIs must have a host.";
|
|
89370
89370
|
}
|
|
@@ -89394,7 +89394,7 @@ var require_uri_all = __commonJS({
|
|
|
89394
89394
|
var handler$2 = {
|
|
89395
89395
|
scheme: "ws",
|
|
89396
89396
|
domainHost: true,
|
|
89397
|
-
parse: /* @__PURE__ */ __name(function
|
|
89397
|
+
parse: /* @__PURE__ */ __name(function parse6(components, options6) {
|
|
89398
89398
|
var wsComponents = components;
|
|
89399
89399
|
wsComponents.secure = isSecure(wsComponents);
|
|
89400
89400
|
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
@@ -89571,7 +89571,7 @@ var require_uri_all = __commonJS({
|
|
|
89571
89571
|
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
89572
89572
|
var handler$6 = {
|
|
89573
89573
|
scheme: "urn:uuid",
|
|
89574
|
-
parse: /* @__PURE__ */ __name(function
|
|
89574
|
+
parse: /* @__PURE__ */ __name(function parse6(urnComponents, options6) {
|
|
89575
89575
|
var uuidComponents = urnComponents;
|
|
89576
89576
|
uuidComponents.uuid = uuidComponents.nss;
|
|
89577
89577
|
uuidComponents.nss = void 0;
|
|
@@ -89596,7 +89596,7 @@ var require_uri_all = __commonJS({
|
|
|
89596
89596
|
exports3.SCHEMES = SCHEMES;
|
|
89597
89597
|
exports3.pctEncChar = pctEncChar;
|
|
89598
89598
|
exports3.pctDecChars = pctDecChars;
|
|
89599
|
-
exports3.parse =
|
|
89599
|
+
exports3.parse = parse5;
|
|
89600
89600
|
exports3.removeDotSegments = removeDotSegments;
|
|
89601
89601
|
exports3.serialize = serialize;
|
|
89602
89602
|
exports3.resolveComponents = resolveComponents;
|
|
@@ -101892,7 +101892,7 @@ var require_extension2 = __commonJS({
|
|
|
101892
101892
|
dest[name].push(elem);
|
|
101893
101893
|
}
|
|
101894
101894
|
__name(push, "push");
|
|
101895
|
-
function
|
|
101895
|
+
function parse5(header) {
|
|
101896
101896
|
const offers = /* @__PURE__ */ Object.create(null);
|
|
101897
101897
|
let params = /* @__PURE__ */ Object.create(null);
|
|
101898
101898
|
let mustUnescape = false;
|
|
@@ -102030,7 +102030,7 @@ var require_extension2 = __commonJS({
|
|
|
102030
102030
|
}
|
|
102031
102031
|
return offers;
|
|
102032
102032
|
}
|
|
102033
|
-
__name(
|
|
102033
|
+
__name(parse5, "parse");
|
|
102034
102034
|
function format8(extensions) {
|
|
102035
102035
|
return Object.keys(extensions).map((extension) => {
|
|
102036
102036
|
let configurations = extensions[extension];
|
|
@@ -102049,7 +102049,7 @@ var require_extension2 = __commonJS({
|
|
|
102049
102049
|
}).join(", ");
|
|
102050
102050
|
}
|
|
102051
102051
|
__name(format8, "format");
|
|
102052
|
-
module2.exports = { format: format8, parse:
|
|
102052
|
+
module2.exports = { format: format8, parse: parse5 };
|
|
102053
102053
|
}
|
|
102054
102054
|
});
|
|
102055
102055
|
|
|
@@ -102082,7 +102082,7 @@ var require_websocket3 = __commonJS({
|
|
|
102082
102082
|
var {
|
|
102083
102083
|
EventTarget: { addEventListener, removeEventListener }
|
|
102084
102084
|
} = require_event_target2();
|
|
102085
|
-
var { format: format8, parse:
|
|
102085
|
+
var { format: format8, parse: parse5 } = require_extension2();
|
|
102086
102086
|
var { toBuffer } = require_buffer_util2();
|
|
102087
102087
|
var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
|
|
102088
102088
|
var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
|
|
@@ -102606,7 +102606,7 @@ var require_websocket3 = __commonJS({
|
|
|
102606
102606
|
}
|
|
102607
102607
|
let extensions;
|
|
102608
102608
|
try {
|
|
102609
|
-
extensions =
|
|
102609
|
+
extensions = parse5(secWebSocketExtensions);
|
|
102610
102610
|
} catch (err) {
|
|
102611
102611
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
102612
102612
|
abortHandshake(websocket, socket, message);
|
|
@@ -102794,7 +102794,7 @@ var require_subprotocol = __commonJS({
|
|
|
102794
102794
|
"use strict";
|
|
102795
102795
|
init_import_meta_url();
|
|
102796
102796
|
var { tokenChars } = require_validation2();
|
|
102797
|
-
function
|
|
102797
|
+
function parse5(header) {
|
|
102798
102798
|
const protocols = /* @__PURE__ */ new Set();
|
|
102799
102799
|
let start = -1;
|
|
102800
102800
|
let end = -1;
|
|
@@ -102833,8 +102833,8 @@ var require_subprotocol = __commonJS({
|
|
|
102833
102833
|
protocols.add(protocol);
|
|
102834
102834
|
return protocols;
|
|
102835
102835
|
}
|
|
102836
|
-
__name(
|
|
102837
|
-
module2.exports = { parse:
|
|
102836
|
+
__name(parse5, "parse");
|
|
102837
|
+
module2.exports = { parse: parse5 };
|
|
102838
102838
|
}
|
|
102839
102839
|
});
|
|
102840
102840
|
|
|
@@ -104032,7 +104032,7 @@ var require_parse5 = __commonJS({
|
|
|
104032
104032
|
var { re, t: t2 } = require_re();
|
|
104033
104033
|
var SemVer = require_semver();
|
|
104034
104034
|
var parseOptions = require_parse_options();
|
|
104035
|
-
var
|
|
104035
|
+
var parse5 = /* @__PURE__ */ __name((version2, options6) => {
|
|
104036
104036
|
options6 = parseOptions(options6);
|
|
104037
104037
|
if (version2 instanceof SemVer) {
|
|
104038
104038
|
return version2;
|
|
@@ -104053,7 +104053,7 @@ var require_parse5 = __commonJS({
|
|
|
104053
104053
|
return null;
|
|
104054
104054
|
}
|
|
104055
104055
|
}, "parse");
|
|
104056
|
-
module2.exports =
|
|
104056
|
+
module2.exports = parse5;
|
|
104057
104057
|
}
|
|
104058
104058
|
});
|
|
104059
104059
|
|
|
@@ -104061,9 +104061,9 @@ var require_parse5 = __commonJS({
|
|
|
104061
104061
|
var require_valid = __commonJS({
|
|
104062
104062
|
"../../node_modules/npx-import/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
104063
104063
|
init_import_meta_url();
|
|
104064
|
-
var
|
|
104064
|
+
var parse5 = require_parse5();
|
|
104065
104065
|
var valid = /* @__PURE__ */ __name((version2, options6) => {
|
|
104066
|
-
const v =
|
|
104066
|
+
const v = parse5(version2, options6);
|
|
104067
104067
|
return v ? v.version : null;
|
|
104068
104068
|
}, "valid");
|
|
104069
104069
|
module2.exports = valid;
|
|
@@ -104074,9 +104074,9 @@ var require_valid = __commonJS({
|
|
|
104074
104074
|
var require_clean = __commonJS({
|
|
104075
104075
|
"../../node_modules/npx-import/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
104076
104076
|
init_import_meta_url();
|
|
104077
|
-
var
|
|
104077
|
+
var parse5 = require_parse5();
|
|
104078
104078
|
var clean = /* @__PURE__ */ __name((version2, options6) => {
|
|
104079
|
-
const s =
|
|
104079
|
+
const s = parse5(version2.trim().replace(/^[=v]+/, ""), options6);
|
|
104080
104080
|
return s ? s.version : null;
|
|
104081
104081
|
}, "clean");
|
|
104082
104082
|
module2.exports = clean;
|
|
@@ -104130,14 +104130,14 @@ var require_eq = __commonJS({
|
|
|
104130
104130
|
var require_diff = __commonJS({
|
|
104131
104131
|
"../../node_modules/npx-import/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
104132
104132
|
init_import_meta_url();
|
|
104133
|
-
var
|
|
104133
|
+
var parse5 = require_parse5();
|
|
104134
104134
|
var eq = require_eq();
|
|
104135
104135
|
var diff = /* @__PURE__ */ __name((version1, version2) => {
|
|
104136
104136
|
if (eq(version1, version2)) {
|
|
104137
104137
|
return null;
|
|
104138
104138
|
} else {
|
|
104139
|
-
const v1 =
|
|
104140
|
-
const v2 =
|
|
104139
|
+
const v1 = parse5(version1);
|
|
104140
|
+
const v2 = parse5(version2);
|
|
104141
104141
|
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
104142
104142
|
const prefix = hasPre ? "pre" : "";
|
|
104143
104143
|
const defaultResult = hasPre ? "prerelease" : "";
|
|
@@ -104189,9 +104189,9 @@ var require_patch = __commonJS({
|
|
|
104189
104189
|
var require_prerelease = __commonJS({
|
|
104190
104190
|
"../../node_modules/npx-import/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
104191
104191
|
init_import_meta_url();
|
|
104192
|
-
var
|
|
104192
|
+
var parse5 = require_parse5();
|
|
104193
104193
|
var prerelease = /* @__PURE__ */ __name((version2, options6) => {
|
|
104194
|
-
const parsed =
|
|
104194
|
+
const parsed = parse5(version2, options6);
|
|
104195
104195
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
104196
104196
|
}, "prerelease");
|
|
104197
104197
|
module2.exports = prerelease;
|
|
@@ -104357,7 +104357,7 @@ var require_coerce = __commonJS({
|
|
|
104357
104357
|
"../../node_modules/npx-import/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
104358
104358
|
init_import_meta_url();
|
|
104359
104359
|
var SemVer = require_semver();
|
|
104360
|
-
var
|
|
104360
|
+
var parse5 = require_parse5();
|
|
104361
104361
|
var { re, t: t2 } = require_re();
|
|
104362
104362
|
var coerce = /* @__PURE__ */ __name((version2, options6) => {
|
|
104363
104363
|
if (version2 instanceof SemVer) {
|
|
@@ -104386,7 +104386,7 @@ var require_coerce = __commonJS({
|
|
|
104386
104386
|
if (match === null) {
|
|
104387
104387
|
return null;
|
|
104388
104388
|
}
|
|
104389
|
-
return
|
|
104389
|
+
return parse5(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options6);
|
|
104390
104390
|
}, "coerce");
|
|
104391
104391
|
module2.exports = coerce;
|
|
104392
104392
|
}
|
|
@@ -106405,7 +106405,7 @@ var require_parse6 = __commonJS({
|
|
|
106405
106405
|
var { re, t: t2 } = require_re2();
|
|
106406
106406
|
var SemVer = require_semver3();
|
|
106407
106407
|
var parseOptions = require_parse_options2();
|
|
106408
|
-
var
|
|
106408
|
+
var parse5 = /* @__PURE__ */ __name((version2, options6) => {
|
|
106409
106409
|
options6 = parseOptions(options6);
|
|
106410
106410
|
if (version2 instanceof SemVer) {
|
|
106411
106411
|
return version2;
|
|
@@ -106426,7 +106426,7 @@ var require_parse6 = __commonJS({
|
|
|
106426
106426
|
return null;
|
|
106427
106427
|
}
|
|
106428
106428
|
}, "parse");
|
|
106429
|
-
module2.exports =
|
|
106429
|
+
module2.exports = parse5;
|
|
106430
106430
|
}
|
|
106431
106431
|
});
|
|
106432
106432
|
|
|
@@ -106434,9 +106434,9 @@ var require_parse6 = __commonJS({
|
|
|
106434
106434
|
var require_valid3 = __commonJS({
|
|
106435
106435
|
"../../node_modules/builtins/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
106436
106436
|
init_import_meta_url();
|
|
106437
|
-
var
|
|
106437
|
+
var parse5 = require_parse6();
|
|
106438
106438
|
var valid = /* @__PURE__ */ __name((version2, options6) => {
|
|
106439
|
-
const v =
|
|
106439
|
+
const v = parse5(version2, options6);
|
|
106440
106440
|
return v ? v.version : null;
|
|
106441
106441
|
}, "valid");
|
|
106442
106442
|
module2.exports = valid;
|
|
@@ -106447,9 +106447,9 @@ var require_valid3 = __commonJS({
|
|
|
106447
106447
|
var require_clean2 = __commonJS({
|
|
106448
106448
|
"../../node_modules/builtins/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
106449
106449
|
init_import_meta_url();
|
|
106450
|
-
var
|
|
106450
|
+
var parse5 = require_parse6();
|
|
106451
106451
|
var clean = /* @__PURE__ */ __name((version2, options6) => {
|
|
106452
|
-
const s =
|
|
106452
|
+
const s = parse5(version2.trim().replace(/^[=v]+/, ""), options6);
|
|
106453
106453
|
return s ? s.version : null;
|
|
106454
106454
|
}, "clean");
|
|
106455
106455
|
module2.exports = clean;
|
|
@@ -106503,14 +106503,14 @@ var require_eq2 = __commonJS({
|
|
|
106503
106503
|
var require_diff2 = __commonJS({
|
|
106504
106504
|
"../../node_modules/builtins/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
106505
106505
|
init_import_meta_url();
|
|
106506
|
-
var
|
|
106506
|
+
var parse5 = require_parse6();
|
|
106507
106507
|
var eq = require_eq2();
|
|
106508
106508
|
var diff = /* @__PURE__ */ __name((version1, version2) => {
|
|
106509
106509
|
if (eq(version1, version2)) {
|
|
106510
106510
|
return null;
|
|
106511
106511
|
} else {
|
|
106512
|
-
const v1 =
|
|
106513
|
-
const v2 =
|
|
106512
|
+
const v1 = parse5(version1);
|
|
106513
|
+
const v2 = parse5(version2);
|
|
106514
106514
|
const hasPre = v1.prerelease.length || v2.prerelease.length;
|
|
106515
106515
|
const prefix = hasPre ? "pre" : "";
|
|
106516
106516
|
const defaultResult = hasPre ? "prerelease" : "";
|
|
@@ -106562,9 +106562,9 @@ var require_patch2 = __commonJS({
|
|
|
106562
106562
|
var require_prerelease2 = __commonJS({
|
|
106563
106563
|
"../../node_modules/builtins/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
106564
106564
|
init_import_meta_url();
|
|
106565
|
-
var
|
|
106565
|
+
var parse5 = require_parse6();
|
|
106566
106566
|
var prerelease = /* @__PURE__ */ __name((version2, options6) => {
|
|
106567
|
-
const parsed =
|
|
106567
|
+
const parsed = parse5(version2, options6);
|
|
106568
106568
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
106569
106569
|
}, "prerelease");
|
|
106570
106570
|
module2.exports = prerelease;
|
|
@@ -106730,7 +106730,7 @@ var require_coerce2 = __commonJS({
|
|
|
106730
106730
|
"../../node_modules/builtins/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
106731
106731
|
init_import_meta_url();
|
|
106732
106732
|
var SemVer = require_semver3();
|
|
106733
|
-
var
|
|
106733
|
+
var parse5 = require_parse6();
|
|
106734
106734
|
var { re, t: t2 } = require_re2();
|
|
106735
106735
|
var coerce = /* @__PURE__ */ __name((version2, options6) => {
|
|
106736
106736
|
if (version2 instanceof SemVer) {
|
|
@@ -106759,7 +106759,7 @@ var require_coerce2 = __commonJS({
|
|
|
106759
106759
|
if (match === null) {
|
|
106760
106760
|
return null;
|
|
106761
106761
|
}
|
|
106762
|
-
return
|
|
106762
|
+
return parse5(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options6);
|
|
106763
106763
|
}, "coerce");
|
|
106764
106764
|
module2.exports = coerce;
|
|
106765
106765
|
}
|
|
@@ -119597,7 +119597,7 @@ var require_utils6 = __commonJS({
|
|
|
119597
119597
|
var ini = require_ini();
|
|
119598
119598
|
var path42 = require("path");
|
|
119599
119599
|
var stripJsonComments = require_strip_json_comments();
|
|
119600
|
-
var
|
|
119600
|
+
var parse5 = exports2.parse = function(content) {
|
|
119601
119601
|
if (/^\s*{/.test(content))
|
|
119602
119602
|
return JSON.parse(stripJsonComments(content));
|
|
119603
119603
|
return ini.parse(content);
|
|
@@ -119619,7 +119619,7 @@ var require_utils6 = __commonJS({
|
|
|
119619
119619
|
};
|
|
119620
119620
|
var json = exports2.json = function() {
|
|
119621
119621
|
var content = file.apply(null, arguments);
|
|
119622
|
-
return content ?
|
|
119622
|
+
return content ? parse5(content) : null;
|
|
119623
119623
|
};
|
|
119624
119624
|
var env5 = exports2.env = function(prefix, env6) {
|
|
119625
119625
|
env6 = env6 || process.env;
|
|
@@ -119971,18 +119971,18 @@ var require_rc = __commonJS({
|
|
|
119971
119971
|
"../../node_modules/rc/index.js"(exports2, module2) {
|
|
119972
119972
|
init_import_meta_url();
|
|
119973
119973
|
var cc = require_utils6();
|
|
119974
|
-
var
|
|
119974
|
+
var join12 = require("path").join;
|
|
119975
119975
|
var deepExtend = require_deep_extend();
|
|
119976
119976
|
var etc = "/etc";
|
|
119977
119977
|
var win = process.platform === "win32";
|
|
119978
119978
|
var home = win ? process.env.USERPROFILE : process.env.HOME;
|
|
119979
|
-
module2.exports = function(name, defaults, argv,
|
|
119979
|
+
module2.exports = function(name, defaults, argv, parse5) {
|
|
119980
119980
|
if ("string" !== typeof name)
|
|
119981
119981
|
throw new Error("rc(name): name *must* be string");
|
|
119982
119982
|
if (!argv)
|
|
119983
119983
|
argv = require_minimist()(process.argv.slice(2));
|
|
119984
119984
|
defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
|
|
119985
|
-
|
|
119985
|
+
parse5 = parse5 || cc.parse;
|
|
119986
119986
|
var env5 = cc.env(name + "_");
|
|
119987
119987
|
var configs = [defaults];
|
|
119988
119988
|
var configFiles = [];
|
|
@@ -119991,22 +119991,22 @@ var require_rc = __commonJS({
|
|
|
119991
119991
|
return;
|
|
119992
119992
|
var fileConfig = cc.file(file);
|
|
119993
119993
|
if (fileConfig) {
|
|
119994
|
-
configs.push(
|
|
119994
|
+
configs.push(parse5(fileConfig));
|
|
119995
119995
|
configFiles.push(file);
|
|
119996
119996
|
}
|
|
119997
119997
|
}
|
|
119998
119998
|
__name(addConfigFile, "addConfigFile");
|
|
119999
119999
|
if (!win)
|
|
120000
120000
|
[
|
|
120001
|
-
|
|
120002
|
-
|
|
120001
|
+
join12(etc, name, "config"),
|
|
120002
|
+
join12(etc, name + "rc")
|
|
120003
120003
|
].forEach(addConfigFile);
|
|
120004
120004
|
if (home)
|
|
120005
120005
|
[
|
|
120006
|
-
|
|
120007
|
-
|
|
120008
|
-
|
|
120009
|
-
|
|
120006
|
+
join12(home, ".config", name, "config"),
|
|
120007
|
+
join12(home, ".config", name),
|
|
120008
|
+
join12(home, "." + name, "config"),
|
|
120009
|
+
join12(home, "." + name + "rc")
|
|
120010
120010
|
].forEach(addConfigFile);
|
|
120011
120011
|
addConfigFile(cc.find("." + name + "rc"));
|
|
120012
120012
|
if (env5.config)
|
|
@@ -120219,7 +120219,7 @@ var require_update_check = __commonJS({
|
|
|
120219
120219
|
"../../node_modules/update-check/index.js"(exports2, module2) {
|
|
120220
120220
|
init_import_meta_url();
|
|
120221
120221
|
var { URL: URL4 } = require("url");
|
|
120222
|
-
var { join:
|
|
120222
|
+
var { join: join12 } = require("path");
|
|
120223
120223
|
var fs18 = require("fs");
|
|
120224
120224
|
var { promisify: promisify2 } = require("util");
|
|
120225
120225
|
var { tmpdir: tmpdir5 } = require("os");
|
|
@@ -120231,7 +120231,7 @@ var require_update_check = __commonJS({
|
|
|
120231
120231
|
var encode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
|
|
120232
120232
|
var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
|
|
120233
120233
|
const rootDir = tmpdir5();
|
|
120234
|
-
const subDir =
|
|
120234
|
+
const subDir = join12(rootDir, "update-check");
|
|
120235
120235
|
if (!fs18.existsSync(subDir)) {
|
|
120236
120236
|
await mkdir4(subDir);
|
|
120237
120237
|
}
|
|
@@ -120239,7 +120239,7 @@ var require_update_check = __commonJS({
|
|
|
120239
120239
|
if (details.scope) {
|
|
120240
120240
|
name = `${details.scope}-${name}`;
|
|
120241
120241
|
}
|
|
120242
|
-
return
|
|
120242
|
+
return join12(subDir, name);
|
|
120243
120243
|
}, "getFile");
|
|
120244
120244
|
var evaluateCache = /* @__PURE__ */ __name(async (file, time, interval2) => {
|
|
120245
120245
|
if (fs18.existsSync(file)) {
|
|
@@ -127781,7 +127781,7 @@ var import_websocket_server = __toESM(require_websocket_server2(), 1);
|
|
|
127781
127781
|
var wrapper_default = import_websocket.default;
|
|
127782
127782
|
|
|
127783
127783
|
// package.json
|
|
127784
|
-
var version = "2.12.
|
|
127784
|
+
var version = "2.12.2";
|
|
127785
127785
|
var package_default = {
|
|
127786
127786
|
name: "wrangler",
|
|
127787
127787
|
version,
|
|
@@ -130445,7 +130445,7 @@ async function requireAuth(config) {
|
|
|
130445
130445
|
if (!loggedIn) {
|
|
130446
130446
|
if (!isInteractive() || CI.isCI()) {
|
|
130447
130447
|
throw new Error(
|
|
130448
|
-
"In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/api/
|
|
130448
|
+
"In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for wrangler to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN."
|
|
130449
130449
|
);
|
|
130450
130450
|
} else {
|
|
130451
130451
|
throw new Error("Did not login, quitting...");
|
|
@@ -130880,7 +130880,6 @@ function useLocalWorker({
|
|
|
130880
130880
|
localUpstream,
|
|
130881
130881
|
inspect: inspect2,
|
|
130882
130882
|
onReady,
|
|
130883
|
-
logPrefix,
|
|
130884
130883
|
enablePagesAssetsServiceBinding,
|
|
130885
130884
|
experimentalLocal,
|
|
130886
130885
|
accountId,
|
|
@@ -130957,12 +130956,11 @@ function useLocalWorker({
|
|
|
130957
130956
|
dataBlobBindings,
|
|
130958
130957
|
crons,
|
|
130959
130958
|
upstream,
|
|
130960
|
-
logPrefix,
|
|
130961
130959
|
workerDefinitions,
|
|
130962
130960
|
enablePagesAssetsServiceBinding
|
|
130963
130961
|
});
|
|
130964
130962
|
if (experimentalLocal) {
|
|
130965
|
-
const log = await buildMiniflare3Logger(
|
|
130963
|
+
const log = await buildMiniflare3Logger();
|
|
130966
130964
|
const mf3Options = await transformMf2OptionsToMf3Options({
|
|
130967
130965
|
miniflare2Options: options6,
|
|
130968
130966
|
format: format8,
|
|
@@ -131141,7 +131139,6 @@ function useLocalWorker({
|
|
|
131141
131139
|
localProtocol,
|
|
131142
131140
|
localUpstream,
|
|
131143
131141
|
inspect2,
|
|
131144
|
-
logPrefix,
|
|
131145
131142
|
onReady,
|
|
131146
131143
|
enablePagesAssetsServiceBinding,
|
|
131147
131144
|
experimentalLocal,
|
|
@@ -131240,7 +131237,6 @@ function setupMiniflareOptions({
|
|
|
131240
131237
|
dataBlobBindings,
|
|
131241
131238
|
crons,
|
|
131242
131239
|
upstream,
|
|
131243
|
-
logPrefix,
|
|
131244
131240
|
workerDefinitions,
|
|
131245
131241
|
enablePagesAssetsServiceBinding
|
|
131246
131242
|
}) {
|
|
@@ -131326,7 +131322,6 @@ function setupMiniflareOptions({
|
|
|
131326
131322
|
crons,
|
|
131327
131323
|
upstream,
|
|
131328
131324
|
logLevel: logger.loggerLevel,
|
|
131329
|
-
logOptions: logPrefix ? { prefix: logPrefix } : void 0,
|
|
131330
131325
|
enablePagesAssetsServiceBinding
|
|
131331
131326
|
};
|
|
131332
131327
|
const miniflareCLIPath = import_node_path17.default.resolve(
|
|
@@ -131355,13 +131350,13 @@ function setupNodeOptions({
|
|
|
131355
131350
|
return nodeOptions;
|
|
131356
131351
|
}
|
|
131357
131352
|
__name(setupNodeOptions, "setupNodeOptions");
|
|
131358
|
-
async function buildMiniflare3Logger(
|
|
131353
|
+
async function buildMiniflare3Logger() {
|
|
131359
131354
|
const { Log, NoOpLog, LogLevel } = await getMiniflare3();
|
|
131360
131355
|
let level = logger.loggerLevel.toUpperCase();
|
|
131361
131356
|
if (level === "LOG")
|
|
131362
131357
|
level = "INFO";
|
|
131363
131358
|
const logLevel = LogLevel[level];
|
|
131364
|
-
return logLevel === LogLevel.NONE ? new NoOpLog() : new Log(logLevel
|
|
131359
|
+
return logLevel === LogLevel.NONE ? new NoOpLog() : new Log(logLevel);
|
|
131365
131360
|
}
|
|
131366
131361
|
__name(buildMiniflare3Logger, "buildMiniflare3Logger");
|
|
131367
131362
|
async function transformMf2OptionsToMf3Options({
|
|
@@ -131408,7 +131403,7 @@ async function transformMf2OptionsToMf3Options({
|
|
|
131408
131403
|
log
|
|
131409
131404
|
};
|
|
131410
131405
|
if (enablePagesAssetsServiceBinding !== void 0) {
|
|
131411
|
-
const generateASSETSBinding2 = (init_assets(), __toCommonJS(assets_exports));
|
|
131406
|
+
const generateASSETSBinding2 = (init_assets(), __toCommonJS(assets_exports)).default;
|
|
131412
131407
|
options6.serviceBindings = {
|
|
131413
131408
|
...options6.serviceBindings,
|
|
131414
131409
|
ASSETS: await generateASSETSBinding2({
|
|
@@ -131920,6 +131915,7 @@ async function bundleWorker(entry, destination, options6) {
|
|
|
131920
131915
|
doBindings,
|
|
131921
131916
|
jsxFactory,
|
|
131922
131917
|
jsxFragment,
|
|
131918
|
+
entryName,
|
|
131923
131919
|
rules,
|
|
131924
131920
|
watch: watch6,
|
|
131925
131921
|
tsconfig,
|
|
@@ -132041,9 +132037,11 @@ async function bundleWorker(entry, destination, options6) {
|
|
|
132041
132037
|
bundle: true,
|
|
132042
132038
|
absWorkingDir: entry.directory,
|
|
132043
132039
|
outdir: destination,
|
|
132040
|
+
entryNames: entryName || path16.parse(entry.file).name,
|
|
132044
132041
|
...isOutfile ? {
|
|
132045
132042
|
outdir: void 0,
|
|
132046
|
-
outfile: destination
|
|
132043
|
+
outfile: destination,
|
|
132044
|
+
entryNames: void 0
|
|
132047
132045
|
} : {},
|
|
132048
132046
|
inject,
|
|
132049
132047
|
external: ["__STATIC_CONTENT_MANIFEST"],
|
|
@@ -135034,7 +135032,6 @@ function DevSession(props) {
|
|
|
135034
135032
|
queueConsumers: props.queueConsumers,
|
|
135035
135033
|
localProtocol: props.localProtocol,
|
|
135036
135034
|
localUpstream: props.localUpstream,
|
|
135037
|
-
logPrefix: props.logPrefix,
|
|
135038
135035
|
inspect: props.inspect,
|
|
135039
135036
|
onReady: announceAndOnReady,
|
|
135040
135037
|
enablePagesAssetsServiceBinding: props.enablePagesAssetsServiceBinding,
|
|
@@ -135363,7 +135360,6 @@ async function startDevServer(props) {
|
|
|
135363
135360
|
queueConsumers: props.queueConsumers,
|
|
135364
135361
|
localProtocol: props.localProtocol,
|
|
135365
135362
|
localUpstream: props.localUpstream,
|
|
135366
|
-
logPrefix: props.logPrefix,
|
|
135367
135363
|
inspect: props.inspect,
|
|
135368
135364
|
onReady: props.onReady,
|
|
135369
135365
|
enablePagesAssetsServiceBinding: props.enablePagesAssetsServiceBinding,
|
|
@@ -135524,7 +135520,6 @@ async function startLocalServer({
|
|
|
135524
135520
|
localUpstream,
|
|
135525
135521
|
inspect: inspect2,
|
|
135526
135522
|
onReady,
|
|
135527
|
-
logPrefix,
|
|
135528
135523
|
enablePagesAssetsServiceBinding,
|
|
135529
135524
|
experimentalLocal,
|
|
135530
135525
|
accountId,
|
|
@@ -135594,12 +135589,11 @@ async function startLocalServer({
|
|
|
135594
135589
|
dataBlobBindings,
|
|
135595
135590
|
crons,
|
|
135596
135591
|
upstream,
|
|
135597
|
-
logPrefix,
|
|
135598
135592
|
workerDefinitions,
|
|
135599
135593
|
enablePagesAssetsServiceBinding
|
|
135600
135594
|
});
|
|
135601
135595
|
if (experimentalLocal) {
|
|
135602
|
-
const log = await buildMiniflare3Logger(
|
|
135596
|
+
const log = await buildMiniflare3Logger();
|
|
135603
135597
|
const mf3Options = await transformMf2OptionsToMf3Options({
|
|
135604
135598
|
miniflare2Options: options6,
|
|
135605
135599
|
format: format8,
|
|
@@ -138129,9 +138123,9 @@ var YargsInstance = class {
|
|
|
138129
138123
|
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
138130
138124
|
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
138131
138125
|
if (!this.parsed) {
|
|
138132
|
-
const
|
|
138133
|
-
if (isPromise(
|
|
138134
|
-
return
|
|
138126
|
+
const parse5 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
|
|
138127
|
+
if (isPromise(parse5)) {
|
|
138128
|
+
return parse5.then(() => {
|
|
138135
138129
|
return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
|
|
138136
138130
|
});
|
|
138137
138131
|
}
|
|
@@ -138472,9 +138466,9 @@ var YargsInstance = class {
|
|
|
138472
138466
|
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
138473
138467
|
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
138474
138468
|
if (!this.parsed) {
|
|
138475
|
-
const
|
|
138476
|
-
if (isPromise(
|
|
138477
|
-
|
|
138469
|
+
const parse5 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
|
|
138470
|
+
if (isPromise(parse5)) {
|
|
138471
|
+
parse5.then(() => {
|
|
138478
138472
|
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
|
|
138479
138473
|
});
|
|
138480
138474
|
return this;
|
|
@@ -145336,7 +145330,6 @@ init_import_meta_url();
|
|
|
145336
145330
|
// src/pages/build.ts
|
|
145337
145331
|
init_import_meta_url();
|
|
145338
145332
|
var import_node_fs22 = require("node:fs");
|
|
145339
|
-
var import_node_os11 = require("node:os");
|
|
145340
145333
|
var import_node_path34 = require("node:path");
|
|
145341
145334
|
|
|
145342
145335
|
// src/api/pages/create-worker-bundle-contents.ts
|
|
@@ -145397,7 +145390,7 @@ __name(createWorkerBundleFormData, "createWorkerBundleFormData");
|
|
|
145397
145390
|
// src/pages/buildFunctions.ts
|
|
145398
145391
|
init_import_meta_url();
|
|
145399
145392
|
var import_node_fs21 = require("node:fs");
|
|
145400
|
-
var
|
|
145393
|
+
var import_node_os11 = require("node:os");
|
|
145401
145394
|
var import_node_path33 = require("node:path");
|
|
145402
145395
|
|
|
145403
145396
|
// src/pages/errors.ts
|
|
@@ -145544,6 +145537,7 @@ __name(hasOverlappingRules, "hasOverlappingRules");
|
|
|
145544
145537
|
|
|
145545
145538
|
// src/pages/errors.ts
|
|
145546
145539
|
var EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR = 156;
|
|
145540
|
+
var EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR = 157;
|
|
145547
145541
|
var FunctionsNoRoutesError = class extends Error {
|
|
145548
145542
|
constructor(message) {
|
|
145549
145543
|
super(message);
|
|
@@ -145594,6 +145588,7 @@ var import_node_path29 = require("node:path");
|
|
|
145594
145588
|
// src/pages/functions/buildWorker.ts
|
|
145595
145589
|
init_import_meta_url();
|
|
145596
145590
|
var import_promises9 = require("node:fs/promises");
|
|
145591
|
+
var import_node_os10 = require("node:os");
|
|
145597
145592
|
var import_node_path28 = require("node:path");
|
|
145598
145593
|
var import_esbuild3 = require("esbuild");
|
|
145599
145594
|
|
|
@@ -145632,7 +145627,8 @@ var nanoid = /* @__PURE__ */ __name((size = 21) => {
|
|
|
145632
145627
|
// src/pages/functions/buildWorker.ts
|
|
145633
145628
|
function buildWorker({
|
|
145634
145629
|
routesModule,
|
|
145635
|
-
outfile =
|
|
145630
|
+
outfile = (0, import_node_path28.join)((0, import_node_os10.tmpdir)(), `./functionsWorker-${Math.random()}.js`),
|
|
145631
|
+
outdir,
|
|
145636
145632
|
minify = false,
|
|
145637
145633
|
sourcemap = false,
|
|
145638
145634
|
fallbackService = "ASSETS",
|
|
@@ -145644,8 +145640,7 @@ function buildWorker({
|
|
|
145644
145640
|
nodejsCompat,
|
|
145645
145641
|
functionsDirectory,
|
|
145646
145642
|
local,
|
|
145647
|
-
betaD1Shims
|
|
145648
|
-
experimentalWorkerBundle = false
|
|
145643
|
+
betaD1Shims
|
|
145649
145644
|
}) {
|
|
145650
145645
|
return bundleWorker(
|
|
145651
145646
|
{
|
|
@@ -145653,9 +145648,10 @@ function buildWorker({
|
|
|
145653
145648
|
directory: functionsDirectory,
|
|
145654
145649
|
format: "modules"
|
|
145655
145650
|
},
|
|
145656
|
-
(0, import_node_path28.resolve)(outfile),
|
|
145651
|
+
outdir ? (0, import_node_path28.resolve)(outdir) : (0, import_node_path28.resolve)(outfile),
|
|
145657
145652
|
{
|
|
145658
145653
|
inject: [routesModule],
|
|
145654
|
+
...outdir ? { entryName: "index" } : {},
|
|
145659
145655
|
minify,
|
|
145660
145656
|
sourcemap,
|
|
145661
145657
|
watch: watch6,
|
|
@@ -145736,9 +145732,9 @@ function buildWorker({
|
|
|
145736
145732
|
}
|
|
145737
145733
|
}
|
|
145738
145734
|
],
|
|
145739
|
-
isOutfile:
|
|
145735
|
+
isOutfile: !outdir,
|
|
145740
145736
|
serveAssetsFromWorker: false,
|
|
145741
|
-
disableModuleCollection:
|
|
145737
|
+
disableModuleCollection: false,
|
|
145742
145738
|
rules: [],
|
|
145743
145739
|
checkFetch: local,
|
|
145744
145740
|
targetConsumer: local ? "dev" : "publish",
|
|
@@ -145750,7 +145746,8 @@ function buildWorker({
|
|
|
145750
145746
|
__name(buildWorker, "buildWorker");
|
|
145751
145747
|
function buildRawWorker({
|
|
145752
145748
|
workerScriptPath,
|
|
145753
|
-
outfile,
|
|
145749
|
+
outfile = (0, import_node_path28.join)((0, import_node_os10.tmpdir)(), `./functionsWorker-${Math.random()}.js`),
|
|
145750
|
+
outdir,
|
|
145754
145751
|
directory,
|
|
145755
145752
|
minify = false,
|
|
145756
145753
|
sourcemap = false,
|
|
@@ -145761,8 +145758,7 @@ function buildRawWorker({
|
|
|
145761
145758
|
legacyNodeCompat,
|
|
145762
145759
|
nodejsCompat,
|
|
145763
145760
|
local,
|
|
145764
|
-
betaD1Shims
|
|
145765
|
-
experimentalWorkerBundle = false
|
|
145761
|
+
betaD1Shims
|
|
145766
145762
|
}) {
|
|
145767
145763
|
return bundleWorker(
|
|
145768
145764
|
{
|
|
@@ -145770,7 +145766,7 @@ function buildRawWorker({
|
|
|
145770
145766
|
directory: (0, import_node_path28.resolve)(directory),
|
|
145771
145767
|
format: "modules"
|
|
145772
145768
|
},
|
|
145773
|
-
(0, import_node_path28.resolve)(outfile),
|
|
145769
|
+
outdir ? (0, import_node_path28.resolve)(outdir) : (0, import_node_path28.resolve)(outfile),
|
|
145774
145770
|
{
|
|
145775
145771
|
minify,
|
|
145776
145772
|
sourcemap,
|
|
@@ -145787,9 +145783,9 @@ function buildRawWorker({
|
|
|
145787
145783
|
),
|
|
145788
145784
|
doBindings: [],
|
|
145789
145785
|
plugins: [...plugins, buildNotifierPlugin(onEnd)],
|
|
145790
|
-
isOutfile:
|
|
145786
|
+
isOutfile: !outdir,
|
|
145791
145787
|
serveAssetsFromWorker: false,
|
|
145792
|
-
disableModuleCollection:
|
|
145788
|
+
disableModuleCollection: false,
|
|
145793
145789
|
rules: [],
|
|
145794
145790
|
checkFetch: local,
|
|
145795
145791
|
targetConsumer: local ? "dev" : "publish",
|
|
@@ -145840,10 +145836,10 @@ var blockWorkerJsImports = {
|
|
|
145840
145836
|
path: args.path
|
|
145841
145837
|
};
|
|
145842
145838
|
}
|
|
145843
|
-
|
|
145844
|
-
"_worker.js is not being bundled by Wrangler but it is importing from another file.\nThis will throw an error if deployed.\nYou should bundle the Worker in a pre-build step, remove the import if it is unused, or ask Wrangler to bundle it by setting `--bundle`."
|
|
145839
|
+
throw new FatalError(
|
|
145840
|
+
"_worker.js is not being bundled by Wrangler but it is importing from another file.\nThis will throw an error if deployed.\nYou should bundle the Worker in a pre-build step, remove the import if it is unused, or ask Wrangler to bundle it by setting `--bundle`.",
|
|
145841
|
+
1
|
|
145845
145842
|
);
|
|
145846
|
-
process.exit(1);
|
|
145847
145843
|
});
|
|
145848
145844
|
}
|
|
145849
145845
|
};
|
|
@@ -145851,7 +145847,7 @@ var blockWorkerJsImports = {
|
|
|
145851
145847
|
// src/pages/functions/buildPlugin.ts
|
|
145852
145848
|
function buildPlugin({
|
|
145853
145849
|
routesModule,
|
|
145854
|
-
|
|
145850
|
+
outdir,
|
|
145855
145851
|
minify = false,
|
|
145856
145852
|
sourcemap = false,
|
|
145857
145853
|
watch: watch6 = false,
|
|
@@ -145868,9 +145864,10 @@ function buildPlugin({
|
|
|
145868
145864
|
directory: functionsDirectory,
|
|
145869
145865
|
format: "modules"
|
|
145870
145866
|
},
|
|
145871
|
-
(0, import_node_path29.resolve)(
|
|
145867
|
+
(0, import_node_path29.resolve)(outdir),
|
|
145872
145868
|
{
|
|
145873
145869
|
inject: [routesModule],
|
|
145870
|
+
entryName: "index",
|
|
145874
145871
|
minify,
|
|
145875
145872
|
sourcemap,
|
|
145876
145873
|
watch: watch6,
|
|
@@ -145886,34 +145883,47 @@ function buildPlugin({
|
|
|
145886
145883
|
{
|
|
145887
145884
|
name: "Assets",
|
|
145888
145885
|
setup(pluginBuild) {
|
|
145889
|
-
|
|
145890
|
-
const
|
|
145891
|
-
|
|
145892
|
-
|
|
145893
|
-
|
|
145894
|
-
|
|
145895
|
-
|
|
145896
|
-
|
|
145897
|
-
|
|
145898
|
-
|
|
145899
|
-
|
|
145900
|
-
|
|
145901
|
-
|
|
145902
|
-
|
|
145903
|
-
|
|
145904
|
-
|
|
145905
|
-
|
|
145906
|
-
|
|
145907
|
-
|
|
145908
|
-
|
|
145909
|
-
|
|
145910
|
-
|
|
145886
|
+
pluginBuild.onResolve({ filter: /^assets:/ }, async (args) => {
|
|
145887
|
+
const directory = (0, import_node_path29.resolve)(
|
|
145888
|
+
args.resolveDir,
|
|
145889
|
+
args.path.slice("assets:".length)
|
|
145890
|
+
);
|
|
145891
|
+
const exists = await (0, import_promises10.access)(directory).then(() => true).catch(() => false);
|
|
145892
|
+
const isDirectory2 = exists && (await (0, import_promises10.lstat)(directory)).isDirectory();
|
|
145893
|
+
if (!isDirectory2) {
|
|
145894
|
+
return {
|
|
145895
|
+
errors: [
|
|
145896
|
+
{
|
|
145897
|
+
text: `'${directory}' does not exist or is not a directory.`
|
|
145898
|
+
}
|
|
145899
|
+
]
|
|
145900
|
+
};
|
|
145901
|
+
}
|
|
145902
|
+
const path42 = `assets:./${(0, import_node_path29.relative)(outdir, directory)}`;
|
|
145903
|
+
return { path: path42, external: true, namespace: "assets" };
|
|
145904
|
+
});
|
|
145905
|
+
}
|
|
145906
|
+
},
|
|
145907
|
+
{
|
|
145908
|
+
name: "Mark externals",
|
|
145909
|
+
setup(pluginBuild) {
|
|
145910
|
+
pluginBuild.onResolve(
|
|
145911
|
+
{ filter: /.*\.(wasm|bin)$/ },
|
|
145912
|
+
async (args) => {
|
|
145913
|
+
return {
|
|
145914
|
+
external: true,
|
|
145915
|
+
path: `./${(0, import_node_path29.relative)(
|
|
145916
|
+
outdir,
|
|
145917
|
+
(0, import_node_path29.resolve)(args.resolveDir, args.path)
|
|
145918
|
+
)}`
|
|
145919
|
+
};
|
|
145920
|
+
}
|
|
145921
|
+
);
|
|
145911
145922
|
}
|
|
145912
145923
|
}
|
|
145913
145924
|
],
|
|
145914
|
-
isOutfile: true,
|
|
145915
145925
|
serveAssetsFromWorker: false,
|
|
145916
|
-
disableModuleCollection:
|
|
145926
|
+
disableModuleCollection: false,
|
|
145917
145927
|
rules: [],
|
|
145918
145928
|
checkFetch: local,
|
|
145919
145929
|
targetConsumer: local ? "dev" : "publish",
|
|
@@ -146351,6 +146361,7 @@ __name(isUrl, "isUrl");
|
|
|
146351
146361
|
// src/pages/buildFunctions.ts
|
|
146352
146362
|
async function buildFunctions({
|
|
146353
146363
|
outfile,
|
|
146364
|
+
outdir,
|
|
146354
146365
|
outputConfigPath,
|
|
146355
146366
|
functionsDirectory,
|
|
146356
146367
|
minify = false,
|
|
@@ -146364,13 +146375,12 @@ async function buildFunctions({
|
|
|
146364
146375
|
legacyNodeCompat,
|
|
146365
146376
|
nodejsCompat,
|
|
146366
146377
|
local,
|
|
146367
|
-
d1Databases
|
|
146368
|
-
experimentalWorkerBundle = false
|
|
146378
|
+
d1Databases
|
|
146369
146379
|
}) {
|
|
146370
146380
|
RUNNING_BUILDERS.forEach(
|
|
146371
146381
|
(runningBuilder) => runningBuilder.stop && runningBuilder.stop()
|
|
146372
146382
|
);
|
|
146373
|
-
const routesModule = (0, import_node_path33.join)((0,
|
|
146383
|
+
const routesModule = (0, import_node_path33.join)((0, import_node_os11.tmpdir)(), `./functionsRoutes-${Math.random()}.mjs`);
|
|
146374
146384
|
const baseURL = toUrlPath("/");
|
|
146375
146385
|
const config = await generateConfigFromFileTree({
|
|
146376
146386
|
baseDir: functionsDirectory,
|
|
@@ -146399,22 +146409,28 @@ async function buildFunctions({
|
|
|
146399
146409
|
const absoluteFunctionsDirectory = (0, import_node_path33.resolve)(functionsDirectory);
|
|
146400
146410
|
let bundle;
|
|
146401
146411
|
if (plugin) {
|
|
146412
|
+
if (outdir === void 0) {
|
|
146413
|
+
throw new FatalError(
|
|
146414
|
+
"Must specify an output directory when building a Plugin.",
|
|
146415
|
+
1
|
|
146416
|
+
);
|
|
146417
|
+
}
|
|
146402
146418
|
bundle = await buildPlugin({
|
|
146403
146419
|
routesModule,
|
|
146404
|
-
|
|
146420
|
+
outdir,
|
|
146405
146421
|
minify,
|
|
146406
146422
|
sourcemap,
|
|
146407
146423
|
watch: watch6,
|
|
146408
146424
|
legacyNodeCompat,
|
|
146409
146425
|
functionsDirectory: absoluteFunctionsDirectory,
|
|
146410
146426
|
local,
|
|
146411
|
-
betaD1Shims: d1Databases
|
|
146412
|
-
onEnd
|
|
146427
|
+
betaD1Shims: d1Databases
|
|
146413
146428
|
});
|
|
146414
146429
|
} else {
|
|
146415
146430
|
bundle = await buildWorker({
|
|
146416
146431
|
routesModule,
|
|
146417
146432
|
outfile,
|
|
146433
|
+
outdir,
|
|
146418
146434
|
minify,
|
|
146419
146435
|
sourcemap,
|
|
146420
146436
|
fallbackService,
|
|
@@ -146425,8 +146441,7 @@ async function buildFunctions({
|
|
|
146425
146441
|
onEnd,
|
|
146426
146442
|
buildOutputDirectory,
|
|
146427
146443
|
legacyNodeCompat,
|
|
146428
|
-
nodejsCompat
|
|
146429
|
-
experimentalWorkerBundle
|
|
146444
|
+
nodejsCompat
|
|
146430
146445
|
});
|
|
146431
146446
|
}
|
|
146432
146447
|
RUNNING_BUILDERS.push(bundle);
|
|
@@ -146443,9 +146458,12 @@ function Options5(yargs) {
|
|
|
146443
146458
|
}).options({
|
|
146444
146459
|
outfile: {
|
|
146445
146460
|
type: "string",
|
|
146446
|
-
default: "_worker.js",
|
|
146447
146461
|
description: "The location of the output Worker script"
|
|
146448
146462
|
},
|
|
146463
|
+
outdir: {
|
|
146464
|
+
type: "string",
|
|
146465
|
+
description: "Output directory for the bundled Worker"
|
|
146466
|
+
},
|
|
146449
146467
|
"output-config-path": {
|
|
146450
146468
|
type: "string",
|
|
146451
146469
|
description: "The location for the output config file"
|
|
@@ -146506,88 +146524,35 @@ function Options5(yargs) {
|
|
|
146506
146524
|
describe: "Bindings used in Functions (used to register beta product shims)",
|
|
146507
146525
|
deprecated: true,
|
|
146508
146526
|
hidden: true
|
|
146509
|
-
},
|
|
146510
|
-
"experimental-worker-bundle": {
|
|
146511
|
-
type: "boolean",
|
|
146512
|
-
default: false,
|
|
146513
|
-
hidden: true,
|
|
146514
|
-
description: "Whether to process non-JS module imports or not, such as wasm/text/binary, when we run bundling on `functions` or `_worker.js`"
|
|
146515
146527
|
}
|
|
146516
146528
|
}).epilogue(pagesBetaWarning);
|
|
146517
146529
|
}
|
|
146518
146530
|
__name(Options5, "Options");
|
|
146519
|
-
var Handler5 = /* @__PURE__ */ __name(async ({
|
|
146520
|
-
directory,
|
|
146521
|
-
outfile,
|
|
146522
|
-
outputConfigPath,
|
|
146523
|
-
outputRoutesPath: routesOutputPath,
|
|
146524
|
-
minify,
|
|
146525
|
-
sourcemap,
|
|
146526
|
-
fallbackService,
|
|
146527
|
-
watch: watch6,
|
|
146528
|
-
plugin,
|
|
146529
|
-
buildOutputDirectory,
|
|
146530
|
-
nodeCompat: legacyNodeCompat,
|
|
146531
|
-
compatibilityFlags,
|
|
146532
|
-
bindings,
|
|
146533
|
-
experimentalWorkerBundle
|
|
146534
|
-
}) => {
|
|
146531
|
+
var Handler5 = /* @__PURE__ */ __name(async (args) => {
|
|
146535
146532
|
if (!isInPagesCI) {
|
|
146536
146533
|
logger.log(pagesBetaWarning);
|
|
146537
146534
|
}
|
|
146538
|
-
|
|
146539
|
-
console.warn(
|
|
146540
|
-
"Enabling Node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
|
|
146541
|
-
);
|
|
146542
|
-
}
|
|
146543
|
-
const nodejsCompat = compatibilityFlags?.includes("nodejs_compat");
|
|
146544
|
-
if (legacyNodeCompat && nodejsCompat) {
|
|
146545
|
-
throw new Error(
|
|
146546
|
-
"The `nodejs_compat` compatibility flag cannot be used in conjunction with the legacy `--node-compat` flag. If you want to use the Workers runtime Node.js compatibility features, please remove the `--node-compat` argument from your CLI command."
|
|
146547
|
-
);
|
|
146548
|
-
}
|
|
146549
|
-
let d1Databases = void 0;
|
|
146550
|
-
if (bindings) {
|
|
146551
|
-
try {
|
|
146552
|
-
const decodedBindings = JSON.parse(bindings);
|
|
146553
|
-
d1Databases = Object.keys(decodedBindings?.d1_databases || {});
|
|
146554
|
-
} catch {
|
|
146555
|
-
throw new FatalError("Could not parse a valid set of 'bindings'.", 1);
|
|
146556
|
-
}
|
|
146557
|
-
}
|
|
146558
|
-
buildOutputDirectory ??= (0, import_node_path34.dirname)(outfile);
|
|
146559
|
-
const workerScriptPath = (0, import_node_path34.resolve)(buildOutputDirectory, "_worker.js");
|
|
146560
|
-
const foundWorkerScript = (0, import_node_fs22.existsSync)(workerScriptPath);
|
|
146535
|
+
const validatedArgs = validateArgs(args);
|
|
146561
146536
|
let bundle = void 0;
|
|
146562
|
-
if (
|
|
146563
|
-
|
|
146564
|
-
|
|
146565
|
-
|
|
146566
|
-
|
|
146567
|
-
|
|
146568
|
-
|
|
146569
|
-
|
|
146570
|
-
|
|
146571
|
-
|
|
146572
|
-
|
|
146573
|
-
|
|
146574
|
-
|
|
146575
|
-
|
|
146576
|
-
|
|
146577
|
-
directory: buildOutputDirectory,
|
|
146578
|
-
local: false,
|
|
146579
|
-
sourcemap: true,
|
|
146580
|
-
watch: false,
|
|
146581
|
-
onEnd: () => {
|
|
146582
|
-
},
|
|
146583
|
-
betaD1Shims: d1Databases,
|
|
146584
|
-
experimentalWorkerBundle
|
|
146585
|
-
});
|
|
146586
|
-
} else {
|
|
146537
|
+
if (validatedArgs.plugin) {
|
|
146538
|
+
const {
|
|
146539
|
+
directory,
|
|
146540
|
+
outfile,
|
|
146541
|
+
outdir,
|
|
146542
|
+
outputConfigPath,
|
|
146543
|
+
outputRoutesPath: routesOutputPath,
|
|
146544
|
+
minify,
|
|
146545
|
+
sourcemap,
|
|
146546
|
+
fallbackService,
|
|
146547
|
+
watch: watch6,
|
|
146548
|
+
plugin,
|
|
146549
|
+
nodejsCompat,
|
|
146550
|
+
legacyNodeCompat
|
|
146551
|
+
} = validatedArgs;
|
|
146587
146552
|
try {
|
|
146588
|
-
const functionsOutfile = experimentalWorkerBundle ? (0, import_node_path34.join)((0, import_node_os11.tmpdir)(), `./functionsWorker-${Math.random()}.js`) : outfile;
|
|
146589
146553
|
bundle = await buildFunctions({
|
|
146590
|
-
outfile
|
|
146554
|
+
outfile,
|
|
146555
|
+
outdir,
|
|
146591
146556
|
outputConfigPath,
|
|
146592
146557
|
functionsDirectory: directory,
|
|
146593
146558
|
minify,
|
|
@@ -146595,13 +146560,10 @@ We first looked inside the build output directory (${(0, import_node_path34.base
|
|
|
146595
146560
|
fallbackService,
|
|
146596
146561
|
watch: watch6,
|
|
146597
146562
|
plugin,
|
|
146598
|
-
buildOutputDirectory,
|
|
146599
146563
|
legacyNodeCompat,
|
|
146600
146564
|
nodejsCompat,
|
|
146601
146565
|
routesOutputPath,
|
|
146602
|
-
local: false
|
|
146603
|
-
d1Databases,
|
|
146604
|
-
experimentalWorkerBundle
|
|
146566
|
+
local: false
|
|
146605
146567
|
});
|
|
146606
146568
|
} catch (e2) {
|
|
146607
146569
|
if (e2 instanceof FunctionsNoRoutesError) {
|
|
@@ -146613,18 +146575,192 @@ We first looked inside the build output directory (${(0, import_node_path34.base
|
|
|
146613
146575
|
throw e2;
|
|
146614
146576
|
}
|
|
146615
146577
|
}
|
|
146616
|
-
|
|
146617
|
-
|
|
146618
|
-
|
|
146619
|
-
|
|
146620
|
-
|
|
146621
|
-
|
|
146578
|
+
if (outfile && outfile !== bundle.resolvedEntryPointPath) {
|
|
146579
|
+
(0, import_node_fs22.writeFileSync)(
|
|
146580
|
+
outfile,
|
|
146581
|
+
`export { default } from './${(0, import_node_path34.relative)(
|
|
146582
|
+
(0, import_node_path34.dirname)(outfile),
|
|
146583
|
+
bundle.resolvedEntryPointPath
|
|
146584
|
+
)}'`
|
|
146585
|
+
);
|
|
146586
|
+
}
|
|
146587
|
+
} else {
|
|
146588
|
+
const {
|
|
146589
|
+
directory,
|
|
146622
146590
|
outfile,
|
|
146623
|
-
|
|
146624
|
-
|
|
146591
|
+
outdir,
|
|
146592
|
+
outputConfigPath,
|
|
146593
|
+
outputRoutesPath: routesOutputPath,
|
|
146594
|
+
minify,
|
|
146595
|
+
sourcemap,
|
|
146596
|
+
fallbackService,
|
|
146597
|
+
watch: watch6,
|
|
146598
|
+
plugin,
|
|
146599
|
+
buildOutputDirectory,
|
|
146600
|
+
nodejsCompat,
|
|
146601
|
+
legacyNodeCompat,
|
|
146602
|
+
bindings,
|
|
146603
|
+
workerScriptPath
|
|
146604
|
+
} = validatedArgs;
|
|
146605
|
+
let d1Databases = void 0;
|
|
146606
|
+
if (bindings) {
|
|
146607
|
+
try {
|
|
146608
|
+
const decodedBindings = JSON.parse(bindings);
|
|
146609
|
+
d1Databases = Object.keys(decodedBindings?.d1_databases || {});
|
|
146610
|
+
} catch {
|
|
146611
|
+
throw new FatalError("Could not parse a valid set of 'bindings'.", 1);
|
|
146612
|
+
}
|
|
146613
|
+
}
|
|
146614
|
+
if (workerScriptPath) {
|
|
146615
|
+
bundle = await buildRawWorker({
|
|
146616
|
+
workerScriptPath,
|
|
146617
|
+
outdir,
|
|
146618
|
+
directory: buildOutputDirectory,
|
|
146619
|
+
local: false,
|
|
146620
|
+
sourcemap,
|
|
146621
|
+
watch: watch6,
|
|
146622
|
+
betaD1Shims: d1Databases
|
|
146623
|
+
});
|
|
146624
|
+
} else {
|
|
146625
|
+
try {
|
|
146626
|
+
bundle = await buildFunctions({
|
|
146627
|
+
outdir,
|
|
146628
|
+
outputConfigPath,
|
|
146629
|
+
functionsDirectory: directory,
|
|
146630
|
+
minify,
|
|
146631
|
+
sourcemap,
|
|
146632
|
+
fallbackService,
|
|
146633
|
+
watch: watch6,
|
|
146634
|
+
plugin,
|
|
146635
|
+
buildOutputDirectory,
|
|
146636
|
+
legacyNodeCompat,
|
|
146637
|
+
nodejsCompat,
|
|
146638
|
+
routesOutputPath,
|
|
146639
|
+
local: false,
|
|
146640
|
+
d1Databases
|
|
146641
|
+
});
|
|
146642
|
+
} catch (e2) {
|
|
146643
|
+
if (e2 instanceof FunctionsNoRoutesError) {
|
|
146644
|
+
throw new FatalError(
|
|
146645
|
+
getFunctionsNoRoutesWarning(directory),
|
|
146646
|
+
EXIT_CODE_FUNCTIONS_NO_ROUTES_ERROR
|
|
146647
|
+
);
|
|
146648
|
+
} else {
|
|
146649
|
+
throw e2;
|
|
146650
|
+
}
|
|
146651
|
+
}
|
|
146652
|
+
}
|
|
146653
|
+
if (outfile) {
|
|
146654
|
+
const workerBundleContents = await createUploadWorkerBundleContents(
|
|
146655
|
+
bundle
|
|
146656
|
+
);
|
|
146657
|
+
(0, import_node_fs22.mkdirSync)((0, import_node_path34.dirname)(outfile), { recursive: true });
|
|
146658
|
+
(0, import_node_fs22.writeFileSync)(
|
|
146659
|
+
outfile,
|
|
146660
|
+
Buffer.from(await workerBundleContents.arrayBuffer())
|
|
146661
|
+
);
|
|
146662
|
+
}
|
|
146625
146663
|
}
|
|
146626
146664
|
await sendMetricsEvent("build pages functions");
|
|
146627
146665
|
}, "Handler");
|
|
146666
|
+
var validateArgs = /* @__PURE__ */ __name((args) => {
|
|
146667
|
+
if (args.outdir && args.outfile) {
|
|
146668
|
+
throw new FatalError(
|
|
146669
|
+
"Cannot specify both an `--outdir` and an `--outfile`.",
|
|
146670
|
+
1
|
|
146671
|
+
);
|
|
146672
|
+
}
|
|
146673
|
+
if (args.plugin) {
|
|
146674
|
+
if (args.outfile) {
|
|
146675
|
+
logger.warn(
|
|
146676
|
+
"Creating a Pages Plugin with `--outfile` is now deprecated. Please use `--outdir` instead."
|
|
146677
|
+
);
|
|
146678
|
+
args.outdir = (0, import_node_path34.dirname)((0, import_node_path34.resolve)(args.outfile));
|
|
146679
|
+
} else if (!args.outfile && !args.outdir) {
|
|
146680
|
+
args.outfile ??= "_worker.js";
|
|
146681
|
+
args.outdir = ".";
|
|
146682
|
+
logger.warn(
|
|
146683
|
+
"Creating a Pages Plugin without `--outdir` is now deprecated. Please add an `--outdir` argument."
|
|
146684
|
+
);
|
|
146685
|
+
}
|
|
146686
|
+
if (args.bindings) {
|
|
146687
|
+
throw new FatalError(
|
|
146688
|
+
"The `--bindings` flag cannot be used when creating a Pages Plugin with `--plugin`.",
|
|
146689
|
+
1
|
|
146690
|
+
);
|
|
146691
|
+
}
|
|
146692
|
+
if (args.buildOutputDirectory) {
|
|
146693
|
+
throw new FatalError(
|
|
146694
|
+
"The `--build-output-directory` flag cannot be used when creating a Pages Plugin with `--plugin`.",
|
|
146695
|
+
1
|
|
146696
|
+
);
|
|
146697
|
+
}
|
|
146698
|
+
} else {
|
|
146699
|
+
if (!args.outdir) {
|
|
146700
|
+
args.outfile ??= "_worker.bundle";
|
|
146701
|
+
}
|
|
146702
|
+
args.buildOutputDirectory ??= args.outfile ? (0, import_node_path34.dirname)(args.outfile) : ".";
|
|
146703
|
+
}
|
|
146704
|
+
if (args.buildOutputDirectory) {
|
|
146705
|
+
args.buildOutputDirectory = (0, import_node_path34.resolve)(args.buildOutputDirectory);
|
|
146706
|
+
}
|
|
146707
|
+
if (args.outdir) {
|
|
146708
|
+
args.outdir = (0, import_node_path34.resolve)(args.outdir);
|
|
146709
|
+
}
|
|
146710
|
+
if (args.outfile) {
|
|
146711
|
+
args.outfile = (0, import_node_path34.resolve)(args.outfile);
|
|
146712
|
+
}
|
|
146713
|
+
const { nodeCompat: legacyNodeCompat, ...argsExceptNodeCompat } = args;
|
|
146714
|
+
if (legacyNodeCompat) {
|
|
146715
|
+
console.warn(
|
|
146716
|
+
"Enabling Node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
|
|
146717
|
+
);
|
|
146718
|
+
}
|
|
146719
|
+
const nodejsCompat = !!args.compatibilityFlags?.includes("nodejs_compat");
|
|
146720
|
+
if (legacyNodeCompat && nodejsCompat) {
|
|
146721
|
+
throw new Error(
|
|
146722
|
+
"The `nodejs_compat` compatibility flag cannot be used in conjunction with the legacy `--node-compat` flag. If you want to use the Workers runtime Node.js compatibility features, please remove the `--node-compat` argument from your CLI command."
|
|
146723
|
+
);
|
|
146724
|
+
}
|
|
146725
|
+
let workerScriptPath;
|
|
146726
|
+
if (args.buildOutputDirectory) {
|
|
146727
|
+
const prospectiveWorkerScriptPath = (0, import_node_path34.resolve)(
|
|
146728
|
+
args.buildOutputDirectory,
|
|
146729
|
+
"_worker.js"
|
|
146730
|
+
);
|
|
146731
|
+
const foundWorkerScript = (0, import_node_fs22.existsSync)(prospectiveWorkerScriptPath);
|
|
146732
|
+
if (foundWorkerScript) {
|
|
146733
|
+
workerScriptPath = prospectiveWorkerScriptPath;
|
|
146734
|
+
} else if (!foundWorkerScript && !(0, import_node_fs22.existsSync)(args.directory)) {
|
|
146735
|
+
throw new FatalError(
|
|
146736
|
+
`Could not find anything to build.
|
|
146737
|
+
We first looked inside the build output directory (${(0, import_node_path34.basename)(
|
|
146738
|
+
(0, import_node_path34.resolve)(args.buildOutputDirectory)
|
|
146739
|
+
)}), then looked for the Functions directory (${(0, import_node_path34.basename)(
|
|
146740
|
+
args.directory
|
|
146741
|
+
)}) but couldn't find anything to build.
|
|
146742
|
+
\u27A4 If you are trying to build _worker.js, please make sure you provide the [--build-output-directory] containing your static files.
|
|
146743
|
+
\u27A4 If you are trying to build Pages Functions, please make sure [directory] points to the location of your Functions files.`,
|
|
146744
|
+
EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR
|
|
146745
|
+
);
|
|
146746
|
+
}
|
|
146747
|
+
} else if (!(0, import_node_fs22.existsSync)(args.directory)) {
|
|
146748
|
+
throw new FatalError(
|
|
146749
|
+
`Could not find anything to build.
|
|
146750
|
+
We looked for the Functions directory (${(0, import_node_path34.basename)(
|
|
146751
|
+
args.directory
|
|
146752
|
+
)}) but couldn't find anything to build.
|
|
146753
|
+
\u27A4 Please make sure [directory] points to the location of your Functions files.`,
|
|
146754
|
+
EXIT_CODE_FUNCTIONS_NOTHING_TO_BUILD_ERROR
|
|
146755
|
+
);
|
|
146756
|
+
}
|
|
146757
|
+
return {
|
|
146758
|
+
...argsExceptNodeCompat,
|
|
146759
|
+
workerScriptPath,
|
|
146760
|
+
nodejsCompat,
|
|
146761
|
+
legacyNodeCompat
|
|
146762
|
+
};
|
|
146763
|
+
}, "validateArgs");
|
|
146628
146764
|
|
|
146629
146765
|
// src/pages/deployment-tails.ts
|
|
146630
146766
|
init_import_meta_url();
|
|
@@ -147472,15 +147608,9 @@ function Options7(yargs) {
|
|
|
147472
147608
|
hidden: true
|
|
147473
147609
|
},
|
|
147474
147610
|
"no-bundle": {
|
|
147475
|
-
type: "boolean",
|
|
147476
|
-
default: true,
|
|
147477
|
-
description: "Whether to run bundling on `_worker.js`"
|
|
147478
|
-
},
|
|
147479
|
-
"experimental-worker-bundle": {
|
|
147480
147611
|
type: "boolean",
|
|
147481
147612
|
default: false,
|
|
147482
|
-
|
|
147483
|
-
description: "Whether to process non-JS module imports or not, such as wasm/text/binary, when we run bundling on `functions` or `_worker.js`"
|
|
147613
|
+
description: "Whether to run bundling on `_worker.js`"
|
|
147484
147614
|
},
|
|
147485
147615
|
binding: {
|
|
147486
147616
|
type: "array",
|
|
@@ -147563,7 +147693,6 @@ var Handler7 = /* @__PURE__ */ __name(async ({
|
|
|
147563
147693
|
proxy: requestedProxyPort,
|
|
147564
147694
|
bundle,
|
|
147565
147695
|
noBundle,
|
|
147566
|
-
experimentalWorkerBundle,
|
|
147567
147696
|
scriptPath: singleWorkerScriptPath,
|
|
147568
147697
|
binding: bindings = [],
|
|
147569
147698
|
kv: kvs = [],
|
|
@@ -147642,7 +147771,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
147642
147771
|
let runBuild = /* @__PURE__ */ __name(async () => {
|
|
147643
147772
|
await checkRawWorker(workerScriptPath, () => scriptReadyResolve());
|
|
147644
147773
|
}, "runBuild");
|
|
147645
|
-
const enableBundling =
|
|
147774
|
+
const enableBundling = bundle ?? !noBundle;
|
|
147646
147775
|
if (enableBundling) {
|
|
147647
147776
|
scriptPath = (0, import_node_path35.join)((0, import_node_os12.tmpdir)(), `./bundledWorker-${Math.random()}.mjs`);
|
|
147648
147777
|
runBuild = /* @__PURE__ */ __name(async () => {
|
|
@@ -147655,8 +147784,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
147655
147784
|
local: true,
|
|
147656
147785
|
sourcemap: true,
|
|
147657
147786
|
watch: true,
|
|
147658
|
-
onEnd: () => scriptReadyResolve()
|
|
147659
|
-
experimentalWorkerBundle
|
|
147787
|
+
onEnd: () => scriptReadyResolve()
|
|
147660
147788
|
});
|
|
147661
147789
|
} catch (e2) {
|
|
147662
147790
|
logger.warn("Failed to bundle _worker.js.", e2);
|
|
@@ -147664,7 +147792,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
147664
147792
|
}, "runBuild");
|
|
147665
147793
|
}
|
|
147666
147794
|
await runBuild();
|
|
147667
|
-
(0, import_chokidar4.watch)([
|
|
147795
|
+
(0, import_chokidar4.watch)([workerScriptPath], {
|
|
147668
147796
|
persistent: true,
|
|
147669
147797
|
ignoreInitial: true
|
|
147670
147798
|
}).on("all", async () => {
|
|
@@ -147696,8 +147824,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
147696
147824
|
buildOutputDirectory: directory,
|
|
147697
147825
|
legacyNodeCompat,
|
|
147698
147826
|
nodejsCompat,
|
|
147699
|
-
local: true
|
|
147700
|
-
experimentalWorkerBundle
|
|
147827
|
+
local: true
|
|
147701
147828
|
});
|
|
147702
147829
|
await sendMetricsEvent("build pages functions");
|
|
147703
147830
|
}, "buildFn");
|
|
@@ -147853,8 +147980,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
|
147853
147980
|
persist,
|
|
147854
147981
|
persistTo,
|
|
147855
147982
|
inspect: void 0,
|
|
147856
|
-
|
|
147857
|
-
logLevel: logLevel ?? "warn",
|
|
147983
|
+
logLevel,
|
|
147858
147984
|
experimental: {
|
|
147859
147985
|
d1Databases: d1s.map((binding) => ({
|
|
147860
147986
|
binding: binding.toString(),
|
|
@@ -148827,8 +148953,7 @@ async function publish2({
|
|
|
148827
148953
|
commitHash,
|
|
148828
148954
|
commitDirty,
|
|
148829
148955
|
functionsDirectory: customFunctionsDirectory,
|
|
148830
|
-
bundle
|
|
148831
|
-
experimentalWorkerBundle
|
|
148956
|
+
bundle
|
|
148832
148957
|
}) {
|
|
148833
148958
|
let _headers, _redirects, _routesGenerated, _routesCustom, _workerJS;
|
|
148834
148959
|
const workerScriptPath = (0, import_node_path38.resolve)(directory, "_worker.js");
|
|
@@ -148866,26 +148991,26 @@ async function publish2({
|
|
|
148866
148991
|
project.deployment_configs[isProduction ? "production" : "preview"].d1_databases ?? {}
|
|
148867
148992
|
);
|
|
148868
148993
|
if (!_workerJS && (0, import_node_fs25.existsSync)(functionsDirectory)) {
|
|
148869
|
-
const outfile = (0, import_node_path38.join)((0, import_node_os13.tmpdir)(), `./functionsWorker-${Math.random()}.js`);
|
|
148870
148994
|
const outputConfigPath = (0, import_node_path38.join)(
|
|
148871
148995
|
(0, import_node_os13.tmpdir)(),
|
|
148872
148996
|
`functions-filepath-routing-config-${Math.random()}.json`
|
|
148873
148997
|
);
|
|
148874
148998
|
try {
|
|
148875
148999
|
workerBundle = await buildFunctions({
|
|
148876
|
-
outfile,
|
|
148877
149000
|
outputConfigPath,
|
|
148878
149001
|
functionsDirectory,
|
|
148879
149002
|
onEnd: () => {
|
|
148880
149003
|
},
|
|
148881
|
-
buildOutputDirectory:
|
|
149004
|
+
buildOutputDirectory: directory,
|
|
148882
149005
|
routesOutputPath,
|
|
148883
149006
|
local: false,
|
|
148884
149007
|
d1Databases,
|
|
148885
|
-
nodejsCompat
|
|
148886
|
-
experimentalWorkerBundle
|
|
149008
|
+
nodejsCompat
|
|
148887
149009
|
});
|
|
148888
|
-
builtFunctions = (0, import_node_fs25.readFileSync)(
|
|
149010
|
+
builtFunctions = (0, import_node_fs25.readFileSync)(
|
|
149011
|
+
workerBundle.resolvedEntryPointPath,
|
|
149012
|
+
"utf-8"
|
|
149013
|
+
);
|
|
148889
149014
|
filepathRoutingConfig = (0, import_node_fs25.readFileSync)(outputConfigPath, "utf-8");
|
|
148890
149015
|
} catch (e2) {
|
|
148891
149016
|
if (e2 instanceof FunctionsNoRoutesError) {
|
|
@@ -148935,9 +149060,7 @@ async function publish2({
|
|
|
148935
149060
|
);
|
|
148936
149061
|
}
|
|
148937
149062
|
if (_workerJS) {
|
|
148938
|
-
|
|
148939
|
-
const enableBundling = bundle || experimentalWorkerBundle;
|
|
148940
|
-
if (enableBundling) {
|
|
149063
|
+
if (bundle) {
|
|
148941
149064
|
const outfile = (0, import_node_path38.join)((0, import_node_os13.tmpdir)(), `./bundledWorker-${Math.random()}.mjs`);
|
|
148942
149065
|
workerBundle = await buildRawWorker({
|
|
148943
149066
|
workerScriptPath,
|
|
@@ -148949,30 +149072,27 @@ async function publish2({
|
|
|
148949
149072
|
onEnd: () => {
|
|
148950
149073
|
},
|
|
148951
149074
|
betaD1Shims: d1Databases,
|
|
148952
|
-
nodejsCompat
|
|
148953
|
-
experimentalWorkerBundle
|
|
149075
|
+
nodejsCompat
|
|
148954
149076
|
});
|
|
148955
|
-
workerFileContents = (0, import_node_fs25.readFileSync)(outfile, "utf8");
|
|
148956
149077
|
} else {
|
|
148957
149078
|
await checkRawWorker(workerScriptPath, () => {
|
|
148958
149079
|
});
|
|
149080
|
+
workerBundle = {
|
|
149081
|
+
modules: [],
|
|
149082
|
+
dependencies: {},
|
|
149083
|
+
stop: void 0,
|
|
149084
|
+
resolvedEntryPointPath: workerScriptPath,
|
|
149085
|
+
bundleType: "esm"
|
|
149086
|
+
};
|
|
148959
149087
|
}
|
|
148960
|
-
|
|
148961
|
-
|
|
148962
|
-
|
|
148963
|
-
|
|
148964
|
-
|
|
148965
|
-
|
|
148966
|
-
|
|
148967
|
-
|
|
148968
|
-
logger.log(`\u2728 Uploading Worker bundle`);
|
|
148969
|
-
} else {
|
|
148970
|
-
formData.append(
|
|
148971
|
-
"_worker.js",
|
|
148972
|
-
new import_undici12.File([workerFileContents], "_worker.js")
|
|
148973
|
-
);
|
|
148974
|
-
logger.log(`\u2728 Uploading _worker.js`);
|
|
148975
|
-
}
|
|
149088
|
+
const workerBundleContents = await createUploadWorkerBundleContents(
|
|
149089
|
+
workerBundle
|
|
149090
|
+
);
|
|
149091
|
+
formData.append(
|
|
149092
|
+
"_worker.bundle",
|
|
149093
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
|
149094
|
+
);
|
|
149095
|
+
logger.log(`\u2728 Uploading Worker bundle`);
|
|
148976
149096
|
if (_routesCustom) {
|
|
148977
149097
|
try {
|
|
148978
149098
|
const routesCustomJSON = JSON.parse(_routesCustom);
|
|
@@ -148990,19 +149110,14 @@ async function publish2({
|
|
|
148990
149110
|
}
|
|
148991
149111
|
}
|
|
148992
149112
|
if (builtFunctions && !_workerJS) {
|
|
148993
|
-
|
|
148994
|
-
|
|
148995
|
-
|
|
148996
|
-
|
|
148997
|
-
|
|
148998
|
-
|
|
148999
|
-
|
|
149000
|
-
|
|
149001
|
-
logger.log(`\u2728 Uploading Functions bundle`);
|
|
149002
|
-
} else {
|
|
149003
|
-
formData.append("_worker.js", new import_undici12.File([builtFunctions], "_worker.js"));
|
|
149004
|
-
logger.log(`\u2728 Uploading Functions`);
|
|
149005
|
-
}
|
|
149113
|
+
const workerBundleContents = await createUploadWorkerBundleContents(
|
|
149114
|
+
workerBundle
|
|
149115
|
+
);
|
|
149116
|
+
formData.append(
|
|
149117
|
+
"_worker.bundle",
|
|
149118
|
+
new import_undici12.File([workerBundleContents], "_worker.bundle")
|
|
149119
|
+
);
|
|
149120
|
+
logger.log(`\u2728 Uploading Functions bundle`);
|
|
149006
149121
|
if (_routesCustom) {
|
|
149007
149122
|
try {
|
|
149008
149123
|
const routesCustomJSON = JSON.parse(_routesCustom);
|
|
@@ -149078,15 +149193,9 @@ function Options9(yargs) {
|
|
|
149078
149193
|
hidden: true
|
|
149079
149194
|
},
|
|
149080
149195
|
"no-bundle": {
|
|
149081
|
-
type: "boolean",
|
|
149082
|
-
default: true,
|
|
149083
|
-
description: "Whether to run bundling on `_worker.js` before deploying"
|
|
149084
|
-
},
|
|
149085
|
-
"experimental-worker-bundle": {
|
|
149086
149196
|
type: "boolean",
|
|
149087
149197
|
default: false,
|
|
149088
|
-
|
|
149089
|
-
description: "Whether to process non-JS module imports or not, such as wasm/text/binary, when we run bundling on `functions` or `_worker.js`"
|
|
149198
|
+
description: "Whether to run bundling on `_worker.js` before deploying"
|
|
149090
149199
|
},
|
|
149091
149200
|
config: {
|
|
149092
149201
|
describe: "Pages does not support wrangler.toml",
|
|
@@ -149106,7 +149215,6 @@ var Handler9 = /* @__PURE__ */ __name(async ({
|
|
|
149106
149215
|
skipCaching,
|
|
149107
149216
|
bundle,
|
|
149108
149217
|
noBundle,
|
|
149109
|
-
experimentalWorkerBundle,
|
|
149110
149218
|
config: wranglerConfig
|
|
149111
149219
|
}) => {
|
|
149112
149220
|
if (wranglerConfig) {
|
|
@@ -149242,8 +149350,7 @@ To silence this warning, pass in --commit-dirty=true`
|
|
|
149242
149350
|
commitMessage,
|
|
149243
149351
|
commitHash,
|
|
149244
149352
|
commitDirty,
|
|
149245
|
-
bundle: bundle ?? !noBundle
|
|
149246
|
-
experimentalWorkerBundle
|
|
149353
|
+
bundle: bundle ?? !noBundle
|
|
149247
149354
|
});
|
|
149248
149355
|
saveToConfigCache(PAGES_CONFIG_CACHE_FILENAME, {
|
|
149249
149356
|
account_id: accountId,
|
|
@@ -152097,7 +152204,6 @@ Switch out --local for ${import_chalk10.default.bold(
|
|
|
152097
152204
|
bindings,
|
|
152098
152205
|
crons: configParam.triggers.crons,
|
|
152099
152206
|
queueConsumers: configParam.queues.consumers,
|
|
152100
|
-
logPrefix: args.logPrefix,
|
|
152101
152207
|
onReady: args.onReady,
|
|
152102
152208
|
inspect: args.inspect ?? true,
|
|
152103
152209
|
showInteractiveDevSession: args.showInteractiveDevSession,
|
|
@@ -152204,7 +152310,6 @@ async function startApiDev(args) {
|
|
|
152204
152310
|
bindings,
|
|
152205
152311
|
crons: configParam.triggers.crons,
|
|
152206
152312
|
queueConsumers: configParam.queues.consumers,
|
|
152207
|
-
logPrefix: args.logPrefix,
|
|
152208
152313
|
onReady: args.onReady,
|
|
152209
152314
|
inspect: args.inspect ?? true,
|
|
152210
152315
|
showInteractiveDevSession: args.showInteractiveDevSession,
|