vercel 58.10.0 → 59.0.0
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/chunks/{add-5KFK4EFH.js → add-3LO3UMYC.js} +6 -6
- package/dist/chunks/{add-W4XR5GYX.js → add-QZUQNL2C.js} +2 -2
- package/dist/chunks/{add-NMYLVDBN.js → add-SQ6ERCFZ.js} +2 -2
- package/dist/chunks/{build-BCMSG7TU.js → build-WMUKZEFH.js} +2 -2
- package/dist/chunks/{chunk-IBIZT5M4.js → chunk-3R5JGMHV.js} +62 -20
- package/dist/chunks/{chunk-CLUCO4RD.js → chunk-5KI3SUJI.js} +81 -18
- package/dist/chunks/{chunk-MGCBTAA7.js → chunk-BGILSKZ5.js} +1 -1
- package/dist/chunks/{chunk-BZGIBXY6.js → chunk-CMR5KQVR.js} +1 -1
- package/dist/chunks/{chunk-AZCZV4XI.js → chunk-DMLU5KQE.js} +1 -1
- package/dist/chunks/chunk-DQDJVHA5.js +559 -0
- package/dist/chunks/{chunk-UDHYVIJL.js → chunk-L6NIIAB7.js} +4 -4
- package/dist/chunks/{chunk-2J7BL7IF.js → chunk-LT5UQNTC.js} +2 -2
- package/dist/chunks/{chunk-MAZ2BUBX.js → chunk-MZ3L3SGZ.js} +2 -2
- package/dist/chunks/{chunk-5MERQE7H.js → chunk-N5DK7EMY.js} +1 -1
- package/dist/chunks/{chunk-KUZCVMVA.js → chunk-PBECT5BN.js} +4 -3
- package/dist/chunks/{chunk-N5YCPDWG.js → chunk-PSZQNYEV.js} +1 -1
- package/dist/chunks/{chunk-6SXIT6Q3.js → chunk-PVCJIMVY.js} +2 -2
- package/dist/chunks/{chunk-H25BISPQ.js → chunk-QGQX7BYN.js} +10 -518
- package/dist/chunks/{chunk-PTZ6X4P4.js → chunk-RWRSUGXY.js} +1 -1
- package/dist/chunks/{chunk-TNKTZDOL.js → chunk-S3H7ITUR.js} +1 -1
- package/dist/chunks/{chunk-U4LWFSR4.js → chunk-SD2QZHZA.js} +1 -1
- package/dist/chunks/{chunk-2SEBBSKD.js → chunk-SHR6DYA5.js} +1 -1
- package/dist/chunks/{chunk-DQDAQYQI.js → chunk-SQAQED4U.js} +1 -1
- package/dist/chunks/{chunk-NDOZRKTB.js → chunk-UQVOFOP2.js} +1 -1
- package/dist/chunks/{chunk-L6BFCLXF.js → chunk-V42UVZDX.js} +80 -38
- package/dist/chunks/chunk-W34XLJ44.js +61 -0
- package/dist/chunks/{chunk-6WWATEWK.js → chunk-WE3TFESA.js} +1 -1
- package/dist/chunks/{chunk-ELJ56NBY.js → chunk-ZFTRB6AB.js} +173 -173
- package/dist/chunks/{chunk-7RUZPHW7.js → chunk-ZRWSSPW5.js} +1 -1
- package/dist/chunks/{clear-54WX3NA2.js → clear-W2B4CHTP.js} +2 -2
- package/dist/chunks/{compile-vercel-config-LSW4TWGX.js → compile-vercel-config-HTWOS7DZ.js} +1 -1
- package/dist/chunks/{config-WXQTPQW7.js → config-EGJY4UUE.js} +2 -2
- package/dist/chunks/{delete-OGP3RVWM.js → delete-6I7V5AGV.js} +2 -2
- package/dist/chunks/{delete-HQMI44SG.js → delete-BVMID4W2.js} +2 -2
- package/dist/chunks/{disable-HC266OB7.js → disable-I54JNXJE.js} +2 -2
- package/dist/chunks/{discard-3RFIPLXY.js → discard-6TSJJCUQ.js} +2 -2
- package/dist/chunks/{edit-TZOCRGG6.js → edit-KCWYQ2YT.js} +2 -2
- package/dist/chunks/{edit-NXPQFWM6.js → edit-YS2SWHFJ.js} +3 -3
- package/dist/chunks/{enable-OGFRN4CG.js → enable-RYXRIGQN.js} +2 -2
- package/dist/chunks/{export-AEESZFZX.js → export-G3NYOADE.js} +2 -2
- package/dist/chunks/{image-EIAO7LVN.js → image-RJBLSUES.js} +3 -3
- package/dist/chunks/{import-builders-KCQLA2YR.js → import-builders-M6F3F4DH.js} +2 -2
- package/dist/chunks/{inspect-RUGPLO7A.js → inspect-7XUEVBDM.js} +2 -2
- package/dist/chunks/{inspect-MGIECVLH.js → inspect-AE4YIJYS.js} +2 -2
- package/dist/chunks/{inspect-TTHC6L7Q.js → inspect-E7TBGK7D.js} +2 -2
- package/dist/chunks/{inspect-HHSDXTII.js → inspect-YTCVTZHY.js} +2 -2
- package/dist/chunks/{inspect-EM34BOTE.js → inspect-Z74NZZ2A.js} +3 -3
- package/dist/chunks/{list-A74MGEOB.js → list-KJNC3NOE.js} +2 -2
- package/dist/chunks/{list-GQDUIRBU.js → list-SGPLL4KJ.js} +3 -3
- package/dist/chunks/{list-EOG3TYBE.js → list-WXS2AFQD.js} +1 -1
- package/dist/chunks/{login-L4EWZOGH.js → login-XD3CFPBF.js} +2 -2
- package/dist/chunks/{ls-F6WCPVB7.js → ls-5A4327XJ.js} +2 -2
- package/dist/chunks/{ls-OWHNAGNT.js → ls-5DSOTTYX.js} +2 -2
- package/dist/chunks/{ls-OJGSWVWO.js → ls-KE5I7BZO.js} +2 -2
- package/dist/chunks/{ls-D5ESYWG5.js → ls-NBKSDTWX.js} +2 -2
- package/dist/chunks/{ls-VBFBWSWD.js → ls-SVSO3677.js} +3 -3
- package/dist/chunks/{open-FHER5QV2.js → open-M2MOAE2K.js} +2 -2
- package/dist/chunks/{permissions-JSXC7BRD.js → permissions-ADPY554K.js} +4 -4
- package/dist/chunks/{publish-CM6ZGWIE.js → publish-OBIOOL7T.js} +2 -2
- package/dist/chunks/{push-5NYG7HIR.js → push-5237XBTO.js} +2 -2
- package/dist/chunks/{query-5GQLF2BR.js → query-ILL74HIA.js} +1 -1
- package/dist/chunks/{reorder-5GCNY75W.js → reorder-GAUAO4LW.js} +2 -2
- package/dist/chunks/{reply-B2XCK5XR.js → reply-IZJHEULD.js} +2 -2
- package/dist/chunks/{resolve-YQP5C2QY.js → resolve-HTIT7CGL.js} +2 -2
- package/dist/chunks/{restore-VHX4JV5J.js → restore-IKL74HSE.js} +2 -2
- package/dist/chunks/{rm-VDFSX3LH.js → rm-5Y6BL47T.js} +2 -2
- package/dist/chunks/{rm-AUUT2YIT.js → rm-C37ZORQV.js} +2 -2
- package/dist/chunks/{rm-QVVQDCDX.js → rm-QAVNP5KX.js} +3 -3
- package/dist/chunks/{rm-OILUGCTW.js → rm-XJU5SBGH.js} +2 -2
- package/dist/chunks/{rule-inspect-LKTUPW4B.js → rule-inspect-DYHWWROS.js} +3 -3
- package/dist/chunks/{rules-J5JM5VFQ.js → rules-M6EJ2Y6S.js} +6 -6
- package/dist/chunks/{schema-OIKSCLDU.js → schema-LLBDZNIC.js} +1 -1
- package/dist/chunks/{tags-AMTMNRLQ.js → tags-HR5RVQFA.js} +2 -2
- package/dist/chunks/{update-AFL3GHKB.js → update-6A5V6HBH.js} +6 -6
- package/dist/commands/build/index.js +15 -11
- package/dist/commands/deploy/index.js +347 -49
- package/dist/commands/dev/index.js +8 -8
- package/dist/commands/env/index.js +4 -4
- package/dist/commands/link/index.js +6 -6
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +2111 -1619
- package/dist/index.js +32 -42
- package/dist/version.mjs +1 -1
- package/package.json +35 -35
- package/dist/chunks/chunk-I2XE3GMB.js +0 -21
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
require_dist as require_dist2,
|
|
10
10
|
require_dist3,
|
|
11
11
|
require_lib
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3R5JGMHV.js";
|
|
13
13
|
import {
|
|
14
14
|
output_manager_default,
|
|
15
15
|
require_dist
|
|
@@ -9916,126 +9916,8 @@ var require_lib3 = __commonJS({
|
|
|
9916
9916
|
}
|
|
9917
9917
|
});
|
|
9918
9918
|
|
|
9919
|
-
// src/util/get-files.ts
|
|
9920
|
-
var import_fs_extra = __toESM(require_lib(), 1);
|
|
9921
|
-
var import_client = __toESM(require_dist2(), 1);
|
|
9922
|
-
import { resolve } from "path";
|
|
9923
|
-
|
|
9924
|
-
// src/util/unique-strings.ts
|
|
9925
|
-
var unique_strings_default = (arr) => {
|
|
9926
|
-
const len = arr.length;
|
|
9927
|
-
const res = [];
|
|
9928
|
-
const o = {};
|
|
9929
|
-
let i;
|
|
9930
|
-
for (i = 0; i < len; i += 1) {
|
|
9931
|
-
o[arr[i]] = o[arr[i]] || res.push(arr[i]);
|
|
9932
|
-
}
|
|
9933
|
-
return res;
|
|
9934
|
-
};
|
|
9935
|
-
|
|
9936
|
-
// src/util/get-files.ts
|
|
9937
|
-
function flatten(arr, res = []) {
|
|
9938
|
-
for (const cur of arr) {
|
|
9939
|
-
if (Array.isArray(cur)) {
|
|
9940
|
-
flatten(cur, res);
|
|
9941
|
-
} else {
|
|
9942
|
-
res.push(cur);
|
|
9943
|
-
}
|
|
9944
|
-
}
|
|
9945
|
-
return res;
|
|
9946
|
-
}
|
|
9947
|
-
var asAbsolute = function(path2, parent) {
|
|
9948
|
-
if (path2[0] === "/") {
|
|
9949
|
-
return path2;
|
|
9950
|
-
}
|
|
9951
|
-
return resolve(parent, path2);
|
|
9952
|
-
};
|
|
9953
|
-
async function staticFiles(path2, { src }) {
|
|
9954
|
-
const { debug, time } = output_manager_default;
|
|
9955
|
-
let files = [];
|
|
9956
|
-
const source = src || ".";
|
|
9957
|
-
const search = resolve(path2, source);
|
|
9958
|
-
const { ig } = await (0, import_client.getVercelIgnore)(path2);
|
|
9959
|
-
const filter = ig.createFilter();
|
|
9960
|
-
const prefixLength = path2.length + 1;
|
|
9961
|
-
const accepts = (file) => {
|
|
9962
|
-
const relativePath = file.slice(prefixLength);
|
|
9963
|
-
if (relativePath === "") {
|
|
9964
|
-
return true;
|
|
9965
|
-
}
|
|
9966
|
-
const accepted = filter(relativePath);
|
|
9967
|
-
if (!accepted) {
|
|
9968
|
-
debug(`Ignoring ${file}`);
|
|
9969
|
-
}
|
|
9970
|
-
return accepted;
|
|
9971
|
-
};
|
|
9972
|
-
files = await time(
|
|
9973
|
-
`Locating files ${path2}`,
|
|
9974
|
-
explode([search], {
|
|
9975
|
-
accepts
|
|
9976
|
-
})
|
|
9977
|
-
);
|
|
9978
|
-
return unique_strings_default(files);
|
|
9979
|
-
}
|
|
9980
|
-
async function explode(paths, { accepts }) {
|
|
9981
|
-
const { debug } = output_manager_default;
|
|
9982
|
-
const list = async (file) => {
|
|
9983
|
-
let path2 = file;
|
|
9984
|
-
let s;
|
|
9985
|
-
if (!accepts(file)) {
|
|
9986
|
-
return null;
|
|
9987
|
-
}
|
|
9988
|
-
try {
|
|
9989
|
-
s = await import_fs_extra.default.stat(path2);
|
|
9990
|
-
} catch (_e) {
|
|
9991
|
-
path2 = `${file}.js`;
|
|
9992
|
-
try {
|
|
9993
|
-
s = await import_fs_extra.default.stat(path2);
|
|
9994
|
-
} catch (_e2) {
|
|
9995
|
-
debug(`Ignoring invalid file ${file}`);
|
|
9996
|
-
return null;
|
|
9997
|
-
}
|
|
9998
|
-
}
|
|
9999
|
-
if (s.isDirectory()) {
|
|
10000
|
-
let all;
|
|
10001
|
-
try {
|
|
10002
|
-
all = await import_fs_extra.default.readdir(file);
|
|
10003
|
-
} catch (err) {
|
|
10004
|
-
const code = err instanceof Error && "code" in err ? err.code : void 0;
|
|
10005
|
-
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
10006
|
-
debug(`Ignoring directory that has since been removed ${file}`);
|
|
10007
|
-
return null;
|
|
10008
|
-
}
|
|
10009
|
-
throw err;
|
|
10010
|
-
}
|
|
10011
|
-
const recursive = many(all.map((subdir) => asAbsolute(subdir, file)));
|
|
10012
|
-
return recursive;
|
|
10013
|
-
}
|
|
10014
|
-
if (!s.isFile()) {
|
|
10015
|
-
debug(`Ignoring special file ${file}`);
|
|
10016
|
-
return null;
|
|
10017
|
-
}
|
|
10018
|
-
return path2;
|
|
10019
|
-
};
|
|
10020
|
-
const many = (all) => Promise.all(all.map((file) => list(file)));
|
|
10021
|
-
const arrayOfArrays = await many(paths);
|
|
10022
|
-
return flatten(arrayOfArrays).filter(notNull);
|
|
10023
|
-
}
|
|
10024
|
-
function notNull(value) {
|
|
10025
|
-
return value !== null;
|
|
10026
|
-
}
|
|
10027
|
-
|
|
10028
|
-
// src/util/service-schedules.ts
|
|
10029
|
-
var DYNAMIC_SCHEDULE = "<dynamic>";
|
|
10030
|
-
function getStaticServiceSchedules(schedule) {
|
|
10031
|
-
if (!schedule || schedule === DYNAMIC_SCHEDULE) {
|
|
10032
|
-
return [];
|
|
10033
|
-
}
|
|
10034
|
-
return Array.isArray(schedule) ? schedule.filter((item) => item !== DYNAMIC_SCHEDULE) : [schedule];
|
|
10035
|
-
}
|
|
10036
|
-
|
|
10037
9919
|
// src/util/build/write-build-result.ts
|
|
10038
|
-
var
|
|
9920
|
+
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
10039
9921
|
var import_mime_types = __toESM(require_mime_types(), 1);
|
|
10040
9922
|
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
10041
9923
|
var import_promisepipe2 = __toESM(require_promisepipe(), 1);
|
|
@@ -10045,7 +9927,7 @@ import {
|
|
|
10045
9927
|
extname,
|
|
10046
9928
|
join as join2,
|
|
10047
9929
|
relative as relative2,
|
|
10048
|
-
resolve
|
|
9930
|
+
resolve,
|
|
10049
9931
|
posix
|
|
10050
9932
|
} from "path";
|
|
10051
9933
|
import {
|
|
@@ -10063,28 +9945,28 @@ import {
|
|
|
10063
9945
|
|
|
10064
9946
|
// src/util/build/merge.ts
|
|
10065
9947
|
var import_error_utils = __toESM(require_dist(), 1);
|
|
10066
|
-
var
|
|
9948
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
10067
9949
|
import { join, relative } from "path";
|
|
10068
9950
|
async function merge(source, destination, ignoreFilter, sourceRoot) {
|
|
10069
9951
|
const root = sourceRoot || source;
|
|
10070
9952
|
if (ignoreFilter) {
|
|
10071
9953
|
const relPath = relative(root, source);
|
|
10072
9954
|
if (relPath && !ignoreFilter(relPath)) {
|
|
10073
|
-
await (0,
|
|
9955
|
+
await (0, import_fs_extra.remove)(source);
|
|
10074
9956
|
return;
|
|
10075
9957
|
}
|
|
10076
9958
|
}
|
|
10077
|
-
const destStat = await (0,
|
|
9959
|
+
const destStat = await (0, import_fs_extra.stat)(destination).catch(
|
|
10078
9960
|
(err) => err
|
|
10079
9961
|
);
|
|
10080
9962
|
if ((0, import_error_utils.isErrnoException)(destStat)) {
|
|
10081
9963
|
if (destStat.code === "ENOENT") {
|
|
10082
|
-
await (0,
|
|
9964
|
+
await (0, import_fs_extra.move)(source, destination);
|
|
10083
9965
|
return;
|
|
10084
9966
|
}
|
|
10085
9967
|
throw destStat;
|
|
10086
9968
|
} else if (destStat.isDirectory()) {
|
|
10087
|
-
const contents = await (0,
|
|
9969
|
+
const contents = await (0, import_fs_extra.readdir)(
|
|
10088
9970
|
source
|
|
10089
9971
|
).catch((err) => err);
|
|
10090
9972
|
if ((0, import_error_utils.isErrnoException)(contents)) {
|
|
@@ -10097,17 +9979,17 @@ async function merge(source, destination, ignoreFilter, sourceRoot) {
|
|
|
10097
9979
|
(name) => merge(join(source, name), join(destination, name), ignoreFilter, root)
|
|
10098
9980
|
)
|
|
10099
9981
|
);
|
|
10100
|
-
await (0,
|
|
9982
|
+
await (0, import_fs_extra.rmdir)(source);
|
|
10101
9983
|
return;
|
|
10102
9984
|
}
|
|
10103
9985
|
}
|
|
10104
|
-
await (0,
|
|
10105
|
-
await (0,
|
|
9986
|
+
await (0, import_fs_extra.remove)(destination);
|
|
9987
|
+
await (0, import_fs_extra.move)(source, destination);
|
|
10106
9988
|
}
|
|
10107
9989
|
|
|
10108
9990
|
// src/util/build/unzip.ts
|
|
10109
9991
|
var import_promisepipe = __toESM(require_promisepipe(), 1);
|
|
10110
|
-
var
|
|
9992
|
+
var fs = __toESM(require_lib(), 1);
|
|
10111
9993
|
var import_yauzl_promise = __toESM(require_lib3(), 1);
|
|
10112
9994
|
import path from "path";
|
|
10113
9995
|
import { streamToBuffer } from "@vercel/build-utils";
|
|
@@ -10124,8 +10006,8 @@ async function unzip(buffer, dir) {
|
|
|
10124
10006
|
continue;
|
|
10125
10007
|
try {
|
|
10126
10008
|
const destDir = path.dirname(path.join(dir, entry.fileName));
|
|
10127
|
-
await
|
|
10128
|
-
const canonicalDestDir = await
|
|
10009
|
+
await fs.mkdirp(destDir);
|
|
10010
|
+
const canonicalDestDir = await fs.realpath(destDir);
|
|
10129
10011
|
const relativeDestDir = path.relative(dir, canonicalDestDir);
|
|
10130
10012
|
if (relativeDestDir.split(path.sep).includes("..")) {
|
|
10131
10013
|
throw new Error(
|
|
@@ -10159,15 +10041,15 @@ async function extractEntry(zipFile, entry, dir) {
|
|
|
10159
10041
|
if (isDir) {
|
|
10160
10042
|
mkdirOptions.mode = procMode;
|
|
10161
10043
|
}
|
|
10162
|
-
await
|
|
10044
|
+
await fs.mkdir(destDir, mkdirOptions);
|
|
10163
10045
|
if (isDir)
|
|
10164
10046
|
return;
|
|
10165
10047
|
const readStream = await zipFile.openReadStream(entry);
|
|
10166
10048
|
if (symlink2) {
|
|
10167
10049
|
const link = await streamToBuffer(readStream);
|
|
10168
|
-
await
|
|
10050
|
+
await fs.symlink(link.toString("utf8"), dest);
|
|
10169
10051
|
} else {
|
|
10170
|
-
await (0, import_promisepipe.default)(readStream,
|
|
10052
|
+
await (0, import_promisepipe.default)(readStream, fs.createWriteStream(dest, { mode: procMode }));
|
|
10171
10053
|
}
|
|
10172
10054
|
}
|
|
10173
10055
|
function getExtractedMode(entryMode, isDir) {
|
|
@@ -10183,7 +10065,7 @@ function getExtractedMode(entryMode, isDir) {
|
|
|
10183
10065
|
}
|
|
10184
10066
|
|
|
10185
10067
|
// src/util/build/write-build-result.ts
|
|
10186
|
-
var
|
|
10068
|
+
var import_client = __toESM(require_dist2(), 1);
|
|
10187
10069
|
var { normalize } = posix;
|
|
10188
10070
|
var OUTPUT_DIR = join2(VERCEL_DIR, "output");
|
|
10189
10071
|
var BUILD_OUTPUT_API_ENTRIES = [
|
|
@@ -10335,7 +10217,7 @@ async function writeBuildResultV2(args) {
|
|
|
10335
10217
|
return;
|
|
10336
10218
|
}
|
|
10337
10219
|
if (!buildResult.output) {
|
|
10338
|
-
const configFile = vercelConfig?.[
|
|
10220
|
+
const configFile = vercelConfig?.[import_client.fileNameSymbol];
|
|
10339
10221
|
const updateMessage = build.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
|
|
10340
10222
|
throw new Error(
|
|
10341
10223
|
`The build result from "${build.use}" is missing the "output" property.${updateMessage}`
|
|
@@ -10396,7 +10278,7 @@ async function writeBuildResultV2(args) {
|
|
|
10396
10278
|
let usedHardLink = false;
|
|
10397
10279
|
if ("fsPath" in fallback) {
|
|
10398
10280
|
try {
|
|
10399
|
-
await
|
|
10281
|
+
await import_fs_extra2.default.link(fallback.fsPath, fallbackPath);
|
|
10400
10282
|
usedHardLink = true;
|
|
10401
10283
|
} catch (_) {
|
|
10402
10284
|
}
|
|
@@ -10405,7 +10287,7 @@ async function writeBuildResultV2(args) {
|
|
|
10405
10287
|
const stream = fallback.toStream();
|
|
10406
10288
|
await (0, import_promisepipe2.default)(
|
|
10407
10289
|
stream,
|
|
10408
|
-
|
|
10290
|
+
import_fs_extra2.default.createWriteStream(fallbackPath, { mode: fallback.mode })
|
|
10409
10291
|
);
|
|
10410
10292
|
}
|
|
10411
10293
|
fallback = new FileFsRef({
|
|
@@ -10423,7 +10305,7 @@ async function writeBuildResultV2(args) {
|
|
|
10423
10305
|
lambda: void 0,
|
|
10424
10306
|
fallback
|
|
10425
10307
|
};
|
|
10426
|
-
await
|
|
10308
|
+
await import_fs_extra2.default.writeJSON(prerenderConfigPath, prerenderConfig, { spaces: 2 });
|
|
10427
10309
|
} else if (isFile(output)) {
|
|
10428
10310
|
await writeStaticFile(
|
|
10429
10311
|
outputDir,
|
|
@@ -10465,12 +10347,12 @@ async function writeBuildResultV3(args) {
|
|
|
10465
10347
|
const { output } = buildResult;
|
|
10466
10348
|
const routesJsonPath = join2(workPath, ".vercel", "routes.json");
|
|
10467
10349
|
if (isBackendBuilder(build) || build.use === "@vercel/python") {
|
|
10468
|
-
if ((0,
|
|
10350
|
+
if ((0, import_fs_extra2.existsSync)(routesJsonPath)) {
|
|
10469
10351
|
try {
|
|
10470
10352
|
const newOutput = {
|
|
10471
10353
|
index: output
|
|
10472
10354
|
};
|
|
10473
|
-
const routesJson = await
|
|
10355
|
+
const routesJson = await import_fs_extra2.default.readJSON(routesJsonPath);
|
|
10474
10356
|
if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
|
|
10475
10357
|
for (const route of routesJson.routes) {
|
|
10476
10358
|
if (route.source === "/") {
|
|
@@ -10586,13 +10468,13 @@ async function writeStaticFile(outputDir, file, path2, overrides, cleanUrls = fa
|
|
|
10586
10468
|
overrides[fsPath] = override;
|
|
10587
10469
|
}
|
|
10588
10470
|
const dest = join2(outputDir, "static", fsPath);
|
|
10589
|
-
await
|
|
10471
|
+
await import_fs_extra2.default.mkdirp(dirname(dest));
|
|
10590
10472
|
if ("fsPath" in file) {
|
|
10591
|
-
if (
|
|
10473
|
+
if (resolve(file.fsPath) === resolve(dest)) {
|
|
10592
10474
|
return;
|
|
10593
10475
|
}
|
|
10594
10476
|
try {
|
|
10595
|
-
return await
|
|
10477
|
+
return await import_fs_extra2.default.link(file.fsPath, dest);
|
|
10596
10478
|
} catch (_) {
|
|
10597
10479
|
}
|
|
10598
10480
|
}
|
|
@@ -10605,8 +10487,8 @@ async function writeFunctionSymlink(outputDir, dest, fn, existingFunctions) {
|
|
|
10605
10487
|
const destDir = dirname(dest);
|
|
10606
10488
|
const targetDest = join2(outputDir, "functions", `${existingPath}.func`);
|
|
10607
10489
|
const target = relative2(destDir, targetDest);
|
|
10608
|
-
await
|
|
10609
|
-
await
|
|
10490
|
+
await import_fs_extra2.default.mkdirp(destDir);
|
|
10491
|
+
await import_fs_extra2.default.symlink(target, dest);
|
|
10610
10492
|
return true;
|
|
10611
10493
|
}
|
|
10612
10494
|
async function writeContainerImage(outputDir, containerImage, path2, functionConfiguration) {
|
|
@@ -10625,8 +10507,8 @@ async function writeContainerImage(outputDir, containerImage, path2, functionCon
|
|
|
10625
10507
|
const functionFailoverRegions = functionConfiguration?.functionFailoverRegions ?? containerImage.functionFailoverRegions;
|
|
10626
10508
|
const experimentalTriggers = functionConfiguration?.experimentalTriggers ?? containerImage.experimentalTriggers;
|
|
10627
10509
|
const supportsCancellation = functionConfiguration?.supportsCancellation ?? containerImage.supportsCancellation;
|
|
10628
|
-
await
|
|
10629
|
-
await
|
|
10510
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
10511
|
+
await import_fs_extra2.default.writeJSON(
|
|
10630
10512
|
join2(dest, ".vc-config.json"),
|
|
10631
10513
|
{
|
|
10632
10514
|
handler,
|
|
@@ -10658,7 +10540,7 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, e
|
|
|
10658
10540
|
}
|
|
10659
10541
|
existingFunctions.set(edgeFunction, path2);
|
|
10660
10542
|
}
|
|
10661
|
-
await
|
|
10543
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
10662
10544
|
const ops = [];
|
|
10663
10545
|
const { files, filePathMap } = filesWithoutFsRefs(
|
|
10664
10546
|
edgeFunction.files,
|
|
@@ -10676,7 +10558,7 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, e
|
|
|
10676
10558
|
};
|
|
10677
10559
|
const configPath = join2(dest, ".vc-config.json");
|
|
10678
10560
|
ops.push(
|
|
10679
|
-
|
|
10561
|
+
import_fs_extra2.default.writeJSON(configPath, config, {
|
|
10680
10562
|
spaces: 2
|
|
10681
10563
|
})
|
|
10682
10564
|
);
|
|
@@ -10690,7 +10572,7 @@ async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfi
|
|
|
10690
10572
|
}
|
|
10691
10573
|
existingFunctions.set(lambda, path2);
|
|
10692
10574
|
}
|
|
10693
|
-
await
|
|
10575
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
10694
10576
|
const ops = [];
|
|
10695
10577
|
let filePathMap;
|
|
10696
10578
|
if (lambda.files) {
|
|
@@ -10728,27 +10610,27 @@ async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfi
|
|
|
10728
10610
|
};
|
|
10729
10611
|
const configPath = join2(dest, ".vc-config.json");
|
|
10730
10612
|
ops.push(
|
|
10731
|
-
|
|
10613
|
+
import_fs_extra2.default.writeJSON(configPath, config, {
|
|
10732
10614
|
spaces: 2
|
|
10733
10615
|
})
|
|
10734
10616
|
);
|
|
10735
10617
|
await Promise.all(ops);
|
|
10736
10618
|
for await (const dir of findDirs(".vercel", dest)) {
|
|
10737
10619
|
const absDir = join2(dest, dir);
|
|
10738
|
-
const entries = await
|
|
10620
|
+
const entries = await import_fs_extra2.default.readdir(absDir);
|
|
10739
10621
|
if (entries.includes("cache")) {
|
|
10740
10622
|
await Promise.all(
|
|
10741
|
-
entries.filter((e) => e !== "cache").map((entry) =>
|
|
10623
|
+
entries.filter((e) => e !== "cache").map((entry) => import_fs_extra2.default.remove(join2(absDir, entry)))
|
|
10742
10624
|
);
|
|
10743
10625
|
} else {
|
|
10744
|
-
await
|
|
10626
|
+
await import_fs_extra2.default.remove(absDir);
|
|
10745
10627
|
}
|
|
10746
10628
|
}
|
|
10747
10629
|
}
|
|
10748
10630
|
async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDir) {
|
|
10749
|
-
const absOutputDir =
|
|
10750
|
-
const absRootOutputDir =
|
|
10751
|
-
const { ig } = await (0,
|
|
10631
|
+
const absOutputDir = resolve(outputDir);
|
|
10632
|
+
const absRootOutputDir = resolve(rootOutputDir);
|
|
10633
|
+
const { ig } = await (0, import_client.getVercelIgnore)(workPath);
|
|
10752
10634
|
const filter = ig.createFilter();
|
|
10753
10635
|
if (absOutputDir === buildResult.buildOutputPath) {
|
|
10754
10636
|
const staticDir = join2(outputDir, "static");
|
|
@@ -10760,7 +10642,7 @@ async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDi
|
|
|
10760
10642
|
}
|
|
10761
10643
|
return;
|
|
10762
10644
|
}
|
|
10763
|
-
if (
|
|
10645
|
+
if (resolve(buildResult.buildOutputPath) === absRootOutputDir) {
|
|
10764
10646
|
await relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath);
|
|
10765
10647
|
return;
|
|
10766
10648
|
}
|
|
@@ -10774,13 +10656,13 @@ async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDi
|
|
|
10774
10656
|
await merge(buildResult.buildOutputPath, outputDir, ignoreFilter);
|
|
10775
10657
|
}
|
|
10776
10658
|
async function relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath) {
|
|
10777
|
-
const { ig } = await (0,
|
|
10659
|
+
const { ig } = await (0, import_client.getVercelIgnore)(workPath);
|
|
10778
10660
|
const filter = ig.createFilter();
|
|
10779
|
-
await
|
|
10661
|
+
await import_fs_extra2.default.mkdirp(outputDir);
|
|
10780
10662
|
await Promise.all(
|
|
10781
10663
|
BUILD_OUTPUT_API_ENTRIES.map(async (entry) => {
|
|
10782
10664
|
const src = join2(rootOutputDir, entry);
|
|
10783
|
-
if (!await
|
|
10665
|
+
if (!await import_fs_extra2.default.pathExists(src))
|
|
10784
10666
|
return;
|
|
10785
10667
|
const dest = join2(outputDir, entry);
|
|
10786
10668
|
if (entry === "static") {
|
|
@@ -10792,21 +10674,21 @@ async function relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath)
|
|
|
10792
10674
|
);
|
|
10793
10675
|
}
|
|
10794
10676
|
async function cleanIgnoredFiles(dir, staticRoot, filter) {
|
|
10795
|
-
const entries = await
|
|
10677
|
+
const entries = await import_fs_extra2.default.readdir(dir);
|
|
10796
10678
|
await Promise.all(
|
|
10797
10679
|
entries.map(async (entry) => {
|
|
10798
10680
|
const entryPath = join2(dir, entry);
|
|
10799
|
-
const stat2 = await
|
|
10681
|
+
const stat2 = await import_fs_extra2.default.stat(entryPath);
|
|
10800
10682
|
const relativePath = relative2(staticRoot, entryPath);
|
|
10801
10683
|
if (stat2.isDirectory()) {
|
|
10802
10684
|
await cleanIgnoredFiles(entryPath, staticRoot, filter);
|
|
10803
|
-
const remaining = await
|
|
10685
|
+
const remaining = await import_fs_extra2.default.readdir(entryPath);
|
|
10804
10686
|
if (remaining.length === 0) {
|
|
10805
|
-
await
|
|
10687
|
+
await import_fs_extra2.default.rmdir(entryPath);
|
|
10806
10688
|
}
|
|
10807
10689
|
} else if (!filter(relativePath)) {
|
|
10808
10690
|
output_manager_default.debug(`Removing ignored file: ${relativePath}`);
|
|
10809
|
-
await
|
|
10691
|
+
await import_fs_extra2.default.remove(entryPath);
|
|
10810
10692
|
}
|
|
10811
10693
|
})
|
|
10812
10694
|
);
|
|
@@ -10827,7 +10709,7 @@ function getFileExtension(file) {
|
|
|
10827
10709
|
async function* findDirs(name, dir, root = dir) {
|
|
10828
10710
|
let paths;
|
|
10829
10711
|
try {
|
|
10830
|
-
paths = await
|
|
10712
|
+
paths = await import_fs_extra2.default.readdir(dir);
|
|
10831
10713
|
} catch (err) {
|
|
10832
10714
|
if (err.code !== "ENOENT") {
|
|
10833
10715
|
throw err;
|
|
@@ -10838,7 +10720,7 @@ async function* findDirs(name, dir, root = dir) {
|
|
|
10838
10720
|
const abs = join2(dir, path2);
|
|
10839
10721
|
let stat2;
|
|
10840
10722
|
try {
|
|
10841
|
-
stat2 = await
|
|
10723
|
+
stat2 = await import_fs_extra2.default.lstat(abs);
|
|
10842
10724
|
} catch (err) {
|
|
10843
10725
|
if (err.code === "ENOENT")
|
|
10844
10726
|
continue;
|
|
@@ -10879,13 +10761,131 @@ function filesWithoutFsRefs(files, repoRootPath, standalone) {
|
|
|
10879
10761
|
return { files: out, filePathMap };
|
|
10880
10762
|
}
|
|
10881
10763
|
|
|
10764
|
+
// src/util/get-files.ts
|
|
10765
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
10766
|
+
var import_client2 = __toESM(require_dist2(), 1);
|
|
10767
|
+
import { resolve as resolve2 } from "path";
|
|
10768
|
+
|
|
10769
|
+
// src/util/unique-strings.ts
|
|
10770
|
+
var unique_strings_default = (arr) => {
|
|
10771
|
+
const len = arr.length;
|
|
10772
|
+
const res = [];
|
|
10773
|
+
const o = {};
|
|
10774
|
+
let i;
|
|
10775
|
+
for (i = 0; i < len; i += 1) {
|
|
10776
|
+
o[arr[i]] = o[arr[i]] || res.push(arr[i]);
|
|
10777
|
+
}
|
|
10778
|
+
return res;
|
|
10779
|
+
};
|
|
10780
|
+
|
|
10781
|
+
// src/util/get-files.ts
|
|
10782
|
+
function flatten(arr, res = []) {
|
|
10783
|
+
for (const cur of arr) {
|
|
10784
|
+
if (Array.isArray(cur)) {
|
|
10785
|
+
flatten(cur, res);
|
|
10786
|
+
} else {
|
|
10787
|
+
res.push(cur);
|
|
10788
|
+
}
|
|
10789
|
+
}
|
|
10790
|
+
return res;
|
|
10791
|
+
}
|
|
10792
|
+
var asAbsolute = function(path2, parent) {
|
|
10793
|
+
if (path2[0] === "/") {
|
|
10794
|
+
return path2;
|
|
10795
|
+
}
|
|
10796
|
+
return resolve2(parent, path2);
|
|
10797
|
+
};
|
|
10798
|
+
async function staticFiles(path2, { src }) {
|
|
10799
|
+
const { debug, time } = output_manager_default;
|
|
10800
|
+
let files = [];
|
|
10801
|
+
const source = src || ".";
|
|
10802
|
+
const search = resolve2(path2, source);
|
|
10803
|
+
const { ig } = await (0, import_client2.getVercelIgnore)(path2);
|
|
10804
|
+
const filter = ig.createFilter();
|
|
10805
|
+
const prefixLength = path2.length + 1;
|
|
10806
|
+
const accepts = (file) => {
|
|
10807
|
+
const relativePath = file.slice(prefixLength);
|
|
10808
|
+
if (relativePath === "") {
|
|
10809
|
+
return true;
|
|
10810
|
+
}
|
|
10811
|
+
const accepted = filter(relativePath);
|
|
10812
|
+
if (!accepted) {
|
|
10813
|
+
debug(`Ignoring ${file}`);
|
|
10814
|
+
}
|
|
10815
|
+
return accepted;
|
|
10816
|
+
};
|
|
10817
|
+
files = await time(
|
|
10818
|
+
`Locating files ${path2}`,
|
|
10819
|
+
explode([search], {
|
|
10820
|
+
accepts
|
|
10821
|
+
})
|
|
10822
|
+
);
|
|
10823
|
+
return unique_strings_default(files);
|
|
10824
|
+
}
|
|
10825
|
+
async function explode(paths, { accepts }) {
|
|
10826
|
+
const { debug } = output_manager_default;
|
|
10827
|
+
const list = async (file) => {
|
|
10828
|
+
let path2 = file;
|
|
10829
|
+
let s;
|
|
10830
|
+
if (!accepts(file)) {
|
|
10831
|
+
return null;
|
|
10832
|
+
}
|
|
10833
|
+
try {
|
|
10834
|
+
s = await import_fs_extra3.default.stat(path2);
|
|
10835
|
+
} catch (_e) {
|
|
10836
|
+
path2 = `${file}.js`;
|
|
10837
|
+
try {
|
|
10838
|
+
s = await import_fs_extra3.default.stat(path2);
|
|
10839
|
+
} catch (_e2) {
|
|
10840
|
+
debug(`Ignoring invalid file ${file}`);
|
|
10841
|
+
return null;
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
if (s.isDirectory()) {
|
|
10845
|
+
let all;
|
|
10846
|
+
try {
|
|
10847
|
+
all = await import_fs_extra3.default.readdir(file);
|
|
10848
|
+
} catch (err) {
|
|
10849
|
+
const code = err instanceof Error && "code" in err ? err.code : void 0;
|
|
10850
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
10851
|
+
debug(`Ignoring directory that has since been removed ${file}`);
|
|
10852
|
+
return null;
|
|
10853
|
+
}
|
|
10854
|
+
throw err;
|
|
10855
|
+
}
|
|
10856
|
+
const recursive = many(all.map((subdir) => asAbsolute(subdir, file)));
|
|
10857
|
+
return recursive;
|
|
10858
|
+
}
|
|
10859
|
+
if (!s.isFile()) {
|
|
10860
|
+
debug(`Ignoring special file ${file}`);
|
|
10861
|
+
return null;
|
|
10862
|
+
}
|
|
10863
|
+
return path2;
|
|
10864
|
+
};
|
|
10865
|
+
const many = (all) => Promise.all(all.map((file) => list(file)));
|
|
10866
|
+
const arrayOfArrays = await many(paths);
|
|
10867
|
+
return flatten(arrayOfArrays).filter(notNull);
|
|
10868
|
+
}
|
|
10869
|
+
function notNull(value) {
|
|
10870
|
+
return value !== null;
|
|
10871
|
+
}
|
|
10872
|
+
|
|
10873
|
+
// src/util/service-schedules.ts
|
|
10874
|
+
var DYNAMIC_SCHEDULE = "<dynamic>";
|
|
10875
|
+
function getStaticServiceSchedules(schedule) {
|
|
10876
|
+
if (!schedule || schedule === DYNAMIC_SCHEDULE) {
|
|
10877
|
+
return [];
|
|
10878
|
+
}
|
|
10879
|
+
return Array.isArray(schedule) ? schedule.filter((item) => item !== DYNAMIC_SCHEDULE) : [schedule];
|
|
10880
|
+
}
|
|
10881
|
+
|
|
10882
10882
|
export {
|
|
10883
|
-
staticFiles,
|
|
10884
10883
|
require_mime_types,
|
|
10885
|
-
getStaticServiceSchedules,
|
|
10886
10884
|
OUTPUT_DIR,
|
|
10887
10885
|
writeBuildResult,
|
|
10888
|
-
isLambda
|
|
10886
|
+
isLambda,
|
|
10887
|
+
staticFiles,
|
|
10888
|
+
getStaticServiceSchedules
|
|
10889
10889
|
};
|
|
10890
10890
|
/*! Bundled license information:
|
|
10891
10891
|
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
requireVcrRepository,
|
|
14
14
|
resolveVcrScope,
|
|
15
15
|
validateVcrJsonOutput
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WE3TFESA.js";
|
|
17
17
|
import "./chunk-G75NFPIT.js";
|
|
18
18
|
import "./chunk-P65EEFTR.js";
|
|
19
19
|
import "./chunk-KXDWXXJH.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
permissionsClearSubcommand
|
|
22
22
|
} from "./chunk-J6LK45HT.js";
|
|
23
23
|
import "./chunk-R6IGDGX3.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-3R5JGMHV.js";
|
|
25
25
|
import "./chunk-ECCWJHC6.js";
|
|
26
26
|
import {
|
|
27
27
|
AGENT_REASON,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
resolveVcrScope,
|
|
15
15
|
validateVcrChoice,
|
|
16
16
|
validateVcrJsonOutput
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WE3TFESA.js";
|
|
18
18
|
import "./chunk-G75NFPIT.js";
|
|
19
19
|
import {
|
|
20
20
|
outputError
|
|
@@ -27,7 +27,7 @@ import "./chunk-B3JTF4CF.js";
|
|
|
27
27
|
import "./chunk-A5KP5HAI.js";
|
|
28
28
|
import "./chunk-J6LK45HT.js";
|
|
29
29
|
import "./chunk-R6IGDGX3.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-3R5JGMHV.js";
|
|
31
31
|
import "./chunk-ECCWJHC6.js";
|
|
32
32
|
import {
|
|
33
33
|
AGENT_REASON,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveCommentsScope,
|
|
14
14
|
threadNotFoundMessage,
|
|
15
15
|
toApiErrorParts
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RWRSUGXY.js";
|
|
17
17
|
import {
|
|
18
18
|
canPrompt
|
|
19
19
|
} from "./chunk-2473DUBR.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
deleteSubcommand
|
|
28
28
|
} from "./chunk-4LDQIDRM.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-3R5JGMHV.js";
|
|
30
30
|
import "./chunk-ECCWJHC6.js";
|
|
31
31
|
import "./chunk-TJJ562C5.js";
|
|
32
32
|
import "./chunk-GGP5R3FU.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
requireProjectContext,
|
|
16
16
|
resolveRoutes,
|
|
17
17
|
withGlobalFlags
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CMR5KQVR.js";
|
|
19
19
|
import {
|
|
20
20
|
deleteSubcommand
|
|
21
21
|
} from "./chunk-M22O6CYY.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
stamp_default
|
|
24
24
|
} from "./chunk-64IF634X.js";
|
|
25
25
|
import "./chunk-VXYGCOKL.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-3R5JGMHV.js";
|
|
27
27
|
import "./chunk-ECCWJHC6.js";
|
|
28
28
|
import {
|
|
29
29
|
AGENT_REASON,
|