@vercel/static-build 2.9.28 → 2.9.30
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/dist/index.js +757 -1014
- package/package.json +6 -8
package/dist/index.js
CHANGED
|
@@ -2240,7 +2240,7 @@ var require_lib2 = __commonJS({
|
|
|
2240
2240
|
let accum = [];
|
|
2241
2241
|
let accumBytes = 0;
|
|
2242
2242
|
let abort = false;
|
|
2243
|
-
return new Body.Promise(function(
|
|
2243
|
+
return new Body.Promise(function(resolve, reject) {
|
|
2244
2244
|
let resTimeout;
|
|
2245
2245
|
if (_this4.timeout) {
|
|
2246
2246
|
resTimeout = setTimeout(function() {
|
|
@@ -2274,7 +2274,7 @@ var require_lib2 = __commonJS({
|
|
|
2274
2274
|
}
|
|
2275
2275
|
clearTimeout(resTimeout);
|
|
2276
2276
|
try {
|
|
2277
|
-
|
|
2277
|
+
resolve(Buffer.concat(accum, accumBytes));
|
|
2278
2278
|
} catch (err) {
|
|
2279
2279
|
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err));
|
|
2280
2280
|
}
|
|
@@ -2949,7 +2949,7 @@ var require_lib2 = __commonJS({
|
|
|
2949
2949
|
throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
|
|
2950
2950
|
}
|
|
2951
2951
|
Body.Promise = fetch.Promise;
|
|
2952
|
-
return new fetch.Promise(function(
|
|
2952
|
+
return new fetch.Promise(function(resolve, reject) {
|
|
2953
2953
|
const request = new Request(url, opts);
|
|
2954
2954
|
const options = getNodeRequestOptions(request);
|
|
2955
2955
|
const send = (options.protocol === "https:" ? https : http).request;
|
|
@@ -3061,7 +3061,7 @@ var require_lib2 = __commonJS({
|
|
|
3061
3061
|
requestOpts.body = void 0;
|
|
3062
3062
|
requestOpts.headers.delete("content-length");
|
|
3063
3063
|
}
|
|
3064
|
-
|
|
3064
|
+
resolve(fetch(new Request(locationURL, requestOpts)));
|
|
3065
3065
|
finalize();
|
|
3066
3066
|
return;
|
|
3067
3067
|
}
|
|
@@ -3083,7 +3083,7 @@ var require_lib2 = __commonJS({
|
|
|
3083
3083
|
const codings = headers.get("Content-Encoding");
|
|
3084
3084
|
if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
|
|
3085
3085
|
response = new Response(body, response_options);
|
|
3086
|
-
|
|
3086
|
+
resolve(response);
|
|
3087
3087
|
return;
|
|
3088
3088
|
}
|
|
3089
3089
|
const zlibOptions = {
|
|
@@ -3093,7 +3093,7 @@ var require_lib2 = __commonJS({
|
|
|
3093
3093
|
if (codings == "gzip" || codings == "x-gzip") {
|
|
3094
3094
|
body = body.pipe(zlib.createGunzip(zlibOptions));
|
|
3095
3095
|
response = new Response(body, response_options);
|
|
3096
|
-
|
|
3096
|
+
resolve(response);
|
|
3097
3097
|
return;
|
|
3098
3098
|
}
|
|
3099
3099
|
if (codings == "deflate" || codings == "x-deflate") {
|
|
@@ -3105,18 +3105,18 @@ var require_lib2 = __commonJS({
|
|
|
3105
3105
|
body = body.pipe(zlib.createInflateRaw());
|
|
3106
3106
|
}
|
|
3107
3107
|
response = new Response(body, response_options);
|
|
3108
|
-
|
|
3108
|
+
resolve(response);
|
|
3109
3109
|
});
|
|
3110
3110
|
return;
|
|
3111
3111
|
}
|
|
3112
3112
|
if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
|
|
3113
3113
|
body = body.pipe(zlib.createBrotliDecompress());
|
|
3114
3114
|
response = new Response(body, response_options);
|
|
3115
|
-
|
|
3115
|
+
resolve(response);
|
|
3116
3116
|
return;
|
|
3117
3117
|
}
|
|
3118
3118
|
response = new Response(body, response_options);
|
|
3119
|
-
|
|
3119
|
+
resolve(response);
|
|
3120
3120
|
});
|
|
3121
3121
|
writeToStream(req, request);
|
|
3122
3122
|
});
|
|
@@ -3140,14 +3140,14 @@ var require_get_port = __commonJS({
|
|
|
3140
3140
|
"../../node_modules/.pnpm/get-port@5.0.0/node_modules/get-port/index.js"(exports, module2) {
|
|
3141
3141
|
"use strict";
|
|
3142
3142
|
var net = require("net");
|
|
3143
|
-
var getAvailablePort = (options) => new Promise((
|
|
3143
|
+
var getAvailablePort = (options) => new Promise((resolve, reject) => {
|
|
3144
3144
|
const server = net.createServer();
|
|
3145
3145
|
server.unref();
|
|
3146
3146
|
server.on("error", reject);
|
|
3147
3147
|
server.listen(options, () => {
|
|
3148
3148
|
const { port } = server.address();
|
|
3149
3149
|
server.close(() => {
|
|
3150
|
-
|
|
3150
|
+
resolve(port);
|
|
3151
3151
|
});
|
|
3152
3152
|
});
|
|
3153
3153
|
});
|
|
@@ -3203,18 +3203,18 @@ var require_is_port_reachable = __commonJS({
|
|
|
3203
3203
|
var net = require("net");
|
|
3204
3204
|
module2.exports = (port, options) => {
|
|
3205
3205
|
options = Object.assign({ timeout: 1e3 }, options);
|
|
3206
|
-
return new Promise((
|
|
3206
|
+
return new Promise((resolve) => {
|
|
3207
3207
|
const socket = new net.Socket();
|
|
3208
3208
|
const onError = () => {
|
|
3209
3209
|
socket.destroy();
|
|
3210
|
-
|
|
3210
|
+
resolve(false);
|
|
3211
3211
|
};
|
|
3212
3212
|
socket.setTimeout(options.timeout);
|
|
3213
3213
|
socket.once("error", onError);
|
|
3214
3214
|
socket.once("timeout", onError);
|
|
3215
3215
|
socket.connect(port, options.host, () => {
|
|
3216
3216
|
socket.end();
|
|
3217
|
-
|
|
3217
|
+
resolve(true);
|
|
3218
3218
|
});
|
|
3219
3219
|
});
|
|
3220
3220
|
};
|
|
@@ -6978,7 +6978,7 @@ var require_dist2 = __commonJS({
|
|
|
6978
6978
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
6979
6979
|
var src_exports2 = {};
|
|
6980
6980
|
__export2(src_exports2, {
|
|
6981
|
-
errorToString: () =>
|
|
6981
|
+
errorToString: () => errorToString,
|
|
6982
6982
|
isErrnoException: () => isErrnoException3,
|
|
6983
6983
|
isError: () => isError,
|
|
6984
6984
|
isErrorLike: () => isErrorLike,
|
|
@@ -6996,7 +6996,7 @@ var require_dist2 = __commonJS({
|
|
|
6996
6996
|
return isError(error) && "code" in error;
|
|
6997
6997
|
};
|
|
6998
6998
|
var isErrorLike = (error) => isObject(error) && "message" in error;
|
|
6999
|
-
var
|
|
6999
|
+
var errorToString = (error, fallback) => {
|
|
7000
7000
|
if (isError(error) || isErrorLike(error))
|
|
7001
7001
|
return error.message;
|
|
7002
7002
|
if (typeof error === "string")
|
|
@@ -7006,7 +7006,7 @@ var require_dist2 = __commonJS({
|
|
|
7006
7006
|
var normalizeError = (error) => {
|
|
7007
7007
|
if (isError(error))
|
|
7008
7008
|
return error;
|
|
7009
|
-
const errorMessage =
|
|
7009
|
+
const errorMessage = errorToString(error);
|
|
7010
7010
|
return isErrorLike(error) ? Object.assign(new Error(errorMessage), error) : new Error(errorMessage);
|
|
7011
7011
|
};
|
|
7012
7012
|
function isSpawnError(v) {
|
|
@@ -7053,15 +7053,15 @@ var require_read_config_file = __commonJS({
|
|
|
7053
7053
|
module2.exports = __toCommonJS2(read_config_file_exports);
|
|
7054
7054
|
var import_js_yaml = __toESM2(require_js_yaml2());
|
|
7055
7055
|
var import_smol_toml = require_dist();
|
|
7056
|
-
var
|
|
7057
|
-
var
|
|
7058
|
-
var { readFile } =
|
|
7056
|
+
var import_fs5 = require("fs");
|
|
7057
|
+
var import_error_utils3 = require_dist2();
|
|
7058
|
+
var { readFile } = import_fs5.promises;
|
|
7059
7059
|
async function readFileOrNull(file) {
|
|
7060
7060
|
try {
|
|
7061
7061
|
const data = await readFile(file);
|
|
7062
7062
|
return data;
|
|
7063
7063
|
} catch (error) {
|
|
7064
|
-
if (!(0,
|
|
7064
|
+
if (!(0, import_error_utils3.isErrnoException)(error)) {
|
|
7065
7065
|
throw error;
|
|
7066
7066
|
}
|
|
7067
7067
|
if (error.code !== "ENOENT") {
|
|
@@ -7141,11 +7141,11 @@ var require_frameworks = __commonJS({
|
|
|
7141
7141
|
frameworks: () => frameworks2
|
|
7142
7142
|
});
|
|
7143
7143
|
module2.exports = __toCommonJS2(frameworks_exports);
|
|
7144
|
-
var
|
|
7145
|
-
var
|
|
7144
|
+
var import_path7 = require("path");
|
|
7145
|
+
var import_fs5 = require("fs");
|
|
7146
7146
|
var import_read_config_file = require_read_config_file();
|
|
7147
7147
|
__reExport(frameworks_exports, require_types(), module2.exports);
|
|
7148
|
-
var { readdir, readFile, unlink } =
|
|
7148
|
+
var { readdir, readFile, unlink } = import_fs5.promises;
|
|
7149
7149
|
var frameworks2 = [
|
|
7150
7150
|
{
|
|
7151
7151
|
name: "Blitz.js (Legacy)",
|
|
@@ -7268,7 +7268,7 @@ var require_frameworks = __commonJS({
|
|
|
7268
7268
|
getOutputDirName: async () => "public",
|
|
7269
7269
|
defaultRoutes: async (dirPrefix) => {
|
|
7270
7270
|
try {
|
|
7271
|
-
const nowRoutesPath = (0,
|
|
7271
|
+
const nowRoutesPath = (0, import_path7.join)(
|
|
7272
7272
|
dirPrefix,
|
|
7273
7273
|
"public",
|
|
7274
7274
|
"__now_routes_g4t5bY.json"
|
|
@@ -7556,10 +7556,10 @@ var require_frameworks = __commonJS({
|
|
|
7556
7556
|
getOutputDirName: async (dirPrefix) => {
|
|
7557
7557
|
const base = "build";
|
|
7558
7558
|
try {
|
|
7559
|
-
const location = (0,
|
|
7559
|
+
const location = (0, import_path7.join)(dirPrefix, base);
|
|
7560
7560
|
const content = await readdir(location, { withFileTypes: true });
|
|
7561
7561
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
7562
|
-
return (0,
|
|
7562
|
+
return (0, import_path7.join)(base, content[0].name);
|
|
7563
7563
|
}
|
|
7564
7564
|
} catch (error) {
|
|
7565
7565
|
console.error(`Error detecting output directory: `, error);
|
|
@@ -7637,10 +7637,10 @@ var require_frameworks = __commonJS({
|
|
|
7637
7637
|
getOutputDirName: async (dirPrefix) => {
|
|
7638
7638
|
const base = "build";
|
|
7639
7639
|
try {
|
|
7640
|
-
const location = (0,
|
|
7640
|
+
const location = (0, import_path7.join)(dirPrefix, base);
|
|
7641
7641
|
const content = await readdir(location, { withFileTypes: true });
|
|
7642
7642
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
7643
|
-
return (0,
|
|
7643
|
+
return (0, import_path7.join)(base, content[0].name);
|
|
7644
7644
|
}
|
|
7645
7645
|
} catch (error) {
|
|
7646
7646
|
console.error(`Error detecting output directory: `, error);
|
|
@@ -7801,7 +7801,7 @@ var require_frameworks = __commonJS({
|
|
|
7801
7801
|
}
|
|
7802
7802
|
},
|
|
7803
7803
|
dependency: "@dojo/cli",
|
|
7804
|
-
getOutputDirName: async () => (0,
|
|
7804
|
+
getOutputDirName: async () => (0, import_path7.join)("output", "dist"),
|
|
7805
7805
|
defaultRoutes: [
|
|
7806
7806
|
{
|
|
7807
7807
|
handle: "filesystem"
|
|
@@ -8036,12 +8036,12 @@ var require_frameworks = __commonJS({
|
|
|
8036
8036
|
getOutputDirName: async (dirPrefix) => {
|
|
8037
8037
|
const base = "dist";
|
|
8038
8038
|
try {
|
|
8039
|
-
const location = (0,
|
|
8039
|
+
const location = (0, import_path7.join)(dirPrefix, base);
|
|
8040
8040
|
const content = await readdir(location, { withFileTypes: true });
|
|
8041
8041
|
if (content.length === 1 && content[0].isDirectory()) {
|
|
8042
|
-
const potentialOutDir = (0,
|
|
8043
|
-
const potentialOutDirWithBrowser = (0,
|
|
8044
|
-
return (0,
|
|
8042
|
+
const potentialOutDir = (0, import_path7.join)(base, content[0].name);
|
|
8043
|
+
const potentialOutDirWithBrowser = (0, import_path7.join)(potentialOutDir, "browser");
|
|
8044
|
+
return (0, import_fs5.existsSync)(potentialOutDirWithBrowser) ? potentialOutDirWithBrowser : potentialOutDir;
|
|
8045
8045
|
}
|
|
8046
8046
|
} catch (error) {
|
|
8047
8047
|
console.error(`Error detecting output directory: `, error);
|
|
@@ -8093,10 +8093,10 @@ var require_frameworks = __commonJS({
|
|
|
8093
8093
|
getOutputDirName: async (dirPrefix) => {
|
|
8094
8094
|
const base = "build";
|
|
8095
8095
|
try {
|
|
8096
|
-
const location = (0,
|
|
8096
|
+
const location = (0, import_path7.join)(dirPrefix, base);
|
|
8097
8097
|
const content = await readdir(location);
|
|
8098
8098
|
const paths = content.filter((item) => !item.includes("."));
|
|
8099
|
-
return (0,
|
|
8099
|
+
return (0, import_path7.join)(base, paths[0]);
|
|
8100
8100
|
} catch (error) {
|
|
8101
8101
|
console.error(`Error detecting output directory: `, error);
|
|
8102
8102
|
}
|
|
@@ -8714,7 +8714,7 @@ var require_frameworks = __commonJS({
|
|
|
8714
8714
|
getOutputDirName: async (dirPrefix) => {
|
|
8715
8715
|
const config = await (0, import_read_config_file.readConfigFile)(
|
|
8716
8716
|
["config.json", "config.yaml", "config.toml"].map((fileName) => {
|
|
8717
|
-
return (0,
|
|
8717
|
+
return (0, import_path7.join)(dirPrefix, fileName);
|
|
8718
8718
|
})
|
|
8719
8719
|
);
|
|
8720
8720
|
return config && config.publishDir || "public";
|
|
@@ -8755,7 +8755,7 @@ var require_frameworks = __commonJS({
|
|
|
8755
8755
|
},
|
|
8756
8756
|
getOutputDirName: async (dirPrefix) => {
|
|
8757
8757
|
const config = await (0, import_read_config_file.readConfigFile)(
|
|
8758
|
-
(0,
|
|
8758
|
+
(0, import_path7.join)(dirPrefix, "_config.yml")
|
|
8759
8759
|
);
|
|
8760
8760
|
return config && config.destination || "_site";
|
|
8761
8761
|
},
|
|
@@ -11375,8 +11375,8 @@ var require_universalify = __commonJS({
|
|
|
11375
11375
|
if (typeof args[args.length - 1] === "function")
|
|
11376
11376
|
fn.apply(this, args);
|
|
11377
11377
|
else {
|
|
11378
|
-
return new Promise((
|
|
11379
|
-
args.push((err, res) => err != null ? reject(err) :
|
|
11378
|
+
return new Promise((resolve, reject) => {
|
|
11379
|
+
args.push((err, res) => err != null ? reject(err) : resolve(res));
|
|
11380
11380
|
fn.apply(this, args);
|
|
11381
11381
|
});
|
|
11382
11382
|
}
|
|
@@ -11423,56 +11423,56 @@ var require_polyfills = __commonJS({
|
|
|
11423
11423
|
}
|
|
11424
11424
|
var chdir;
|
|
11425
11425
|
module2.exports = patch;
|
|
11426
|
-
function patch(
|
|
11426
|
+
function patch(fs5) {
|
|
11427
11427
|
if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
11428
|
-
patchLchmod(
|
|
11429
|
-
}
|
|
11430
|
-
if (!
|
|
11431
|
-
patchLutimes(
|
|
11432
|
-
}
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
if (
|
|
11452
|
-
|
|
11428
|
+
patchLchmod(fs5);
|
|
11429
|
+
}
|
|
11430
|
+
if (!fs5.lutimes) {
|
|
11431
|
+
patchLutimes(fs5);
|
|
11432
|
+
}
|
|
11433
|
+
fs5.chown = chownFix(fs5.chown);
|
|
11434
|
+
fs5.fchown = chownFix(fs5.fchown);
|
|
11435
|
+
fs5.lchown = chownFix(fs5.lchown);
|
|
11436
|
+
fs5.chmod = chmodFix(fs5.chmod);
|
|
11437
|
+
fs5.fchmod = chmodFix(fs5.fchmod);
|
|
11438
|
+
fs5.lchmod = chmodFix(fs5.lchmod);
|
|
11439
|
+
fs5.chownSync = chownFixSync(fs5.chownSync);
|
|
11440
|
+
fs5.fchownSync = chownFixSync(fs5.fchownSync);
|
|
11441
|
+
fs5.lchownSync = chownFixSync(fs5.lchownSync);
|
|
11442
|
+
fs5.chmodSync = chmodFixSync(fs5.chmodSync);
|
|
11443
|
+
fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
|
|
11444
|
+
fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
|
|
11445
|
+
fs5.stat = statFix(fs5.stat);
|
|
11446
|
+
fs5.fstat = statFix(fs5.fstat);
|
|
11447
|
+
fs5.lstat = statFix(fs5.lstat);
|
|
11448
|
+
fs5.statSync = statFixSync(fs5.statSync);
|
|
11449
|
+
fs5.fstatSync = statFixSync(fs5.fstatSync);
|
|
11450
|
+
fs5.lstatSync = statFixSync(fs5.lstatSync);
|
|
11451
|
+
if (fs5.chmod && !fs5.lchmod) {
|
|
11452
|
+
fs5.lchmod = function(path6, mode, cb) {
|
|
11453
11453
|
if (cb)
|
|
11454
11454
|
process.nextTick(cb);
|
|
11455
11455
|
};
|
|
11456
|
-
|
|
11456
|
+
fs5.lchmodSync = function() {
|
|
11457
11457
|
};
|
|
11458
11458
|
}
|
|
11459
|
-
if (
|
|
11460
|
-
|
|
11459
|
+
if (fs5.chown && !fs5.lchown) {
|
|
11460
|
+
fs5.lchown = function(path6, uid, gid, cb) {
|
|
11461
11461
|
if (cb)
|
|
11462
11462
|
process.nextTick(cb);
|
|
11463
11463
|
};
|
|
11464
|
-
|
|
11464
|
+
fs5.lchownSync = function() {
|
|
11465
11465
|
};
|
|
11466
11466
|
}
|
|
11467
11467
|
if (platform === "win32") {
|
|
11468
|
-
|
|
11468
|
+
fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : function(fs$rename) {
|
|
11469
11469
|
function rename(from, to, cb) {
|
|
11470
11470
|
var start = Date.now();
|
|
11471
11471
|
var backoff = 0;
|
|
11472
11472
|
fs$rename(from, to, function CB(er) {
|
|
11473
11473
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
11474
11474
|
setTimeout(function() {
|
|
11475
|
-
|
|
11475
|
+
fs5.stat(to, function(stater, st) {
|
|
11476
11476
|
if (stater && stater.code === "ENOENT")
|
|
11477
11477
|
fs$rename(from, to, CB);
|
|
11478
11478
|
else
|
|
@@ -11490,9 +11490,9 @@ var require_polyfills = __commonJS({
|
|
|
11490
11490
|
if (Object.setPrototypeOf)
|
|
11491
11491
|
Object.setPrototypeOf(rename, fs$rename);
|
|
11492
11492
|
return rename;
|
|
11493
|
-
}(
|
|
11493
|
+
}(fs5.rename);
|
|
11494
11494
|
}
|
|
11495
|
-
|
|
11495
|
+
fs5.read = typeof fs5.read !== "function" ? fs5.read : function(fs$read) {
|
|
11496
11496
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
11497
11497
|
var callback;
|
|
11498
11498
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -11500,23 +11500,23 @@ var require_polyfills = __commonJS({
|
|
|
11500
11500
|
callback = function(er, _, __) {
|
|
11501
11501
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
11502
11502
|
eagCounter++;
|
|
11503
|
-
return fs$read.call(
|
|
11503
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
11504
11504
|
}
|
|
11505
11505
|
callback_.apply(this, arguments);
|
|
11506
11506
|
};
|
|
11507
11507
|
}
|
|
11508
|
-
return fs$read.call(
|
|
11508
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
11509
11509
|
}
|
|
11510
11510
|
if (Object.setPrototypeOf)
|
|
11511
11511
|
Object.setPrototypeOf(read, fs$read);
|
|
11512
11512
|
return read;
|
|
11513
|
-
}(
|
|
11514
|
-
|
|
11513
|
+
}(fs5.read);
|
|
11514
|
+
fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : function(fs$readSync) {
|
|
11515
11515
|
return function(fd, buffer, offset, length, position) {
|
|
11516
11516
|
var eagCounter = 0;
|
|
11517
11517
|
while (true) {
|
|
11518
11518
|
try {
|
|
11519
|
-
return fs$readSync.call(
|
|
11519
|
+
return fs$readSync.call(fs5, fd, buffer, offset, length, position);
|
|
11520
11520
|
} catch (er) {
|
|
11521
11521
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
11522
11522
|
eagCounter++;
|
|
@@ -11526,10 +11526,10 @@ var require_polyfills = __commonJS({
|
|
|
11526
11526
|
}
|
|
11527
11527
|
}
|
|
11528
11528
|
};
|
|
11529
|
-
}(
|
|
11530
|
-
function patchLchmod(
|
|
11531
|
-
|
|
11532
|
-
|
|
11529
|
+
}(fs5.readSync);
|
|
11530
|
+
function patchLchmod(fs6) {
|
|
11531
|
+
fs6.lchmod = function(path6, mode, callback) {
|
|
11532
|
+
fs6.open(
|
|
11533
11533
|
path6,
|
|
11534
11534
|
constants2.O_WRONLY | constants2.O_SYMLINK,
|
|
11535
11535
|
mode,
|
|
@@ -11539,8 +11539,8 @@ var require_polyfills = __commonJS({
|
|
|
11539
11539
|
callback(err);
|
|
11540
11540
|
return;
|
|
11541
11541
|
}
|
|
11542
|
-
|
|
11543
|
-
|
|
11542
|
+
fs6.fchmod(fd, mode, function(err2) {
|
|
11543
|
+
fs6.close(fd, function(err22) {
|
|
11544
11544
|
if (callback)
|
|
11545
11545
|
callback(err2 || err22);
|
|
11546
11546
|
});
|
|
@@ -11548,68 +11548,68 @@ var require_polyfills = __commonJS({
|
|
|
11548
11548
|
}
|
|
11549
11549
|
);
|
|
11550
11550
|
};
|
|
11551
|
-
|
|
11552
|
-
var fd =
|
|
11551
|
+
fs6.lchmodSync = function(path6, mode) {
|
|
11552
|
+
var fd = fs6.openSync(path6, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
|
|
11553
11553
|
var threw = true;
|
|
11554
11554
|
var ret;
|
|
11555
11555
|
try {
|
|
11556
|
-
ret =
|
|
11556
|
+
ret = fs6.fchmodSync(fd, mode);
|
|
11557
11557
|
threw = false;
|
|
11558
11558
|
} finally {
|
|
11559
11559
|
if (threw) {
|
|
11560
11560
|
try {
|
|
11561
|
-
|
|
11561
|
+
fs6.closeSync(fd);
|
|
11562
11562
|
} catch (er) {
|
|
11563
11563
|
}
|
|
11564
11564
|
} else {
|
|
11565
|
-
|
|
11565
|
+
fs6.closeSync(fd);
|
|
11566
11566
|
}
|
|
11567
11567
|
}
|
|
11568
11568
|
return ret;
|
|
11569
11569
|
};
|
|
11570
11570
|
}
|
|
11571
|
-
function patchLutimes(
|
|
11572
|
-
if (constants2.hasOwnProperty("O_SYMLINK") &&
|
|
11573
|
-
|
|
11574
|
-
|
|
11571
|
+
function patchLutimes(fs6) {
|
|
11572
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
|
|
11573
|
+
fs6.lutimes = function(path6, at, mt, cb) {
|
|
11574
|
+
fs6.open(path6, constants2.O_SYMLINK, function(er, fd) {
|
|
11575
11575
|
if (er) {
|
|
11576
11576
|
if (cb)
|
|
11577
11577
|
cb(er);
|
|
11578
11578
|
return;
|
|
11579
11579
|
}
|
|
11580
|
-
|
|
11581
|
-
|
|
11580
|
+
fs6.futimes(fd, at, mt, function(er2) {
|
|
11581
|
+
fs6.close(fd, function(er22) {
|
|
11582
11582
|
if (cb)
|
|
11583
11583
|
cb(er2 || er22);
|
|
11584
11584
|
});
|
|
11585
11585
|
});
|
|
11586
11586
|
});
|
|
11587
11587
|
};
|
|
11588
|
-
|
|
11589
|
-
var fd =
|
|
11588
|
+
fs6.lutimesSync = function(path6, at, mt) {
|
|
11589
|
+
var fd = fs6.openSync(path6, constants2.O_SYMLINK);
|
|
11590
11590
|
var ret;
|
|
11591
11591
|
var threw = true;
|
|
11592
11592
|
try {
|
|
11593
|
-
ret =
|
|
11593
|
+
ret = fs6.futimesSync(fd, at, mt);
|
|
11594
11594
|
threw = false;
|
|
11595
11595
|
} finally {
|
|
11596
11596
|
if (threw) {
|
|
11597
11597
|
try {
|
|
11598
|
-
|
|
11598
|
+
fs6.closeSync(fd);
|
|
11599
11599
|
} catch (er) {
|
|
11600
11600
|
}
|
|
11601
11601
|
} else {
|
|
11602
|
-
|
|
11602
|
+
fs6.closeSync(fd);
|
|
11603
11603
|
}
|
|
11604
11604
|
}
|
|
11605
11605
|
return ret;
|
|
11606
11606
|
};
|
|
11607
|
-
} else if (
|
|
11608
|
-
|
|
11607
|
+
} else if (fs6.futimes) {
|
|
11608
|
+
fs6.lutimes = function(_a, _b, _c, cb) {
|
|
11609
11609
|
if (cb)
|
|
11610
11610
|
process.nextTick(cb);
|
|
11611
11611
|
};
|
|
11612
|
-
|
|
11612
|
+
fs6.lutimesSync = function() {
|
|
11613
11613
|
};
|
|
11614
11614
|
}
|
|
11615
11615
|
}
|
|
@@ -11617,7 +11617,7 @@ var require_polyfills = __commonJS({
|
|
|
11617
11617
|
if (!orig)
|
|
11618
11618
|
return orig;
|
|
11619
11619
|
return function(target, mode, cb) {
|
|
11620
|
-
return orig.call(
|
|
11620
|
+
return orig.call(fs5, target, mode, function(er) {
|
|
11621
11621
|
if (chownErOk(er))
|
|
11622
11622
|
er = null;
|
|
11623
11623
|
if (cb)
|
|
@@ -11630,7 +11630,7 @@ var require_polyfills = __commonJS({
|
|
|
11630
11630
|
return orig;
|
|
11631
11631
|
return function(target, mode) {
|
|
11632
11632
|
try {
|
|
11633
|
-
return orig.call(
|
|
11633
|
+
return orig.call(fs5, target, mode);
|
|
11634
11634
|
} catch (er) {
|
|
11635
11635
|
if (!chownErOk(er))
|
|
11636
11636
|
throw er;
|
|
@@ -11641,7 +11641,7 @@ var require_polyfills = __commonJS({
|
|
|
11641
11641
|
if (!orig)
|
|
11642
11642
|
return orig;
|
|
11643
11643
|
return function(target, uid, gid, cb) {
|
|
11644
|
-
return orig.call(
|
|
11644
|
+
return orig.call(fs5, target, uid, gid, function(er) {
|
|
11645
11645
|
if (chownErOk(er))
|
|
11646
11646
|
er = null;
|
|
11647
11647
|
if (cb)
|
|
@@ -11654,7 +11654,7 @@ var require_polyfills = __commonJS({
|
|
|
11654
11654
|
return orig;
|
|
11655
11655
|
return function(target, uid, gid) {
|
|
11656
11656
|
try {
|
|
11657
|
-
return orig.call(
|
|
11657
|
+
return orig.call(fs5, target, uid, gid);
|
|
11658
11658
|
} catch (er) {
|
|
11659
11659
|
if (!chownErOk(er))
|
|
11660
11660
|
throw er;
|
|
@@ -11679,14 +11679,14 @@ var require_polyfills = __commonJS({
|
|
|
11679
11679
|
if (cb)
|
|
11680
11680
|
cb.apply(this, arguments);
|
|
11681
11681
|
}
|
|
11682
|
-
return options ? orig.call(
|
|
11682
|
+
return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
|
|
11683
11683
|
};
|
|
11684
11684
|
}
|
|
11685
11685
|
function statFixSync(orig) {
|
|
11686
11686
|
if (!orig)
|
|
11687
11687
|
return orig;
|
|
11688
11688
|
return function(target, options) {
|
|
11689
|
-
var stats = options ? orig.call(
|
|
11689
|
+
var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
|
|
11690
11690
|
if (stats) {
|
|
11691
11691
|
if (stats.uid < 0)
|
|
11692
11692
|
stats.uid += 4294967296;
|
|
@@ -11717,7 +11717,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11717
11717
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module2) {
|
|
11718
11718
|
var Stream = require("stream").Stream;
|
|
11719
11719
|
module2.exports = legacy;
|
|
11720
|
-
function legacy(
|
|
11720
|
+
function legacy(fs5) {
|
|
11721
11721
|
return {
|
|
11722
11722
|
ReadStream,
|
|
11723
11723
|
WriteStream
|
|
@@ -11762,7 +11762,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11762
11762
|
});
|
|
11763
11763
|
return;
|
|
11764
11764
|
}
|
|
11765
|
-
|
|
11765
|
+
fs5.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
11766
11766
|
if (err) {
|
|
11767
11767
|
self.emit("error", err);
|
|
11768
11768
|
self.readable = false;
|
|
@@ -11802,7 +11802,7 @@ var require_legacy_streams = __commonJS({
|
|
|
11802
11802
|
this.busy = false;
|
|
11803
11803
|
this._queue = [];
|
|
11804
11804
|
if (this.fd === null) {
|
|
11805
|
-
this._open =
|
|
11805
|
+
this._open = fs5.open;
|
|
11806
11806
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
11807
11807
|
this.flush();
|
|
11808
11808
|
}
|
|
@@ -11837,7 +11837,7 @@ var require_clone = __commonJS({
|
|
|
11837
11837
|
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
11838
11838
|
var require_graceful_fs = __commonJS({
|
|
11839
11839
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module2) {
|
|
11840
|
-
var
|
|
11840
|
+
var fs5 = require("fs");
|
|
11841
11841
|
var polyfills = require_polyfills();
|
|
11842
11842
|
var legacy = require_legacy_streams();
|
|
11843
11843
|
var clone = require_clone();
|
|
@@ -11860,21 +11860,21 @@ var require_graceful_fs = __commonJS({
|
|
|
11860
11860
|
}
|
|
11861
11861
|
});
|
|
11862
11862
|
}
|
|
11863
|
-
var
|
|
11863
|
+
var debug4 = noop;
|
|
11864
11864
|
if (util.debuglog)
|
|
11865
|
-
|
|
11865
|
+
debug4 = util.debuglog("gfs4");
|
|
11866
11866
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
11867
|
-
|
|
11867
|
+
debug4 = function() {
|
|
11868
11868
|
var m = util.format.apply(util, arguments);
|
|
11869
11869
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
11870
11870
|
console.error(m);
|
|
11871
11871
|
};
|
|
11872
|
-
if (!
|
|
11872
|
+
if (!fs5[gracefulQueue]) {
|
|
11873
11873
|
queue = global[gracefulQueue] || [];
|
|
11874
|
-
publishQueue(
|
|
11875
|
-
|
|
11874
|
+
publishQueue(fs5, queue);
|
|
11875
|
+
fs5.close = function(fs$close) {
|
|
11876
11876
|
function close(fd, cb) {
|
|
11877
|
-
return fs$close.call(
|
|
11877
|
+
return fs$close.call(fs5, fd, function(err) {
|
|
11878
11878
|
if (!err) {
|
|
11879
11879
|
resetQueue();
|
|
11880
11880
|
}
|
|
@@ -11886,40 +11886,40 @@ var require_graceful_fs = __commonJS({
|
|
|
11886
11886
|
value: fs$close
|
|
11887
11887
|
});
|
|
11888
11888
|
return close;
|
|
11889
|
-
}(
|
|
11890
|
-
|
|
11889
|
+
}(fs5.close);
|
|
11890
|
+
fs5.closeSync = function(fs$closeSync) {
|
|
11891
11891
|
function closeSync(fd) {
|
|
11892
|
-
fs$closeSync.apply(
|
|
11892
|
+
fs$closeSync.apply(fs5, arguments);
|
|
11893
11893
|
resetQueue();
|
|
11894
11894
|
}
|
|
11895
11895
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
11896
11896
|
value: fs$closeSync
|
|
11897
11897
|
});
|
|
11898
11898
|
return closeSync;
|
|
11899
|
-
}(
|
|
11899
|
+
}(fs5.closeSync);
|
|
11900
11900
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
11901
11901
|
process.on("exit", function() {
|
|
11902
|
-
|
|
11903
|
-
require("assert").equal(
|
|
11902
|
+
debug4(fs5[gracefulQueue]);
|
|
11903
|
+
require("assert").equal(fs5[gracefulQueue].length, 0);
|
|
11904
11904
|
});
|
|
11905
11905
|
}
|
|
11906
11906
|
}
|
|
11907
11907
|
var queue;
|
|
11908
11908
|
if (!global[gracefulQueue]) {
|
|
11909
|
-
publishQueue(global,
|
|
11910
|
-
}
|
|
11911
|
-
module2.exports = patch(clone(
|
|
11912
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
11913
|
-
module2.exports = patch(
|
|
11914
|
-
|
|
11915
|
-
}
|
|
11916
|
-
function patch(
|
|
11917
|
-
polyfills(
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
var fs$readFile =
|
|
11922
|
-
|
|
11909
|
+
publishQueue(global, fs5[gracefulQueue]);
|
|
11910
|
+
}
|
|
11911
|
+
module2.exports = patch(clone(fs5));
|
|
11912
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
|
|
11913
|
+
module2.exports = patch(fs5);
|
|
11914
|
+
fs5.__patched = true;
|
|
11915
|
+
}
|
|
11916
|
+
function patch(fs6) {
|
|
11917
|
+
polyfills(fs6);
|
|
11918
|
+
fs6.gracefulify = patch;
|
|
11919
|
+
fs6.createReadStream = createReadStream;
|
|
11920
|
+
fs6.createWriteStream = createWriteStream;
|
|
11921
|
+
var fs$readFile = fs6.readFile;
|
|
11922
|
+
fs6.readFile = readFile;
|
|
11923
11923
|
function readFile(path6, options, cb) {
|
|
11924
11924
|
if (typeof options === "function")
|
|
11925
11925
|
cb = options, options = null;
|
|
@@ -11935,8 +11935,8 @@ var require_graceful_fs = __commonJS({
|
|
|
11935
11935
|
});
|
|
11936
11936
|
}
|
|
11937
11937
|
}
|
|
11938
|
-
var fs$writeFile =
|
|
11939
|
-
|
|
11938
|
+
var fs$writeFile = fs6.writeFile;
|
|
11939
|
+
fs6.writeFile = writeFile;
|
|
11940
11940
|
function writeFile(path6, data, options, cb) {
|
|
11941
11941
|
if (typeof options === "function")
|
|
11942
11942
|
cb = options, options = null;
|
|
@@ -11952,9 +11952,9 @@ var require_graceful_fs = __commonJS({
|
|
|
11952
11952
|
});
|
|
11953
11953
|
}
|
|
11954
11954
|
}
|
|
11955
|
-
var fs$appendFile =
|
|
11955
|
+
var fs$appendFile = fs6.appendFile;
|
|
11956
11956
|
if (fs$appendFile)
|
|
11957
|
-
|
|
11957
|
+
fs6.appendFile = appendFile2;
|
|
11958
11958
|
function appendFile2(path6, data, options, cb) {
|
|
11959
11959
|
if (typeof options === "function")
|
|
11960
11960
|
cb = options, options = null;
|
|
@@ -11970,9 +11970,9 @@ var require_graceful_fs = __commonJS({
|
|
|
11970
11970
|
});
|
|
11971
11971
|
}
|
|
11972
11972
|
}
|
|
11973
|
-
var fs$copyFile =
|
|
11973
|
+
var fs$copyFile = fs6.copyFile;
|
|
11974
11974
|
if (fs$copyFile)
|
|
11975
|
-
|
|
11975
|
+
fs6.copyFile = copyFile;
|
|
11976
11976
|
function copyFile(src, dest, flags, cb) {
|
|
11977
11977
|
if (typeof flags === "function") {
|
|
11978
11978
|
cb = flags;
|
|
@@ -11990,8 +11990,8 @@ var require_graceful_fs = __commonJS({
|
|
|
11990
11990
|
});
|
|
11991
11991
|
}
|
|
11992
11992
|
}
|
|
11993
|
-
var fs$readdir =
|
|
11994
|
-
|
|
11993
|
+
var fs$readdir = fs6.readdir;
|
|
11994
|
+
fs6.readdir = readdir;
|
|
11995
11995
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
11996
11996
|
function readdir(path6, options, cb) {
|
|
11997
11997
|
if (typeof options === "function")
|
|
@@ -12032,21 +12032,21 @@ var require_graceful_fs = __commonJS({
|
|
|
12032
12032
|
}
|
|
12033
12033
|
}
|
|
12034
12034
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
12035
|
-
var legStreams = legacy(
|
|
12035
|
+
var legStreams = legacy(fs6);
|
|
12036
12036
|
ReadStream = legStreams.ReadStream;
|
|
12037
12037
|
WriteStream = legStreams.WriteStream;
|
|
12038
12038
|
}
|
|
12039
|
-
var fs$ReadStream =
|
|
12039
|
+
var fs$ReadStream = fs6.ReadStream;
|
|
12040
12040
|
if (fs$ReadStream) {
|
|
12041
12041
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
12042
12042
|
ReadStream.prototype.open = ReadStream$open;
|
|
12043
12043
|
}
|
|
12044
|
-
var fs$WriteStream =
|
|
12044
|
+
var fs$WriteStream = fs6.WriteStream;
|
|
12045
12045
|
if (fs$WriteStream) {
|
|
12046
12046
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
12047
12047
|
WriteStream.prototype.open = WriteStream$open;
|
|
12048
12048
|
}
|
|
12049
|
-
Object.defineProperty(
|
|
12049
|
+
Object.defineProperty(fs6, "ReadStream", {
|
|
12050
12050
|
get: function() {
|
|
12051
12051
|
return ReadStream;
|
|
12052
12052
|
},
|
|
@@ -12056,7 +12056,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12056
12056
|
enumerable: true,
|
|
12057
12057
|
configurable: true
|
|
12058
12058
|
});
|
|
12059
|
-
Object.defineProperty(
|
|
12059
|
+
Object.defineProperty(fs6, "WriteStream", {
|
|
12060
12060
|
get: function() {
|
|
12061
12061
|
return WriteStream;
|
|
12062
12062
|
},
|
|
@@ -12067,7 +12067,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12067
12067
|
configurable: true
|
|
12068
12068
|
});
|
|
12069
12069
|
var FileReadStream = ReadStream;
|
|
12070
|
-
Object.defineProperty(
|
|
12070
|
+
Object.defineProperty(fs6, "FileReadStream", {
|
|
12071
12071
|
get: function() {
|
|
12072
12072
|
return FileReadStream;
|
|
12073
12073
|
},
|
|
@@ -12078,7 +12078,7 @@ var require_graceful_fs = __commonJS({
|
|
|
12078
12078
|
configurable: true
|
|
12079
12079
|
});
|
|
12080
12080
|
var FileWriteStream = WriteStream;
|
|
12081
|
-
Object.defineProperty(
|
|
12081
|
+
Object.defineProperty(fs6, "FileWriteStream", {
|
|
12082
12082
|
get: function() {
|
|
12083
12083
|
return FileWriteStream;
|
|
12084
12084
|
},
|
|
@@ -12127,13 +12127,13 @@ var require_graceful_fs = __commonJS({
|
|
|
12127
12127
|
});
|
|
12128
12128
|
}
|
|
12129
12129
|
function createReadStream(path6, options) {
|
|
12130
|
-
return new
|
|
12130
|
+
return new fs6.ReadStream(path6, options);
|
|
12131
12131
|
}
|
|
12132
12132
|
function createWriteStream(path6, options) {
|
|
12133
|
-
return new
|
|
12133
|
+
return new fs6.WriteStream(path6, options);
|
|
12134
12134
|
}
|
|
12135
|
-
var fs$open =
|
|
12136
|
-
|
|
12135
|
+
var fs$open = fs6.open;
|
|
12136
|
+
fs6.open = open;
|
|
12137
12137
|
function open(path6, flags, mode, cb) {
|
|
12138
12138
|
if (typeof mode === "function")
|
|
12139
12139
|
cb = mode, mode = null;
|
|
@@ -12149,20 +12149,20 @@ var require_graceful_fs = __commonJS({
|
|
|
12149
12149
|
});
|
|
12150
12150
|
}
|
|
12151
12151
|
}
|
|
12152
|
-
return
|
|
12152
|
+
return fs6;
|
|
12153
12153
|
}
|
|
12154
12154
|
function enqueue(elem) {
|
|
12155
|
-
|
|
12156
|
-
|
|
12155
|
+
debug4("ENQUEUE", elem[0].name, elem[1]);
|
|
12156
|
+
fs5[gracefulQueue].push(elem);
|
|
12157
12157
|
retry();
|
|
12158
12158
|
}
|
|
12159
12159
|
var retryTimer;
|
|
12160
12160
|
function resetQueue() {
|
|
12161
12161
|
var now = Date.now();
|
|
12162
|
-
for (var i = 0; i <
|
|
12163
|
-
if (
|
|
12164
|
-
|
|
12165
|
-
|
|
12162
|
+
for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
|
|
12163
|
+
if (fs5[gracefulQueue][i].length > 2) {
|
|
12164
|
+
fs5[gracefulQueue][i][3] = now;
|
|
12165
|
+
fs5[gracefulQueue][i][4] = now;
|
|
12166
12166
|
}
|
|
12167
12167
|
}
|
|
12168
12168
|
retry();
|
|
@@ -12170,19 +12170,19 @@ var require_graceful_fs = __commonJS({
|
|
|
12170
12170
|
function retry() {
|
|
12171
12171
|
clearTimeout(retryTimer);
|
|
12172
12172
|
retryTimer = void 0;
|
|
12173
|
-
if (
|
|
12173
|
+
if (fs5[gracefulQueue].length === 0)
|
|
12174
12174
|
return;
|
|
12175
|
-
var elem =
|
|
12175
|
+
var elem = fs5[gracefulQueue].shift();
|
|
12176
12176
|
var fn = elem[0];
|
|
12177
12177
|
var args = elem[1];
|
|
12178
12178
|
var err = elem[2];
|
|
12179
12179
|
var startTime = elem[3];
|
|
12180
12180
|
var lastTime = elem[4];
|
|
12181
12181
|
if (startTime === void 0) {
|
|
12182
|
-
|
|
12182
|
+
debug4("RETRY", fn.name, args);
|
|
12183
12183
|
fn.apply(null, args);
|
|
12184
12184
|
} else if (Date.now() - startTime >= 6e4) {
|
|
12185
|
-
|
|
12185
|
+
debug4("TIMEOUT", fn.name, args);
|
|
12186
12186
|
var cb = args.pop();
|
|
12187
12187
|
if (typeof cb === "function")
|
|
12188
12188
|
cb.call(null, err);
|
|
@@ -12191,10 +12191,10 @@ var require_graceful_fs = __commonJS({
|
|
|
12191
12191
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
12192
12192
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
12193
12193
|
if (sinceAttempt >= desiredDelay) {
|
|
12194
|
-
|
|
12194
|
+
debug4("RETRY", fn.name, args);
|
|
12195
12195
|
fn.apply(null, args.concat([startTime]));
|
|
12196
12196
|
} else {
|
|
12197
|
-
|
|
12197
|
+
fs5[gracefulQueue].push(elem);
|
|
12198
12198
|
}
|
|
12199
12199
|
}
|
|
12200
12200
|
if (retryTimer === void 0) {
|
|
@@ -12209,7 +12209,7 @@ var require_fs = __commonJS({
|
|
|
12209
12209
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
|
|
12210
12210
|
"use strict";
|
|
12211
12211
|
var u = require_universalify().fromCallback;
|
|
12212
|
-
var
|
|
12212
|
+
var fs5 = require_graceful_fs();
|
|
12213
12213
|
var api = [
|
|
12214
12214
|
"access",
|
|
12215
12215
|
"appendFile",
|
|
@@ -12246,55 +12246,55 @@ var require_fs = __commonJS({
|
|
|
12246
12246
|
"utimes",
|
|
12247
12247
|
"writeFile"
|
|
12248
12248
|
].filter((key) => {
|
|
12249
|
-
return typeof
|
|
12249
|
+
return typeof fs5[key] === "function";
|
|
12250
12250
|
});
|
|
12251
|
-
Object.assign(exports,
|
|
12251
|
+
Object.assign(exports, fs5);
|
|
12252
12252
|
api.forEach((method) => {
|
|
12253
|
-
exports[method] = u(
|
|
12253
|
+
exports[method] = u(fs5[method]);
|
|
12254
12254
|
});
|
|
12255
|
-
exports.realpath.native = u(
|
|
12255
|
+
exports.realpath.native = u(fs5.realpath.native);
|
|
12256
12256
|
exports.exists = function(filename, callback) {
|
|
12257
12257
|
if (typeof callback === "function") {
|
|
12258
|
-
return
|
|
12258
|
+
return fs5.exists(filename, callback);
|
|
12259
12259
|
}
|
|
12260
|
-
return new Promise((
|
|
12261
|
-
return
|
|
12260
|
+
return new Promise((resolve) => {
|
|
12261
|
+
return fs5.exists(filename, resolve);
|
|
12262
12262
|
});
|
|
12263
12263
|
};
|
|
12264
12264
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
12265
12265
|
if (typeof callback === "function") {
|
|
12266
|
-
return
|
|
12266
|
+
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
12267
12267
|
}
|
|
12268
|
-
return new Promise((
|
|
12269
|
-
|
|
12268
|
+
return new Promise((resolve, reject) => {
|
|
12269
|
+
fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
12270
12270
|
if (err)
|
|
12271
12271
|
return reject(err);
|
|
12272
|
-
|
|
12272
|
+
resolve({ bytesRead, buffer: buffer2 });
|
|
12273
12273
|
});
|
|
12274
12274
|
});
|
|
12275
12275
|
};
|
|
12276
12276
|
exports.write = function(fd, buffer, ...args) {
|
|
12277
12277
|
if (typeof args[args.length - 1] === "function") {
|
|
12278
|
-
return
|
|
12278
|
+
return fs5.write(fd, buffer, ...args);
|
|
12279
12279
|
}
|
|
12280
|
-
return new Promise((
|
|
12281
|
-
|
|
12280
|
+
return new Promise((resolve, reject) => {
|
|
12281
|
+
fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
12282
12282
|
if (err)
|
|
12283
12283
|
return reject(err);
|
|
12284
|
-
|
|
12284
|
+
resolve({ bytesWritten, buffer: buffer2 });
|
|
12285
12285
|
});
|
|
12286
12286
|
});
|
|
12287
12287
|
};
|
|
12288
|
-
if (typeof
|
|
12288
|
+
if (typeof fs5.writev === "function") {
|
|
12289
12289
|
exports.writev = function(fd, buffers, ...args) {
|
|
12290
12290
|
if (typeof args[args.length - 1] === "function") {
|
|
12291
|
-
return
|
|
12291
|
+
return fs5.writev(fd, buffers, ...args);
|
|
12292
12292
|
}
|
|
12293
|
-
return new Promise((
|
|
12294
|
-
|
|
12293
|
+
return new Promise((resolve, reject) => {
|
|
12294
|
+
fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
12295
12295
|
if (err)
|
|
12296
12296
|
return reject(err);
|
|
12297
|
-
|
|
12297
|
+
resolve({ bytesWritten, buffers: buffers2 });
|
|
12298
12298
|
});
|
|
12299
12299
|
});
|
|
12300
12300
|
};
|
|
@@ -12324,7 +12324,7 @@ var require_utils2 = __commonJS({
|
|
|
12324
12324
|
var require_make_dir = __commonJS({
|
|
12325
12325
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
|
|
12326
12326
|
"use strict";
|
|
12327
|
-
var
|
|
12327
|
+
var fs5 = require_fs();
|
|
12328
12328
|
var { checkPath } = require_utils2();
|
|
12329
12329
|
var getMode = (options) => {
|
|
12330
12330
|
const defaults = { mode: 511 };
|
|
@@ -12334,14 +12334,14 @@ var require_make_dir = __commonJS({
|
|
|
12334
12334
|
};
|
|
12335
12335
|
module2.exports.makeDir = async (dir, options) => {
|
|
12336
12336
|
checkPath(dir);
|
|
12337
|
-
return
|
|
12337
|
+
return fs5.mkdir(dir, {
|
|
12338
12338
|
mode: getMode(options),
|
|
12339
12339
|
recursive: true
|
|
12340
12340
|
});
|
|
12341
12341
|
};
|
|
12342
12342
|
module2.exports.makeDirSync = (dir, options) => {
|
|
12343
12343
|
checkPath(dir);
|
|
12344
|
-
return
|
|
12344
|
+
return fs5.mkdirSync(dir, {
|
|
12345
12345
|
mode: getMode(options),
|
|
12346
12346
|
recursive: true
|
|
12347
12347
|
});
|
|
@@ -12372,13 +12372,13 @@ var require_mkdirs = __commonJS({
|
|
|
12372
12372
|
var require_utimes = __commonJS({
|
|
12373
12373
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
|
|
12374
12374
|
"use strict";
|
|
12375
|
-
var
|
|
12375
|
+
var fs5 = require_graceful_fs();
|
|
12376
12376
|
function utimesMillis(path6, atime, mtime, callback) {
|
|
12377
|
-
|
|
12377
|
+
fs5.open(path6, "r+", (err, fd) => {
|
|
12378
12378
|
if (err)
|
|
12379
12379
|
return callback(err);
|
|
12380
|
-
|
|
12381
|
-
|
|
12380
|
+
fs5.futimes(fd, atime, mtime, (futimesErr) => {
|
|
12381
|
+
fs5.close(fd, (closeErr) => {
|
|
12382
12382
|
if (callback)
|
|
12383
12383
|
callback(futimesErr || closeErr);
|
|
12384
12384
|
});
|
|
@@ -12386,9 +12386,9 @@ var require_utimes = __commonJS({
|
|
|
12386
12386
|
});
|
|
12387
12387
|
}
|
|
12388
12388
|
function utimesMillisSync(path6, atime, mtime) {
|
|
12389
|
-
const fd =
|
|
12390
|
-
|
|
12391
|
-
return
|
|
12389
|
+
const fd = fs5.openSync(path6, "r+");
|
|
12390
|
+
fs5.futimesSync(fd, atime, mtime);
|
|
12391
|
+
return fs5.closeSync(fd);
|
|
12392
12392
|
}
|
|
12393
12393
|
module2.exports = {
|
|
12394
12394
|
utimesMillis,
|
|
@@ -12401,11 +12401,11 @@ var require_utimes = __commonJS({
|
|
|
12401
12401
|
var require_stat = __commonJS({
|
|
12402
12402
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
|
|
12403
12403
|
"use strict";
|
|
12404
|
-
var
|
|
12404
|
+
var fs5 = require_fs();
|
|
12405
12405
|
var path6 = require("path");
|
|
12406
12406
|
var util = require("util");
|
|
12407
12407
|
function getStats(src, dest, opts) {
|
|
12408
|
-
const statFunc = opts.dereference ? (file) =>
|
|
12408
|
+
const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
|
|
12409
12409
|
return Promise.all([
|
|
12410
12410
|
statFunc(src),
|
|
12411
12411
|
statFunc(dest).catch((err) => {
|
|
@@ -12417,7 +12417,7 @@ var require_stat = __commonJS({
|
|
|
12417
12417
|
}
|
|
12418
12418
|
function getStatsSync(src, dest, opts) {
|
|
12419
12419
|
let destStat;
|
|
12420
|
-
const statFunc = opts.dereference ? (file) =>
|
|
12420
|
+
const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
|
|
12421
12421
|
const srcStat = statFunc(src);
|
|
12422
12422
|
try {
|
|
12423
12423
|
destStat = statFunc(dest);
|
|
@@ -12483,7 +12483,7 @@ var require_stat = __commonJS({
|
|
|
12483
12483
|
const destParent = path6.resolve(path6.dirname(dest));
|
|
12484
12484
|
if (destParent === srcParent || destParent === path6.parse(destParent).root)
|
|
12485
12485
|
return cb();
|
|
12486
|
-
|
|
12486
|
+
fs5.stat(destParent, { bigint: true }, (err, destStat) => {
|
|
12487
12487
|
if (err) {
|
|
12488
12488
|
if (err.code === "ENOENT")
|
|
12489
12489
|
return cb();
|
|
@@ -12502,7 +12502,7 @@ var require_stat = __commonJS({
|
|
|
12502
12502
|
return;
|
|
12503
12503
|
let destStat;
|
|
12504
12504
|
try {
|
|
12505
|
-
destStat =
|
|
12505
|
+
destStat = fs5.statSync(destParent, { bigint: true });
|
|
12506
12506
|
} catch (err) {
|
|
12507
12507
|
if (err.code === "ENOENT")
|
|
12508
12508
|
return;
|
|
@@ -12539,7 +12539,7 @@ var require_stat = __commonJS({
|
|
|
12539
12539
|
var require_copy_sync = __commonJS({
|
|
12540
12540
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy-sync/copy-sync.js"(exports, module2) {
|
|
12541
12541
|
"use strict";
|
|
12542
|
-
var
|
|
12542
|
+
var fs5 = require_graceful_fs();
|
|
12543
12543
|
var path6 = require("path");
|
|
12544
12544
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
12545
12545
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
@@ -12564,7 +12564,7 @@ var require_copy_sync = __commonJS({
|
|
|
12564
12564
|
if (opts.filter && !opts.filter(src, dest))
|
|
12565
12565
|
return;
|
|
12566
12566
|
const destParent = path6.dirname(dest);
|
|
12567
|
-
if (!
|
|
12567
|
+
if (!fs5.existsSync(destParent))
|
|
12568
12568
|
mkdirsSync(destParent);
|
|
12569
12569
|
return getStats(destStat, src, dest, opts);
|
|
12570
12570
|
}
|
|
@@ -12574,7 +12574,7 @@ var require_copy_sync = __commonJS({
|
|
|
12574
12574
|
return getStats(destStat, src, dest, opts);
|
|
12575
12575
|
}
|
|
12576
12576
|
function getStats(destStat, src, dest, opts) {
|
|
12577
|
-
const statSync2 = opts.dereference ?
|
|
12577
|
+
const statSync2 = opts.dereference ? fs5.statSync : fs5.lstatSync;
|
|
12578
12578
|
const srcStat = statSync2(src);
|
|
12579
12579
|
if (srcStat.isDirectory())
|
|
12580
12580
|
return onDir(srcStat, destStat, src, dest, opts);
|
|
@@ -12595,14 +12595,14 @@ var require_copy_sync = __commonJS({
|
|
|
12595
12595
|
}
|
|
12596
12596
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
12597
12597
|
if (opts.overwrite) {
|
|
12598
|
-
|
|
12598
|
+
fs5.unlinkSync(dest);
|
|
12599
12599
|
return copyFile(srcStat, src, dest, opts);
|
|
12600
12600
|
} else if (opts.errorOnExist) {
|
|
12601
12601
|
throw new Error(`'${dest}' already exists`);
|
|
12602
12602
|
}
|
|
12603
12603
|
}
|
|
12604
12604
|
function copyFile(srcStat, src, dest, opts) {
|
|
12605
|
-
|
|
12605
|
+
fs5.copyFileSync(src, dest);
|
|
12606
12606
|
if (opts.preserveTimestamps)
|
|
12607
12607
|
handleTimestamps(srcStat.mode, src, dest);
|
|
12608
12608
|
return setDestMode(dest, srcStat.mode);
|
|
@@ -12619,10 +12619,10 @@ var require_copy_sync = __commonJS({
|
|
|
12619
12619
|
return setDestMode(dest, srcMode | 128);
|
|
12620
12620
|
}
|
|
12621
12621
|
function setDestMode(dest, srcMode) {
|
|
12622
|
-
return
|
|
12622
|
+
return fs5.chmodSync(dest, srcMode);
|
|
12623
12623
|
}
|
|
12624
12624
|
function setDestTimestamps(src, dest) {
|
|
12625
|
-
const updatedSrcStat =
|
|
12625
|
+
const updatedSrcStat = fs5.statSync(src);
|
|
12626
12626
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
12627
12627
|
}
|
|
12628
12628
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -12631,12 +12631,12 @@ var require_copy_sync = __commonJS({
|
|
|
12631
12631
|
return copyDir(src, dest, opts);
|
|
12632
12632
|
}
|
|
12633
12633
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
12634
|
-
|
|
12634
|
+
fs5.mkdirSync(dest);
|
|
12635
12635
|
copyDir(src, dest, opts);
|
|
12636
12636
|
return setDestMode(dest, srcMode);
|
|
12637
12637
|
}
|
|
12638
12638
|
function copyDir(src, dest, opts) {
|
|
12639
|
-
|
|
12639
|
+
fs5.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
|
|
12640
12640
|
}
|
|
12641
12641
|
function copyDirItem(item, src, dest, opts) {
|
|
12642
12642
|
const srcItem = path6.join(src, item);
|
|
@@ -12645,19 +12645,19 @@ var require_copy_sync = __commonJS({
|
|
|
12645
12645
|
return startCopy(destStat, srcItem, destItem, opts);
|
|
12646
12646
|
}
|
|
12647
12647
|
function onLink(destStat, src, dest, opts) {
|
|
12648
|
-
let resolvedSrc =
|
|
12648
|
+
let resolvedSrc = fs5.readlinkSync(src);
|
|
12649
12649
|
if (opts.dereference) {
|
|
12650
12650
|
resolvedSrc = path6.resolve(process.cwd(), resolvedSrc);
|
|
12651
12651
|
}
|
|
12652
12652
|
if (!destStat) {
|
|
12653
|
-
return
|
|
12653
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
12654
12654
|
} else {
|
|
12655
12655
|
let resolvedDest;
|
|
12656
12656
|
try {
|
|
12657
|
-
resolvedDest =
|
|
12657
|
+
resolvedDest = fs5.readlinkSync(dest);
|
|
12658
12658
|
} catch (err) {
|
|
12659
12659
|
if (err.code === "EINVAL" || err.code === "UNKNOWN")
|
|
12660
|
-
return
|
|
12660
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
12661
12661
|
throw err;
|
|
12662
12662
|
}
|
|
12663
12663
|
if (opts.dereference) {
|
|
@@ -12666,15 +12666,15 @@ var require_copy_sync = __commonJS({
|
|
|
12666
12666
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
12667
12667
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
12668
12668
|
}
|
|
12669
|
-
if (
|
|
12669
|
+
if (fs5.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
12670
12670
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
12671
12671
|
}
|
|
12672
12672
|
return copyLink(resolvedSrc, dest);
|
|
12673
12673
|
}
|
|
12674
12674
|
}
|
|
12675
12675
|
function copyLink(resolvedSrc, dest) {
|
|
12676
|
-
|
|
12677
|
-
return
|
|
12676
|
+
fs5.unlinkSync(dest);
|
|
12677
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
12678
12678
|
}
|
|
12679
12679
|
module2.exports = copySync;
|
|
12680
12680
|
}
|
|
@@ -12695,13 +12695,13 @@ var require_path_exists = __commonJS({
|
|
|
12695
12695
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
|
|
12696
12696
|
"use strict";
|
|
12697
12697
|
var u = require_universalify().fromPromise;
|
|
12698
|
-
var
|
|
12698
|
+
var fs5 = require_fs();
|
|
12699
12699
|
function pathExists2(path6) {
|
|
12700
|
-
return
|
|
12700
|
+
return fs5.access(path6).then(() => true).catch(() => false);
|
|
12701
12701
|
}
|
|
12702
12702
|
module2.exports = {
|
|
12703
12703
|
pathExists: u(pathExists2),
|
|
12704
|
-
pathExistsSync:
|
|
12704
|
+
pathExistsSync: fs5.existsSync
|
|
12705
12705
|
};
|
|
12706
12706
|
}
|
|
12707
12707
|
});
|
|
@@ -12710,7 +12710,7 @@ var require_path_exists = __commonJS({
|
|
|
12710
12710
|
var require_copy = __commonJS({
|
|
12711
12711
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
|
|
12712
12712
|
"use strict";
|
|
12713
|
-
var
|
|
12713
|
+
var fs5 = require_graceful_fs();
|
|
12714
12714
|
var path6 = require("path");
|
|
12715
12715
|
var mkdirs = require_mkdirs().mkdirs;
|
|
12716
12716
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -12773,7 +12773,7 @@ var require_copy = __commonJS({
|
|
|
12773
12773
|
return getStats(destStat, src, dest, opts, cb);
|
|
12774
12774
|
}
|
|
12775
12775
|
function getStats(destStat, src, dest, opts, cb) {
|
|
12776
|
-
const stat2 = opts.dereference ?
|
|
12776
|
+
const stat2 = opts.dereference ? fs5.stat : fs5.lstat;
|
|
12777
12777
|
stat2(src, (err, srcStat) => {
|
|
12778
12778
|
if (err)
|
|
12779
12779
|
return cb(err);
|
|
@@ -12797,7 +12797,7 @@ var require_copy = __commonJS({
|
|
|
12797
12797
|
}
|
|
12798
12798
|
function mayCopyFile(srcStat, src, dest, opts, cb) {
|
|
12799
12799
|
if (opts.overwrite) {
|
|
12800
|
-
|
|
12800
|
+
fs5.unlink(dest, (err) => {
|
|
12801
12801
|
if (err)
|
|
12802
12802
|
return cb(err);
|
|
12803
12803
|
return copyFile(srcStat, src, dest, opts, cb);
|
|
@@ -12808,7 +12808,7 @@ var require_copy = __commonJS({
|
|
|
12808
12808
|
return cb();
|
|
12809
12809
|
}
|
|
12810
12810
|
function copyFile(srcStat, src, dest, opts, cb) {
|
|
12811
|
-
|
|
12811
|
+
fs5.copyFile(src, dest, (err) => {
|
|
12812
12812
|
if (err)
|
|
12813
12813
|
return cb(err);
|
|
12814
12814
|
if (opts.preserveTimestamps)
|
|
@@ -12840,10 +12840,10 @@ var require_copy = __commonJS({
|
|
|
12840
12840
|
});
|
|
12841
12841
|
}
|
|
12842
12842
|
function setDestMode(dest, srcMode, cb) {
|
|
12843
|
-
return
|
|
12843
|
+
return fs5.chmod(dest, srcMode, cb);
|
|
12844
12844
|
}
|
|
12845
12845
|
function setDestTimestamps(src, dest, cb) {
|
|
12846
|
-
|
|
12846
|
+
fs5.stat(src, (err, updatedSrcStat) => {
|
|
12847
12847
|
if (err)
|
|
12848
12848
|
return cb(err);
|
|
12849
12849
|
return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
|
|
@@ -12855,7 +12855,7 @@ var require_copy = __commonJS({
|
|
|
12855
12855
|
return copyDir(src, dest, opts, cb);
|
|
12856
12856
|
}
|
|
12857
12857
|
function mkDirAndCopy(srcMode, src, dest, opts, cb) {
|
|
12858
|
-
|
|
12858
|
+
fs5.mkdir(dest, (err) => {
|
|
12859
12859
|
if (err)
|
|
12860
12860
|
return cb(err);
|
|
12861
12861
|
copyDir(src, dest, opts, (err2) => {
|
|
@@ -12866,7 +12866,7 @@ var require_copy = __commonJS({
|
|
|
12866
12866
|
});
|
|
12867
12867
|
}
|
|
12868
12868
|
function copyDir(src, dest, opts, cb) {
|
|
12869
|
-
|
|
12869
|
+
fs5.readdir(src, (err, items) => {
|
|
12870
12870
|
if (err)
|
|
12871
12871
|
return cb(err);
|
|
12872
12872
|
return copyDirItems(items, src, dest, opts, cb);
|
|
@@ -12893,19 +12893,19 @@ var require_copy = __commonJS({
|
|
|
12893
12893
|
});
|
|
12894
12894
|
}
|
|
12895
12895
|
function onLink(destStat, src, dest, opts, cb) {
|
|
12896
|
-
|
|
12896
|
+
fs5.readlink(src, (err, resolvedSrc) => {
|
|
12897
12897
|
if (err)
|
|
12898
12898
|
return cb(err);
|
|
12899
12899
|
if (opts.dereference) {
|
|
12900
12900
|
resolvedSrc = path6.resolve(process.cwd(), resolvedSrc);
|
|
12901
12901
|
}
|
|
12902
12902
|
if (!destStat) {
|
|
12903
|
-
return
|
|
12903
|
+
return fs5.symlink(resolvedSrc, dest, cb);
|
|
12904
12904
|
} else {
|
|
12905
|
-
|
|
12905
|
+
fs5.readlink(dest, (err2, resolvedDest) => {
|
|
12906
12906
|
if (err2) {
|
|
12907
12907
|
if (err2.code === "EINVAL" || err2.code === "UNKNOWN")
|
|
12908
|
-
return
|
|
12908
|
+
return fs5.symlink(resolvedSrc, dest, cb);
|
|
12909
12909
|
return cb(err2);
|
|
12910
12910
|
}
|
|
12911
12911
|
if (opts.dereference) {
|
|
@@ -12923,10 +12923,10 @@ var require_copy = __commonJS({
|
|
|
12923
12923
|
});
|
|
12924
12924
|
}
|
|
12925
12925
|
function copyLink(resolvedSrc, dest, cb) {
|
|
12926
|
-
|
|
12926
|
+
fs5.unlink(dest, (err) => {
|
|
12927
12927
|
if (err)
|
|
12928
12928
|
return cb(err);
|
|
12929
|
-
return
|
|
12929
|
+
return fs5.symlink(resolvedSrc, dest, cb);
|
|
12930
12930
|
});
|
|
12931
12931
|
}
|
|
12932
12932
|
module2.exports = copy;
|
|
@@ -12948,7 +12948,7 @@ var require_copy2 = __commonJS({
|
|
|
12948
12948
|
var require_rimraf = __commonJS({
|
|
12949
12949
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/remove/rimraf.js"(exports, module2) {
|
|
12950
12950
|
"use strict";
|
|
12951
|
-
var
|
|
12951
|
+
var fs5 = require_graceful_fs();
|
|
12952
12952
|
var path6 = require("path");
|
|
12953
12953
|
var assert = require("assert");
|
|
12954
12954
|
var isWindows = process.platform === "win32";
|
|
@@ -12962,9 +12962,9 @@ var require_rimraf = __commonJS({
|
|
|
12962
12962
|
"readdir"
|
|
12963
12963
|
];
|
|
12964
12964
|
methods.forEach((m) => {
|
|
12965
|
-
options[m] = options[m] ||
|
|
12965
|
+
options[m] = options[m] || fs5[m];
|
|
12966
12966
|
m = m + "Sync";
|
|
12967
|
-
options[m] = options[m] ||
|
|
12967
|
+
options[m] = options[m] || fs5[m];
|
|
12968
12968
|
});
|
|
12969
12969
|
options.maxBusyTries = options.maxBusyTries || 3;
|
|
12970
12970
|
}
|
|
@@ -13187,17 +13187,17 @@ var require_rimraf = __commonJS({
|
|
|
13187
13187
|
var require_remove = __commonJS({
|
|
13188
13188
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
|
|
13189
13189
|
"use strict";
|
|
13190
|
-
var
|
|
13190
|
+
var fs5 = require_graceful_fs();
|
|
13191
13191
|
var u = require_universalify().fromCallback;
|
|
13192
13192
|
var rimraf = require_rimraf();
|
|
13193
13193
|
function remove(path6, callback) {
|
|
13194
|
-
if (
|
|
13195
|
-
return
|
|
13194
|
+
if (fs5.rm)
|
|
13195
|
+
return fs5.rm(path6, { recursive: true, force: true }, callback);
|
|
13196
13196
|
rimraf(path6, callback);
|
|
13197
13197
|
}
|
|
13198
13198
|
function removeSync(path6) {
|
|
13199
|
-
if (
|
|
13200
|
-
return
|
|
13199
|
+
if (fs5.rmSync)
|
|
13200
|
+
return fs5.rmSync(path6, { recursive: true, force: true });
|
|
13201
13201
|
rimraf.sync(path6);
|
|
13202
13202
|
}
|
|
13203
13203
|
module2.exports = {
|
|
@@ -13212,14 +13212,14 @@ var require_empty = __commonJS({
|
|
|
13212
13212
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
|
|
13213
13213
|
"use strict";
|
|
13214
13214
|
var u = require_universalify().fromPromise;
|
|
13215
|
-
var
|
|
13215
|
+
var fs5 = require_fs();
|
|
13216
13216
|
var path6 = require("path");
|
|
13217
13217
|
var mkdir = require_mkdirs();
|
|
13218
13218
|
var remove = require_remove();
|
|
13219
13219
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
13220
13220
|
let items;
|
|
13221
13221
|
try {
|
|
13222
|
-
items = await
|
|
13222
|
+
items = await fs5.readdir(dir);
|
|
13223
13223
|
} catch {
|
|
13224
13224
|
return mkdir.mkdirs(dir);
|
|
13225
13225
|
}
|
|
@@ -13228,7 +13228,7 @@ var require_empty = __commonJS({
|
|
|
13228
13228
|
function emptyDirSync(dir) {
|
|
13229
13229
|
let items;
|
|
13230
13230
|
try {
|
|
13231
|
-
items =
|
|
13231
|
+
items = fs5.readdirSync(dir);
|
|
13232
13232
|
} catch {
|
|
13233
13233
|
return mkdir.mkdirsSync(dir);
|
|
13234
13234
|
}
|
|
@@ -13252,21 +13252,21 @@ var require_file = __commonJS({
|
|
|
13252
13252
|
"use strict";
|
|
13253
13253
|
var u = require_universalify().fromCallback;
|
|
13254
13254
|
var path6 = require("path");
|
|
13255
|
-
var
|
|
13255
|
+
var fs5 = require_graceful_fs();
|
|
13256
13256
|
var mkdir = require_mkdirs();
|
|
13257
13257
|
function createFile(file, callback) {
|
|
13258
13258
|
function makeFile() {
|
|
13259
|
-
|
|
13259
|
+
fs5.writeFile(file, "", (err) => {
|
|
13260
13260
|
if (err)
|
|
13261
13261
|
return callback(err);
|
|
13262
13262
|
callback();
|
|
13263
13263
|
});
|
|
13264
13264
|
}
|
|
13265
|
-
|
|
13265
|
+
fs5.stat(file, (err, stats) => {
|
|
13266
13266
|
if (!err && stats.isFile())
|
|
13267
13267
|
return callback();
|
|
13268
13268
|
const dir = path6.dirname(file);
|
|
13269
|
-
|
|
13269
|
+
fs5.stat(dir, (err2, stats2) => {
|
|
13270
13270
|
if (err2) {
|
|
13271
13271
|
if (err2.code === "ENOENT") {
|
|
13272
13272
|
return mkdir.mkdirs(dir, (err3) => {
|
|
@@ -13280,7 +13280,7 @@ var require_file = __commonJS({
|
|
|
13280
13280
|
if (stats2.isDirectory())
|
|
13281
13281
|
makeFile();
|
|
13282
13282
|
else {
|
|
13283
|
-
|
|
13283
|
+
fs5.readdir(dir, (err3) => {
|
|
13284
13284
|
if (err3)
|
|
13285
13285
|
return callback(err3);
|
|
13286
13286
|
});
|
|
@@ -13291,15 +13291,15 @@ var require_file = __commonJS({
|
|
|
13291
13291
|
function createFileSync(file) {
|
|
13292
13292
|
let stats;
|
|
13293
13293
|
try {
|
|
13294
|
-
stats =
|
|
13294
|
+
stats = fs5.statSync(file);
|
|
13295
13295
|
} catch {
|
|
13296
13296
|
}
|
|
13297
13297
|
if (stats && stats.isFile())
|
|
13298
13298
|
return;
|
|
13299
13299
|
const dir = path6.dirname(file);
|
|
13300
13300
|
try {
|
|
13301
|
-
if (!
|
|
13302
|
-
|
|
13301
|
+
if (!fs5.statSync(dir).isDirectory()) {
|
|
13302
|
+
fs5.readdirSync(dir);
|
|
13303
13303
|
}
|
|
13304
13304
|
} catch (err) {
|
|
13305
13305
|
if (err && err.code === "ENOENT")
|
|
@@ -13307,7 +13307,7 @@ var require_file = __commonJS({
|
|
|
13307
13307
|
else
|
|
13308
13308
|
throw err;
|
|
13309
13309
|
}
|
|
13310
|
-
|
|
13310
|
+
fs5.writeFileSync(file, "");
|
|
13311
13311
|
}
|
|
13312
13312
|
module2.exports = {
|
|
13313
13313
|
createFile: u(createFile),
|
|
@@ -13322,20 +13322,20 @@ var require_link = __commonJS({
|
|
|
13322
13322
|
"use strict";
|
|
13323
13323
|
var u = require_universalify().fromCallback;
|
|
13324
13324
|
var path6 = require("path");
|
|
13325
|
-
var
|
|
13325
|
+
var fs5 = require_graceful_fs();
|
|
13326
13326
|
var mkdir = require_mkdirs();
|
|
13327
13327
|
var pathExists2 = require_path_exists().pathExists;
|
|
13328
13328
|
var { areIdentical } = require_stat();
|
|
13329
13329
|
function createLink(srcpath, dstpath, callback) {
|
|
13330
13330
|
function makeLink(srcpath2, dstpath2) {
|
|
13331
|
-
|
|
13331
|
+
fs5.link(srcpath2, dstpath2, (err) => {
|
|
13332
13332
|
if (err)
|
|
13333
13333
|
return callback(err);
|
|
13334
13334
|
callback(null);
|
|
13335
13335
|
});
|
|
13336
13336
|
}
|
|
13337
|
-
|
|
13338
|
-
|
|
13337
|
+
fs5.lstat(dstpath, (_, dstStat) => {
|
|
13338
|
+
fs5.lstat(srcpath, (err, srcStat) => {
|
|
13339
13339
|
if (err) {
|
|
13340
13340
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
13341
13341
|
return callback(err);
|
|
@@ -13360,11 +13360,11 @@ var require_link = __commonJS({
|
|
|
13360
13360
|
function createLinkSync(srcpath, dstpath) {
|
|
13361
13361
|
let dstStat;
|
|
13362
13362
|
try {
|
|
13363
|
-
dstStat =
|
|
13363
|
+
dstStat = fs5.lstatSync(dstpath);
|
|
13364
13364
|
} catch {
|
|
13365
13365
|
}
|
|
13366
13366
|
try {
|
|
13367
|
-
const srcStat =
|
|
13367
|
+
const srcStat = fs5.lstatSync(srcpath);
|
|
13368
13368
|
if (dstStat && areIdentical(srcStat, dstStat))
|
|
13369
13369
|
return;
|
|
13370
13370
|
} catch (err) {
|
|
@@ -13372,11 +13372,11 @@ var require_link = __commonJS({
|
|
|
13372
13372
|
throw err;
|
|
13373
13373
|
}
|
|
13374
13374
|
const dir = path6.dirname(dstpath);
|
|
13375
|
-
const dirExists =
|
|
13375
|
+
const dirExists = fs5.existsSync(dir);
|
|
13376
13376
|
if (dirExists)
|
|
13377
|
-
return
|
|
13377
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
13378
13378
|
mkdir.mkdirsSync(dir);
|
|
13379
|
-
return
|
|
13379
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
13380
13380
|
}
|
|
13381
13381
|
module2.exports = {
|
|
13382
13382
|
createLink: u(createLink),
|
|
@@ -13390,11 +13390,11 @@ var require_symlink_paths = __commonJS({
|
|
|
13390
13390
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
|
|
13391
13391
|
"use strict";
|
|
13392
13392
|
var path6 = require("path");
|
|
13393
|
-
var
|
|
13393
|
+
var fs5 = require_graceful_fs();
|
|
13394
13394
|
var pathExists2 = require_path_exists().pathExists;
|
|
13395
13395
|
function symlinkPaths(srcpath, dstpath, callback) {
|
|
13396
13396
|
if (path6.isAbsolute(srcpath)) {
|
|
13397
|
-
return
|
|
13397
|
+
return fs5.lstat(srcpath, (err) => {
|
|
13398
13398
|
if (err) {
|
|
13399
13399
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
13400
13400
|
return callback(err);
|
|
@@ -13416,7 +13416,7 @@ var require_symlink_paths = __commonJS({
|
|
|
13416
13416
|
toDst: srcpath
|
|
13417
13417
|
});
|
|
13418
13418
|
} else {
|
|
13419
|
-
return
|
|
13419
|
+
return fs5.lstat(srcpath, (err2) => {
|
|
13420
13420
|
if (err2) {
|
|
13421
13421
|
err2.message = err2.message.replace("lstat", "ensureSymlink");
|
|
13422
13422
|
return callback(err2);
|
|
@@ -13433,7 +13433,7 @@ var require_symlink_paths = __commonJS({
|
|
|
13433
13433
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
13434
13434
|
let exists;
|
|
13435
13435
|
if (path6.isAbsolute(srcpath)) {
|
|
13436
|
-
exists =
|
|
13436
|
+
exists = fs5.existsSync(srcpath);
|
|
13437
13437
|
if (!exists)
|
|
13438
13438
|
throw new Error("absolute srcpath does not exist");
|
|
13439
13439
|
return {
|
|
@@ -13443,14 +13443,14 @@ var require_symlink_paths = __commonJS({
|
|
|
13443
13443
|
} else {
|
|
13444
13444
|
const dstdir = path6.dirname(dstpath);
|
|
13445
13445
|
const relativeToDst = path6.join(dstdir, srcpath);
|
|
13446
|
-
exists =
|
|
13446
|
+
exists = fs5.existsSync(relativeToDst);
|
|
13447
13447
|
if (exists) {
|
|
13448
13448
|
return {
|
|
13449
13449
|
toCwd: relativeToDst,
|
|
13450
13450
|
toDst: srcpath
|
|
13451
13451
|
};
|
|
13452
13452
|
} else {
|
|
13453
|
-
exists =
|
|
13453
|
+
exists = fs5.existsSync(srcpath);
|
|
13454
13454
|
if (!exists)
|
|
13455
13455
|
throw new Error("relative srcpath does not exist");
|
|
13456
13456
|
return {
|
|
@@ -13471,13 +13471,13 @@ var require_symlink_paths = __commonJS({
|
|
|
13471
13471
|
var require_symlink_type = __commonJS({
|
|
13472
13472
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
|
|
13473
13473
|
"use strict";
|
|
13474
|
-
var
|
|
13474
|
+
var fs5 = require_graceful_fs();
|
|
13475
13475
|
function symlinkType(srcpath, type, callback) {
|
|
13476
13476
|
callback = typeof type === "function" ? type : callback;
|
|
13477
13477
|
type = typeof type === "function" ? false : type;
|
|
13478
13478
|
if (type)
|
|
13479
13479
|
return callback(null, type);
|
|
13480
|
-
|
|
13480
|
+
fs5.lstat(srcpath, (err, stats) => {
|
|
13481
13481
|
if (err)
|
|
13482
13482
|
return callback(null, "file");
|
|
13483
13483
|
type = stats && stats.isDirectory() ? "dir" : "file";
|
|
@@ -13489,7 +13489,7 @@ var require_symlink_type = __commonJS({
|
|
|
13489
13489
|
if (type)
|
|
13490
13490
|
return type;
|
|
13491
13491
|
try {
|
|
13492
|
-
stats =
|
|
13492
|
+
stats = fs5.lstatSync(srcpath);
|
|
13493
13493
|
} catch {
|
|
13494
13494
|
return "file";
|
|
13495
13495
|
}
|
|
@@ -13508,7 +13508,7 @@ var require_symlink = __commonJS({
|
|
|
13508
13508
|
"use strict";
|
|
13509
13509
|
var u = require_universalify().fromCallback;
|
|
13510
13510
|
var path6 = require("path");
|
|
13511
|
-
var
|
|
13511
|
+
var fs5 = require_fs();
|
|
13512
13512
|
var _mkdirs = require_mkdirs();
|
|
13513
13513
|
var mkdirs = _mkdirs.mkdirs;
|
|
13514
13514
|
var mkdirsSync = _mkdirs.mkdirsSync;
|
|
@@ -13523,11 +13523,11 @@ var require_symlink = __commonJS({
|
|
|
13523
13523
|
function createSymlink(srcpath, dstpath, type, callback) {
|
|
13524
13524
|
callback = typeof type === "function" ? type : callback;
|
|
13525
13525
|
type = typeof type === "function" ? false : type;
|
|
13526
|
-
|
|
13526
|
+
fs5.lstat(dstpath, (err, stats) => {
|
|
13527
13527
|
if (!err && stats.isSymbolicLink()) {
|
|
13528
13528
|
Promise.all([
|
|
13529
|
-
|
|
13530
|
-
|
|
13529
|
+
fs5.stat(srcpath),
|
|
13530
|
+
fs5.stat(dstpath)
|
|
13531
13531
|
]).then(([srcStat, dstStat]) => {
|
|
13532
13532
|
if (areIdentical(srcStat, dstStat))
|
|
13533
13533
|
return callback(null);
|
|
@@ -13538,11 +13538,11 @@ var require_symlink = __commonJS({
|
|
|
13538
13538
|
});
|
|
13539
13539
|
}
|
|
13540
13540
|
function _createSymlink(srcpath, dstpath, type, callback) {
|
|
13541
|
-
symlinkPaths(srcpath, dstpath, (err,
|
|
13541
|
+
symlinkPaths(srcpath, dstpath, (err, relative) => {
|
|
13542
13542
|
if (err)
|
|
13543
13543
|
return callback(err);
|
|
13544
|
-
srcpath =
|
|
13545
|
-
symlinkType(
|
|
13544
|
+
srcpath = relative.toDst;
|
|
13545
|
+
symlinkType(relative.toCwd, type, (err2, type2) => {
|
|
13546
13546
|
if (err2)
|
|
13547
13547
|
return callback(err2);
|
|
13548
13548
|
const dir = path6.dirname(dstpath);
|
|
@@ -13550,11 +13550,11 @@ var require_symlink = __commonJS({
|
|
|
13550
13550
|
if (err3)
|
|
13551
13551
|
return callback(err3);
|
|
13552
13552
|
if (dirExists)
|
|
13553
|
-
return
|
|
13553
|
+
return fs5.symlink(srcpath, dstpath, type2, callback);
|
|
13554
13554
|
mkdirs(dir, (err4) => {
|
|
13555
13555
|
if (err4)
|
|
13556
13556
|
return callback(err4);
|
|
13557
|
-
|
|
13557
|
+
fs5.symlink(srcpath, dstpath, type2, callback);
|
|
13558
13558
|
});
|
|
13559
13559
|
});
|
|
13560
13560
|
});
|
|
@@ -13563,24 +13563,24 @@ var require_symlink = __commonJS({
|
|
|
13563
13563
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
13564
13564
|
let stats;
|
|
13565
13565
|
try {
|
|
13566
|
-
stats =
|
|
13566
|
+
stats = fs5.lstatSync(dstpath);
|
|
13567
13567
|
} catch {
|
|
13568
13568
|
}
|
|
13569
13569
|
if (stats && stats.isSymbolicLink()) {
|
|
13570
|
-
const srcStat =
|
|
13571
|
-
const dstStat =
|
|
13570
|
+
const srcStat = fs5.statSync(srcpath);
|
|
13571
|
+
const dstStat = fs5.statSync(dstpath);
|
|
13572
13572
|
if (areIdentical(srcStat, dstStat))
|
|
13573
13573
|
return;
|
|
13574
13574
|
}
|
|
13575
|
-
const
|
|
13576
|
-
srcpath =
|
|
13577
|
-
type = symlinkTypeSync(
|
|
13575
|
+
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
13576
|
+
srcpath = relative.toDst;
|
|
13577
|
+
type = symlinkTypeSync(relative.toCwd, type);
|
|
13578
13578
|
const dir = path6.dirname(dstpath);
|
|
13579
|
-
const exists =
|
|
13579
|
+
const exists = fs5.existsSync(dir);
|
|
13580
13580
|
if (exists)
|
|
13581
|
-
return
|
|
13581
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
13582
13582
|
mkdirsSync(dir);
|
|
13583
|
-
return
|
|
13583
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
13584
13584
|
}
|
|
13585
13585
|
module2.exports = {
|
|
13586
13586
|
createSymlink: u(createSymlink),
|
|
@@ -13648,9 +13648,9 @@ var require_jsonfile = __commonJS({
|
|
|
13648
13648
|
if (typeof options === "string") {
|
|
13649
13649
|
options = { encoding: options };
|
|
13650
13650
|
}
|
|
13651
|
-
const
|
|
13651
|
+
const fs5 = options.fs || _fs;
|
|
13652
13652
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13653
|
-
let data = await universalify.fromCallback(
|
|
13653
|
+
let data = await universalify.fromCallback(fs5.readFile)(file, options);
|
|
13654
13654
|
data = stripBom(data);
|
|
13655
13655
|
let obj;
|
|
13656
13656
|
try {
|
|
@@ -13666,14 +13666,14 @@ var require_jsonfile = __commonJS({
|
|
|
13666
13666
|
return obj;
|
|
13667
13667
|
}
|
|
13668
13668
|
var readFile = universalify.fromPromise(_readFile);
|
|
13669
|
-
function
|
|
13669
|
+
function readFileSync2(file, options = {}) {
|
|
13670
13670
|
if (typeof options === "string") {
|
|
13671
13671
|
options = { encoding: options };
|
|
13672
13672
|
}
|
|
13673
|
-
const
|
|
13673
|
+
const fs5 = options.fs || _fs;
|
|
13674
13674
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
13675
13675
|
try {
|
|
13676
|
-
let content =
|
|
13676
|
+
let content = fs5.readFileSync(file, options);
|
|
13677
13677
|
content = stripBom(content);
|
|
13678
13678
|
return JSON.parse(content, options.reviver);
|
|
13679
13679
|
} catch (err) {
|
|
@@ -13686,19 +13686,19 @@ var require_jsonfile = __commonJS({
|
|
|
13686
13686
|
}
|
|
13687
13687
|
}
|
|
13688
13688
|
async function _writeFile(file, obj, options = {}) {
|
|
13689
|
-
const
|
|
13689
|
+
const fs5 = options.fs || _fs;
|
|
13690
13690
|
const str = stringify2(obj, options);
|
|
13691
|
-
await universalify.fromCallback(
|
|
13691
|
+
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
13692
13692
|
}
|
|
13693
13693
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
13694
13694
|
function writeFileSync(file, obj, options = {}) {
|
|
13695
|
-
const
|
|
13695
|
+
const fs5 = options.fs || _fs;
|
|
13696
13696
|
const str = stringify2(obj, options);
|
|
13697
|
-
return
|
|
13697
|
+
return fs5.writeFileSync(file, str, options);
|
|
13698
13698
|
}
|
|
13699
13699
|
var jsonfile = {
|
|
13700
13700
|
readFile,
|
|
13701
|
-
readFileSync:
|
|
13701
|
+
readFileSync: readFileSync2,
|
|
13702
13702
|
writeFile,
|
|
13703
13703
|
writeFileSync
|
|
13704
13704
|
};
|
|
@@ -13726,7 +13726,7 @@ var require_output = __commonJS({
|
|
|
13726
13726
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/output/index.js"(exports, module2) {
|
|
13727
13727
|
"use strict";
|
|
13728
13728
|
var u = require_universalify().fromCallback;
|
|
13729
|
-
var
|
|
13729
|
+
var fs5 = require_graceful_fs();
|
|
13730
13730
|
var path6 = require("path");
|
|
13731
13731
|
var mkdir = require_mkdirs();
|
|
13732
13732
|
var pathExists2 = require_path_exists().pathExists;
|
|
@@ -13740,21 +13740,21 @@ var require_output = __commonJS({
|
|
|
13740
13740
|
if (err)
|
|
13741
13741
|
return callback(err);
|
|
13742
13742
|
if (itDoes)
|
|
13743
|
-
return
|
|
13743
|
+
return fs5.writeFile(file, data, encoding, callback);
|
|
13744
13744
|
mkdir.mkdirs(dir, (err2) => {
|
|
13745
13745
|
if (err2)
|
|
13746
13746
|
return callback(err2);
|
|
13747
|
-
|
|
13747
|
+
fs5.writeFile(file, data, encoding, callback);
|
|
13748
13748
|
});
|
|
13749
13749
|
});
|
|
13750
13750
|
}
|
|
13751
13751
|
function outputFileSync(file, ...args) {
|
|
13752
13752
|
const dir = path6.dirname(file);
|
|
13753
|
-
if (
|
|
13754
|
-
return
|
|
13753
|
+
if (fs5.existsSync(dir)) {
|
|
13754
|
+
return fs5.writeFileSync(file, ...args);
|
|
13755
13755
|
}
|
|
13756
13756
|
mkdir.mkdirsSync(dir);
|
|
13757
|
-
|
|
13757
|
+
fs5.writeFileSync(file, ...args);
|
|
13758
13758
|
}
|
|
13759
13759
|
module2.exports = {
|
|
13760
13760
|
outputFile: u(outputFile),
|
|
@@ -13813,7 +13813,7 @@ var require_json2 = __commonJS({
|
|
|
13813
13813
|
var require_move_sync = __commonJS({
|
|
13814
13814
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move-sync/move-sync.js"(exports, module2) {
|
|
13815
13815
|
"use strict";
|
|
13816
|
-
var
|
|
13816
|
+
var fs5 = require_graceful_fs();
|
|
13817
13817
|
var path6 = require("path");
|
|
13818
13818
|
var copySync = require_copy_sync2().copySync;
|
|
13819
13819
|
var removeSync = require_remove().removeSync;
|
|
@@ -13840,13 +13840,13 @@ var require_move_sync = __commonJS({
|
|
|
13840
13840
|
removeSync(dest);
|
|
13841
13841
|
return rename(src, dest, overwrite);
|
|
13842
13842
|
}
|
|
13843
|
-
if (
|
|
13843
|
+
if (fs5.existsSync(dest))
|
|
13844
13844
|
throw new Error("dest already exists.");
|
|
13845
13845
|
return rename(src, dest, overwrite);
|
|
13846
13846
|
}
|
|
13847
13847
|
function rename(src, dest, overwrite) {
|
|
13848
13848
|
try {
|
|
13849
|
-
|
|
13849
|
+
fs5.renameSync(src, dest);
|
|
13850
13850
|
} catch (err) {
|
|
13851
13851
|
if (err.code !== "EXDEV")
|
|
13852
13852
|
throw err;
|
|
@@ -13879,7 +13879,7 @@ var require_move_sync2 = __commonJS({
|
|
|
13879
13879
|
var require_move = __commonJS({
|
|
13880
13880
|
"../../node_modules/.pnpm/fs-extra@10.0.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
|
|
13881
13881
|
"use strict";
|
|
13882
|
-
var
|
|
13882
|
+
var fs5 = require_graceful_fs();
|
|
13883
13883
|
var path6 = require("path");
|
|
13884
13884
|
var copy = require_copy2().copy;
|
|
13885
13885
|
var remove = require_remove().remove;
|
|
@@ -13933,7 +13933,7 @@ var require_move = __commonJS({
|
|
|
13933
13933
|
});
|
|
13934
13934
|
}
|
|
13935
13935
|
function rename(src, dest, overwrite, cb) {
|
|
13936
|
-
|
|
13936
|
+
fs5.rename(src, dest, (err) => {
|
|
13937
13937
|
if (!err)
|
|
13938
13938
|
return cb();
|
|
13939
13939
|
if (err.code !== "EXDEV")
|
|
@@ -14022,9 +14022,9 @@ var require_constants = __commonJS({
|
|
|
14022
14022
|
// ../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/internal/debug.js
|
|
14023
14023
|
var require_debug = __commonJS({
|
|
14024
14024
|
"../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/internal/debug.js"(exports, module2) {
|
|
14025
|
-
var
|
|
14025
|
+
var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
14026
14026
|
};
|
|
14027
|
-
module2.exports =
|
|
14027
|
+
module2.exports = debug4;
|
|
14028
14028
|
}
|
|
14029
14029
|
});
|
|
14030
14030
|
|
|
@@ -14032,7 +14032,7 @@ var require_debug = __commonJS({
|
|
|
14032
14032
|
var require_re = __commonJS({
|
|
14033
14033
|
"../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/internal/re.js"(exports, module2) {
|
|
14034
14034
|
var { MAX_SAFE_COMPONENT_LENGTH } = require_constants();
|
|
14035
|
-
var
|
|
14035
|
+
var debug4 = require_debug();
|
|
14036
14036
|
exports = module2.exports = {};
|
|
14037
14037
|
var re = exports.re = [];
|
|
14038
14038
|
var safeRe = exports.safeRe = [];
|
|
@@ -14042,7 +14042,7 @@ var require_re = __commonJS({
|
|
|
14042
14042
|
var createToken = (name, value, isGlobal) => {
|
|
14043
14043
|
const safe = value.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s");
|
|
14044
14044
|
const index = R++;
|
|
14045
|
-
|
|
14045
|
+
debug4(name, index, value);
|
|
14046
14046
|
t[name] = index;
|
|
14047
14047
|
src[index] = value;
|
|
14048
14048
|
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
@@ -14136,7 +14136,7 @@ var require_identifiers = __commonJS({
|
|
|
14136
14136
|
// ../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/classes/semver.js
|
|
14137
14137
|
var require_semver = __commonJS({
|
|
14138
14138
|
"../../node_modules/.pnpm/semver@7.5.2/node_modules/semver/classes/semver.js"(exports, module2) {
|
|
14139
|
-
var
|
|
14139
|
+
var debug4 = require_debug();
|
|
14140
14140
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
14141
14141
|
var { safeRe: re, t } = require_re();
|
|
14142
14142
|
var parseOptions = require_parse_options();
|
|
@@ -14158,7 +14158,7 @@ var require_semver = __commonJS({
|
|
|
14158
14158
|
`version is longer than ${MAX_LENGTH} characters`
|
|
14159
14159
|
);
|
|
14160
14160
|
}
|
|
14161
|
-
|
|
14161
|
+
debug4("SemVer", version2, options);
|
|
14162
14162
|
this.options = options;
|
|
14163
14163
|
this.loose = !!options.loose;
|
|
14164
14164
|
this.includePrerelease = !!options.includePrerelease;
|
|
@@ -14206,7 +14206,7 @@ var require_semver = __commonJS({
|
|
|
14206
14206
|
return this.version;
|
|
14207
14207
|
}
|
|
14208
14208
|
compare(other) {
|
|
14209
|
-
|
|
14209
|
+
debug4("SemVer.compare", this.version, this.options, other);
|
|
14210
14210
|
if (!(other instanceof _SemVer)) {
|
|
14211
14211
|
if (typeof other === "string" && other === this.version) {
|
|
14212
14212
|
return 0;
|
|
@@ -14239,7 +14239,7 @@ var require_semver = __commonJS({
|
|
|
14239
14239
|
do {
|
|
14240
14240
|
const a = this.prerelease[i];
|
|
14241
14241
|
const b = other.prerelease[i];
|
|
14242
|
-
|
|
14242
|
+
debug4("prerelease compare", i, a, b);
|
|
14243
14243
|
if (a === void 0 && b === void 0) {
|
|
14244
14244
|
return 0;
|
|
14245
14245
|
} else if (b === void 0) {
|
|
@@ -14261,7 +14261,7 @@ var require_semver = __commonJS({
|
|
|
14261
14261
|
do {
|
|
14262
14262
|
const a = this.build[i];
|
|
14263
14263
|
const b = other.build[i];
|
|
14264
|
-
|
|
14264
|
+
debug4("prerelease compare", i, a, b);
|
|
14265
14265
|
if (a === void 0 && b === void 0) {
|
|
14266
14266
|
return 0;
|
|
14267
14267
|
} else if (b === void 0) {
|
|
@@ -15439,19 +15439,19 @@ var require_range = __commonJS({
|
|
|
15439
15439
|
const loose = this.options.loose;
|
|
15440
15440
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
15441
15441
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
15442
|
-
|
|
15442
|
+
debug4("hyphen replace", range);
|
|
15443
15443
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
15444
|
-
|
|
15444
|
+
debug4("comparator trim", range);
|
|
15445
15445
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
15446
15446
|
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
15447
15447
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
15448
15448
|
if (loose) {
|
|
15449
15449
|
rangeList = rangeList.filter((comp) => {
|
|
15450
|
-
|
|
15450
|
+
debug4("loose invalid filter", comp, this.options);
|
|
15451
15451
|
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
15452
15452
|
});
|
|
15453
15453
|
}
|
|
15454
|
-
|
|
15454
|
+
debug4("range list", rangeList);
|
|
15455
15455
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
15456
15456
|
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
15457
15457
|
for (const comp of comparators) {
|
|
@@ -15506,7 +15506,7 @@ var require_range = __commonJS({
|
|
|
15506
15506
|
var cache = new LRU({ max: 1e3 });
|
|
15507
15507
|
var parseOptions = require_parse_options();
|
|
15508
15508
|
var Comparator = require_comparator();
|
|
15509
|
-
var
|
|
15509
|
+
var debug4 = require_debug();
|
|
15510
15510
|
var SemVer = require_semver();
|
|
15511
15511
|
var {
|
|
15512
15512
|
safeRe: re,
|
|
@@ -15531,15 +15531,15 @@ var require_range = __commonJS({
|
|
|
15531
15531
|
return result;
|
|
15532
15532
|
};
|
|
15533
15533
|
var parseComparator = (comp, options) => {
|
|
15534
|
-
|
|
15534
|
+
debug4("comp", comp, options);
|
|
15535
15535
|
comp = replaceCarets(comp, options);
|
|
15536
|
-
|
|
15536
|
+
debug4("caret", comp);
|
|
15537
15537
|
comp = replaceTildes(comp, options);
|
|
15538
|
-
|
|
15538
|
+
debug4("tildes", comp);
|
|
15539
15539
|
comp = replaceXRanges(comp, options);
|
|
15540
|
-
|
|
15540
|
+
debug4("xrange", comp);
|
|
15541
15541
|
comp = replaceStars(comp, options);
|
|
15542
|
-
|
|
15542
|
+
debug4("stars", comp);
|
|
15543
15543
|
return comp;
|
|
15544
15544
|
};
|
|
15545
15545
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
@@ -15549,7 +15549,7 @@ var require_range = __commonJS({
|
|
|
15549
15549
|
var replaceTilde = (comp, options) => {
|
|
15550
15550
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
15551
15551
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
15552
|
-
|
|
15552
|
+
debug4("tilde", comp, _, M, m, p, pr);
|
|
15553
15553
|
let ret;
|
|
15554
15554
|
if (isX(M)) {
|
|
15555
15555
|
ret = "";
|
|
@@ -15558,12 +15558,12 @@ var require_range = __commonJS({
|
|
|
15558
15558
|
} else if (isX(p)) {
|
|
15559
15559
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
15560
15560
|
} else if (pr) {
|
|
15561
|
-
|
|
15561
|
+
debug4("replaceTilde pr", pr);
|
|
15562
15562
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
15563
15563
|
} else {
|
|
15564
15564
|
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
15565
15565
|
}
|
|
15566
|
-
|
|
15566
|
+
debug4("tilde return", ret);
|
|
15567
15567
|
return ret;
|
|
15568
15568
|
});
|
|
15569
15569
|
};
|
|
@@ -15571,11 +15571,11 @@ var require_range = __commonJS({
|
|
|
15571
15571
|
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
15572
15572
|
};
|
|
15573
15573
|
var replaceCaret = (comp, options) => {
|
|
15574
|
-
|
|
15574
|
+
debug4("caret", comp, options);
|
|
15575
15575
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
15576
15576
|
const z = options.includePrerelease ? "-0" : "";
|
|
15577
15577
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
15578
|
-
|
|
15578
|
+
debug4("caret", comp, _, M, m, p, pr);
|
|
15579
15579
|
let ret;
|
|
15580
15580
|
if (isX(M)) {
|
|
15581
15581
|
ret = "";
|
|
@@ -15588,7 +15588,7 @@ var require_range = __commonJS({
|
|
|
15588
15588
|
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
15589
15589
|
}
|
|
15590
15590
|
} else if (pr) {
|
|
15591
|
-
|
|
15591
|
+
debug4("replaceCaret pr", pr);
|
|
15592
15592
|
if (M === "0") {
|
|
15593
15593
|
if (m === "0") {
|
|
15594
15594
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
@@ -15599,7 +15599,7 @@ var require_range = __commonJS({
|
|
|
15599
15599
|
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
15600
15600
|
}
|
|
15601
15601
|
} else {
|
|
15602
|
-
|
|
15602
|
+
debug4("no pr");
|
|
15603
15603
|
if (M === "0") {
|
|
15604
15604
|
if (m === "0") {
|
|
15605
15605
|
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
@@ -15610,19 +15610,19 @@ var require_range = __commonJS({
|
|
|
15610
15610
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
15611
15611
|
}
|
|
15612
15612
|
}
|
|
15613
|
-
|
|
15613
|
+
debug4("caret return", ret);
|
|
15614
15614
|
return ret;
|
|
15615
15615
|
});
|
|
15616
15616
|
};
|
|
15617
15617
|
var replaceXRanges = (comp, options) => {
|
|
15618
|
-
|
|
15618
|
+
debug4("replaceXRanges", comp, options);
|
|
15619
15619
|
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
15620
15620
|
};
|
|
15621
15621
|
var replaceXRange = (comp, options) => {
|
|
15622
15622
|
comp = comp.trim();
|
|
15623
15623
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
15624
15624
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
15625
|
-
|
|
15625
|
+
debug4("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
15626
15626
|
const xM = isX(M);
|
|
15627
15627
|
const xm = xM || isX(m);
|
|
15628
15628
|
const xp = xm || isX(p);
|
|
@@ -15669,16 +15669,16 @@ var require_range = __commonJS({
|
|
|
15669
15669
|
} else if (xp) {
|
|
15670
15670
|
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
15671
15671
|
}
|
|
15672
|
-
|
|
15672
|
+
debug4("xRange return", ret);
|
|
15673
15673
|
return ret;
|
|
15674
15674
|
});
|
|
15675
15675
|
};
|
|
15676
15676
|
var replaceStars = (comp, options) => {
|
|
15677
|
-
|
|
15677
|
+
debug4("replaceStars", comp, options);
|
|
15678
15678
|
return comp.trim().replace(re[t.STAR], "");
|
|
15679
15679
|
};
|
|
15680
15680
|
var replaceGTE0 = (comp, options) => {
|
|
15681
|
-
|
|
15681
|
+
debug4("replaceGTE0", comp, options);
|
|
15682
15682
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
15683
15683
|
};
|
|
15684
15684
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
|
|
@@ -15716,7 +15716,7 @@ var require_range = __commonJS({
|
|
|
15716
15716
|
}
|
|
15717
15717
|
if (version2.prerelease.length && !options.includePrerelease) {
|
|
15718
15718
|
for (let i = 0; i < set.length; i++) {
|
|
15719
|
-
|
|
15719
|
+
debug4(set[i].semver);
|
|
15720
15720
|
if (set[i].semver === Comparator.ANY) {
|
|
15721
15721
|
continue;
|
|
15722
15722
|
}
|
|
@@ -15752,7 +15752,7 @@ var require_comparator = __commonJS({
|
|
|
15752
15752
|
}
|
|
15753
15753
|
}
|
|
15754
15754
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
15755
|
-
|
|
15755
|
+
debug4("comparator", comp, options);
|
|
15756
15756
|
this.options = options;
|
|
15757
15757
|
this.loose = !!options.loose;
|
|
15758
15758
|
this.parse(comp);
|
|
@@ -15761,7 +15761,7 @@ var require_comparator = __commonJS({
|
|
|
15761
15761
|
} else {
|
|
15762
15762
|
this.value = this.operator + this.semver.version;
|
|
15763
15763
|
}
|
|
15764
|
-
|
|
15764
|
+
debug4("comp", this);
|
|
15765
15765
|
}
|
|
15766
15766
|
parse(comp) {
|
|
15767
15767
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
@@ -15783,7 +15783,7 @@ var require_comparator = __commonJS({
|
|
|
15783
15783
|
return this.value;
|
|
15784
15784
|
}
|
|
15785
15785
|
test(version2) {
|
|
15786
|
-
|
|
15786
|
+
debug4("Comparator.test", version2, this.options.loose);
|
|
15787
15787
|
if (this.semver === ANY || version2 === ANY) {
|
|
15788
15788
|
return true;
|
|
15789
15789
|
}
|
|
@@ -15840,7 +15840,7 @@ var require_comparator = __commonJS({
|
|
|
15840
15840
|
var parseOptions = require_parse_options();
|
|
15841
15841
|
var { safeRe: re, t } = require_re();
|
|
15842
15842
|
var cmp = require_cmp();
|
|
15843
|
-
var
|
|
15843
|
+
var debug4 = require_debug();
|
|
15844
15844
|
var SemVer = require_semver();
|
|
15845
15845
|
var Range = require_range();
|
|
15846
15846
|
}
|
|
@@ -16634,7 +16634,7 @@ var require_dist4 = __commonJS({
|
|
|
16634
16634
|
"../../node_modules/.pnpm/rc9@1.2.0/node_modules/rc9/dist/index.js"(exports) {
|
|
16635
16635
|
"use strict";
|
|
16636
16636
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16637
|
-
var
|
|
16637
|
+
var fs5 = require("fs");
|
|
16638
16638
|
var path6 = require("path");
|
|
16639
16639
|
var os = require("os");
|
|
16640
16640
|
var destr2 = require_dist3();
|
|
@@ -16681,10 +16681,10 @@ var require_dist4 = __commonJS({
|
|
|
16681
16681
|
return (options == null ? void 0 : options.flat) ? config : flat.unflatten(config, { overwrite: true });
|
|
16682
16682
|
}
|
|
16683
16683
|
function parseFile(path22, options) {
|
|
16684
|
-
if (!
|
|
16684
|
+
if (!fs5.existsSync(path22)) {
|
|
16685
16685
|
return {};
|
|
16686
16686
|
}
|
|
16687
|
-
return parse2(
|
|
16687
|
+
return parse2(fs5.readFileSync(path22, "utf-8"), options);
|
|
16688
16688
|
}
|
|
16689
16689
|
function read(options) {
|
|
16690
16690
|
options = withDefaults(options);
|
|
@@ -16700,7 +16700,7 @@ var require_dist4 = __commonJS({
|
|
|
16700
16700
|
}
|
|
16701
16701
|
function write(config, options) {
|
|
16702
16702
|
options = withDefaults(options);
|
|
16703
|
-
|
|
16703
|
+
fs5.writeFileSync(path6.resolve(options.dir, options.name), serialize(config), {
|
|
16704
16704
|
encoding: "utf-8"
|
|
16705
16705
|
});
|
|
16706
16706
|
}
|
|
@@ -17201,7 +17201,7 @@ var require_minimatch = __commonJS({
|
|
|
17201
17201
|
this.parseNegate();
|
|
17202
17202
|
var set = this.globSet = this.braceExpand();
|
|
17203
17203
|
if (options.debug)
|
|
17204
|
-
this.debug = function
|
|
17204
|
+
this.debug = function debug4() {
|
|
17205
17205
|
console.error.apply(console, arguments);
|
|
17206
17206
|
};
|
|
17207
17207
|
this.debug(this.pattern, set);
|
|
@@ -17661,15 +17661,15 @@ var require_minimatch = __commonJS({
|
|
|
17661
17661
|
var require_semver3 = __commonJS({
|
|
17662
17662
|
"../../node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js"(exports, module2) {
|
|
17663
17663
|
exports = module2.exports = SemVer;
|
|
17664
|
-
var
|
|
17664
|
+
var debug4;
|
|
17665
17665
|
if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
|
|
17666
|
-
|
|
17666
|
+
debug4 = function() {
|
|
17667
17667
|
var args = Array.prototype.slice.call(arguments, 0);
|
|
17668
17668
|
args.unshift("SEMVER");
|
|
17669
17669
|
console.log.apply(console, args);
|
|
17670
17670
|
};
|
|
17671
17671
|
} else {
|
|
17672
|
-
|
|
17672
|
+
debug4 = function() {
|
|
17673
17673
|
};
|
|
17674
17674
|
}
|
|
17675
17675
|
exports.SEMVER_SPEC_VERSION = "2.0.0";
|
|
@@ -17787,7 +17787,7 @@ var require_semver3 = __commonJS({
|
|
|
17787
17787
|
tok("STAR");
|
|
17788
17788
|
src[t.STAR] = "(<|>)?=?\\s*\\*";
|
|
17789
17789
|
for (i = 0; i < R; i++) {
|
|
17790
|
-
|
|
17790
|
+
debug4(i, src[i]);
|
|
17791
17791
|
if (!re[i]) {
|
|
17792
17792
|
re[i] = new RegExp(src[i]);
|
|
17793
17793
|
safeRe[i] = new RegExp(makeSafeRe(src[i]));
|
|
@@ -17854,7 +17854,7 @@ var require_semver3 = __commonJS({
|
|
|
17854
17854
|
if (!(this instanceof SemVer)) {
|
|
17855
17855
|
return new SemVer(version2, options);
|
|
17856
17856
|
}
|
|
17857
|
-
|
|
17857
|
+
debug4("SemVer", version2, options);
|
|
17858
17858
|
this.options = options;
|
|
17859
17859
|
this.loose = !!options.loose;
|
|
17860
17860
|
var m = version2.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
|
|
@@ -17901,7 +17901,7 @@ var require_semver3 = __commonJS({
|
|
|
17901
17901
|
return this.version;
|
|
17902
17902
|
};
|
|
17903
17903
|
SemVer.prototype.compare = function(other) {
|
|
17904
|
-
|
|
17904
|
+
debug4("SemVer.compare", this.version, this.options, other);
|
|
17905
17905
|
if (!(other instanceof SemVer)) {
|
|
17906
17906
|
other = new SemVer(other, this.options);
|
|
17907
17907
|
}
|
|
@@ -17928,7 +17928,7 @@ var require_semver3 = __commonJS({
|
|
|
17928
17928
|
do {
|
|
17929
17929
|
var a = this.prerelease[i2];
|
|
17930
17930
|
var b = other.prerelease[i2];
|
|
17931
|
-
|
|
17931
|
+
debug4("prerelease compare", i2, a, b);
|
|
17932
17932
|
if (a === void 0 && b === void 0) {
|
|
17933
17933
|
return 0;
|
|
17934
17934
|
} else if (b === void 0) {
|
|
@@ -17950,7 +17950,7 @@ var require_semver3 = __commonJS({
|
|
|
17950
17950
|
do {
|
|
17951
17951
|
var a = this.build[i2];
|
|
17952
17952
|
var b = other.build[i2];
|
|
17953
|
-
|
|
17953
|
+
debug4("prerelease compare", i2, a, b);
|
|
17954
17954
|
if (a === void 0 && b === void 0) {
|
|
17955
17955
|
return 0;
|
|
17956
17956
|
} else if (b === void 0) {
|
|
@@ -18210,7 +18210,7 @@ var require_semver3 = __commonJS({
|
|
|
18210
18210
|
return new Comparator(comp, options);
|
|
18211
18211
|
}
|
|
18212
18212
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
18213
|
-
|
|
18213
|
+
debug4("comparator", comp, options);
|
|
18214
18214
|
this.options = options;
|
|
18215
18215
|
this.loose = !!options.loose;
|
|
18216
18216
|
this.parse(comp);
|
|
@@ -18219,7 +18219,7 @@ var require_semver3 = __commonJS({
|
|
|
18219
18219
|
} else {
|
|
18220
18220
|
this.value = this.operator + this.semver.version;
|
|
18221
18221
|
}
|
|
18222
|
-
|
|
18222
|
+
debug4("comp", this);
|
|
18223
18223
|
}
|
|
18224
18224
|
var ANY = {};
|
|
18225
18225
|
Comparator.prototype.parse = function(comp) {
|
|
@@ -18242,7 +18242,7 @@ var require_semver3 = __commonJS({
|
|
|
18242
18242
|
return this.value;
|
|
18243
18243
|
};
|
|
18244
18244
|
Comparator.prototype.test = function(version2) {
|
|
18245
|
-
|
|
18245
|
+
debug4("Comparator.test", version2, this.options.loose);
|
|
18246
18246
|
if (this.semver === ANY || version2 === ANY) {
|
|
18247
18247
|
return true;
|
|
18248
18248
|
}
|
|
@@ -18335,9 +18335,9 @@ var require_semver3 = __commonJS({
|
|
|
18335
18335
|
var loose = this.options.loose;
|
|
18336
18336
|
var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
|
|
18337
18337
|
range = range.replace(hr, hyphenReplace);
|
|
18338
|
-
|
|
18338
|
+
debug4("hyphen replace", range);
|
|
18339
18339
|
range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
18340
|
-
|
|
18340
|
+
debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]);
|
|
18341
18341
|
range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
|
|
18342
18342
|
range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
|
|
18343
18343
|
range = range.split(/\s+/).join(" ");
|
|
@@ -18390,15 +18390,15 @@ var require_semver3 = __commonJS({
|
|
|
18390
18390
|
});
|
|
18391
18391
|
}
|
|
18392
18392
|
function parseComparator(comp, options) {
|
|
18393
|
-
|
|
18393
|
+
debug4("comp", comp, options);
|
|
18394
18394
|
comp = replaceCarets(comp, options);
|
|
18395
|
-
|
|
18395
|
+
debug4("caret", comp);
|
|
18396
18396
|
comp = replaceTildes(comp, options);
|
|
18397
|
-
|
|
18397
|
+
debug4("tildes", comp);
|
|
18398
18398
|
comp = replaceXRanges(comp, options);
|
|
18399
|
-
|
|
18399
|
+
debug4("xrange", comp);
|
|
18400
18400
|
comp = replaceStars(comp, options);
|
|
18401
|
-
|
|
18401
|
+
debug4("stars", comp);
|
|
18402
18402
|
return comp;
|
|
18403
18403
|
}
|
|
18404
18404
|
function isX(id) {
|
|
@@ -18412,7 +18412,7 @@ var require_semver3 = __commonJS({
|
|
|
18412
18412
|
function replaceTilde(comp, options) {
|
|
18413
18413
|
var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
|
|
18414
18414
|
return comp.replace(r, function(_, M, m, p, pr) {
|
|
18415
|
-
|
|
18415
|
+
debug4("tilde", comp, _, M, m, p, pr);
|
|
18416
18416
|
var ret;
|
|
18417
18417
|
if (isX(M)) {
|
|
18418
18418
|
ret = "";
|
|
@@ -18421,12 +18421,12 @@ var require_semver3 = __commonJS({
|
|
|
18421
18421
|
} else if (isX(p)) {
|
|
18422
18422
|
ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
|
|
18423
18423
|
} else if (pr) {
|
|
18424
|
-
|
|
18424
|
+
debug4("replaceTilde pr", pr);
|
|
18425
18425
|
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
|
|
18426
18426
|
} else {
|
|
18427
18427
|
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
|
|
18428
18428
|
}
|
|
18429
|
-
|
|
18429
|
+
debug4("tilde return", ret);
|
|
18430
18430
|
return ret;
|
|
18431
18431
|
});
|
|
18432
18432
|
}
|
|
@@ -18436,10 +18436,10 @@ var require_semver3 = __commonJS({
|
|
|
18436
18436
|
}).join(" ");
|
|
18437
18437
|
}
|
|
18438
18438
|
function replaceCaret(comp, options) {
|
|
18439
|
-
|
|
18439
|
+
debug4("caret", comp, options);
|
|
18440
18440
|
var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
|
|
18441
18441
|
return comp.replace(r, function(_, M, m, p, pr) {
|
|
18442
|
-
|
|
18442
|
+
debug4("caret", comp, _, M, m, p, pr);
|
|
18443
18443
|
var ret;
|
|
18444
18444
|
if (isX(M)) {
|
|
18445
18445
|
ret = "";
|
|
@@ -18452,7 +18452,7 @@ var require_semver3 = __commonJS({
|
|
|
18452
18452
|
ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
|
|
18453
18453
|
}
|
|
18454
18454
|
} else if (pr) {
|
|
18455
|
-
|
|
18455
|
+
debug4("replaceCaret pr", pr);
|
|
18456
18456
|
if (M === "0") {
|
|
18457
18457
|
if (m === "0") {
|
|
18458
18458
|
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
|
|
@@ -18463,7 +18463,7 @@ var require_semver3 = __commonJS({
|
|
|
18463
18463
|
ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
|
|
18464
18464
|
}
|
|
18465
18465
|
} else {
|
|
18466
|
-
|
|
18466
|
+
debug4("no pr");
|
|
18467
18467
|
if (M === "0") {
|
|
18468
18468
|
if (m === "0") {
|
|
18469
18469
|
ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
|
|
@@ -18474,12 +18474,12 @@ var require_semver3 = __commonJS({
|
|
|
18474
18474
|
ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
|
|
18475
18475
|
}
|
|
18476
18476
|
}
|
|
18477
|
-
|
|
18477
|
+
debug4("caret return", ret);
|
|
18478
18478
|
return ret;
|
|
18479
18479
|
});
|
|
18480
18480
|
}
|
|
18481
18481
|
function replaceXRanges(comp, options) {
|
|
18482
|
-
|
|
18482
|
+
debug4("replaceXRanges", comp, options);
|
|
18483
18483
|
return comp.split(/\s+/).map(function(comp2) {
|
|
18484
18484
|
return replaceXRange(comp2, options);
|
|
18485
18485
|
}).join(" ");
|
|
@@ -18488,7 +18488,7 @@ var require_semver3 = __commonJS({
|
|
|
18488
18488
|
comp = comp.trim();
|
|
18489
18489
|
var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
|
|
18490
18490
|
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
|
18491
|
-
|
|
18491
|
+
debug4("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
18492
18492
|
var xM = isX(M);
|
|
18493
18493
|
var xm = xM || isX(m);
|
|
18494
18494
|
var xp = xm || isX(p);
|
|
@@ -18532,12 +18532,12 @@ var require_semver3 = __commonJS({
|
|
|
18532
18532
|
} else if (xp) {
|
|
18533
18533
|
ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
|
|
18534
18534
|
}
|
|
18535
|
-
|
|
18535
|
+
debug4("xRange return", ret);
|
|
18536
18536
|
return ret;
|
|
18537
18537
|
});
|
|
18538
18538
|
}
|
|
18539
18539
|
function replaceStars(comp, options) {
|
|
18540
|
-
|
|
18540
|
+
debug4("replaceStars", comp, options);
|
|
18541
18541
|
return comp.trim().replace(safeRe[t.STAR], "");
|
|
18542
18542
|
}
|
|
18543
18543
|
function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
|
|
@@ -18589,7 +18589,7 @@ var require_semver3 = __commonJS({
|
|
|
18589
18589
|
}
|
|
18590
18590
|
if (version2.prerelease.length && !options.includePrerelease) {
|
|
18591
18591
|
for (i2 = 0; i2 < set.length; i2++) {
|
|
18592
|
-
|
|
18592
|
+
debug4(set[i2].semver);
|
|
18593
18593
|
if (set[i2].semver === ANY) {
|
|
18594
18594
|
continue;
|
|
18595
18595
|
}
|
|
@@ -22390,14 +22390,14 @@ var require_utils4 = __commonJS({
|
|
|
22390
22390
|
__export2(utils_exports, {
|
|
22391
22391
|
DETECTION_FRAMEWORKS: () => DETECTION_FRAMEWORKS,
|
|
22392
22392
|
INTERNAL_QUEUES_PREFIX: () => INTERNAL_QUEUES_PREFIX,
|
|
22393
|
-
INTERNAL_SERVICE_PREFIX: () =>
|
|
22393
|
+
INTERNAL_SERVICE_PREFIX: () => import_build_utils5.INTERNAL_SERVICE_PREFIX,
|
|
22394
22394
|
assignRoutePrefixes: () => assignRoutePrefixes,
|
|
22395
22395
|
combineBuildCommand: () => combineBuildCommand,
|
|
22396
22396
|
filterFrameworksByRuntime: () => filterFrameworksByRuntime,
|
|
22397
22397
|
getBuilderForRuntime: () => getBuilderForRuntime,
|
|
22398
|
-
getInternalServiceCronPath: () =>
|
|
22399
|
-
getInternalServiceCronPathPrefix: () =>
|
|
22400
|
-
getInternalServiceFunctionPath: () =>
|
|
22398
|
+
getInternalServiceCronPath: () => import_build_utils5.getInternalServiceCronPath,
|
|
22399
|
+
getInternalServiceCronPathPrefix: () => import_build_utils5.getInternalServiceCronPathPrefix,
|
|
22400
|
+
getInternalServiceFunctionPath: () => import_build_utils5.getInternalServiceFunctionPath,
|
|
22401
22401
|
getInternalServiceWorkerPath: () => getInternalServiceWorkerPath2,
|
|
22402
22402
|
getInternalServiceWorkerPathPrefix: () => getInternalServiceWorkerPathPrefix2,
|
|
22403
22403
|
hasFile: () => hasFile,
|
|
@@ -22412,15 +22412,15 @@ var require_utils4 = __commonJS({
|
|
|
22412
22412
|
});
|
|
22413
22413
|
module2.exports = __toCommonJS2(utils_exports);
|
|
22414
22414
|
var import_framework_helpers = require("@vercel/build-utils/dist/framework-helpers");
|
|
22415
|
-
var
|
|
22415
|
+
var import_build_utils5 = require("@vercel/build-utils");
|
|
22416
22416
|
var import_frameworks2 = require_frameworks();
|
|
22417
22417
|
var import_types = require_types3();
|
|
22418
22418
|
var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
|
|
22419
22419
|
(framework) => !framework.experimental || framework.runtimeFramework
|
|
22420
22420
|
);
|
|
22421
|
-
async function hasFile(
|
|
22421
|
+
async function hasFile(fs5, filePath) {
|
|
22422
22422
|
try {
|
|
22423
|
-
return await
|
|
22423
|
+
return await fs5.isFile(filePath);
|
|
22424
22424
|
} catch {
|
|
22425
22425
|
return false;
|
|
22426
22426
|
}
|
|
@@ -22443,7 +22443,7 @@ var require_utils4 = __commonJS({
|
|
|
22443
22443
|
return normalized || "index";
|
|
22444
22444
|
}
|
|
22445
22445
|
function getInternalServiceWorkerPathPrefix2(serviceName) {
|
|
22446
|
-
return `${
|
|
22446
|
+
return `${import_build_utils5.INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
|
|
22447
22447
|
}
|
|
22448
22448
|
function getInternalServiceWorkerPath2(serviceName, entrypoint, handler = "worker") {
|
|
22449
22449
|
const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
|
|
@@ -22515,11 +22515,11 @@ var require_utils4 = __commonJS({
|
|
|
22515
22515
|
}
|
|
22516
22516
|
return void 0;
|
|
22517
22517
|
}
|
|
22518
|
-
async function readVercelConfig(
|
|
22519
|
-
const hasVercelJson = await
|
|
22518
|
+
async function readVercelConfig(fs5) {
|
|
22519
|
+
const hasVercelJson = await fs5.hasPath("vercel.json");
|
|
22520
22520
|
if (hasVercelJson) {
|
|
22521
22521
|
try {
|
|
22522
|
-
const content = await
|
|
22522
|
+
const content = await fs5.readFile("vercel.json");
|
|
22523
22523
|
const config = JSON.parse(content.toString());
|
|
22524
22524
|
const gateError = validateServicesConfigGate(config);
|
|
22525
22525
|
if (gateError) {
|
|
@@ -22536,11 +22536,11 @@ var require_utils4 = __commonJS({
|
|
|
22536
22536
|
};
|
|
22537
22537
|
}
|
|
22538
22538
|
}
|
|
22539
|
-
const hasVercelToml = process.env.VERCEL_TOML_CONFIG_ENABLED === "1" && await
|
|
22539
|
+
const hasVercelToml = process.env.VERCEL_TOML_CONFIG_ENABLED === "1" && await fs5.hasPath("vercel.toml");
|
|
22540
22540
|
if (hasVercelToml) {
|
|
22541
22541
|
try {
|
|
22542
22542
|
const { parse: tomlParse } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
22543
|
-
const content = await
|
|
22543
|
+
const content = await fs5.readFile("vercel.toml");
|
|
22544
22544
|
const config = tomlParse(content.toString());
|
|
22545
22545
|
const gateError = validateServicesConfigGate(config);
|
|
22546
22546
|
if (gateError) {
|
|
@@ -22645,7 +22645,7 @@ var require_detect_framework = __commonJS({
|
|
|
22645
22645
|
return !experimental;
|
|
22646
22646
|
});
|
|
22647
22647
|
}
|
|
22648
|
-
async function matches(
|
|
22648
|
+
async function matches(fs5, framework) {
|
|
22649
22649
|
const { detectors } = framework;
|
|
22650
22650
|
if (!detectors) {
|
|
22651
22651
|
return;
|
|
@@ -22683,15 +22683,15 @@ var require_detect_framework = __commonJS({
|
|
|
22683
22683
|
if (matchPackage) {
|
|
22684
22684
|
matchContent = `"(dev)?(d|D)ependencies":\\s*{[^}]*"${matchPackage}":\\s*"(.+?)"[^}]*}`;
|
|
22685
22685
|
}
|
|
22686
|
-
if (await
|
|
22686
|
+
if (await fs5.hasPath(path6) === false) {
|
|
22687
22687
|
return;
|
|
22688
22688
|
}
|
|
22689
22689
|
if (matchContent) {
|
|
22690
|
-
if (await
|
|
22690
|
+
if (await fs5.isFile(path6) === false) {
|
|
22691
22691
|
return;
|
|
22692
22692
|
}
|
|
22693
22693
|
const regex = new RegExp(matchContent, "m");
|
|
22694
|
-
const content = await
|
|
22694
|
+
const content = await fs5.readFile(path6);
|
|
22695
22695
|
const match = content.toString().match(regex);
|
|
22696
22696
|
if (!match) {
|
|
22697
22697
|
return;
|
|
@@ -22756,7 +22756,7 @@ var require_detect_framework = __commonJS({
|
|
|
22756
22756
|
}
|
|
22757
22757
|
}
|
|
22758
22758
|
async function detectFramework2({
|
|
22759
|
-
fs:
|
|
22759
|
+
fs: fs5,
|
|
22760
22760
|
frameworkList,
|
|
22761
22761
|
useExperimentalFrameworks
|
|
22762
22762
|
}) {
|
|
@@ -22766,7 +22766,7 @@ var require_detect_framework = __commonJS({
|
|
|
22766
22766
|
);
|
|
22767
22767
|
const result = await Promise.all(
|
|
22768
22768
|
filteredList.map(async (frameworkMatch) => {
|
|
22769
|
-
if (await matches(
|
|
22769
|
+
if (await matches(fs5, frameworkMatch)) {
|
|
22770
22770
|
return frameworkMatch;
|
|
22771
22771
|
}
|
|
22772
22772
|
return null;
|
|
@@ -22776,7 +22776,7 @@ var require_detect_framework = __commonJS({
|
|
|
22776
22776
|
return result.find((res) => res !== null)?.slug ?? null;
|
|
22777
22777
|
}
|
|
22778
22778
|
async function detectFrameworks2({
|
|
22779
|
-
fs:
|
|
22779
|
+
fs: fs5,
|
|
22780
22780
|
frameworkList,
|
|
22781
22781
|
useExperimentalFrameworks
|
|
22782
22782
|
}) {
|
|
@@ -22786,7 +22786,7 @@ var require_detect_framework = __commonJS({
|
|
|
22786
22786
|
);
|
|
22787
22787
|
const result = await Promise.all(
|
|
22788
22788
|
filteredList.map(async (frameworkMatch) => {
|
|
22789
|
-
if (await matches(
|
|
22789
|
+
if (await matches(fs5, frameworkMatch)) {
|
|
22790
22790
|
return frameworkMatch;
|
|
22791
22791
|
}
|
|
22792
22792
|
return null;
|
|
@@ -22796,7 +22796,7 @@ var require_detect_framework = __commonJS({
|
|
|
22796
22796
|
return result.filter((res) => res !== null);
|
|
22797
22797
|
}
|
|
22798
22798
|
async function detectFrameworkRecord3({
|
|
22799
|
-
fs:
|
|
22799
|
+
fs: fs5,
|
|
22800
22800
|
frameworkList,
|
|
22801
22801
|
useExperimentalFrameworks
|
|
22802
22802
|
}) {
|
|
@@ -22806,7 +22806,7 @@ var require_detect_framework = __commonJS({
|
|
|
22806
22806
|
);
|
|
22807
22807
|
const result = await Promise.all(
|
|
22808
22808
|
filteredList.map(async (frameworkMatch) => {
|
|
22809
|
-
const matchResult = await matches(
|
|
22809
|
+
const matchResult = await matches(fs5, frameworkMatch);
|
|
22810
22810
|
if (matchResult) {
|
|
22811
22811
|
return {
|
|
22812
22812
|
...frameworkMatch,
|
|
@@ -22878,8 +22878,8 @@ var require_resolve = __commonJS({
|
|
|
22878
22878
|
validateServiceEntrypoint: () => validateServiceEntrypoint
|
|
22879
22879
|
});
|
|
22880
22880
|
module2.exports = __toCommonJS2(resolve_exports);
|
|
22881
|
-
var
|
|
22882
|
-
var
|
|
22881
|
+
var import_path7 = require("path");
|
|
22882
|
+
var import_build_utils5 = require("@vercel/build-utils");
|
|
22883
22883
|
var import_types = require_types3();
|
|
22884
22884
|
var import_utils = require_utils4();
|
|
22885
22885
|
var import_frameworks2 = require_frameworks();
|
|
@@ -22905,14 +22905,14 @@ var require_resolve = __commonJS({
|
|
|
22905
22905
|
"python",
|
|
22906
22906
|
"go"
|
|
22907
22907
|
]);
|
|
22908
|
-
async function getServiceFs(
|
|
22908
|
+
async function getServiceFs(fs5, serviceName, root) {
|
|
22909
22909
|
if (!root) {
|
|
22910
|
-
return { fs:
|
|
22910
|
+
return { fs: fs5 };
|
|
22911
22911
|
}
|
|
22912
|
-
const normalizedRoot =
|
|
22913
|
-
if (!await
|
|
22912
|
+
const normalizedRoot = import_path7.posix.normalize(root);
|
|
22913
|
+
if (!await fs5.hasPath(normalizedRoot)) {
|
|
22914
22914
|
return {
|
|
22915
|
-
fs:
|
|
22915
|
+
fs: fs5,
|
|
22916
22916
|
error: {
|
|
22917
22917
|
code: "ROOT_NOT_FOUND",
|
|
22918
22918
|
message: `Service "${serviceName}" has root "${root}" but that directory does not exist.`,
|
|
@@ -22920,9 +22920,9 @@ var require_resolve = __commonJS({
|
|
|
22920
22920
|
}
|
|
22921
22921
|
};
|
|
22922
22922
|
}
|
|
22923
|
-
if (await
|
|
22923
|
+
if (await fs5.isFile(normalizedRoot)) {
|
|
22924
22924
|
return {
|
|
22925
|
-
fs:
|
|
22925
|
+
fs: fs5,
|
|
22926
22926
|
error: {
|
|
22927
22927
|
code: "ROOT_NOT_DIRECTORY",
|
|
22928
22928
|
message: `Service "${serviceName}" has root "${root}" but that path is a file, not a directory.`,
|
|
@@ -22930,10 +22930,10 @@ var require_resolve = __commonJS({
|
|
|
22930
22930
|
}
|
|
22931
22931
|
};
|
|
22932
22932
|
}
|
|
22933
|
-
return { fs:
|
|
22933
|
+
return { fs: fs5.chdir(normalizedRoot) };
|
|
22934
22934
|
}
|
|
22935
22935
|
function normalizeServiceEntrypoint(entrypoint) {
|
|
22936
|
-
const normalized =
|
|
22936
|
+
const normalized = import_path7.posix.normalize(entrypoint);
|
|
22937
22937
|
return normalized === "" ? "." : normalized;
|
|
22938
22938
|
}
|
|
22939
22939
|
function getEffectiveServiceTrigger(config) {
|
|
@@ -22969,12 +22969,12 @@ var require_resolve = __commonJS({
|
|
|
22969
22969
|
};
|
|
22970
22970
|
}
|
|
22971
22971
|
async function resolveEntrypointPath({
|
|
22972
|
-
fs:
|
|
22972
|
+
fs: fs5,
|
|
22973
22973
|
serviceName,
|
|
22974
22974
|
entrypoint
|
|
22975
22975
|
}) {
|
|
22976
22976
|
const normalized = normalizeServiceEntrypoint(entrypoint);
|
|
22977
|
-
if (!await
|
|
22977
|
+
if (!await fs5.hasPath(normalized)) {
|
|
22978
22978
|
return {
|
|
22979
22979
|
error: {
|
|
22980
22980
|
code: "ENTRYPOINT_NOT_FOUND",
|
|
@@ -22986,12 +22986,12 @@ var require_resolve = __commonJS({
|
|
|
22986
22986
|
return {
|
|
22987
22987
|
entrypoint: {
|
|
22988
22988
|
normalized,
|
|
22989
|
-
isDirectory: !await
|
|
22989
|
+
isDirectory: !await fs5.isFile(normalized)
|
|
22990
22990
|
}
|
|
22991
22991
|
};
|
|
22992
22992
|
}
|
|
22993
22993
|
function toWorkspaceRelativeEntrypoint(entrypoint, workspace) {
|
|
22994
|
-
const normalizedEntrypoint =
|
|
22994
|
+
const normalizedEntrypoint = import_path7.posix.normalize(entrypoint);
|
|
22995
22995
|
if (workspace === ".") {
|
|
22996
22996
|
return normalizedEntrypoint;
|
|
22997
22997
|
}
|
|
@@ -22999,7 +22999,7 @@ var require_resolve = __commonJS({
|
|
|
22999
22999
|
if (normalizedEntrypoint.startsWith(workspacePrefix)) {
|
|
23000
23000
|
return normalizedEntrypoint.slice(workspacePrefix.length);
|
|
23001
23001
|
}
|
|
23002
|
-
const relativeEntrypoint =
|
|
23002
|
+
const relativeEntrypoint = import_path7.posix.relative(
|
|
23003
23003
|
workspace,
|
|
23004
23004
|
normalizedEntrypoint
|
|
23005
23005
|
);
|
|
@@ -23009,7 +23009,7 @@ var require_resolve = __commonJS({
|
|
|
23009
23009
|
return relativeEntrypoint;
|
|
23010
23010
|
}
|
|
23011
23011
|
async function inferWorkspaceFromNearestManifest({
|
|
23012
|
-
fs:
|
|
23012
|
+
fs: fs5,
|
|
23013
23013
|
entrypoint,
|
|
23014
23014
|
runtime
|
|
23015
23015
|
}) {
|
|
@@ -23020,22 +23020,22 @@ var require_resolve = __commonJS({
|
|
|
23020
23020
|
if (!manifests || manifests.length === 0) {
|
|
23021
23021
|
return void 0;
|
|
23022
23022
|
}
|
|
23023
|
-
let dir =
|
|
23023
|
+
let dir = import_path7.posix.dirname(import_path7.posix.normalize(entrypoint)) || ".";
|
|
23024
23024
|
if (dir === "") {
|
|
23025
23025
|
dir = ".";
|
|
23026
23026
|
}
|
|
23027
23027
|
let reachedRoot = false;
|
|
23028
23028
|
while (!reachedRoot) {
|
|
23029
23029
|
for (const manifest of manifests) {
|
|
23030
|
-
const manifestPath = dir === "." ? manifest :
|
|
23031
|
-
if (await (0, import_utils.hasFile)(
|
|
23030
|
+
const manifestPath = dir === "." ? manifest : import_path7.posix.join(dir, manifest);
|
|
23031
|
+
if (await (0, import_utils.hasFile)(fs5, manifestPath)) {
|
|
23032
23032
|
return dir;
|
|
23033
23033
|
}
|
|
23034
23034
|
}
|
|
23035
23035
|
if (dir === "." || dir === "/") {
|
|
23036
23036
|
reachedRoot = true;
|
|
23037
23037
|
} else {
|
|
23038
|
-
const parent =
|
|
23038
|
+
const parent = import_path7.posix.dirname(dir);
|
|
23039
23039
|
if (!parent || parent === dir) {
|
|
23040
23040
|
reachedRoot = true;
|
|
23041
23041
|
} else {
|
|
@@ -23046,12 +23046,12 @@ var require_resolve = __commonJS({
|
|
|
23046
23046
|
return void 0;
|
|
23047
23047
|
}
|
|
23048
23048
|
async function detectFrameworkFromWorkspace({
|
|
23049
|
-
fs:
|
|
23049
|
+
fs: fs5,
|
|
23050
23050
|
workspace,
|
|
23051
23051
|
serviceName,
|
|
23052
23052
|
runtime
|
|
23053
23053
|
}) {
|
|
23054
|
-
const serviceFs = workspace === "." ?
|
|
23054
|
+
const serviceFs = workspace === "." ? fs5 : fs5.chdir(workspace);
|
|
23055
23055
|
const frameworkCandidates = (0, import_utils.filterFrameworksByRuntime)(import_frameworks2.frameworkList, runtime);
|
|
23056
23056
|
const frameworks2 = await (0, import_detect_framework.detectFrameworks)({
|
|
23057
23057
|
fs: serviceFs,
|
|
@@ -23178,8 +23178,8 @@ var require_resolve = __commonJS({
|
|
|
23178
23178
|
trigger: effectiveTrigger
|
|
23179
23179
|
};
|
|
23180
23180
|
const isJobService = serviceType === "job" || serviceType === "cron";
|
|
23181
|
-
const isScheduleJobService = (0,
|
|
23182
|
-
const isQueueJobService = serviceType === "job" && (0,
|
|
23181
|
+
const isScheduleJobService = (0, import_build_utils5.isScheduleTriggeredService)(effectiveService);
|
|
23182
|
+
const isQueueJobService = serviceType === "job" && (0, import_build_utils5.isQueueTriggeredService)(effectiveService);
|
|
23183
23183
|
const isWorkflowService = serviceType === "job" && effectiveTrigger === "workflow";
|
|
23184
23184
|
const isNonWebService = serviceType === "worker" || isJobService;
|
|
23185
23185
|
const serviceTypeLabel = isJobService ? "Job" : serviceType === "worker" ? "Worker" : "Web";
|
|
@@ -23233,10 +23233,10 @@ var require_resolve = __commonJS({
|
|
|
23233
23233
|
serviceName: name
|
|
23234
23234
|
};
|
|
23235
23235
|
}
|
|
23236
|
-
if (serviceType === "job" && effectiveTrigger && !
|
|
23236
|
+
if (serviceType === "job" && effectiveTrigger && !import_build_utils5.JOB_TRIGGERS.includes(effectiveTrigger)) {
|
|
23237
23237
|
return {
|
|
23238
23238
|
code: "INVALID_JOB_TRIGGER",
|
|
23239
|
-
message: `Job service "${name}" has invalid trigger "${effectiveTrigger}". Expected ${
|
|
23239
|
+
message: `Job service "${name}" has invalid trigger "${effectiveTrigger}". Expected ${import_build_utils5.JOB_TRIGGERS.map((t) => `"${t}"`).join(", ")}.`,
|
|
23240
23240
|
serviceName: name
|
|
23241
23241
|
};
|
|
23242
23242
|
}
|
|
@@ -23262,7 +23262,7 @@ var require_resolve = __commonJS({
|
|
|
23262
23262
|
};
|
|
23263
23263
|
}
|
|
23264
23264
|
if (config.root !== void 0) {
|
|
23265
|
-
const normalizedRoot =
|
|
23265
|
+
const normalizedRoot = import_path7.posix.normalize(config.root);
|
|
23266
23266
|
if (normalizedRoot.startsWith("/")) {
|
|
23267
23267
|
return {
|
|
23268
23268
|
code: "INVALID_ROOT",
|
|
@@ -23450,12 +23450,12 @@ var require_resolve = __commonJS({
|
|
|
23450
23450
|
}
|
|
23451
23451
|
}
|
|
23452
23452
|
if (root) {
|
|
23453
|
-
const normalizedRoot =
|
|
23453
|
+
const normalizedRoot = import_path7.posix.normalize(root);
|
|
23454
23454
|
if (normalizedRoot !== ".") {
|
|
23455
|
-
workspace = workspace === "." ? normalizedRoot :
|
|
23455
|
+
workspace = workspace === "." ? normalizedRoot : import_path7.posix.join(normalizedRoot, workspace);
|
|
23456
23456
|
}
|
|
23457
23457
|
}
|
|
23458
|
-
const topics = type === "worker" ? (0,
|
|
23458
|
+
const topics = type === "worker" ? (0, import_build_utils5.getServiceQueueTopics)({ type, topics: config.topics }) : trigger === "queue" ? config.topics : trigger === "workflow" ? ["__wkf_*"] : void 0;
|
|
23459
23459
|
let builderUse;
|
|
23460
23460
|
let builderSrc;
|
|
23461
23461
|
const frameworkDefinition = config.framework ? frameworksBySlug.get(config.framework) : void 0;
|
|
@@ -23463,7 +23463,7 @@ var require_resolve = __commonJS({
|
|
|
23463
23463
|
builderUse = config.builder;
|
|
23464
23464
|
builderSrc = resolvedEntrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
|
|
23465
23465
|
} else if (config.framework) {
|
|
23466
|
-
const isCronService = (0,
|
|
23466
|
+
const isCronService = (0, import_build_utils5.isScheduleTriggeredService)({ type, trigger });
|
|
23467
23467
|
if ((0, import_build_utils22.isNodeBackendFramework)(config.framework) && (type === "web" || isCronService)) {
|
|
23468
23468
|
builderUse = "@vercel/backends";
|
|
23469
23469
|
} else {
|
|
@@ -23477,7 +23477,7 @@ var require_resolve = __commonJS({
|
|
|
23477
23477
|
);
|
|
23478
23478
|
}
|
|
23479
23479
|
if (inferredRuntime === "node") {
|
|
23480
|
-
const isCronService = (0,
|
|
23480
|
+
const isCronService = (0, import_build_utils5.isScheduleTriggeredService)({ type, trigger });
|
|
23481
23481
|
builderUse = type === "web" || isCronService ? "@vercel/backends" : "@vercel/node";
|
|
23482
23482
|
} else {
|
|
23483
23483
|
builderUse = (0, import_utils.getBuilderForRuntime)(inferredRuntime);
|
|
@@ -23490,7 +23490,7 @@ var require_resolve = __commonJS({
|
|
|
23490
23490
|
const resolvedRoutePrefixSource = type === "web" && typeof routePrefix === "string" ? routePrefixWasConfigured ? routePrefixSource : "generated" : void 0;
|
|
23491
23491
|
const isRoot = workspace === ".";
|
|
23492
23492
|
if (!isRoot) {
|
|
23493
|
-
builderSrc =
|
|
23493
|
+
builderSrc = import_path7.posix.join(workspace, builderSrc);
|
|
23494
23494
|
}
|
|
23495
23495
|
const builderConfig = { zeroConfig: true };
|
|
23496
23496
|
if (builderUse === "@vercel/backends") {
|
|
@@ -23545,7 +23545,7 @@ var require_resolve = __commonJS({
|
|
|
23545
23545
|
env: config.env
|
|
23546
23546
|
};
|
|
23547
23547
|
}
|
|
23548
|
-
async function resolveAllConfiguredServices(services,
|
|
23548
|
+
async function resolveAllConfiguredServices(services, fs5, routePrefixSource = "configured", options = {}) {
|
|
23549
23549
|
const resolved = [];
|
|
23550
23550
|
const errors = [];
|
|
23551
23551
|
const webServicesByRoutePrefix = /* @__PURE__ */ new Map();
|
|
@@ -23557,7 +23557,7 @@ var require_resolve = __commonJS({
|
|
|
23557
23557
|
continue;
|
|
23558
23558
|
}
|
|
23559
23559
|
const root = serviceConfig.root;
|
|
23560
|
-
const serviceFsResult = await getServiceFs(
|
|
23560
|
+
const serviceFsResult = await getServiceFs(fs5, name, root);
|
|
23561
23561
|
if (serviceFsResult.error) {
|
|
23562
23562
|
errors.push(serviceFsResult.error);
|
|
23563
23563
|
continue;
|
|
@@ -23639,7 +23639,7 @@ var require_resolve = __commonJS({
|
|
|
23639
23639
|
entrypoint: resolvedEntrypoint.normalized,
|
|
23640
23640
|
runtime: inferredRuntime
|
|
23641
23641
|
});
|
|
23642
|
-
const workspace = inferredWorkspace ??
|
|
23642
|
+
const workspace = inferredWorkspace ?? import_path7.posix.dirname(resolvedEntrypoint.normalized);
|
|
23643
23643
|
const detection = await detectFrameworkFromWorkspace({
|
|
23644
23644
|
fs: serviceFs,
|
|
23645
23645
|
workspace,
|
|
@@ -23771,9 +23771,9 @@ var require_auto_detect = __commonJS({
|
|
|
23771
23771
|
var SERVICES_DIR = "services";
|
|
23772
23772
|
var FRONTEND_LOCATIONS = [FRONTEND_DIR, APPS_WEB_DIR];
|
|
23773
23773
|
async function autoDetectServices2(options) {
|
|
23774
|
-
const { fs:
|
|
23774
|
+
const { fs: fs5, detectEntrypoint } = options;
|
|
23775
23775
|
const rootFrameworks = await (0, import_detect_framework.detectFrameworks)({
|
|
23776
|
-
fs:
|
|
23776
|
+
fs: fs5,
|
|
23777
23777
|
frameworkList: import_frameworks2.frameworkList
|
|
23778
23778
|
});
|
|
23779
23779
|
if (rootFrameworks.length > 1) {
|
|
@@ -23790,14 +23790,14 @@ var require_auto_detect = __commonJS({
|
|
|
23790
23790
|
};
|
|
23791
23791
|
}
|
|
23792
23792
|
if (rootFrameworks.length === 1) {
|
|
23793
|
-
return detectServicesAtRoot(
|
|
23793
|
+
return detectServicesAtRoot(fs5, rootFrameworks[0], detectEntrypoint);
|
|
23794
23794
|
}
|
|
23795
23795
|
for (const frontendLocation of FRONTEND_LOCATIONS) {
|
|
23796
|
-
const hasFrontendDir = await
|
|
23796
|
+
const hasFrontendDir = await fs5.hasPath(frontendLocation);
|
|
23797
23797
|
if (!hasFrontendDir) {
|
|
23798
23798
|
continue;
|
|
23799
23799
|
}
|
|
23800
|
-
const frontendFs =
|
|
23800
|
+
const frontendFs = fs5.chdir(frontendLocation);
|
|
23801
23801
|
const frontendFrameworks = await (0, import_detect_framework.detectFrameworks)({
|
|
23802
23802
|
fs: frontendFs,
|
|
23803
23803
|
frameworkList: import_frameworks2.frameworkList
|
|
@@ -23817,9 +23817,10 @@ var require_auto_detect = __commonJS({
|
|
|
23817
23817
|
}
|
|
23818
23818
|
if (frontendFrameworks.length === 1) {
|
|
23819
23819
|
return detectServicesFrontendSubdir(
|
|
23820
|
-
|
|
23820
|
+
fs5,
|
|
23821
23821
|
frontendFrameworks[0],
|
|
23822
|
-
frontendLocation
|
|
23822
|
+
frontendLocation,
|
|
23823
|
+
detectEntrypoint
|
|
23823
23824
|
);
|
|
23824
23825
|
}
|
|
23825
23826
|
}
|
|
@@ -23834,13 +23835,13 @@ var require_auto_detect = __commonJS({
|
|
|
23834
23835
|
]
|
|
23835
23836
|
};
|
|
23836
23837
|
}
|
|
23837
|
-
async function detectServicesAtRoot(
|
|
23838
|
+
async function detectServicesAtRoot(fs5, rootFramework, detectEntrypoint) {
|
|
23838
23839
|
const services = {};
|
|
23839
23840
|
services.frontend = {
|
|
23840
23841
|
framework: rootFramework.slug ?? void 0,
|
|
23841
23842
|
routePrefix: "/"
|
|
23842
23843
|
};
|
|
23843
|
-
const backendResult = await detectBackendServices(
|
|
23844
|
+
const backendResult = await detectBackendServices(fs5, detectEntrypoint);
|
|
23844
23845
|
if (backendResult.error) {
|
|
23845
23846
|
return {
|
|
23846
23847
|
services: null,
|
|
@@ -23862,15 +23863,15 @@ var require_auto_detect = __commonJS({
|
|
|
23862
23863
|
errors: []
|
|
23863
23864
|
};
|
|
23864
23865
|
}
|
|
23865
|
-
async function detectServicesFrontendSubdir(
|
|
23866
|
+
async function detectServicesFrontendSubdir(fs5, frontendFramework, frontendLocation, detectEntrypoint) {
|
|
23866
23867
|
const services = {};
|
|
23867
23868
|
const serviceName = frontendLocation.split("/").pop() || "frontend";
|
|
23868
23869
|
services[serviceName] = {
|
|
23869
23870
|
framework: frontendFramework.slug ?? void 0,
|
|
23870
|
-
|
|
23871
|
+
root: frontendLocation,
|
|
23871
23872
|
routePrefix: "/"
|
|
23872
23873
|
};
|
|
23873
|
-
const backendResult = await detectBackendServices(
|
|
23874
|
+
const backendResult = await detectBackendServices(fs5, detectEntrypoint);
|
|
23874
23875
|
if (backendResult.error) {
|
|
23875
23876
|
return {
|
|
23876
23877
|
services: null,
|
|
@@ -23897,16 +23898,24 @@ var require_auto_detect = __commonJS({
|
|
|
23897
23898
|
errors: []
|
|
23898
23899
|
};
|
|
23899
23900
|
}
|
|
23900
|
-
async function detectBackendServices(
|
|
23901
|
+
async function detectBackendServices(fs5, detectEntrypoint) {
|
|
23901
23902
|
const services = {};
|
|
23902
|
-
const backendResult = await detectServiceInDir(
|
|
23903
|
+
const backendResult = await detectServiceInDir(
|
|
23904
|
+
fs5,
|
|
23905
|
+
BACKEND_DIR,
|
|
23906
|
+
"backend",
|
|
23907
|
+
detectEntrypoint
|
|
23908
|
+
);
|
|
23903
23909
|
if (backendResult.error) {
|
|
23904
23910
|
return { services: {}, error: backendResult.error };
|
|
23905
23911
|
}
|
|
23906
23912
|
if (backendResult.service) {
|
|
23907
23913
|
services.backend = backendResult.service;
|
|
23908
23914
|
}
|
|
23909
|
-
const multiServicesResult = await detectServicesDirectory(
|
|
23915
|
+
const multiServicesResult = await detectServicesDirectory(
|
|
23916
|
+
fs5,
|
|
23917
|
+
detectEntrypoint
|
|
23918
|
+
);
|
|
23910
23919
|
if (multiServicesResult.error) {
|
|
23911
23920
|
return { services: {}, error: multiServicesResult.error };
|
|
23912
23921
|
}
|
|
@@ -23925,13 +23934,13 @@ var require_auto_detect = __commonJS({
|
|
|
23925
23934
|
Object.assign(services, multiServicesResult.services);
|
|
23926
23935
|
return { services };
|
|
23927
23936
|
}
|
|
23928
|
-
async function detectServicesDirectory(
|
|
23937
|
+
async function detectServicesDirectory(fs5, detectEntrypoint) {
|
|
23929
23938
|
const services = {};
|
|
23930
|
-
const hasServicesDir = await
|
|
23939
|
+
const hasServicesDir = await fs5.hasPath(SERVICES_DIR);
|
|
23931
23940
|
if (!hasServicesDir) {
|
|
23932
23941
|
return { services };
|
|
23933
23942
|
}
|
|
23934
|
-
const servicesFs =
|
|
23943
|
+
const servicesFs = fs5.chdir(SERVICES_DIR);
|
|
23935
23944
|
const entries = await servicesFs.readdir("/");
|
|
23936
23945
|
for (const entry of entries) {
|
|
23937
23946
|
if (entry.type !== "dir") {
|
|
@@ -23939,7 +23948,12 @@ var require_auto_detect = __commonJS({
|
|
|
23939
23948
|
}
|
|
23940
23949
|
const serviceName = entry.name;
|
|
23941
23950
|
const serviceDir = `${SERVICES_DIR}/${serviceName}`;
|
|
23942
|
-
const result = await detectServiceInDir(
|
|
23951
|
+
const result = await detectServiceInDir(
|
|
23952
|
+
fs5,
|
|
23953
|
+
serviceDir,
|
|
23954
|
+
serviceName,
|
|
23955
|
+
detectEntrypoint
|
|
23956
|
+
);
|
|
23943
23957
|
if (result.error) {
|
|
23944
23958
|
return { services: {}, error: result.error };
|
|
23945
23959
|
}
|
|
@@ -23949,12 +23963,12 @@ var require_auto_detect = __commonJS({
|
|
|
23949
23963
|
}
|
|
23950
23964
|
return { services };
|
|
23951
23965
|
}
|
|
23952
|
-
async function detectServiceInDir(
|
|
23953
|
-
const hasDirPath = await
|
|
23966
|
+
async function detectServiceInDir(fs5, dirPath, serviceName, detectEntrypoint) {
|
|
23967
|
+
const hasDirPath = await fs5.hasPath(dirPath);
|
|
23954
23968
|
if (!hasDirPath) {
|
|
23955
23969
|
return {};
|
|
23956
23970
|
}
|
|
23957
|
-
const serviceFs =
|
|
23971
|
+
const serviceFs = fs5.chdir(dirPath);
|
|
23958
23972
|
const frameworks2 = await (0, import_detect_framework.detectFrameworks)({
|
|
23959
23973
|
fs: serviceFs,
|
|
23960
23974
|
frameworkList: import_utils.DETECTION_FRAMEWORKS,
|
|
@@ -23970,17 +23984,21 @@ var require_auto_detect = __commonJS({
|
|
|
23970
23984
|
}
|
|
23971
23985
|
};
|
|
23972
23986
|
}
|
|
23973
|
-
if (frameworks2.length
|
|
23974
|
-
|
|
23975
|
-
return {
|
|
23976
|
-
service: {
|
|
23977
|
-
framework: framework.slug ?? void 0,
|
|
23978
|
-
entrypoint: dirPath,
|
|
23979
|
-
routePrefix: `/_/${serviceName}`
|
|
23980
|
-
}
|
|
23981
|
-
};
|
|
23987
|
+
if (frameworks2.length !== 1) {
|
|
23988
|
+
return {};
|
|
23982
23989
|
}
|
|
23983
|
-
|
|
23990
|
+
const framework = frameworks2[0];
|
|
23991
|
+
const slug = framework.slug ?? void 0;
|
|
23992
|
+
const routePrefix = `/_/${serviceName}`;
|
|
23993
|
+
const detected = detectEntrypoint && !(0, import_utils.isFrontendFramework)(slug) ? await detectEntrypoint({ workPath: dirPath, framework: slug }) : null;
|
|
23994
|
+
return {
|
|
23995
|
+
service: {
|
|
23996
|
+
framework: slug,
|
|
23997
|
+
root: dirPath,
|
|
23998
|
+
...detected ? { entrypoint: detected.entrypoint } : {},
|
|
23999
|
+
routePrefix
|
|
24000
|
+
}
|
|
24001
|
+
};
|
|
23984
24002
|
}
|
|
23985
24003
|
}
|
|
23986
24004
|
});
|
|
@@ -24021,7 +24039,7 @@ var require_detect_railway = __commonJS({
|
|
|
24021
24039
|
detectRailwayServices: () => detectRailwayServices
|
|
24022
24040
|
});
|
|
24023
24041
|
module2.exports = __toCommonJS2(detect_railway_exports);
|
|
24024
|
-
var
|
|
24042
|
+
var import_path7 = require("path");
|
|
24025
24043
|
var import_smol_toml = __toESM2(require_dist());
|
|
24026
24044
|
var import_detect_framework = require_detect_framework();
|
|
24027
24045
|
var import_utils = require_utils4();
|
|
@@ -24046,8 +24064,8 @@ var require_detect_railway = __commonJS({
|
|
|
24046
24064
|
"CVS"
|
|
24047
24065
|
]);
|
|
24048
24066
|
async function detectRailwayServices(options) {
|
|
24049
|
-
const { fs:
|
|
24050
|
-
const { configs, warnings } = await findRailwayConfigs(
|
|
24067
|
+
const { fs: fs5, detectEntrypoint } = options;
|
|
24068
|
+
const { configs, warnings } = await findRailwayConfigs(fs5);
|
|
24051
24069
|
if (configs.length === 0) {
|
|
24052
24070
|
return { services: null, errors: [], warnings };
|
|
24053
24071
|
}
|
|
@@ -24055,7 +24073,7 @@ var require_detect_railway = __commonJS({
|
|
|
24055
24073
|
const serviceDirs = /* @__PURE__ */ new Map();
|
|
24056
24074
|
const errors = [];
|
|
24057
24075
|
for (const cf of configs) {
|
|
24058
|
-
const serviceFs = cf.dirPath === "." ?
|
|
24076
|
+
const serviceFs = cf.dirPath === "." ? fs5 : fs5.chdir(cf.dirPath);
|
|
24059
24077
|
const dirLabel = cf.dirPath === "." ? "root" : cf.dirPath;
|
|
24060
24078
|
const frameworks2 = await (0, import_detect_framework.detectFrameworks)({
|
|
24061
24079
|
fs: serviceFs,
|
|
@@ -24109,10 +24127,20 @@ var require_detect_railway = __commonJS({
|
|
|
24109
24127
|
continue;
|
|
24110
24128
|
}
|
|
24111
24129
|
const framework = frameworks2[0];
|
|
24130
|
+
const slug = framework.slug ?? void 0;
|
|
24112
24131
|
let serviceConfig = {};
|
|
24113
|
-
serviceConfig.framework =
|
|
24132
|
+
serviceConfig.framework = slug;
|
|
24114
24133
|
if (cf.dirPath !== ".") {
|
|
24115
|
-
serviceConfig.
|
|
24134
|
+
serviceConfig.root = cf.dirPath;
|
|
24135
|
+
if (detectEntrypoint && !(0, import_utils.isFrontendFramework)(slug)) {
|
|
24136
|
+
const detected = await detectEntrypoint({
|
|
24137
|
+
workPath: cf.dirPath,
|
|
24138
|
+
framework: slug
|
|
24139
|
+
});
|
|
24140
|
+
if (detected) {
|
|
24141
|
+
serviceConfig.entrypoint = detected.entrypoint;
|
|
24142
|
+
}
|
|
24143
|
+
}
|
|
24116
24144
|
}
|
|
24117
24145
|
if (cf.config.build?.buildCommand) {
|
|
24118
24146
|
serviceConfig.buildCommand = cf.config.build.buildCommand;
|
|
@@ -24133,10 +24161,10 @@ var require_detect_railway = __commonJS({
|
|
|
24133
24161
|
warnings.push(...(0, import_utils.assignRoutePrefixes)(services));
|
|
24134
24162
|
return { services, errors: [], warnings };
|
|
24135
24163
|
}
|
|
24136
|
-
async function findRailwayConfigs(
|
|
24164
|
+
async function findRailwayConfigs(fs5, dirPath = ".", depth = 0) {
|
|
24137
24165
|
const configs = [];
|
|
24138
24166
|
const warnings = [];
|
|
24139
|
-
const readResult = await readRailwayConfigRaw(
|
|
24167
|
+
const readResult = await readRailwayConfigRaw(fs5, dirPath);
|
|
24140
24168
|
warnings.push(...readResult.warnings);
|
|
24141
24169
|
const { config, warning } = tryParseRailwayConfig(readResult.raw);
|
|
24142
24170
|
if (warning) {
|
|
@@ -24151,7 +24179,7 @@ var require_detect_railway = __commonJS({
|
|
|
24151
24179
|
const readPath = dirPath === "." ? "/" : dirPath;
|
|
24152
24180
|
let entries;
|
|
24153
24181
|
try {
|
|
24154
|
-
entries = await
|
|
24182
|
+
entries = await fs5.readdir(readPath);
|
|
24155
24183
|
} catch {
|
|
24156
24184
|
return { configs, warnings };
|
|
24157
24185
|
}
|
|
@@ -24159,26 +24187,26 @@ var require_detect_railway = __commonJS({
|
|
|
24159
24187
|
if (entry.type !== "dir" || SKIP_DIRS.has(entry.name)) {
|
|
24160
24188
|
continue;
|
|
24161
24189
|
}
|
|
24162
|
-
const childPath = dirPath === "." ? entry.name :
|
|
24163
|
-
const child = await findRailwayConfigs(
|
|
24190
|
+
const childPath = dirPath === "." ? entry.name : import_path7.posix.join(dirPath, entry.name);
|
|
24191
|
+
const child = await findRailwayConfigs(fs5, childPath, depth + 1);
|
|
24164
24192
|
configs.push(...child.configs);
|
|
24165
24193
|
warnings.push(...child.warnings);
|
|
24166
24194
|
}
|
|
24167
24195
|
return { configs, warnings };
|
|
24168
24196
|
}
|
|
24169
|
-
async function readRailwayConfigRaw(
|
|
24197
|
+
async function readRailwayConfigRaw(fs5, dirPath) {
|
|
24170
24198
|
const warnings = [];
|
|
24171
24199
|
for (const filename of [RAILWAY_JSON, RAILWAY_TOML]) {
|
|
24172
|
-
const filePath = dirPath === "." ? filename :
|
|
24200
|
+
const filePath = dirPath === "." ? filename : import_path7.posix.join(dirPath, filename);
|
|
24173
24201
|
try {
|
|
24174
|
-
const exists = await
|
|
24202
|
+
const exists = await fs5.isFile(filePath);
|
|
24175
24203
|
if (!exists)
|
|
24176
24204
|
continue;
|
|
24177
24205
|
} catch {
|
|
24178
24206
|
continue;
|
|
24179
24207
|
}
|
|
24180
24208
|
try {
|
|
24181
|
-
const buf = await
|
|
24209
|
+
const buf = await fs5.readFile(filePath);
|
|
24182
24210
|
return {
|
|
24183
24211
|
raw: { path: filePath, content: buf.toString("utf-8") },
|
|
24184
24212
|
warnings
|
|
@@ -27131,8 +27159,8 @@ var require_detect_render = __commonJS({
|
|
|
27131
27159
|
static: "web"
|
|
27132
27160
|
};
|
|
27133
27161
|
async function detectRenderServices(options) {
|
|
27134
|
-
const { fs:
|
|
27135
|
-
const raw = await readRenderYaml(
|
|
27162
|
+
const { fs: fs5, detectEntrypoint } = options;
|
|
27163
|
+
const raw = await readRenderYaml(fs5);
|
|
27136
27164
|
if (raw.warning) {
|
|
27137
27165
|
return { services: null, errors: [], warnings: [raw.warning] };
|
|
27138
27166
|
} else if (!raw.content) {
|
|
@@ -27227,7 +27255,7 @@ var require_detect_render = __commonJS({
|
|
|
27227
27255
|
}
|
|
27228
27256
|
serviceNames.add(serviceName);
|
|
27229
27257
|
const rootDir = rs.rootDir || ".";
|
|
27230
|
-
const serviceFs = rootDir === "." ?
|
|
27258
|
+
const serviceFs = rootDir === "." ? fs5 : fs5.chdir(rootDir);
|
|
27231
27259
|
const frameworks2 = await (0, import_detect_framework.detectFrameworks)({
|
|
27232
27260
|
fs: serviceFs,
|
|
27233
27261
|
frameworkList: import_utils.DETECTION_FRAMEWORKS,
|
|
@@ -27255,7 +27283,16 @@ var require_detect_render = __commonJS({
|
|
|
27255
27283
|
serviceConfig.type = vercelType;
|
|
27256
27284
|
serviceConfig.framework = framework.slug ?? void 0;
|
|
27257
27285
|
if (rootDir !== ".") {
|
|
27258
|
-
serviceConfig.
|
|
27286
|
+
serviceConfig.root = rootDir;
|
|
27287
|
+
if (detectEntrypoint && !(0, import_utils.isFrontendFramework)(serviceConfig.framework)) {
|
|
27288
|
+
const detected = await detectEntrypoint({
|
|
27289
|
+
workPath: rootDir,
|
|
27290
|
+
framework: serviceConfig.framework
|
|
27291
|
+
});
|
|
27292
|
+
if (detected) {
|
|
27293
|
+
serviceConfig.entrypoint = detected.entrypoint;
|
|
27294
|
+
}
|
|
27295
|
+
}
|
|
27259
27296
|
}
|
|
27260
27297
|
const buildCommand = (0, import_utils.combineBuildCommand)(
|
|
27261
27298
|
rs.buildCommand,
|
|
@@ -27275,12 +27312,12 @@ var require_detect_render = __commonJS({
|
|
|
27275
27312
|
warnings.push(...(0, import_utils.assignRoutePrefixes)(services));
|
|
27276
27313
|
return { services, errors: [], warnings };
|
|
27277
27314
|
}
|
|
27278
|
-
async function readRenderYaml(
|
|
27315
|
+
async function readRenderYaml(fs5) {
|
|
27279
27316
|
try {
|
|
27280
|
-
const exists = await
|
|
27317
|
+
const exists = await fs5.isFile(RENDER_YAML);
|
|
27281
27318
|
if (!exists)
|
|
27282
27319
|
return { content: null };
|
|
27283
|
-
const buf = await
|
|
27320
|
+
const buf = await fs5.readFile(RENDER_YAML);
|
|
27284
27321
|
return { content: buf.toString("utf-8") };
|
|
27285
27322
|
} catch (err) {
|
|
27286
27323
|
return {
|
|
@@ -27358,8 +27395,8 @@ var require_detect_procfile = __commonJS({
|
|
|
27358
27395
|
]);
|
|
27359
27396
|
var SUPPORTED_WORKER_COMMANDS = /* @__PURE__ */ new Set(["celery", "dramatiq"]);
|
|
27360
27397
|
async function detectProcfileServices(options) {
|
|
27361
|
-
const { fs:
|
|
27362
|
-
const raw = await readProcfile(
|
|
27398
|
+
const { fs: fs5 } = options;
|
|
27399
|
+
const raw = await readProcfile(fs5);
|
|
27363
27400
|
if (raw.warning) {
|
|
27364
27401
|
return { services: null, errors: [], warnings: [raw.warning] };
|
|
27365
27402
|
}
|
|
@@ -27393,7 +27430,7 @@ var require_detect_procfile = __commonJS({
|
|
|
27393
27430
|
return { services: null, errors: [], warnings: [] };
|
|
27394
27431
|
}
|
|
27395
27432
|
const frameworks2 = await (0, import_detect_framework.detectFrameworks)({
|
|
27396
|
-
fs:
|
|
27433
|
+
fs: fs5,
|
|
27397
27434
|
frameworkList: import_utils.DETECTION_FRAMEWORKS,
|
|
27398
27435
|
useExperimentalFrameworks: true
|
|
27399
27436
|
});
|
|
@@ -27415,7 +27452,7 @@ var require_detect_procfile = __commonJS({
|
|
|
27415
27452
|
for (const entry of serviceEntries) {
|
|
27416
27453
|
const { processType, command } = entry;
|
|
27417
27454
|
const tokens = command.split(/\s+/).filter(Boolean);
|
|
27418
|
-
const entrypoint = await extractEntrypoint(tokens,
|
|
27455
|
+
const entrypoint = await extractEntrypoint(tokens, fs5);
|
|
27419
27456
|
const isWorkerLikeProcess = processType.includes("worker") || hasSupportedWorkerCommand(tokens);
|
|
27420
27457
|
if (serviceNames.has(processType)) {
|
|
27421
27458
|
errors.push({
|
|
@@ -27479,12 +27516,12 @@ var require_detect_procfile = __commonJS({
|
|
|
27479
27516
|
}
|
|
27480
27517
|
return entries;
|
|
27481
27518
|
}
|
|
27482
|
-
async function extractEntrypoint(tokens,
|
|
27519
|
+
async function extractEntrypoint(tokens, fs5) {
|
|
27483
27520
|
let firstModulePath;
|
|
27484
27521
|
let lastFilePath;
|
|
27485
27522
|
for (const token of tokens) {
|
|
27486
27523
|
if (!firstModulePath && PY_MODULE_RE.test(token)) {
|
|
27487
|
-
const resolved = await resolvePythonModule(token,
|
|
27524
|
+
const resolved = await resolvePythonModule(token, fs5);
|
|
27488
27525
|
if (resolved)
|
|
27489
27526
|
firstModulePath = resolved;
|
|
27490
27527
|
}
|
|
@@ -27494,14 +27531,14 @@ var require_detect_procfile = __commonJS({
|
|
|
27494
27531
|
}
|
|
27495
27532
|
return firstModulePath ?? lastFilePath;
|
|
27496
27533
|
}
|
|
27497
|
-
async function resolvePythonModule(spec,
|
|
27534
|
+
async function resolvePythonModule(spec, fs5) {
|
|
27498
27535
|
const [modulePart] = spec.split(":");
|
|
27499
27536
|
const filePath = `${modulePart.replace(/\./g, "/")}.py`;
|
|
27500
27537
|
const initPath = `${modulePart.replace(/\./g, "/")}/__init__.py`;
|
|
27501
27538
|
try {
|
|
27502
|
-
if (await
|
|
27539
|
+
if (await fs5.isFile(filePath))
|
|
27503
27540
|
return filePath;
|
|
27504
|
-
if (await
|
|
27541
|
+
if (await fs5.isFile(initPath))
|
|
27505
27542
|
return initPath;
|
|
27506
27543
|
} catch {
|
|
27507
27544
|
}
|
|
@@ -27539,12 +27576,12 @@ var require_detect_procfile = __commonJS({
|
|
|
27539
27576
|
const parts = token.split("/");
|
|
27540
27577
|
return parts[parts.length - 1];
|
|
27541
27578
|
}
|
|
27542
|
-
async function readProcfile(
|
|
27579
|
+
async function readProcfile(fs5) {
|
|
27543
27580
|
try {
|
|
27544
|
-
const exists = await
|
|
27581
|
+
const exists = await fs5.isFile(PROCFILE);
|
|
27545
27582
|
if (!exists)
|
|
27546
27583
|
return { content: null };
|
|
27547
|
-
const buf = await
|
|
27584
|
+
const buf = await fs5.readFile(PROCFILE);
|
|
27548
27585
|
return { content: buf.toString("utf-8") };
|
|
27549
27586
|
} catch (err) {
|
|
27550
27587
|
return {
|
|
@@ -27586,7 +27623,7 @@ var require_detect_services = __commonJS({
|
|
|
27586
27623
|
generateServicesRoutes: () => generateServicesRoutes2
|
|
27587
27624
|
});
|
|
27588
27625
|
module2.exports = __toCommonJS2(detect_services_exports);
|
|
27589
|
-
var
|
|
27626
|
+
var import_build_utils5 = require("@vercel/build-utils");
|
|
27590
27627
|
var import_routing_utils = require_dist7();
|
|
27591
27628
|
var import_utils = require_utils4();
|
|
27592
27629
|
var import_resolve = require_resolve();
|
|
@@ -27633,6 +27670,9 @@ var require_detect_services = __commonJS({
|
|
|
27633
27670
|
if (service.type) {
|
|
27634
27671
|
serviceConfig.type = service.type;
|
|
27635
27672
|
}
|
|
27673
|
+
if (typeof service.root === "string") {
|
|
27674
|
+
serviceConfig.root = service.root;
|
|
27675
|
+
}
|
|
27636
27676
|
if (typeof service.entrypoint === "string") {
|
|
27637
27677
|
serviceConfig.entrypoint = service.entrypoint;
|
|
27638
27678
|
}
|
|
@@ -27653,8 +27693,8 @@ var require_detect_services = __commonJS({
|
|
|
27653
27693
|
return inferredConfig;
|
|
27654
27694
|
}
|
|
27655
27695
|
async function detectServices2(options) {
|
|
27656
|
-
const { fs:
|
|
27657
|
-
const scopedFs = workPath ?
|
|
27696
|
+
const { fs: fs5, workPath, detectEntrypoint } = options;
|
|
27697
|
+
const scopedFs = workPath ? fs5.chdir(workPath) : fs5;
|
|
27658
27698
|
const { config: vercelConfig, error: configError } = await (0, import_utils.readVercelConfig)(scopedFs);
|
|
27659
27699
|
if (configError) {
|
|
27660
27700
|
return withResolvedResult({
|
|
@@ -27677,7 +27717,7 @@ var require_detect_services = __commonJS({
|
|
|
27677
27717
|
{ detect: import_auto_detect.autoDetectServices, source: "layout" }
|
|
27678
27718
|
];
|
|
27679
27719
|
for (const { detect, source } of detectors) {
|
|
27680
|
-
const detectResult = await detect({ fs: scopedFs });
|
|
27720
|
+
const detectResult = await detect({ fs: scopedFs, detectEntrypoint });
|
|
27681
27721
|
const match = await tryResolveInferred(detectResult, source, scopedFs);
|
|
27682
27722
|
if (match)
|
|
27683
27723
|
return match;
|
|
@@ -27853,7 +27893,7 @@ var require_detect_services = __commonJS({
|
|
|
27853
27893
|
}
|
|
27854
27894
|
}
|
|
27855
27895
|
}
|
|
27856
|
-
const cronServices = services.filter(
|
|
27896
|
+
const cronServices = services.filter(import_build_utils5.isScheduleTriggeredService);
|
|
27857
27897
|
for (const service of cronServices) {
|
|
27858
27898
|
const cronPrefix = (0, import_utils.getInternalServiceCronPathPrefix)(service.name);
|
|
27859
27899
|
const functionPath = (0, import_utils.getInternalServiceFunctionPath)(service.name);
|
|
@@ -27926,7 +27966,7 @@ var require_filesystem = __commonJS({
|
|
|
27926
27966
|
DetectorFilesystem: () => DetectorFilesystem2
|
|
27927
27967
|
});
|
|
27928
27968
|
module2.exports = __toCommonJS2(filesystem_exports);
|
|
27929
|
-
var
|
|
27969
|
+
var import_path7 = require("path");
|
|
27930
27970
|
var DetectorFilesystem2 = class {
|
|
27931
27971
|
constructor() {
|
|
27932
27972
|
this.hasPath = async (path6) => {
|
|
@@ -27970,13 +28010,13 @@ var require_filesystem = __commonJS({
|
|
|
27970
28010
|
}
|
|
27971
28011
|
if (options?.potentialFiles) {
|
|
27972
28012
|
const filesInReaddirDir = options.potentialFiles.filter(
|
|
27973
|
-
(path6) => (0,
|
|
28013
|
+
(path6) => (0, import_path7.basename)(path6) === path6
|
|
27974
28014
|
);
|
|
27975
28015
|
const filesThatDoNotExist = filesInReaddirDir.filter(
|
|
27976
28016
|
(path6) => !directoryFiles.has(path6)
|
|
27977
28017
|
);
|
|
27978
28018
|
for (const filePath of filesThatDoNotExist) {
|
|
27979
|
-
const fullFilePath = dirPath === "/" ? filePath :
|
|
28019
|
+
const fullFilePath = dirPath === "/" ? filePath : import_path7.posix.join(dirPath, filePath);
|
|
27980
28020
|
this.fileCache.set(fullFilePath, Promise.resolve(false));
|
|
27981
28021
|
this.pathCache.set(fullFilePath, Promise.resolve(false));
|
|
27982
28022
|
}
|
|
@@ -28037,9 +28077,9 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28037
28077
|
});
|
|
28038
28078
|
module2.exports = __toCommonJS2(local_file_system_detector_exports);
|
|
28039
28079
|
var import_promises = __toESM2(require("fs/promises"));
|
|
28040
|
-
var
|
|
28080
|
+
var import_path7 = require("path");
|
|
28041
28081
|
var import_filesystem = require_filesystem();
|
|
28042
|
-
var
|
|
28082
|
+
var import_error_utils3 = require_dist2();
|
|
28043
28083
|
var LocalFileSystemDetector3 = class _LocalFileSystemDetector extends import_filesystem.DetectorFilesystem {
|
|
28044
28084
|
constructor(rootPath) {
|
|
28045
28085
|
super();
|
|
@@ -28050,7 +28090,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28050
28090
|
await import_promises.default.stat(this.getFilePath(name));
|
|
28051
28091
|
return true;
|
|
28052
28092
|
} catch (err) {
|
|
28053
|
-
if ((0,
|
|
28093
|
+
if ((0, import_error_utils3.isErrnoException)(err) && err.code === "ENOENT") {
|
|
28054
28094
|
return false;
|
|
28055
28095
|
}
|
|
28056
28096
|
throw err;
|
|
@@ -28078,7 +28118,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28078
28118
|
}
|
|
28079
28119
|
result.push({
|
|
28080
28120
|
name: entry.name,
|
|
28081
|
-
path: (0,
|
|
28121
|
+
path: (0, import_path7.join)(this.getRelativeFilePath(dir), entry.name),
|
|
28082
28122
|
type
|
|
28083
28123
|
});
|
|
28084
28124
|
}
|
|
@@ -28088,10 +28128,10 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28088
28128
|
return new _LocalFileSystemDetector(this.getFilePath(name));
|
|
28089
28129
|
}
|
|
28090
28130
|
getRelativeFilePath(name) {
|
|
28091
|
-
return name.startsWith(this.rootPath) ? (0,
|
|
28131
|
+
return name.startsWith(this.rootPath) ? (0, import_path7.relative)(this.rootPath, name) : name;
|
|
28092
28132
|
}
|
|
28093
28133
|
getFilePath(name) {
|
|
28094
|
-
return (0,
|
|
28134
|
+
return (0, import_path7.join)(this.rootPath, this.getRelativeFilePath(name));
|
|
28095
28135
|
}
|
|
28096
28136
|
};
|
|
28097
28137
|
}
|
|
@@ -28168,8 +28208,8 @@ var require_get_services_builders = __commonJS({
|
|
|
28168
28208
|
errorRoutes: null
|
|
28169
28209
|
};
|
|
28170
28210
|
}
|
|
28171
|
-
const
|
|
28172
|
-
const result = await (0, import_detect_services.detectServices)({ fs:
|
|
28211
|
+
const fs5 = new import_local_file_system_detector.LocalFileSystemDetector(workPath);
|
|
28212
|
+
const result = await (0, import_detect_services.detectServices)({ fs: fs5 });
|
|
28173
28213
|
const warningResponses = result.warnings.map((w) => ({
|
|
28174
28214
|
code: w.code,
|
|
28175
28215
|
message: w.message
|
|
@@ -28275,10 +28315,10 @@ var require_detect_builders = __commonJS({
|
|
|
28275
28315
|
module2.exports = __toCommonJS2(detect_builders_exports);
|
|
28276
28316
|
var import_minimatch = __toESM2(require_minimatch());
|
|
28277
28317
|
var import_semver2 = require_semver3();
|
|
28278
|
-
var
|
|
28318
|
+
var import_path7 = require("path");
|
|
28279
28319
|
var import_frameworks2 = require_frameworks();
|
|
28280
28320
|
var import_is_official_runtime = require_is_official_runtime();
|
|
28281
|
-
var
|
|
28321
|
+
var import_build_utils5 = require("@vercel/build-utils");
|
|
28282
28322
|
var import_get_services_builders = require_get_services_builders();
|
|
28283
28323
|
var REGEX_MIDDLEWARE_FILES = "middleware.[jt]s";
|
|
28284
28324
|
var REGEX_VERCEL_PLATFORM_FILES = [
|
|
@@ -28305,7 +28345,7 @@ var require_detect_builders = __commonJS({
|
|
|
28305
28345
|
return new Set(
|
|
28306
28346
|
builders.filter(
|
|
28307
28347
|
(b) => Boolean(b.config && b.config.zeroConfig && b.src?.startsWith("api/"))
|
|
28308
|
-
).map((b) => (0,
|
|
28348
|
+
).map((b) => (0, import_path7.extname)(b.src)).filter(Boolean)
|
|
28309
28349
|
);
|
|
28310
28350
|
}
|
|
28311
28351
|
function detectApiDirectory2(builders) {
|
|
@@ -28554,16 +28594,16 @@ var require_detect_builders = __commonJS({
|
|
|
28554
28594
|
return null;
|
|
28555
28595
|
}
|
|
28556
28596
|
if (fileName.endsWith(".py") && options.workPath) {
|
|
28557
|
-
const fsPath = (0,
|
|
28558
|
-
const isEntrypoint = await (0,
|
|
28597
|
+
const fsPath = (0, import_path7.join)(options.workPath, fileName);
|
|
28598
|
+
const isEntrypoint = await (0, import_build_utils5.isPythonEntrypoint)({ fsPath });
|
|
28559
28599
|
if (!isEntrypoint) {
|
|
28560
28600
|
return null;
|
|
28561
28601
|
}
|
|
28562
28602
|
}
|
|
28563
28603
|
const nodeExtensions = [".js", ".mjs", ".ts", ".tsx"];
|
|
28564
28604
|
if (fileName.startsWith("api/") && process.env.VERCEL_NODE_FILTER_ENTRYPOINTS === "1" && nodeExtensions.some((ext) => fileName.endsWith(ext)) && options.workPath) {
|
|
28565
|
-
const fsPath = (0,
|
|
28566
|
-
const isEntrypoint = await (0,
|
|
28605
|
+
const fsPath = (0, import_path7.join)(options.workPath, fileName);
|
|
28606
|
+
const isEntrypoint = await (0, import_build_utils5.isNodeEntrypoint)({ fsPath });
|
|
28567
28607
|
if (!isEntrypoint) {
|
|
28568
28608
|
return null;
|
|
28569
28609
|
}
|
|
@@ -28673,8 +28713,8 @@ var require_detect_builders = __commonJS({
|
|
|
28673
28713
|
const f = slugToFramework.get(framework || "");
|
|
28674
28714
|
if (f && f.useRuntime) {
|
|
28675
28715
|
const { src, use } = f.useRuntime;
|
|
28676
|
-
const shouldUseUnifiedBackend = (0,
|
|
28677
|
-
const finalUse = shouldUseUnifiedBackend ?
|
|
28716
|
+
const shouldUseUnifiedBackend = (0, import_build_utils5.isExperimentalBackendsEnabled)() && import_build_utils5.BACKEND_BUILDERS.includes(use);
|
|
28717
|
+
const finalUse = shouldUseUnifiedBackend ? import_build_utils5.UNIFIED_BACKEND_BUILDER : use;
|
|
28678
28718
|
return { src, use: `${finalUse}${withTag}`, config };
|
|
28679
28719
|
}
|
|
28680
28720
|
const entrypoints = /* @__PURE__ */ new Set([
|
|
@@ -28851,14 +28891,14 @@ var require_detect_builders = __commonJS({
|
|
|
28851
28891
|
return null;
|
|
28852
28892
|
}
|
|
28853
28893
|
function getSegmentName(segment) {
|
|
28854
|
-
const { name } = (0,
|
|
28894
|
+
const { name } = (0, import_path7.parse)(segment);
|
|
28855
28895
|
if (name.startsWith("[") && name.endsWith("]")) {
|
|
28856
28896
|
return name.slice(1, -1);
|
|
28857
28897
|
}
|
|
28858
28898
|
return null;
|
|
28859
28899
|
}
|
|
28860
28900
|
function getAbsolutePath(unresolvedPath) {
|
|
28861
|
-
const { dir, name } = (0,
|
|
28901
|
+
const { dir, name } = (0, import_path7.parse)(unresolvedPath);
|
|
28862
28902
|
const parts = joinPath(dir, name).split("/");
|
|
28863
28903
|
return parts.map((part) => part.replace(/\[.*\]/, "1")).join("/");
|
|
28864
28904
|
}
|
|
@@ -28937,7 +28977,7 @@ var require_detect_builders = __commonJS({
|
|
|
28937
28977
|
isDynamic = true;
|
|
28938
28978
|
return `([^/]+)`;
|
|
28939
28979
|
} else if (isLast) {
|
|
28940
|
-
const { name: fileName2, ext: ext2 } = (0,
|
|
28980
|
+
const { name: fileName2, ext: ext2 } = (0, import_path7.parse)(segment);
|
|
28941
28981
|
const isIndex2 = fileName2 === "index";
|
|
28942
28982
|
const prefix = isIndex2 ? "/" : "";
|
|
28943
28983
|
const names = [
|
|
@@ -28949,7 +28989,7 @@ var require_detect_builders = __commonJS({
|
|
|
28949
28989
|
}
|
|
28950
28990
|
return segment;
|
|
28951
28991
|
});
|
|
28952
|
-
const { name: fileName, ext } = (0,
|
|
28992
|
+
const { name: fileName, ext } = (0, import_path7.parse)(filePath);
|
|
28953
28993
|
const isIndex = fileName === "index";
|
|
28954
28994
|
const queryString = `${query.length ? "?" : ""}${query.join("&")}`;
|
|
28955
28995
|
const src = isIndex ? `^/${srcParts.slice(0, -1).join("/")}${srcParts.slice(-1)[0]}$` : `^/${srcParts.join("/")}$`;
|
|
@@ -29292,7 +29332,7 @@ var require_get_project_paths = __commonJS({
|
|
|
29292
29332
|
var import_frameworks2 = require_frameworks();
|
|
29293
29333
|
var MAX_DEPTH_TRAVERSE = 3;
|
|
29294
29334
|
var getProjectPaths2 = async ({
|
|
29295
|
-
fs:
|
|
29335
|
+
fs: fs5,
|
|
29296
29336
|
path: path6,
|
|
29297
29337
|
skipPaths,
|
|
29298
29338
|
depth = MAX_DEPTH_TRAVERSE
|
|
@@ -29305,20 +29345,20 @@ var require_get_project_paths = __commonJS({
|
|
|
29305
29345
|
return allPaths;
|
|
29306
29346
|
}
|
|
29307
29347
|
const framework = await (0, import_detect_framework.detectFramework)({
|
|
29308
|
-
fs:
|
|
29348
|
+
fs: fs5.chdir(topPath),
|
|
29309
29349
|
frameworkList: import_frameworks2.frameworkList
|
|
29310
29350
|
});
|
|
29311
29351
|
if (framework !== null)
|
|
29312
29352
|
allPaths.push(topPath);
|
|
29313
29353
|
if (depth > 1) {
|
|
29314
|
-
const directoryContents = await
|
|
29354
|
+
const directoryContents = await fs5.readdir(topPath);
|
|
29315
29355
|
const childDirectories = directoryContents.filter(
|
|
29316
29356
|
(stat) => stat.type === "dir" && !skipPaths?.includes(stat.path)
|
|
29317
29357
|
);
|
|
29318
29358
|
const paths = (await Promise.all(
|
|
29319
29359
|
childDirectories.map(({ path: path22 }) => {
|
|
29320
29360
|
return getProjectPaths2({
|
|
29321
|
-
fs:
|
|
29361
|
+
fs: fs5,
|
|
29322
29362
|
path: path22,
|
|
29323
29363
|
depth: depth - 1,
|
|
29324
29364
|
skipPaths
|
|
@@ -29477,31 +29517,31 @@ var require_get_workspaces = __commonJS({
|
|
|
29477
29517
|
getWorkspaces: () => getWorkspaces2
|
|
29478
29518
|
});
|
|
29479
29519
|
module2.exports = __toCommonJS2(get_workspaces_exports);
|
|
29480
|
-
var
|
|
29520
|
+
var import_path7 = __toESM2(require("path"));
|
|
29481
29521
|
var import_workspace_managers = require_workspace_managers();
|
|
29482
29522
|
var import_detect_framework = require_detect_framework();
|
|
29483
29523
|
var MAX_DEPTH_TRAVERSE = 3;
|
|
29484
|
-
var posixPath =
|
|
29524
|
+
var posixPath = import_path7.default.posix;
|
|
29485
29525
|
async function getWorkspaces2({
|
|
29486
|
-
fs:
|
|
29526
|
+
fs: fs5,
|
|
29487
29527
|
depth = MAX_DEPTH_TRAVERSE,
|
|
29488
29528
|
cwd = "/"
|
|
29489
29529
|
}) {
|
|
29490
29530
|
if (depth === 0)
|
|
29491
29531
|
return [];
|
|
29492
29532
|
const workspaceType = await (0, import_detect_framework.detectFramework)({
|
|
29493
|
-
fs:
|
|
29533
|
+
fs: fs5,
|
|
29494
29534
|
frameworkList: import_workspace_managers.workspaceManagers
|
|
29495
29535
|
});
|
|
29496
29536
|
if (workspaceType === null) {
|
|
29497
|
-
const directoryContents = await
|
|
29537
|
+
const directoryContents = await fs5.readdir("./");
|
|
29498
29538
|
const childDirectories = directoryContents.filter(
|
|
29499
29539
|
(stat) => stat.type === "dir"
|
|
29500
29540
|
);
|
|
29501
29541
|
return (await Promise.all(
|
|
29502
29542
|
childDirectories.map(
|
|
29503
29543
|
(childDirectory) => getWorkspaces2({
|
|
29504
|
-
fs:
|
|
29544
|
+
fs: fs5.chdir(childDirectory.path),
|
|
29505
29545
|
depth: depth - 1,
|
|
29506
29546
|
cwd: posixPath.join(cwd, childDirectory.path)
|
|
29507
29547
|
})
|
|
@@ -29523,7 +29563,7 @@ var require_old = __commonJS({
|
|
|
29523
29563
|
"../../node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
|
|
29524
29564
|
var pathModule = require("path");
|
|
29525
29565
|
var isWindows = process.platform === "win32";
|
|
29526
|
-
var
|
|
29566
|
+
var fs5 = require("fs");
|
|
29527
29567
|
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
29528
29568
|
function rethrow() {
|
|
29529
29569
|
var callback;
|
|
@@ -29588,7 +29628,7 @@ var require_old = __commonJS({
|
|
|
29588
29628
|
base = m[0];
|
|
29589
29629
|
previous = "";
|
|
29590
29630
|
if (isWindows && !knownHard[base]) {
|
|
29591
|
-
|
|
29631
|
+
fs5.lstatSync(base);
|
|
29592
29632
|
knownHard[base] = true;
|
|
29593
29633
|
}
|
|
29594
29634
|
}
|
|
@@ -29606,7 +29646,7 @@ var require_old = __commonJS({
|
|
|
29606
29646
|
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
29607
29647
|
resolvedLink = cache[base];
|
|
29608
29648
|
} else {
|
|
29609
|
-
var stat =
|
|
29649
|
+
var stat = fs5.lstatSync(base);
|
|
29610
29650
|
if (!stat.isSymbolicLink()) {
|
|
29611
29651
|
knownHard[base] = true;
|
|
29612
29652
|
if (cache)
|
|
@@ -29621,8 +29661,8 @@ var require_old = __commonJS({
|
|
|
29621
29661
|
}
|
|
29622
29662
|
}
|
|
29623
29663
|
if (linkTarget === null) {
|
|
29624
|
-
|
|
29625
|
-
linkTarget =
|
|
29664
|
+
fs5.statSync(base);
|
|
29665
|
+
linkTarget = fs5.readlinkSync(base);
|
|
29626
29666
|
}
|
|
29627
29667
|
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
29628
29668
|
if (cache)
|
|
@@ -29659,7 +29699,7 @@ var require_old = __commonJS({
|
|
|
29659
29699
|
base = m[0];
|
|
29660
29700
|
previous = "";
|
|
29661
29701
|
if (isWindows && !knownHard[base]) {
|
|
29662
|
-
|
|
29702
|
+
fs5.lstat(base, function(err) {
|
|
29663
29703
|
if (err)
|
|
29664
29704
|
return cb(err);
|
|
29665
29705
|
knownHard[base] = true;
|
|
@@ -29687,7 +29727,7 @@ var require_old = __commonJS({
|
|
|
29687
29727
|
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
29688
29728
|
return gotResolvedLink(cache[base]);
|
|
29689
29729
|
}
|
|
29690
|
-
return
|
|
29730
|
+
return fs5.lstat(base, gotStat);
|
|
29691
29731
|
}
|
|
29692
29732
|
function gotStat(err, stat) {
|
|
29693
29733
|
if (err)
|
|
@@ -29704,10 +29744,10 @@ var require_old = __commonJS({
|
|
|
29704
29744
|
return gotTarget(null, seenLinks[id], base);
|
|
29705
29745
|
}
|
|
29706
29746
|
}
|
|
29707
|
-
|
|
29747
|
+
fs5.stat(base, function(err2) {
|
|
29708
29748
|
if (err2)
|
|
29709
29749
|
return cb(err2);
|
|
29710
|
-
|
|
29750
|
+
fs5.readlink(base, function(err3, target) {
|
|
29711
29751
|
if (!isWindows)
|
|
29712
29752
|
seenLinks[id] = target;
|
|
29713
29753
|
gotTarget(err3, target);
|
|
@@ -29739,9 +29779,9 @@ var require_fs2 = __commonJS({
|
|
|
29739
29779
|
realpath.realpathSync = realpathSync;
|
|
29740
29780
|
realpath.monkeypatch = monkeypatch;
|
|
29741
29781
|
realpath.unmonkeypatch = unmonkeypatch;
|
|
29742
|
-
var
|
|
29743
|
-
var origRealpath =
|
|
29744
|
-
var origRealpathSync =
|
|
29782
|
+
var fs5 = require("fs");
|
|
29783
|
+
var origRealpath = fs5.realpath;
|
|
29784
|
+
var origRealpathSync = fs5.realpathSync;
|
|
29745
29785
|
var version2 = process.version;
|
|
29746
29786
|
var ok = /^v[0-5]\./.test(version2);
|
|
29747
29787
|
var old = require_old();
|
|
@@ -29779,12 +29819,12 @@ var require_fs2 = __commonJS({
|
|
|
29779
29819
|
}
|
|
29780
29820
|
}
|
|
29781
29821
|
function monkeypatch() {
|
|
29782
|
-
|
|
29783
|
-
|
|
29822
|
+
fs5.realpath = realpath;
|
|
29823
|
+
fs5.realpathSync = realpathSync;
|
|
29784
29824
|
}
|
|
29785
29825
|
function unmonkeypatch() {
|
|
29786
|
-
|
|
29787
|
-
|
|
29826
|
+
fs5.realpath = origRealpath;
|
|
29827
|
+
fs5.realpathSync = origRealpathSync;
|
|
29788
29828
|
}
|
|
29789
29829
|
}
|
|
29790
29830
|
});
|
|
@@ -30551,10 +30591,10 @@ var require_common3 = __commonJS({
|
|
|
30551
30591
|
function ownProp(obj, field) {
|
|
30552
30592
|
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
30553
30593
|
}
|
|
30554
|
-
var
|
|
30594
|
+
var fs5 = require("fs");
|
|
30555
30595
|
var path6 = require("path");
|
|
30556
30596
|
var minimatch = require_minimatch2();
|
|
30557
|
-
var
|
|
30597
|
+
var isAbsolute = require("path").isAbsolute;
|
|
30558
30598
|
var Minimatch = minimatch.Minimatch;
|
|
30559
30599
|
function alphasort(a, b) {
|
|
30560
30600
|
return a.localeCompare(b, "en");
|
|
@@ -30606,7 +30646,7 @@ var require_common3 = __commonJS({
|
|
|
30606
30646
|
self.stat = !!options.stat;
|
|
30607
30647
|
self.noprocess = !!options.noprocess;
|
|
30608
30648
|
self.absolute = !!options.absolute;
|
|
30609
|
-
self.fs = options.fs ||
|
|
30649
|
+
self.fs = options.fs || fs5;
|
|
30610
30650
|
self.maxLength = options.maxLength || Infinity;
|
|
30611
30651
|
self.cache = options.cache || /* @__PURE__ */ Object.create(null);
|
|
30612
30652
|
self.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
|
|
@@ -30622,7 +30662,7 @@ var require_common3 = __commonJS({
|
|
|
30622
30662
|
}
|
|
30623
30663
|
self.root = options.root || path6.resolve(self.cwd, "/");
|
|
30624
30664
|
self.root = path6.resolve(self.root);
|
|
30625
|
-
self.cwdAbs =
|
|
30665
|
+
self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd);
|
|
30626
30666
|
self.nomount = !!options.nomount;
|
|
30627
30667
|
if (process.platform === "win32") {
|
|
30628
30668
|
self.root = self.root.replace(/\\/g, "/");
|
|
@@ -30705,7 +30745,7 @@ var require_common3 = __commonJS({
|
|
|
30705
30745
|
var abs = f;
|
|
30706
30746
|
if (f.charAt(0) === "/") {
|
|
30707
30747
|
abs = path6.join(self.root, f);
|
|
30708
|
-
} else if (
|
|
30748
|
+
} else if (isAbsolute(f) || f === "") {
|
|
30709
30749
|
abs = f;
|
|
30710
30750
|
} else if (self.changedCwd) {
|
|
30711
30751
|
abs = path6.resolve(self.cwd, f);
|
|
@@ -30745,7 +30785,7 @@ var require_sync = __commonJS({
|
|
|
30745
30785
|
var util = require("util");
|
|
30746
30786
|
var path6 = require("path");
|
|
30747
30787
|
var assert = require("assert");
|
|
30748
|
-
var
|
|
30788
|
+
var isAbsolute = require("path").isAbsolute;
|
|
30749
30789
|
var common = require_common3();
|
|
30750
30790
|
var setopts = common.setopts;
|
|
30751
30791
|
var ownProp = common.ownProp;
|
|
@@ -30817,10 +30857,10 @@ var require_sync = __commonJS({
|
|
|
30817
30857
|
var read;
|
|
30818
30858
|
if (prefix === null)
|
|
30819
30859
|
read = ".";
|
|
30820
|
-
else if (
|
|
30860
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
30821
30861
|
return typeof p === "string" ? p : "[*]";
|
|
30822
30862
|
}).join("/"))) {
|
|
30823
|
-
if (!prefix || !
|
|
30863
|
+
if (!prefix || !isAbsolute(prefix))
|
|
30824
30864
|
prefix = "/" + prefix;
|
|
30825
30865
|
read = prefix;
|
|
30826
30866
|
} else
|
|
@@ -31017,7 +31057,7 @@ var require_sync = __commonJS({
|
|
|
31017
31057
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
31018
31058
|
if (!exists)
|
|
31019
31059
|
return;
|
|
31020
|
-
if (prefix &&
|
|
31060
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
31021
31061
|
var trail = /[\/\\]$/.test(prefix);
|
|
31022
31062
|
if (prefix.charAt(0) === "/") {
|
|
31023
31063
|
prefix = path6.join(this.root, prefix);
|
|
@@ -31211,7 +31251,7 @@ var require_inflight = __commonJS({
|
|
|
31211
31251
|
// ../../node_modules/.pnpm/glob@8.0.3/node_modules/glob/glob.js
|
|
31212
31252
|
var require_glob = __commonJS({
|
|
31213
31253
|
"../../node_modules/.pnpm/glob@8.0.3/node_modules/glob/glob.js"(exports, module2) {
|
|
31214
|
-
module2.exports =
|
|
31254
|
+
module2.exports = glob4;
|
|
31215
31255
|
var rp = require_fs2();
|
|
31216
31256
|
var minimatch = require_minimatch2();
|
|
31217
31257
|
var Minimatch = minimatch.Minimatch;
|
|
@@ -31219,7 +31259,7 @@ var require_glob = __commonJS({
|
|
|
31219
31259
|
var EE = require("events").EventEmitter;
|
|
31220
31260
|
var path6 = require("path");
|
|
31221
31261
|
var assert = require("assert");
|
|
31222
|
-
var
|
|
31262
|
+
var isAbsolute = require("path").isAbsolute;
|
|
31223
31263
|
var globSync = require_sync();
|
|
31224
31264
|
var common = require_common3();
|
|
31225
31265
|
var setopts = common.setopts;
|
|
@@ -31229,7 +31269,7 @@ var require_glob = __commonJS({
|
|
|
31229
31269
|
var childrenIgnored = common.childrenIgnored;
|
|
31230
31270
|
var isIgnored = common.isIgnored;
|
|
31231
31271
|
var once2 = require_once();
|
|
31232
|
-
function
|
|
31272
|
+
function glob4(pattern, options, cb) {
|
|
31233
31273
|
if (typeof options === "function")
|
|
31234
31274
|
cb = options, options = {};
|
|
31235
31275
|
if (!options)
|
|
@@ -31241,9 +31281,9 @@ var require_glob = __commonJS({
|
|
|
31241
31281
|
}
|
|
31242
31282
|
return new Glob(pattern, options, cb);
|
|
31243
31283
|
}
|
|
31244
|
-
|
|
31245
|
-
var GlobSync =
|
|
31246
|
-
|
|
31284
|
+
glob4.sync = globSync;
|
|
31285
|
+
var GlobSync = glob4.GlobSync = globSync.GlobSync;
|
|
31286
|
+
glob4.glob = glob4;
|
|
31247
31287
|
function extend(origin, add) {
|
|
31248
31288
|
if (add === null || typeof add !== "object") {
|
|
31249
31289
|
return origin;
|
|
@@ -31255,7 +31295,7 @@ var require_glob = __commonJS({
|
|
|
31255
31295
|
}
|
|
31256
31296
|
return origin;
|
|
31257
31297
|
}
|
|
31258
|
-
|
|
31298
|
+
glob4.hasMagic = function(pattern, options_) {
|
|
31259
31299
|
var options = extend({}, options_);
|
|
31260
31300
|
options.noprocess = true;
|
|
31261
31301
|
var g = new Glob(pattern, options);
|
|
@@ -31270,7 +31310,7 @@ var require_glob = __commonJS({
|
|
|
31270
31310
|
}
|
|
31271
31311
|
return false;
|
|
31272
31312
|
};
|
|
31273
|
-
|
|
31313
|
+
glob4.Glob = Glob;
|
|
31274
31314
|
inherits(Glob, EE);
|
|
31275
31315
|
function Glob(pattern, options, cb) {
|
|
31276
31316
|
if (typeof options === "function") {
|
|
@@ -31441,10 +31481,10 @@ var require_glob = __commonJS({
|
|
|
31441
31481
|
var read;
|
|
31442
31482
|
if (prefix === null)
|
|
31443
31483
|
read = ".";
|
|
31444
|
-
else if (
|
|
31484
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
31445
31485
|
return typeof p === "string" ? p : "[*]";
|
|
31446
31486
|
}).join("/"))) {
|
|
31447
|
-
if (!prefix || !
|
|
31487
|
+
if (!prefix || !isAbsolute(prefix))
|
|
31448
31488
|
prefix = "/" + prefix;
|
|
31449
31489
|
read = prefix;
|
|
31450
31490
|
} else
|
|
@@ -31529,7 +31569,7 @@ var require_glob = __commonJS({
|
|
|
31529
31569
|
this._emitQueue.push([index, e]);
|
|
31530
31570
|
return;
|
|
31531
31571
|
}
|
|
31532
|
-
var abs =
|
|
31572
|
+
var abs = isAbsolute(e) ? e : this._makeAbs(e);
|
|
31533
31573
|
if (this.mark)
|
|
31534
31574
|
e = this._mark(e);
|
|
31535
31575
|
if (this.absolute)
|
|
@@ -31684,7 +31724,7 @@ var require_glob = __commonJS({
|
|
|
31684
31724
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
31685
31725
|
if (!exists)
|
|
31686
31726
|
return cb();
|
|
31687
|
-
if (prefix &&
|
|
31727
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
31688
31728
|
var trail = /[\/\\]$/.test(prefix);
|
|
31689
31729
|
if (prefix.charAt(0) === "/") {
|
|
31690
31730
|
prefix = path6.join(this.root, prefix);
|
|
@@ -32911,7 +32951,7 @@ var require_get_glob_fs = __commonJS({
|
|
|
32911
32951
|
getGlobFs: () => getGlobFs
|
|
32912
32952
|
});
|
|
32913
32953
|
module2.exports = __toCommonJS2(get_glob_fs_exports);
|
|
32914
|
-
var
|
|
32954
|
+
var import_fs5 = __toESM2(require("fs"));
|
|
32915
32955
|
function removeWindowsPrefix(path6) {
|
|
32916
32956
|
return path6.replace(/^[a-zA-Z]:/, "");
|
|
32917
32957
|
}
|
|
@@ -32955,7 +32995,7 @@ var require_get_glob_fs = __commonJS({
|
|
|
32955
32995
|
});
|
|
32956
32996
|
}).catch((err) => callback(err, null));
|
|
32957
32997
|
};
|
|
32958
|
-
return new Proxy(
|
|
32998
|
+
return new Proxy(import_fs5.default, {
|
|
32959
32999
|
get(_target, prop) {
|
|
32960
33000
|
switch (prop) {
|
|
32961
33001
|
case "readdir":
|
|
@@ -33008,18 +33048,18 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33008
33048
|
getWorkspacePackagePaths: () => getWorkspacePackagePaths2
|
|
33009
33049
|
});
|
|
33010
33050
|
module2.exports = __toCommonJS2(get_workspace_package_paths_exports);
|
|
33011
|
-
var
|
|
33051
|
+
var import_path7 = __toESM2(require("path"));
|
|
33012
33052
|
var import_js_yaml = __toESM2(require_js_yaml3());
|
|
33013
33053
|
var import_glob = __toESM2(require_glob());
|
|
33014
33054
|
var import_json5 = __toESM2(require_lib4());
|
|
33015
33055
|
var import_get_glob_fs = require_get_glob_fs();
|
|
33016
|
-
var posixPath =
|
|
33056
|
+
var posixPath = import_path7.default.posix;
|
|
33017
33057
|
async function getWorkspacePackagePaths2({
|
|
33018
|
-
fs:
|
|
33058
|
+
fs: fs5,
|
|
33019
33059
|
workspace
|
|
33020
33060
|
}) {
|
|
33021
33061
|
const { type, rootPath } = workspace;
|
|
33022
|
-
const workspaceFs =
|
|
33062
|
+
const workspaceFs = fs5.chdir(rootPath);
|
|
33023
33063
|
let results = [];
|
|
33024
33064
|
switch (type) {
|
|
33025
33065
|
case "yarn":
|
|
@@ -33044,21 +33084,21 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33044
33084
|
}
|
|
33045
33085
|
var isWin = process.platform === "win32";
|
|
33046
33086
|
var normalizePath = (p) => isWin ? p.replace(/\\/g, "/") : p;
|
|
33047
|
-
async function getPackagePaths(packages,
|
|
33087
|
+
async function getPackagePaths(packages, fs5) {
|
|
33048
33088
|
return (await Promise.all(
|
|
33049
33089
|
packages.map(
|
|
33050
|
-
(packageGlob) => new Promise((
|
|
33090
|
+
(packageGlob) => new Promise((resolve, reject) => {
|
|
33051
33091
|
(0, import_glob.default)(
|
|
33052
33092
|
normalizePath(posixPath.join(packageGlob, "package.json")),
|
|
33053
33093
|
{
|
|
33054
33094
|
cwd: "/",
|
|
33055
|
-
fs: (0, import_get_glob_fs.getGlobFs)(
|
|
33095
|
+
fs: (0, import_get_glob_fs.getGlobFs)(fs5)
|
|
33056
33096
|
},
|
|
33057
33097
|
(err, matches) => {
|
|
33058
33098
|
if (err)
|
|
33059
33099
|
reject(err);
|
|
33060
33100
|
else
|
|
33061
|
-
|
|
33101
|
+
resolve(matches);
|
|
33062
33102
|
}
|
|
33063
33103
|
);
|
|
33064
33104
|
})
|
|
@@ -33066,9 +33106,9 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33066
33106
|
)).flat();
|
|
33067
33107
|
}
|
|
33068
33108
|
async function getPackageJsonWorkspacePackagePaths({
|
|
33069
|
-
fs:
|
|
33109
|
+
fs: fs5
|
|
33070
33110
|
}) {
|
|
33071
|
-
const packageJsonAsBuffer = await
|
|
33111
|
+
const packageJsonAsBuffer = await fs5.readFile("package.json");
|
|
33072
33112
|
const { workspaces } = JSON.parse(
|
|
33073
33113
|
packageJsonAsBuffer.toString()
|
|
33074
33114
|
);
|
|
@@ -33078,35 +33118,35 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33078
33118
|
} else {
|
|
33079
33119
|
packages = workspaces?.packages ?? [];
|
|
33080
33120
|
}
|
|
33081
|
-
return getPackagePaths(packages,
|
|
33121
|
+
return getPackagePaths(packages, fs5);
|
|
33082
33122
|
}
|
|
33083
33123
|
async function getNxWorkspacePackagePaths({
|
|
33084
|
-
fs:
|
|
33124
|
+
fs: fs5
|
|
33085
33125
|
}) {
|
|
33086
|
-
const nxWorkspaceJsonAsBuffer = await
|
|
33126
|
+
const nxWorkspaceJsonAsBuffer = await fs5.readFile("workspace.json");
|
|
33087
33127
|
const { projects } = JSON.parse(nxWorkspaceJsonAsBuffer.toString());
|
|
33088
33128
|
const packages = Object.values(projects);
|
|
33089
|
-
return getPackagePaths(packages,
|
|
33129
|
+
return getPackagePaths(packages, fs5);
|
|
33090
33130
|
}
|
|
33091
33131
|
async function getPnpmWorkspacePackagePaths({
|
|
33092
|
-
fs:
|
|
33132
|
+
fs: fs5
|
|
33093
33133
|
}) {
|
|
33094
|
-
const pnpmWorkspaceAsBuffer = await
|
|
33134
|
+
const pnpmWorkspaceAsBuffer = await fs5.readFile("pnpm-workspace.yaml");
|
|
33095
33135
|
const { packages = [] } = import_js_yaml.default.load(
|
|
33096
33136
|
pnpmWorkspaceAsBuffer.toString()
|
|
33097
33137
|
);
|
|
33098
|
-
return getPackagePaths(packages,
|
|
33138
|
+
return getPackagePaths(packages, fs5);
|
|
33099
33139
|
}
|
|
33100
33140
|
async function getRushWorkspacePackagePaths({
|
|
33101
|
-
fs:
|
|
33141
|
+
fs: fs5
|
|
33102
33142
|
}) {
|
|
33103
|
-
const rushWorkspaceAsBuffer = await
|
|
33143
|
+
const rushWorkspaceAsBuffer = await fs5.readFile("rush.json");
|
|
33104
33144
|
const { projects = [] } = import_json5.default.parse(
|
|
33105
33145
|
rushWorkspaceAsBuffer.toString()
|
|
33106
33146
|
);
|
|
33107
33147
|
if (Array.isArray(projects)) {
|
|
33108
33148
|
const packages = projects.filter((proj) => proj.projectFolder).map((project) => project.projectFolder);
|
|
33109
|
-
return getPackagePaths(packages,
|
|
33149
|
+
return getPackagePaths(packages, fs5);
|
|
33110
33150
|
} else {
|
|
33111
33151
|
return [];
|
|
33112
33152
|
}
|
|
@@ -33380,7 +33420,7 @@ var require_get_monorepo_default_settings = __commonJS({
|
|
|
33380
33420
|
getMonorepoDefaultSettings: () => getMonorepoDefaultSettings
|
|
33381
33421
|
});
|
|
33382
33422
|
module2.exports = __toCommonJS2(get_monorepo_default_settings_exports);
|
|
33383
|
-
var
|
|
33423
|
+
var import_path7 = require("path");
|
|
33384
33424
|
var import_monorepo_managers = require_monorepo_managers();
|
|
33385
33425
|
var import_package_managers = require_package_managers();
|
|
33386
33426
|
var import_detect_framework = require_detect_framework();
|
|
@@ -33484,8 +33524,8 @@ var require_get_monorepo_default_settings = __commonJS({
|
|
|
33484
33524
|
const nxJSON = import_json5.default.parse(nxJSONBuf.toString("utf-8"));
|
|
33485
33525
|
if (!nxJSON?.targetDefaults?.build) {
|
|
33486
33526
|
const [projectJSONBuf, packageJSONBuf] = await Promise.all([
|
|
33487
|
-
detectorFilesystem.readFile((0,
|
|
33488
|
-
detectorFilesystem.readFile((0,
|
|
33527
|
+
detectorFilesystem.readFile((0, import_path7.join)(projectPath, "project.json")).catch(() => null),
|
|
33528
|
+
detectorFilesystem.readFile((0, import_path7.join)(projectPath, "package.json")).catch(() => null)
|
|
33489
33529
|
]);
|
|
33490
33530
|
let hasBuildTarget = false;
|
|
33491
33531
|
if (projectJSONBuf) {
|
|
@@ -33569,14 +33609,14 @@ var require_detect_instrumentation = __commonJS({
|
|
|
33569
33609
|
{ name: OPENTELEMETRY_SDK_TRACE_NODE, minVersion: "1.19.0" },
|
|
33570
33610
|
{ name: OPENTELEMETRY_API, minVersion: "1.7.0" }
|
|
33571
33611
|
];
|
|
33572
|
-
async function detectInstrumentation2(
|
|
33573
|
-
if (await
|
|
33612
|
+
async function detectInstrumentation2(fs5) {
|
|
33613
|
+
if (await fs5.hasPath("package.json") === false) {
|
|
33574
33614
|
return false;
|
|
33575
33615
|
}
|
|
33576
|
-
if (await
|
|
33616
|
+
if (await fs5.isFile("package.json") === false) {
|
|
33577
33617
|
return false;
|
|
33578
33618
|
}
|
|
33579
|
-
const content = await
|
|
33619
|
+
const content = await fs5.readFile("package.json");
|
|
33580
33620
|
const packageJsonContent = content.toString();
|
|
33581
33621
|
let hasInstrumentation = false;
|
|
33582
33622
|
for (const dependency of tracingDependencies) {
|
|
@@ -33696,15 +33736,15 @@ __export(src_exports, {
|
|
|
33696
33736
|
});
|
|
33697
33737
|
module.exports = __toCommonJS(src_exports);
|
|
33698
33738
|
var import_ms = __toESM(require_ms());
|
|
33699
|
-
var
|
|
33739
|
+
var import_path6 = __toESM(require("path"));
|
|
33700
33740
|
var import_node_fetch2 = __toESM(require_lib2());
|
|
33701
33741
|
var import_get_port = __toESM(require_get_port());
|
|
33702
33742
|
var import_is_port_reachable = __toESM(require_is_port_reachable());
|
|
33703
33743
|
var import_frameworks = __toESM(require_frameworks());
|
|
33704
33744
|
var import_child_process = require("child_process");
|
|
33705
|
-
var
|
|
33745
|
+
var import_fs4 = require("fs");
|
|
33706
33746
|
var import_os = require("os");
|
|
33707
|
-
var
|
|
33747
|
+
var import_build_utils4 = require("@vercel/build-utils");
|
|
33708
33748
|
|
|
33709
33749
|
// src/utils/build-output-v1.ts
|
|
33710
33750
|
var import_path2 = __toESM(require("path"));
|
|
@@ -34491,284 +34531,13 @@ async function injectVercelAnalyticsPlugin(dir) {
|
|
|
34491
34531
|
}
|
|
34492
34532
|
}
|
|
34493
34533
|
|
|
34494
|
-
// src/utils/vite-environments.ts
|
|
34495
|
-
var import_fs4 = require("fs");
|
|
34496
|
-
var import_path6 = require("path");
|
|
34497
|
-
var import_module2 = require("module");
|
|
34498
|
-
var import_nft = require("@vercel/nft");
|
|
34499
|
-
var import_error_utils3 = __toESM(require_dist2());
|
|
34500
|
-
var import_build_utils3 = require("@vercel/build-utils");
|
|
34501
|
-
var SERVER_ENTRY_CANDIDATES = ["server.js", "index.js", "entry-server.js"];
|
|
34502
|
-
var envCache = /* @__PURE__ */ new Map();
|
|
34503
|
-
async function getViteEnvironments(workPath) {
|
|
34504
|
-
const cached = envCache.get(workPath);
|
|
34505
|
-
if (cached)
|
|
34506
|
-
return cached;
|
|
34507
|
-
const promise = loadViteEnvironments(workPath);
|
|
34508
|
-
envCache.set(workPath, promise);
|
|
34509
|
-
return promise;
|
|
34510
|
-
}
|
|
34511
|
-
async function loadViteEnvironments(workPath) {
|
|
34512
|
-
const projectRequire = (0, import_module2.createRequire)((0, import_path6.join)(workPath, "__vite_detect__"));
|
|
34513
|
-
let vite;
|
|
34514
|
-
try {
|
|
34515
|
-
vite = projectRequire("vite");
|
|
34516
|
-
} catch {
|
|
34517
|
-
return null;
|
|
34518
|
-
}
|
|
34519
|
-
if (typeof vite.resolveConfig !== "function") {
|
|
34520
|
-
(0, import_build_utils3.debug)("Detected vite, but `resolveConfig` is missing \u2014 skipping");
|
|
34521
|
-
return null;
|
|
34522
|
-
}
|
|
34523
|
-
let resolved;
|
|
34524
|
-
try {
|
|
34525
|
-
resolved = await vite.resolveConfig(
|
|
34526
|
-
{ root: workPath },
|
|
34527
|
-
"build"
|
|
34528
|
-
);
|
|
34529
|
-
} catch (err) {
|
|
34530
|
-
(0, import_build_utils3.debug)(`vite.resolveConfig failed: ${(0, import_error_utils3.errorToString)(err)}`);
|
|
34531
|
-
return null;
|
|
34532
|
-
}
|
|
34533
|
-
const environments = [];
|
|
34534
|
-
for (const [name, env] of Object.entries(resolved.environments ?? {})) {
|
|
34535
|
-
const consumer = env.consumer;
|
|
34536
|
-
if (consumer !== "client" && consumer !== "server")
|
|
34537
|
-
continue;
|
|
34538
|
-
const outDirRel = env.build?.outDir ?? resolved.build?.outDir ?? "dist";
|
|
34539
|
-
const outDir = (0, import_path6.isAbsolute)(outDirRel) ? outDirRel : (0, import_path6.resolve)(resolved.root || workPath, outDirRel);
|
|
34540
|
-
environments.push({
|
|
34541
|
-
name,
|
|
34542
|
-
consumer,
|
|
34543
|
-
outDir,
|
|
34544
|
-
inputNames: collectInputNames(env.build?.rollupOptions?.input),
|
|
34545
|
-
conditions: env.resolve?.conditions ?? []
|
|
34546
|
-
});
|
|
34547
|
-
}
|
|
34548
|
-
const clientOutDirs = new Set(
|
|
34549
|
-
environments.filter((e) => e.consumer === "client").map((e) => e.outDir)
|
|
34550
|
-
);
|
|
34551
|
-
return environments.filter((env) => {
|
|
34552
|
-
if (env.consumer !== "server")
|
|
34553
|
-
return true;
|
|
34554
|
-
return !clientOutDirs.has(env.outDir);
|
|
34555
|
-
});
|
|
34556
|
-
}
|
|
34557
|
-
async function projectDeclaresViteServerEnvironment(workPath) {
|
|
34558
|
-
const envs = await getViteEnvironments(workPath);
|
|
34559
|
-
if (!envs)
|
|
34560
|
-
return false;
|
|
34561
|
-
return envs.some((e) => e.consumer === "server");
|
|
34562
|
-
}
|
|
34563
|
-
async function detectViteServerEnvironments(workPath) {
|
|
34564
|
-
const envs = await getViteEnvironments(workPath);
|
|
34565
|
-
if (!envs)
|
|
34566
|
-
return null;
|
|
34567
|
-
const filtered = envs.filter((env) => {
|
|
34568
|
-
if (env.consumer !== "server")
|
|
34569
|
-
return true;
|
|
34570
|
-
return (0, import_fs4.existsSync)(env.outDir);
|
|
34571
|
-
});
|
|
34572
|
-
const hasBuiltServer = filtered.some((e) => e.consumer === "server");
|
|
34573
|
-
if (!hasBuiltServer)
|
|
34574
|
-
return null;
|
|
34575
|
-
return { environments: filtered };
|
|
34576
|
-
}
|
|
34577
|
-
async function buildViteEnvironments({
|
|
34578
|
-
workPath,
|
|
34579
|
-
repoRootPath,
|
|
34580
|
-
nodeVersion,
|
|
34581
|
-
detection
|
|
34582
|
-
}) {
|
|
34583
|
-
const clientEnvironments = detection.environments.filter(
|
|
34584
|
-
(e) => e.consumer === "client"
|
|
34585
|
-
);
|
|
34586
|
-
const serverEnvironments = detection.environments.filter(
|
|
34587
|
-
(e) => e.consumer === "server"
|
|
34588
|
-
);
|
|
34589
|
-
console.log(
|
|
34590
|
-
`Detected Vite environments: ${detection.environments.map((e) => `${e.name} (${e.consumer}) \u2192 ${(0, import_path6.relative)(workPath, e.outDir)}`).join(", ")}`
|
|
34591
|
-
);
|
|
34592
|
-
let staticFiles = {};
|
|
34593
|
-
for (const env of clientEnvironments) {
|
|
34594
|
-
if (!(0, import_fs4.existsSync)(env.outDir)) {
|
|
34595
|
-
(0, import_build_utils3.debug)(
|
|
34596
|
-
`Skipping client environment "${env.name}": outDir ${env.outDir} does not exist`
|
|
34597
|
-
);
|
|
34598
|
-
continue;
|
|
34599
|
-
}
|
|
34600
|
-
const found = await (0, import_build_utils3.glob)("**", env.outDir);
|
|
34601
|
-
console.log(
|
|
34602
|
-
`Collected ${Object.keys(found).length} static asset(s) from "${env.name}" (${(0, import_path6.relative)(workPath, env.outDir)})`
|
|
34603
|
-
);
|
|
34604
|
-
staticFiles = { ...staticFiles, ...found };
|
|
34605
|
-
}
|
|
34606
|
-
const output = { ...staticFiles };
|
|
34607
|
-
let primaryServerFunctionPath;
|
|
34608
|
-
for (const env of serverEnvironments) {
|
|
34609
|
-
if (!(0, import_fs4.existsSync)(env.outDir)) {
|
|
34610
|
-
(0, import_build_utils3.debug)(
|
|
34611
|
-
`Skipping server environment "${env.name}": outDir ${env.outDir} does not exist`
|
|
34612
|
-
);
|
|
34613
|
-
continue;
|
|
34614
|
-
}
|
|
34615
|
-
const entryFile = await findServerEntry(env);
|
|
34616
|
-
if (!entryFile) {
|
|
34617
|
-
throw new Error(
|
|
34618
|
-
`Could not locate the server entry file inside "${env.outDir}" for environment "${env.name}". Expected a top-level .js entry (e.g. server.js, index.js).`
|
|
34619
|
-
);
|
|
34620
|
-
}
|
|
34621
|
-
console.log(
|
|
34622
|
-
`Creating server function from "${env.name}" \u2192 ${(0, import_path6.relative)(
|
|
34623
|
-
workPath,
|
|
34624
|
-
entryFile
|
|
34625
|
-
)}`
|
|
34626
|
-
);
|
|
34627
|
-
const fn = await createServerFunction({
|
|
34628
|
-
entryAbsolutePath: entryFile,
|
|
34629
|
-
rootDir: repoRootPath,
|
|
34630
|
-
entrypointDir: workPath,
|
|
34631
|
-
nodeVersion,
|
|
34632
|
-
conditions: env.conditions,
|
|
34633
|
-
environmentName: env.name
|
|
34634
|
-
});
|
|
34635
|
-
const outputPath = serverEnvironments.length === 1 || env.name === "server" ? "index" : `__vite/${env.name}`;
|
|
34636
|
-
output[outputPath] = fn;
|
|
34637
|
-
if (!primaryServerFunctionPath) {
|
|
34638
|
-
primaryServerFunctionPath = outputPath;
|
|
34639
|
-
}
|
|
34640
|
-
}
|
|
34641
|
-
const routes = [{ handle: "filesystem" }];
|
|
34642
|
-
if (primaryServerFunctionPath) {
|
|
34643
|
-
routes.push({ src: "/(.*)", dest: `/${primaryServerFunctionPath}` });
|
|
34644
|
-
}
|
|
34645
|
-
routes.push({ handle: "hit" });
|
|
34646
|
-
routes.push({
|
|
34647
|
-
src: "^/assets/(.*)$",
|
|
34648
|
-
headers: { "cache-control": "public, max-age=31536000, immutable" },
|
|
34649
|
-
continue: true
|
|
34650
|
-
});
|
|
34651
|
-
return { routes, output };
|
|
34652
|
-
}
|
|
34653
|
-
function collectInputNames(input) {
|
|
34654
|
-
if (!input)
|
|
34655
|
-
return [];
|
|
34656
|
-
if (typeof input === "string")
|
|
34657
|
-
return [stripExt((0, import_path6.basename)(input))];
|
|
34658
|
-
if (Array.isArray(input))
|
|
34659
|
-
return input.map((i) => stripExt((0, import_path6.basename)(i)));
|
|
34660
|
-
return Object.keys(input);
|
|
34661
|
-
}
|
|
34662
|
-
function stripExt(filename) {
|
|
34663
|
-
return filename.replace(/\.[^.]+$/, "");
|
|
34664
|
-
}
|
|
34665
|
-
async function findServerEntry(env) {
|
|
34666
|
-
for (const name of env.inputNames) {
|
|
34667
|
-
const candidate = (0, import_path6.join)(env.outDir, `${name}.js`);
|
|
34668
|
-
if ((0, import_fs4.existsSync)(candidate))
|
|
34669
|
-
return candidate;
|
|
34670
|
-
}
|
|
34671
|
-
for (const name of SERVER_ENTRY_CANDIDATES) {
|
|
34672
|
-
const candidate = (0, import_path6.join)(env.outDir, name);
|
|
34673
|
-
if ((0, import_fs4.existsSync)(candidate))
|
|
34674
|
-
return candidate;
|
|
34675
|
-
}
|
|
34676
|
-
const entries = await import_fs4.promises.readdir(env.outDir, { withFileTypes: true });
|
|
34677
|
-
const topLevelJs = entries.filter((e) => e.isFile() && e.name.endsWith(".js"));
|
|
34678
|
-
if (topLevelJs.length === 1) {
|
|
34679
|
-
return (0, import_path6.join)(env.outDir, topLevelJs[0].name);
|
|
34680
|
-
}
|
|
34681
|
-
return null;
|
|
34682
|
-
}
|
|
34683
|
-
async function createServerFunction({
|
|
34684
|
-
entryAbsolutePath,
|
|
34685
|
-
rootDir,
|
|
34686
|
-
entrypointDir,
|
|
34687
|
-
nodeVersion,
|
|
34688
|
-
conditions,
|
|
34689
|
-
environmentName
|
|
34690
|
-
}) {
|
|
34691
|
-
const traceConditions = conditions.length ? conditions : ["node", "import", "require", "default"];
|
|
34692
|
-
const trace = await (0, import_nft.nodeFileTrace)([entryAbsolutePath], {
|
|
34693
|
-
base: rootDir,
|
|
34694
|
-
processCwd: entrypointDir,
|
|
34695
|
-
conditions: traceConditions
|
|
34696
|
-
});
|
|
34697
|
-
for (const warning of trace.warnings) {
|
|
34698
|
-
(0, import_build_utils3.debug)(`nft warning (vite/${environmentName}): ${warning.message}`);
|
|
34699
|
-
}
|
|
34700
|
-
const files = {};
|
|
34701
|
-
for (const file of trace.fileList) {
|
|
34702
|
-
files[file] = await import_build_utils3.FileFsRef.fromFsPath({ fsPath: (0, import_path6.join)(rootDir, file) });
|
|
34703
|
-
}
|
|
34704
|
-
const handler = (0, import_path6.relative)(rootDir, entryAbsolutePath);
|
|
34705
|
-
return new import_build_utils3.NodejsLambda({
|
|
34706
|
-
files,
|
|
34707
|
-
handler,
|
|
34708
|
-
runtime: nodeVersion.runtime,
|
|
34709
|
-
shouldAddHelpers: false,
|
|
34710
|
-
shouldAddSourcemapSupport: false,
|
|
34711
|
-
operationType: "SSR",
|
|
34712
|
-
supportsResponseStreaming: true,
|
|
34713
|
-
useWebApi: true
|
|
34714
|
-
});
|
|
34715
|
-
}
|
|
34716
|
-
|
|
34717
|
-
// src/utils/inject-nitro.ts
|
|
34718
|
-
var import_module3 = require("module");
|
|
34719
|
-
var import_fs5 = require("fs");
|
|
34720
|
-
var import_path7 = require("path");
|
|
34721
|
-
var require_2 = (0, import_module3.createRequire)(__filename);
|
|
34722
|
-
function shouldInjectNitro({
|
|
34723
|
-
pkg,
|
|
34724
|
-
config,
|
|
34725
|
-
buildCommand
|
|
34726
|
-
}) {
|
|
34727
|
-
if (config.projectSettings?.buildCommand != null)
|
|
34728
|
-
return false;
|
|
34729
|
-
if (typeof buildCommand === "string")
|
|
34730
|
-
return false;
|
|
34731
|
-
const buildScript = pkg?.scripts?.build;
|
|
34732
|
-
if (typeof buildScript !== "string" || buildScript.trim() !== "vite build") {
|
|
34733
|
-
return false;
|
|
34734
|
-
}
|
|
34735
|
-
const deps = { ...pkg?.dependencies, ...pkg?.devDependencies };
|
|
34736
|
-
if (deps.nitro)
|
|
34737
|
-
return false;
|
|
34738
|
-
return true;
|
|
34739
|
-
}
|
|
34740
|
-
var cachedNitroBinPath;
|
|
34741
|
-
function resolveNitroBin() {
|
|
34742
|
-
if (cachedNitroBinPath)
|
|
34743
|
-
return cachedNitroBinPath;
|
|
34744
|
-
const pkgPath = require_2.resolve("nitro/package.json");
|
|
34745
|
-
const pkg = JSON.parse((0, import_fs5.readFileSync)(pkgPath, "utf8"));
|
|
34746
|
-
let binRelative;
|
|
34747
|
-
if (typeof pkg.bin === "string") {
|
|
34748
|
-
binRelative = pkg.bin;
|
|
34749
|
-
} else if (pkg.bin && typeof pkg.bin === "object") {
|
|
34750
|
-
binRelative = pkg.bin.nitro ?? Object.values(pkg.bin)[0];
|
|
34751
|
-
}
|
|
34752
|
-
if (!binRelative) {
|
|
34753
|
-
throw new Error(
|
|
34754
|
-
"Could not resolve the Nitro CLI binary from the installed `nitro` package."
|
|
34755
|
-
);
|
|
34756
|
-
}
|
|
34757
|
-
cachedNitroBinPath = (0, import_path7.join)((0, import_path7.dirname)(pkgPath), binRelative);
|
|
34758
|
-
return cachedNitroBinPath;
|
|
34759
|
-
}
|
|
34760
|
-
function getNitroInjectionBuildCommand() {
|
|
34761
|
-
const bin = resolveNitroBin();
|
|
34762
|
-
return `node ${JSON.stringify(bin)} build --builder vite`;
|
|
34763
|
-
}
|
|
34764
|
-
|
|
34765
34534
|
// src/index.ts
|
|
34766
34535
|
var import_tree_kill = __toESM(require_tree_kill());
|
|
34767
34536
|
var import_fs_detectors = __toESM(require_dist8());
|
|
34768
34537
|
|
|
34769
34538
|
// src/utils/hugo.ts
|
|
34770
34539
|
var import_node_fetch = __toESM(require_lib2());
|
|
34771
|
-
var
|
|
34540
|
+
var import_build_utils3 = require("@vercel/build-utils");
|
|
34772
34541
|
async function getHugoUrl(version2, platform = process.platform, arch = process.arch) {
|
|
34773
34542
|
const oses = {
|
|
34774
34543
|
linux: ["linux"],
|
|
@@ -34794,7 +34563,7 @@ async function getHugoUrl(version2, platform = process.platform, arch = process.
|
|
|
34794
34563
|
const checksumsUrl = `https://github.com/gohugoio/hugo/releases/download/v${version2}/hugo_${version2}_checksums.txt`;
|
|
34795
34564
|
const checksumsRes = await (0, import_node_fetch.default)(checksumsUrl);
|
|
34796
34565
|
if (checksumsRes.status === 404) {
|
|
34797
|
-
throw new
|
|
34566
|
+
throw new import_build_utils3.NowBuildError({
|
|
34798
34567
|
code: "STATIC_BUILD_BINARY_NOT_FOUND",
|
|
34799
34568
|
message: `Version ${version2} of Hugo does not exist. Please specify a different one.`,
|
|
34800
34569
|
link: "https://vercel.link/framework-versioning"
|
|
@@ -34832,7 +34601,7 @@ function findFile(names, oses, arches, extended) {
|
|
|
34832
34601
|
|
|
34833
34602
|
// src/index.ts
|
|
34834
34603
|
var import_events = require("events");
|
|
34835
|
-
var sleep = (n) => new Promise((
|
|
34604
|
+
var sleep = (n) => new Promise((resolve) => setTimeout(resolve, n));
|
|
34836
34605
|
var DEV_SERVER_PORT_BIND_TIMEOUT = (0, import_ms.default)("5m");
|
|
34837
34606
|
async function checkForPort(port, timeout) {
|
|
34838
34607
|
const start = Date.now();
|
|
@@ -34844,18 +34613,18 @@ async function checkForPort(port, timeout) {
|
|
|
34844
34613
|
}
|
|
34845
34614
|
}
|
|
34846
34615
|
function validateDistDir(distDir, workPath) {
|
|
34847
|
-
const distDirName =
|
|
34848
|
-
const exists = () => (0,
|
|
34849
|
-
const isDirectory = () => (0,
|
|
34850
|
-
const isEmpty = () => (0,
|
|
34616
|
+
const distDirName = import_path6.default.basename(distDir);
|
|
34617
|
+
const exists = () => (0, import_fs4.existsSync)(distDir);
|
|
34618
|
+
const isDirectory = () => (0, import_fs4.statSync)(distDir).isDirectory();
|
|
34619
|
+
const isEmpty = () => (0, import_fs4.readdirSync)(distDir).length === 0;
|
|
34851
34620
|
const link = "https://vercel.link/missing-public-directory";
|
|
34852
34621
|
if (!exists()) {
|
|
34853
|
-
const vercelJsonPath =
|
|
34854
|
-
const vercelJsonExists = (0,
|
|
34622
|
+
const vercelJsonPath = import_path6.default.join(workPath, "vercel.json");
|
|
34623
|
+
const vercelJsonExists = (0, import_fs4.existsSync)(vercelJsonPath);
|
|
34855
34624
|
let buildCommandExists = false;
|
|
34856
34625
|
if (vercelJsonExists) {
|
|
34857
34626
|
try {
|
|
34858
|
-
const vercelJson = JSON.parse((0,
|
|
34627
|
+
const vercelJson = JSON.parse((0, import_fs4.readFileSync)(vercelJsonPath, "utf8"));
|
|
34859
34628
|
buildCommandExists = vercelJson.buildCommand !== void 0;
|
|
34860
34629
|
} catch (_e) {
|
|
34861
34630
|
}
|
|
@@ -34866,21 +34635,21 @@ function validateDistDir(distDir, workPath) {
|
|
|
34866
34635
|
} else {
|
|
34867
34636
|
message += ` Configure the Output Directory in your Project Settings. Alternatively, configure vercel.json#outputDirectory.`;
|
|
34868
34637
|
}
|
|
34869
|
-
throw new
|
|
34638
|
+
throw new import_build_utils4.NowBuildError({
|
|
34870
34639
|
code: "STATIC_BUILD_NO_OUT_DIR",
|
|
34871
34640
|
message,
|
|
34872
34641
|
link
|
|
34873
34642
|
});
|
|
34874
34643
|
}
|
|
34875
34644
|
if (!isDirectory()) {
|
|
34876
|
-
throw new
|
|
34645
|
+
throw new import_build_utils4.NowBuildError({
|
|
34877
34646
|
code: "STATIC_BUILD_NOT_A_DIR",
|
|
34878
34647
|
message: `The path specified as Output Directory ("${distDirName}") is not actually a directory.`,
|
|
34879
34648
|
link
|
|
34880
34649
|
});
|
|
34881
34650
|
}
|
|
34882
34651
|
if (isEmpty()) {
|
|
34883
|
-
throw new
|
|
34652
|
+
throw new import_build_utils4.NowBuildError({
|
|
34884
34653
|
code: "STATIC_BUILD_EMPTY_OUT_DIR",
|
|
34885
34654
|
message: `The Output Directory "${distDirName}" is empty.`,
|
|
34886
34655
|
link
|
|
@@ -34942,10 +34711,10 @@ var nowDevChildProcesses = /* @__PURE__ */ new Set();
|
|
|
34942
34711
|
["SIGINT", "SIGTERM"].forEach((signal) => {
|
|
34943
34712
|
process.once(signal, async () => {
|
|
34944
34713
|
for (const child of nowDevChildProcesses) {
|
|
34945
|
-
(0,
|
|
34714
|
+
(0, import_build_utils4.debug)(
|
|
34946
34715
|
`Got ${signal}, killing dev server child process (pid=${child.pid})`
|
|
34947
34716
|
);
|
|
34948
|
-
await new Promise((
|
|
34717
|
+
await new Promise((resolve) => (0, import_tree_kill.default)(child.pid, signal, resolve));
|
|
34949
34718
|
}
|
|
34950
34719
|
process.exit(0);
|
|
34951
34720
|
});
|
|
@@ -34973,12 +34742,12 @@ async function getFrameworkRoutes(framework, dirPrefix) {
|
|
|
34973
34742
|
return routes;
|
|
34974
34743
|
}
|
|
34975
34744
|
function getPkg(entrypoint, workPath) {
|
|
34976
|
-
if (
|
|
34745
|
+
if (import_path6.default.basename(entrypoint) !== "package.json") {
|
|
34977
34746
|
return null;
|
|
34978
34747
|
}
|
|
34979
34748
|
try {
|
|
34980
|
-
const pkgPath =
|
|
34981
|
-
const pkg = JSON.parse((0,
|
|
34749
|
+
const pkgPath = import_path6.default.join(workPath, entrypoint);
|
|
34750
|
+
const pkg = JSON.parse((0, import_fs4.readFileSync)(pkgPath, "utf8"));
|
|
34982
34751
|
return pkg;
|
|
34983
34752
|
} catch (err) {
|
|
34984
34753
|
if (err.code !== "ENOENT")
|
|
@@ -35009,7 +34778,7 @@ function getFramework(config, pkg) {
|
|
|
35009
34778
|
async function fetchBinary(url, framework, version2, dest = "/usr/local/bin") {
|
|
35010
34779
|
const res = await (0, import_node_fetch2.default)(url);
|
|
35011
34780
|
if (res.status === 404) {
|
|
35012
|
-
throw new
|
|
34781
|
+
throw new import_build_utils4.NowBuildError({
|
|
35013
34782
|
code: "STATIC_BUILD_BINARY_NOT_FOUND",
|
|
35014
34783
|
message: `Version ${version2} of ${framework} does not exist. Please specify a different one.`,
|
|
35015
34784
|
link: "https://vercel.link/framework-versioning"
|
|
@@ -35029,11 +34798,11 @@ async function fetchBinary(url, framework, version2, dest = "/usr/local/bin") {
|
|
|
35029
34798
|
async function getUpdatedDistPath(framework, outputDirPrefix, entrypointDir, distPath, config) {
|
|
35030
34799
|
if (framework) {
|
|
35031
34800
|
const outputDirName = config.outputDirectory ? config.outputDirectory : await framework.getOutputDirName(outputDirPrefix);
|
|
35032
|
-
return
|
|
34801
|
+
return import_path6.default.join(outputDirPrefix, outputDirName);
|
|
35033
34802
|
}
|
|
35034
34803
|
if (!config || !config.distDir) {
|
|
35035
|
-
const publicPath =
|
|
35036
|
-
if (!(0,
|
|
34804
|
+
const publicPath = import_path6.default.join(entrypointDir, "public");
|
|
34805
|
+
if (!(0, import_fs4.existsSync)(distPath) && (0, import_fs4.existsSync)(publicPath) && (0, import_fs4.statSync)(publicPath).isDirectory()) {
|
|
35037
34806
|
return publicPath;
|
|
35038
34807
|
}
|
|
35039
34808
|
}
|
|
@@ -35047,13 +34816,13 @@ var build = async ({
|
|
|
35047
34816
|
config,
|
|
35048
34817
|
meta = {}
|
|
35049
34818
|
}) => {
|
|
35050
|
-
await (0,
|
|
34819
|
+
await (0, import_build_utils4.download)(files, workPath, meta);
|
|
35051
34820
|
const routePrefix = config.routePrefix;
|
|
35052
|
-
const mountpoint = routePrefix ? routePrefix.replace(/^\//, "") || "." :
|
|
35053
|
-
const entrypointDir =
|
|
35054
|
-
let distPath =
|
|
34821
|
+
const mountpoint = routePrefix ? routePrefix.replace(/^\//, "") || "." : import_path6.default.dirname(entrypoint);
|
|
34822
|
+
const entrypointDir = import_path6.default.join(workPath, import_path6.default.dirname(entrypoint));
|
|
34823
|
+
let distPath = import_path6.default.join(
|
|
35055
34824
|
workPath,
|
|
35056
|
-
|
|
34825
|
+
import_path6.default.dirname(entrypoint),
|
|
35057
34826
|
config.distDir || config.outputDirectory || "dist"
|
|
35058
34827
|
);
|
|
35059
34828
|
const pkg = getPkg(entrypoint, workPath);
|
|
@@ -35065,12 +34834,11 @@ var build = async ({
|
|
|
35065
34834
|
frameworkList: import_frameworks.frameworkList
|
|
35066
34835
|
}) ?? {};
|
|
35067
34836
|
const devCommand = getCommand("dev", pkg, config, framework);
|
|
35068
|
-
|
|
34837
|
+
const buildCommand = getCommand("build", pkg, config, framework);
|
|
35069
34838
|
const installCommand = getCommand("install", pkg, config, framework);
|
|
35070
|
-
const nitroInjectionEligible = !meta.isDev && shouldInjectNitro({ pkg, config, buildCommand });
|
|
35071
34839
|
if (pkg || buildCommand) {
|
|
35072
|
-
const gemfilePath =
|
|
35073
|
-
const requirementsPath =
|
|
34840
|
+
const gemfilePath = import_path6.default.join(workPath, "Gemfile");
|
|
34841
|
+
const requirementsPath = import_path6.default.join(workPath, "requirements.txt");
|
|
35074
34842
|
let isNpmInstall = false;
|
|
35075
34843
|
let isBundleInstall = false;
|
|
35076
34844
|
let isPipInstall = false;
|
|
@@ -35082,17 +34850,17 @@ var build = async ({
|
|
|
35082
34850
|
const { HUGO_VERSION, ZOLA_VERSION, GUTENBERG_VERSION } = process.env;
|
|
35083
34851
|
if ((HUGO_VERSION || framework?.slug === "hugo") && !meta.isDev) {
|
|
35084
34852
|
const hugoVersion = HUGO_VERSION || "0.58.2";
|
|
35085
|
-
const hugoDir =
|
|
34853
|
+
const hugoDir = import_path6.default.join(
|
|
35086
34854
|
workPath,
|
|
35087
34855
|
`.vercel/cache/hugo-v${hugoVersion}-${process.platform}-${process.arch}`
|
|
35088
34856
|
);
|
|
35089
|
-
if (!(0,
|
|
34857
|
+
if (!(0, import_fs4.existsSync)(hugoDir)) {
|
|
35090
34858
|
console.log("Installing Hugo version " + hugoVersion);
|
|
35091
34859
|
const url = await getHugoUrl(hugoVersion);
|
|
35092
|
-
(0,
|
|
34860
|
+
(0, import_fs4.mkdirSync)(hugoDir, { recursive: true });
|
|
35093
34861
|
await fetchBinary(url, "Hugo", hugoVersion, hugoDir);
|
|
35094
34862
|
}
|
|
35095
|
-
process.env.PATH = `${hugoDir}${
|
|
34863
|
+
process.env.PATH = `${hugoDir}${import_path6.default.delimiter}${process.env.PATH}`;
|
|
35096
34864
|
}
|
|
35097
34865
|
if (ZOLA_VERSION && !meta.isDev) {
|
|
35098
34866
|
console.log("Installing Zola version " + ZOLA_VERSION);
|
|
@@ -35104,30 +34872,30 @@ var build = async ({
|
|
|
35104
34872
|
const url = `https://github.com/getzola/zola/releases/download/v${GUTENBERG_VERSION}/gutenberg-v${GUTENBERG_VERSION}-x86_64-unknown-linux-gnu.tar.gz`;
|
|
35105
34873
|
await fetchBinary(url, "Gutenberg", GUTENBERG_VERSION);
|
|
35106
34874
|
}
|
|
35107
|
-
distPath =
|
|
34875
|
+
distPath = import_path6.default.join(
|
|
35108
34876
|
workPath,
|
|
35109
|
-
|
|
34877
|
+
import_path6.default.dirname(entrypoint),
|
|
35110
34878
|
config.outputDirectory || "public"
|
|
35111
34879
|
);
|
|
35112
34880
|
}
|
|
35113
34881
|
if (framework) {
|
|
35114
|
-
(0,
|
|
34882
|
+
(0, import_build_utils4.debug)(
|
|
35115
34883
|
`Detected ${framework.name} framework. Optimizing your deployment...`
|
|
35116
34884
|
);
|
|
35117
|
-
const prefixedEnvs = (0,
|
|
34885
|
+
const prefixedEnvs = (0, import_build_utils4.getPrefixedEnvVars)({
|
|
35118
34886
|
envPrefix: framework.envPrefix,
|
|
35119
34887
|
envs: process.env
|
|
35120
34888
|
});
|
|
35121
34889
|
for (const [key, value] of Object.entries(prefixedEnvs)) {
|
|
35122
34890
|
process.env[key] = value;
|
|
35123
34891
|
}
|
|
35124
|
-
const speedInsightsVersion = (0,
|
|
34892
|
+
const speedInsightsVersion = (0, import_build_utils4.getInstalledPackageVersion)(
|
|
35125
34893
|
"@vercel/speed-insights"
|
|
35126
34894
|
);
|
|
35127
34895
|
const isSpeedInsightsInstalled = Boolean(speedInsightsVersion);
|
|
35128
34896
|
if (isSpeedInsightsInstalled && process.env.VERCEL_ANALYTICS_ID && ["next", "nuxtjs", "gatsby"].includes(framework.slug || "")) {
|
|
35129
34897
|
delete process.env.VERCEL_ANALYTICS_ID;
|
|
35130
|
-
(0,
|
|
34898
|
+
(0, import_build_utils4.debug)(
|
|
35131
34899
|
`Removed VERCEL_ANALYTICS_ID from the environment because we detected the @vercel/speed-insights package`
|
|
35132
34900
|
);
|
|
35133
34901
|
}
|
|
@@ -35135,23 +34903,23 @@ var build = async ({
|
|
|
35135
34903
|
await injectPlugins(detectedVersion, entrypointDir);
|
|
35136
34904
|
}
|
|
35137
34905
|
if (process.env.VERCEL_ANALYTICS_ID) {
|
|
35138
|
-
const frameworkDirectory =
|
|
34906
|
+
const frameworkDirectory = import_path6.default.join(
|
|
35139
34907
|
workPath,
|
|
35140
|
-
|
|
34908
|
+
import_path6.default.dirname(entrypoint)
|
|
35141
34909
|
);
|
|
35142
34910
|
switch (framework.slug) {
|
|
35143
34911
|
case "nuxtjs":
|
|
35144
34912
|
await injectVercelAnalyticsPlugin(frameworkDirectory);
|
|
35145
34913
|
break;
|
|
35146
34914
|
default:
|
|
35147
|
-
(0,
|
|
34915
|
+
(0, import_build_utils4.debug)(
|
|
35148
34916
|
`No Web Vitals plugin injected for framework ${framework.slug}`
|
|
35149
34917
|
);
|
|
35150
34918
|
break;
|
|
35151
34919
|
}
|
|
35152
34920
|
}
|
|
35153
34921
|
}
|
|
35154
|
-
const nodeVersion = await (0,
|
|
34922
|
+
const nodeVersion = await (0, import_build_utils4.getNodeVersion)(
|
|
35155
34923
|
entrypointDir,
|
|
35156
34924
|
void 0,
|
|
35157
34925
|
config,
|
|
@@ -35162,8 +34930,8 @@ var build = async ({
|
|
|
35162
34930
|
lockfileVersion,
|
|
35163
34931
|
packageJsonPackageManager,
|
|
35164
34932
|
turboSupportsCorepackHome
|
|
35165
|
-
} = await (0,
|
|
35166
|
-
const spawnEnv = (0,
|
|
34933
|
+
} = await (0, import_build_utils4.scanParentDirs)(entrypointDir, true);
|
|
34934
|
+
const spawnEnv = (0, import_build_utils4.getEnvForPackageManager)({
|
|
35167
34935
|
cliType,
|
|
35168
34936
|
lockfileVersion,
|
|
35169
34937
|
packageJsonPackageManager,
|
|
@@ -35175,7 +34943,7 @@ var build = async ({
|
|
|
35175
34943
|
spawnEnv.CI = "false";
|
|
35176
34944
|
}
|
|
35177
34945
|
if (meta.isDev) {
|
|
35178
|
-
(0,
|
|
34946
|
+
(0, import_build_utils4.debug)("Skipping dependency installation because dev mode is enabled");
|
|
35179
34947
|
} else {
|
|
35180
34948
|
let hasPrintedInstall = false;
|
|
35181
34949
|
const printInstall = () => {
|
|
@@ -35185,8 +34953,8 @@ var build = async ({
|
|
|
35185
34953
|
}
|
|
35186
34954
|
};
|
|
35187
34955
|
if (!config.zeroConfig) {
|
|
35188
|
-
(0,
|
|
35189
|
-
await (0,
|
|
34956
|
+
(0, import_build_utils4.debug)('Detected "builds" - not zero config');
|
|
34957
|
+
await (0, import_build_utils4.runNpmInstall)(
|
|
35190
34958
|
entrypointDir,
|
|
35191
34959
|
[],
|
|
35192
34960
|
{ env: spawnEnv },
|
|
@@ -35197,7 +34965,7 @@ var build = async ({
|
|
|
35197
34965
|
} else if (typeof installCommand === "string") {
|
|
35198
34966
|
if (installCommand.trim()) {
|
|
35199
34967
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
35200
|
-
await (0,
|
|
34968
|
+
await (0, import_build_utils4.execCommand)(installCommand, {
|
|
35201
34969
|
env: spawnEnv,
|
|
35202
34970
|
cwd: entrypointDir
|
|
35203
34971
|
});
|
|
@@ -35208,11 +34976,11 @@ var build = async ({
|
|
|
35208
34976
|
console.log(`Skipping "install" command...`);
|
|
35209
34977
|
}
|
|
35210
34978
|
} else {
|
|
35211
|
-
if ((0,
|
|
35212
|
-
(0,
|
|
34979
|
+
if ((0, import_fs4.existsSync)(gemfilePath)) {
|
|
34980
|
+
(0, import_build_utils4.debug)("Detected Gemfile");
|
|
35213
34981
|
printInstall();
|
|
35214
34982
|
const opts = {
|
|
35215
|
-
env: (0,
|
|
34983
|
+
env: (0, import_build_utils4.cloneEnv)(process.env, {
|
|
35216
34984
|
// See more: https://github.com/rubygems/rubygems/blob/a82d04856deba58be6b90f681a5e42a7c0f2baa7/bundler/lib/bundler/man/bundle-config.1.ronn
|
|
35217
34985
|
BUNDLE_BIN: "vendor/bin",
|
|
35218
34986
|
BUNDLE_CACHE_PATH: "vendor/cache",
|
|
@@ -35224,13 +34992,13 @@ var build = async ({
|
|
|
35224
34992
|
BUNDLE_DISABLE_VERSION_CHECK: "1"
|
|
35225
34993
|
})
|
|
35226
34994
|
};
|
|
35227
|
-
await (0,
|
|
34995
|
+
await (0, import_build_utils4.runBundleInstall)(workPath, [], opts, meta);
|
|
35228
34996
|
isBundleInstall = true;
|
|
35229
34997
|
}
|
|
35230
|
-
if ((0,
|
|
35231
|
-
(0,
|
|
34998
|
+
if ((0, import_fs4.existsSync)(requirementsPath)) {
|
|
34999
|
+
(0, import_build_utils4.debug)("Detected requirements.txt");
|
|
35232
35000
|
printInstall();
|
|
35233
|
-
const pipResult = await (0,
|
|
35001
|
+
const pipResult = await (0, import_build_utils4.runPipInstall)(
|
|
35234
35002
|
workPath,
|
|
35235
35003
|
["-r", requirementsPath],
|
|
35236
35004
|
void 0,
|
|
@@ -35242,7 +35010,7 @@ var build = async ({
|
|
|
35242
35010
|
}
|
|
35243
35011
|
}
|
|
35244
35012
|
if (pkg) {
|
|
35245
|
-
await (0,
|
|
35013
|
+
await (0, import_build_utils4.runNpmInstall)(
|
|
35246
35014
|
entrypointDir,
|
|
35247
35015
|
[],
|
|
35248
35016
|
{ env: spawnEnv },
|
|
@@ -35259,39 +35027,39 @@ var build = async ({
|
|
|
35259
35027
|
let gemHome = void 0;
|
|
35260
35028
|
const pathList = [];
|
|
35261
35029
|
if (isNpmInstall || pkg && (buildCommand || devCommand)) {
|
|
35262
|
-
const nodeBinPaths = (0,
|
|
35030
|
+
const nodeBinPaths = (0, import_build_utils4.getNodeBinPaths)({
|
|
35263
35031
|
start: entrypointDir,
|
|
35264
35032
|
base: repoRootPath
|
|
35265
35033
|
});
|
|
35266
35034
|
pathList.push(...nodeBinPaths);
|
|
35267
|
-
(0,
|
|
35035
|
+
(0, import_build_utils4.debug)(
|
|
35268
35036
|
`Added "${nodeBinPaths.join(
|
|
35269
|
-
|
|
35037
|
+
import_path6.default.delimiter
|
|
35270
35038
|
)}" to PATH env because a package.json file was found`
|
|
35271
35039
|
);
|
|
35272
35040
|
}
|
|
35273
35041
|
if (isBundleInstall) {
|
|
35274
|
-
const vendorBin =
|
|
35042
|
+
const vendorBin = import_path6.default.join(workPath, "vendor", "bin");
|
|
35275
35043
|
pathList.push(vendorBin);
|
|
35276
|
-
(0,
|
|
35277
|
-
const dir =
|
|
35044
|
+
(0, import_build_utils4.debug)(`Added "${vendorBin}" to PATH env because a Gemfile was found`);
|
|
35045
|
+
const dir = import_path6.default.join(workPath, "vendor", "bundle", "ruby");
|
|
35278
35046
|
const rubyVersion = (0, import_child_process.spawnSync)(
|
|
35279
35047
|
"ruby",
|
|
35280
35048
|
["-e", 'print "#{ RUBY_VERSION }"'],
|
|
35281
35049
|
{ encoding: "utf8" }
|
|
35282
35050
|
);
|
|
35283
35051
|
if (rubyVersion.status === 0 && typeof rubyVersion.stdout === "string") {
|
|
35284
|
-
gemHome =
|
|
35285
|
-
(0,
|
|
35286
|
-
const gemBin =
|
|
35052
|
+
gemHome = import_path6.default.join(dir, rubyVersion.stdout.trim());
|
|
35053
|
+
(0, import_build_utils4.debug)(`Set GEM_HOME="${gemHome}" because a Gemfile was found`);
|
|
35054
|
+
const gemBin = import_path6.default.join(gemHome, "bin");
|
|
35287
35055
|
pathList.push(gemBin);
|
|
35288
|
-
(0,
|
|
35056
|
+
(0, import_build_utils4.debug)(`Added "${gemBin}" to PATH env because a Gemfile was found`);
|
|
35289
35057
|
}
|
|
35290
35058
|
}
|
|
35291
35059
|
if (isPipInstall && pipTargetDir) {
|
|
35292
|
-
const pipBinDir =
|
|
35060
|
+
const pipBinDir = import_path6.default.join(pipTargetDir, "bin");
|
|
35293
35061
|
pathList.push(pipBinDir);
|
|
35294
|
-
(0,
|
|
35062
|
+
(0, import_build_utils4.debug)(
|
|
35295
35063
|
`Added "${pipBinDir}" to PATH env because a requirements.txt was found`
|
|
35296
35064
|
);
|
|
35297
35065
|
}
|
|
@@ -35301,21 +35069,21 @@ var build = async ({
|
|
|
35301
35069
|
let pythonPath;
|
|
35302
35070
|
if (isPipInstall && pipTargetDir) {
|
|
35303
35071
|
const existingPythonPath = process.env.PYTHONPATH;
|
|
35304
|
-
pythonPath = existingPythonPath ? `${pipTargetDir}${
|
|
35305
|
-
(0,
|
|
35072
|
+
pythonPath = existingPythonPath ? `${pipTargetDir}${import_path6.default.delimiter}${existingPythonPath}` : pipTargetDir;
|
|
35073
|
+
(0, import_build_utils4.debug)(
|
|
35306
35074
|
`Set PYTHONPATH="${pythonPath}" because a requirements.txt was found`
|
|
35307
35075
|
);
|
|
35308
35076
|
}
|
|
35309
35077
|
const cliEnv = {
|
|
35310
35078
|
...process.env,
|
|
35311
|
-
PATH: pathList.join(
|
|
35079
|
+
PATH: pathList.join(import_path6.default.delimiter),
|
|
35312
35080
|
GEM_HOME: gemHome,
|
|
35313
35081
|
...pythonPath && { PYTHONPATH: pythonPath }
|
|
35314
35082
|
};
|
|
35315
35083
|
if (meta.isDev && (devCommand || pkg && devScript && pkg.scripts && pkg.scripts[devScript])) {
|
|
35316
35084
|
let devPort = nowDevScriptPorts.get(entrypoint);
|
|
35317
35085
|
if (typeof devPort === "number") {
|
|
35318
|
-
(0,
|
|
35086
|
+
(0, import_build_utils4.debug)(
|
|
35319
35087
|
"`%s` server already running for %j",
|
|
35320
35088
|
devCommand || devScript,
|
|
35321
35089
|
entrypoint
|
|
@@ -35329,7 +35097,7 @@ var build = async ({
|
|
|
35329
35097
|
env: { ...cliEnv, PORT: String(devPort) }
|
|
35330
35098
|
};
|
|
35331
35099
|
const cmd = devCommand || `yarn run ${devScript}`;
|
|
35332
|
-
const child = (0,
|
|
35100
|
+
const child = (0, import_build_utils4.spawnCommand)(cmd, opts);
|
|
35333
35101
|
child.on("close", () => nowDevScriptPorts.delete(entrypoint));
|
|
35334
35102
|
nowDevChildProcesses.add(child);
|
|
35335
35103
|
try {
|
|
@@ -35340,7 +35108,7 @@ var build = async ({
|
|
|
35340
35108
|
Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server`
|
|
35341
35109
|
);
|
|
35342
35110
|
}
|
|
35343
|
-
(0,
|
|
35111
|
+
(0, import_build_utils4.debug)("Detected dev server for %j", entrypoint);
|
|
35344
35112
|
}
|
|
35345
35113
|
let srcBase = mountpoint.replace(/^\.\/?/, "");
|
|
35346
35114
|
if (srcBase.length > 0) {
|
|
@@ -35354,26 +35122,13 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
|
|
|
35354
35122
|
);
|
|
35355
35123
|
} else {
|
|
35356
35124
|
if (meta.isDev) {
|
|
35357
|
-
(0,
|
|
35358
|
-
}
|
|
35359
|
-
if (nitroInjectionEligible) {
|
|
35360
|
-
const hasServerEnv = await projectDeclaresViteServerEnvironment(entrypointDir);
|
|
35361
|
-
if (hasServerEnv) {
|
|
35362
|
-
buildCommand = getNitroInjectionBuildCommand();
|
|
35363
|
-
console.log(
|
|
35364
|
-
`Detected \`vite build\` with a server environment but no \`nitro\` dependency. Replacing the build command with \`nitro build --builder vite\` for SSR support.`
|
|
35365
|
-
);
|
|
35366
|
-
} else {
|
|
35367
|
-
(0, import_build_utils5.debug)(
|
|
35368
|
-
"Skipping nitro injection: no SSR-shaped vite environment declared"
|
|
35369
|
-
);
|
|
35370
|
-
}
|
|
35125
|
+
(0, import_build_utils4.debug)(`WARN: A dev script is missing`);
|
|
35371
35126
|
}
|
|
35372
35127
|
if (buildCommand) {
|
|
35373
|
-
(0,
|
|
35128
|
+
(0, import_build_utils4.debug)(`Executing "${buildCommand}"`);
|
|
35374
35129
|
}
|
|
35375
35130
|
try {
|
|
35376
|
-
const found = typeof buildCommand === "string" ? await (0,
|
|
35131
|
+
const found = typeof buildCommand === "string" ? await (0, import_build_utils4.execCommand)(buildCommand, {
|
|
35377
35132
|
// Yarn v2 PnP mode may be activated, so force
|
|
35378
35133
|
// "node-modules" linker style
|
|
35379
35134
|
env: {
|
|
@@ -35381,7 +35136,7 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
|
|
|
35381
35136
|
...cliEnv
|
|
35382
35137
|
},
|
|
35383
35138
|
cwd: entrypointDir
|
|
35384
|
-
}) : await (0,
|
|
35139
|
+
}) : await (0, import_build_utils4.runPackageJsonScript)(
|
|
35385
35140
|
entrypointDir,
|
|
35386
35141
|
["vercel-build", "now-build", "build"],
|
|
35387
35142
|
{ env: cliEnv },
|
|
@@ -35397,7 +35152,7 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
|
|
|
35397
35152
|
cleanupGatsbyFiles(entrypointDir);
|
|
35398
35153
|
}
|
|
35399
35154
|
}
|
|
35400
|
-
const outputDirPrefix =
|
|
35155
|
+
const outputDirPrefix = import_path6.default.join(workPath, import_path6.default.dirname(entrypoint));
|
|
35401
35156
|
distPath = await getUpdatedDistPath(
|
|
35402
35157
|
framework,
|
|
35403
35158
|
outputDirPrefix,
|
|
@@ -35418,18 +35173,6 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
|
|
|
35418
35173
|
if (buildOutputPathV2) {
|
|
35419
35174
|
return await createBuildOutput(workPath);
|
|
35420
35175
|
}
|
|
35421
|
-
const viteDetection = await detectViteServerEnvironments(entrypointDir);
|
|
35422
|
-
if (viteDetection) {
|
|
35423
|
-
(0, import_build_utils5.debug)(
|
|
35424
|
-
`Vite environments path triggered (${viteDetection.environments.map((e) => `${e.name}:${e.consumer}`).join(", ")})`
|
|
35425
|
-
);
|
|
35426
|
-
return await buildViteEnvironments({
|
|
35427
|
-
workPath: entrypointDir,
|
|
35428
|
-
repoRootPath,
|
|
35429
|
-
nodeVersion,
|
|
35430
|
-
detection: viteDetection
|
|
35431
|
-
});
|
|
35432
|
-
}
|
|
35433
35176
|
const extraOutputs = await readBuildOutputDirectory({
|
|
35434
35177
|
workPath,
|
|
35435
35178
|
nodeVersion
|
|
@@ -35471,19 +35214,19 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
|
|
|
35471
35214
|
"package.json",
|
|
35472
35215
|
".vercel_build_output"
|
|
35473
35216
|
];
|
|
35474
|
-
(0,
|
|
35217
|
+
(0, import_build_utils4.debug)(`Using ignore: ${JSON.stringify(ignore)}`);
|
|
35475
35218
|
}
|
|
35476
|
-
output = await (0,
|
|
35219
|
+
output = await (0, import_build_utils4.glob)("**", { cwd: distPath, ignore }, mountpoint);
|
|
35477
35220
|
Object.assign(output, extraOutputs.functions);
|
|
35478
35221
|
}
|
|
35479
35222
|
}
|
|
35480
35223
|
return { routes, images, output };
|
|
35481
35224
|
}
|
|
35482
35225
|
if (!config.zeroConfig && entrypoint.endsWith(".sh")) {
|
|
35483
|
-
(0,
|
|
35484
|
-
await (0,
|
|
35226
|
+
(0, import_build_utils4.debug)(`Running build script "${entrypoint}"`);
|
|
35227
|
+
await (0, import_build_utils4.runShellScript)(import_path6.default.join(workPath, entrypoint));
|
|
35485
35228
|
validateDistDir(distPath, workPath);
|
|
35486
|
-
const output = await (0,
|
|
35229
|
+
const output = await (0, import_build_utils4.glob)("**", distPath, mountpoint);
|
|
35487
35230
|
return {
|
|
35488
35231
|
output,
|
|
35489
35232
|
routes: []
|
|
@@ -35505,7 +35248,7 @@ var prepareCache = async ({
|
|
|
35505
35248
|
const configV3 = await readConfig(workPath);
|
|
35506
35249
|
if (configV3?.cache && Array.isArray(configV3.cache)) {
|
|
35507
35250
|
for (const cacheGlob of configV3.cache) {
|
|
35508
|
-
Object.assign(cacheFiles, await (0,
|
|
35251
|
+
Object.assign(cacheFiles, await (0, import_build_utils4.glob)(cacheGlob, workPath));
|
|
35509
35252
|
}
|
|
35510
35253
|
return cacheFiles;
|
|
35511
35254
|
}
|
|
@@ -35515,22 +35258,22 @@ var prepareCache = async ({
|
|
|
35515
35258
|
});
|
|
35516
35259
|
if (buildConfigV1?.cache && Array.isArray(buildConfigV1.cache)) {
|
|
35517
35260
|
for (const cacheGlob of buildConfigV1.cache) {
|
|
35518
|
-
Object.assign(cacheFiles, await (0,
|
|
35261
|
+
Object.assign(cacheFiles, await (0, import_build_utils4.glob)(cacheGlob, workPath));
|
|
35519
35262
|
}
|
|
35520
35263
|
return cacheFiles;
|
|
35521
35264
|
}
|
|
35522
35265
|
Object.assign(
|
|
35523
35266
|
cacheFiles,
|
|
35524
|
-
await (0,
|
|
35267
|
+
await (0, import_build_utils4.glob)(import_build_utils4.defaultCachePathGlob, repoRootPath || workPath)
|
|
35525
35268
|
);
|
|
35526
35269
|
Object.assign(
|
|
35527
35270
|
cacheFiles,
|
|
35528
|
-
await (0,
|
|
35271
|
+
await (0, import_build_utils4.glob)("**/.shadow-cljs/**", repoRootPath || workPath)
|
|
35529
35272
|
);
|
|
35530
35273
|
const pkg = getPkg(entrypoint, workPath);
|
|
35531
35274
|
const framework = getFramework(config, pkg);
|
|
35532
35275
|
if (framework?.cachePattern) {
|
|
35533
|
-
Object.assign(cacheFiles, await (0,
|
|
35276
|
+
Object.assign(cacheFiles, await (0, import_build_utils4.glob)(framework.cachePattern, workPath));
|
|
35534
35277
|
}
|
|
35535
35278
|
return cacheFiles;
|
|
35536
35279
|
};
|