vercel 32.5.6 → 32.6.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/index.js +236 -198
- package/package.json +6 -6
package/dist/index.js
CHANGED
@@ -140,12 +140,12 @@ var require_polyfills = __commonJS2({
|
|
140
140
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
141
141
|
var constants = require("constants");
|
142
142
|
var origCwd = process.cwd;
|
143
|
-
var
|
143
|
+
var cwd2 = null;
|
144
144
|
var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
145
145
|
process.cwd = function() {
|
146
|
-
if (!
|
147
|
-
|
148
|
-
return
|
146
|
+
if (!cwd2)
|
147
|
+
cwd2 = origCwd.call(process);
|
148
|
+
return cwd2;
|
149
149
|
};
|
150
150
|
try {
|
151
151
|
process.cwd();
|
@@ -154,7 +154,7 @@ var require_polyfills = __commonJS2({
|
|
154
154
|
if (typeof process.chdir === "function") {
|
155
155
|
chdir = process.chdir;
|
156
156
|
process.chdir = function(d) {
|
157
|
-
|
157
|
+
cwd2 = null;
|
158
158
|
chdir.call(process, d);
|
159
159
|
};
|
160
160
|
if (Object.setPrototypeOf)
|
@@ -12008,7 +12008,7 @@ var require_ansi_escapes = __commonJS2({
|
|
12008
12008
|
return ret + ":" + buffer.toString("base64") + BEL;
|
12009
12009
|
};
|
12010
12010
|
ansiEscapes4.iTerm = {
|
12011
|
-
setCwd: (
|
12011
|
+
setCwd: (cwd2 = process.cwd()) => `${OSC}50;CurrentDir=${cwd2}${BEL}`,
|
12012
12012
|
annotation: (message2, options = {}) => {
|
12013
12013
|
let ret = `${OSC}1337;`;
|
12014
12014
|
const hasX = typeof options.x !== "undefined";
|
@@ -52631,12 +52631,12 @@ var require_polyfills2 = __commonJS2({
|
|
52631
52631
|
"../../node_modules/.pnpm/graceful-fs@4.2.10/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
52632
52632
|
var constants = require("constants");
|
52633
52633
|
var origCwd = process.cwd;
|
52634
|
-
var
|
52634
|
+
var cwd2 = null;
|
52635
52635
|
var platform2 = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
52636
52636
|
process.cwd = function() {
|
52637
|
-
if (!
|
52638
|
-
|
52639
|
-
return
|
52637
|
+
if (!cwd2)
|
52638
|
+
cwd2 = origCwd.call(process);
|
52639
|
+
return cwd2;
|
52640
52640
|
};
|
52641
52641
|
try {
|
52642
52642
|
process.cwd();
|
@@ -52645,7 +52645,7 @@ var require_polyfills2 = __commonJS2({
|
|
52645
52645
|
if (typeof process.chdir === "function") {
|
52646
52646
|
chdir = process.chdir;
|
52647
52647
|
process.chdir = function(d) {
|
52648
|
-
|
52648
|
+
cwd2 = null;
|
52649
52649
|
chdir.call(process, d);
|
52650
52650
|
};
|
52651
52651
|
if (Object.setPrototypeOf)
|
@@ -63600,7 +63600,7 @@ var require_utils8 = __commonJS2({
|
|
63600
63600
|
}
|
63601
63601
|
return { fileList, ignoreList };
|
63602
63602
|
}
|
63603
|
-
async function getVercelIgnore4(
|
63603
|
+
async function getVercelIgnore4(cwd2, prebuilt) {
|
63604
63604
|
const ig = (0, import_ignore.default)();
|
63605
63605
|
let ignores;
|
63606
63606
|
if (prebuilt) {
|
@@ -63640,12 +63640,12 @@ var require_utils8 = __commonJS2({
|
|
63640
63640
|
"venv",
|
63641
63641
|
"CVS"
|
63642
63642
|
];
|
63643
|
-
const cwds = Array.isArray(
|
63643
|
+
const cwds = Array.isArray(cwd2) ? cwd2 : [cwd2];
|
63644
63644
|
const files = await Promise.all(
|
63645
|
-
cwds.map(async (
|
63645
|
+
cwds.map(async (cwd22) => {
|
63646
63646
|
const [vercelignore, nowignore] = await Promise.all([
|
63647
|
-
maybeRead((0, import_path44.join)(
|
63648
|
-
maybeRead((0, import_path44.join)(
|
63647
|
+
maybeRead((0, import_path44.join)(cwd22, ".vercelignore"), ""),
|
63648
|
+
maybeRead((0, import_path44.join)(cwd22, ".nowignore"), "")
|
63649
63649
|
]);
|
63650
63650
|
if (vercelignore && nowignore) {
|
63651
63651
|
throw new import_build_utils18.NowBuildError({
|
@@ -68228,13 +68228,13 @@ var require_tar_fs = __commonJS2({
|
|
68228
68228
|
var normalize4 = !win32 ? echo : function(name) {
|
68229
68229
|
return name.replace(/\\/g, "/").replace(/[:?<>|]/g, "_");
|
68230
68230
|
};
|
68231
|
-
var statAll = function(fs16, stat2,
|
68231
|
+
var statAll = function(fs16, stat2, cwd2, ignore, entries, sort) {
|
68232
68232
|
var queue = entries || ["."];
|
68233
68233
|
return function loop(callback) {
|
68234
68234
|
if (!queue.length)
|
68235
68235
|
return callback();
|
68236
68236
|
var next = queue.shift();
|
68237
|
-
var nextAbs = path11.join(
|
68237
|
+
var nextAbs = path11.join(cwd2, next);
|
68238
68238
|
stat2(nextAbs, function(err, stat3) {
|
68239
68239
|
if (err)
|
68240
68240
|
return callback(err);
|
@@ -68246,7 +68246,7 @@ var require_tar_fs = __commonJS2({
|
|
68246
68246
|
if (sort)
|
68247
68247
|
files.sort();
|
68248
68248
|
for (var i = 0; i < files.length; i++) {
|
68249
|
-
if (!ignore(path11.join(
|
68249
|
+
if (!ignore(path11.join(cwd2, next, files[i])))
|
68250
68250
|
queue.push(path11.join(next, files[i]));
|
68251
68251
|
}
|
68252
68252
|
callback(null, next, stat3);
|
@@ -68264,16 +68264,16 @@ var require_tar_fs = __commonJS2({
|
|
68264
68264
|
return map(header);
|
68265
68265
|
};
|
68266
68266
|
};
|
68267
|
-
exports2.pack = function(
|
68268
|
-
if (!
|
68269
|
-
|
68267
|
+
exports2.pack = function(cwd2, opts) {
|
68268
|
+
if (!cwd2)
|
68269
|
+
cwd2 = ".";
|
68270
68270
|
if (!opts)
|
68271
68271
|
opts = {};
|
68272
68272
|
var xfs = opts.fs || fs15;
|
68273
68273
|
var ignore = opts.ignore || opts.filter || noop;
|
68274
68274
|
var map = opts.map || noop;
|
68275
68275
|
var mapStream = opts.mapStream || echo;
|
68276
|
-
var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat,
|
68276
|
+
var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd2, ignore, opts.entries, opts.sort);
|
68277
68277
|
var strict = opts.strict !== false;
|
68278
68278
|
var umask = typeof opts.umask === "number" ? ~opts.umask : ~processUmask();
|
68279
68279
|
var dmode = typeof opts.dmode === "number" ? opts.dmode : 0;
|
@@ -68291,7 +68291,7 @@ var require_tar_fs = __commonJS2({
|
|
68291
68291
|
fmode |= parseInt(222, 8);
|
68292
68292
|
}
|
68293
68293
|
var onsymlink = function(filename, header) {
|
68294
|
-
xfs.readlink(path11.join(
|
68294
|
+
xfs.readlink(path11.join(cwd2, filename), function(err, linkname) {
|
68295
68295
|
if (err)
|
68296
68296
|
return pack.destroy(err);
|
68297
68297
|
header.linkname = normalize4(linkname);
|
@@ -68338,7 +68338,7 @@ var require_tar_fs = __commonJS2({
|
|
68338
68338
|
var entry = pack.entry(header, onnextentry);
|
68339
68339
|
if (!entry)
|
68340
68340
|
return;
|
68341
|
-
var rs = mapStream(xfs.createReadStream(path11.join(
|
68341
|
+
var rs = mapStream(xfs.createReadStream(path11.join(cwd2, filename)), header);
|
68342
68342
|
rs.on("error", function(err2) {
|
68343
68343
|
entry.destroy(err2);
|
68344
68344
|
});
|
@@ -68361,9 +68361,9 @@ var require_tar_fs = __commonJS2({
|
|
68361
68361
|
var processUmask = function() {
|
68362
68362
|
return process.umask ? process.umask() : 0;
|
68363
68363
|
};
|
68364
|
-
exports2.extract = function(
|
68365
|
-
if (!
|
68366
|
-
|
68364
|
+
exports2.extract = function(cwd2, opts) {
|
68365
|
+
if (!cwd2)
|
68366
|
+
cwd2 = ".";
|
68367
68367
|
if (!opts)
|
68368
68368
|
opts = {};
|
68369
68369
|
var xfs = opts.fs || fs15;
|
@@ -68429,7 +68429,7 @@ var require_tar_fs = __commonJS2({
|
|
68429
68429
|
extract.on("entry", function(header, stream, next) {
|
68430
68430
|
header = map(header) || header;
|
68431
68431
|
header.name = normalize4(header.name);
|
68432
|
-
var name = path11.join(
|
68432
|
+
var name = path11.join(cwd2, path11.join("/", header.name));
|
68433
68433
|
if (ignore(name, header)) {
|
68434
68434
|
stream.resume();
|
68435
68435
|
return next();
|
@@ -68456,7 +68456,7 @@ var require_tar_fs = __commonJS2({
|
|
68456
68456
|
if (win32)
|
68457
68457
|
return next();
|
68458
68458
|
xfs.unlink(name, function() {
|
68459
|
-
var srcpath = path11.join(
|
68459
|
+
var srcpath = path11.join(cwd2, path11.join("/", header.linkname));
|
68460
68460
|
xfs.link(srcpath, name, function(err) {
|
68461
68461
|
if (err && err.code === "EPERM" && opts.hardlinkAsFilesFallback) {
|
68462
68462
|
stream = xfs.createReadStream(srcpath);
|
@@ -68488,7 +68488,7 @@ var require_tar_fs = __commonJS2({
|
|
68488
68488
|
}, stat2);
|
68489
68489
|
}
|
68490
68490
|
var dir = path11.dirname(name);
|
68491
|
-
validate2(xfs, dir, path11.join(
|
68491
|
+
validate2(xfs, dir, path11.join(cwd2, "."), function(err, valid) {
|
68492
68492
|
if (err)
|
68493
68493
|
return next(err);
|
68494
68494
|
if (!valid)
|
@@ -129966,7 +129966,7 @@ var require_resolveCommand = __commonJS2({
|
|
129966
129966
|
var getPathKey = require_path_key();
|
129967
129967
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
129968
129968
|
const env = parsed.options.env || process.env;
|
129969
|
-
const
|
129969
|
+
const cwd2 = process.cwd();
|
129970
129970
|
const hasCustomCwd = parsed.options.cwd != null;
|
129971
129971
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
129972
129972
|
if (shouldSwitchCwd) {
|
@@ -129984,7 +129984,7 @@ var require_resolveCommand = __commonJS2({
|
|
129984
129984
|
} catch (e2) {
|
129985
129985
|
} finally {
|
129986
129986
|
if (shouldSwitchCwd) {
|
129987
|
-
process.chdir(
|
129987
|
+
process.chdir(cwd2);
|
129988
129988
|
}
|
129989
129989
|
}
|
129990
129990
|
if (resolved) {
|
@@ -145213,8 +145213,8 @@ var require_frameworks = __commonJS2({
|
|
145213
145213
|
placeholder: "`yarn install`, `pnpm install`, `npm install`, or `bun install`"
|
145214
145214
|
},
|
145215
145215
|
buildCommand: {
|
145216
|
-
placeholder: "`npm run build` or `nuxt
|
145217
|
-
value: "nuxt
|
145216
|
+
placeholder: "`npm run build` or `nuxt build`",
|
145217
|
+
value: "nuxt build"
|
145218
145218
|
},
|
145219
145219
|
devCommand: {
|
145220
145220
|
value: "nuxt"
|
@@ -148133,10 +148133,10 @@ var require_detect_framework = __commonJS2({
|
|
148133
148133
|
firstMatchPackage.matchPackage
|
148134
148134
|
);
|
148135
148135
|
}
|
148136
|
-
function lookupInstalledVersion(
|
148136
|
+
function lookupInstalledVersion(cwd2, packageName2) {
|
148137
148137
|
try {
|
148138
148138
|
const script = `require('${packageName2}/package.json').version`;
|
148139
|
-
return (0, import_child_process4.spawnSync)(
|
148139
|
+
return (0, import_child_process4.spawnSync)(cwd2, ["-p", script], {
|
148140
148140
|
encoding: "utf-8"
|
148141
148141
|
}).stdout.trim();
|
148142
148142
|
} catch (error4) {
|
@@ -148575,7 +148575,7 @@ var require_get_workspaces = __commonJS2({
|
|
148575
148575
|
async function getWorkspaces3({
|
148576
148576
|
fs: fs15,
|
148577
148577
|
depth = MAX_DEPTH_TRAVERSE,
|
148578
|
-
cwd = "/"
|
148578
|
+
cwd: cwd2 = "/"
|
148579
148579
|
}) {
|
148580
148580
|
if (depth === 0)
|
148581
148581
|
return [];
|
@@ -148593,7 +148593,7 @@ var require_get_workspaces = __commonJS2({
|
|
148593
148593
|
(childDirectory) => getWorkspaces3({
|
148594
148594
|
fs: fs15.chdir(childDirectory.path),
|
148595
148595
|
depth: depth - 1,
|
148596
|
-
cwd: posixPath.join(
|
148596
|
+
cwd: posixPath.join(cwd2, childDirectory.path)
|
148597
148597
|
})
|
148598
148598
|
)
|
148599
148599
|
)).flat();
|
@@ -148601,7 +148601,7 @@ var require_get_workspaces = __commonJS2({
|
|
148601
148601
|
return [
|
148602
148602
|
{
|
148603
148603
|
type: workspaceType,
|
148604
|
-
rootPath:
|
148604
|
+
rootPath: cwd2
|
148605
148605
|
}
|
148606
148606
|
];
|
148607
148607
|
}
|
@@ -152377,12 +152377,12 @@ var require_common4 = __commonJS2({
|
|
152377
152377
|
self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
|
152378
152378
|
setupIgnores(self2, options);
|
152379
152379
|
self2.changedCwd = false;
|
152380
|
-
var
|
152380
|
+
var cwd2 = process.cwd();
|
152381
152381
|
if (!ownProp(options, "cwd"))
|
152382
|
-
self2.cwd = path11.resolve(
|
152382
|
+
self2.cwd = path11.resolve(cwd2);
|
152383
152383
|
else {
|
152384
152384
|
self2.cwd = path11.resolve(options.cwd);
|
152385
|
-
self2.changedCwd = self2.cwd !==
|
152385
|
+
self2.changedCwd = self2.cwd !== cwd2;
|
152386
152386
|
}
|
152387
152387
|
self2.root = options.root || path11.resolve(self2.cwd, "/");
|
152388
152388
|
self2.root = path11.resolve(self2.root);
|
@@ -163604,16 +163604,19 @@ async function selectOrg(client2, question, autoConfirm) {
|
|
163604
163604
|
value: { type: "team", id: team.id, slug: team.slug }
|
163605
163605
|
}))
|
163606
163606
|
];
|
163607
|
-
const
|
163607
|
+
const defaultChoiceIndex = Math.max(
|
163608
|
+
choices.findIndex((choice) => choice.value.id === currentTeam),
|
163609
|
+
0
|
163610
|
+
);
|
163608
163611
|
if (autoConfirm) {
|
163609
|
-
return choices[
|
163612
|
+
return choices[defaultChoiceIndex].value;
|
163610
163613
|
}
|
163611
163614
|
const answers = await client2.prompt({
|
163612
163615
|
type: "list",
|
163613
163616
|
name: "org",
|
163614
163617
|
message: question,
|
163615
163618
|
choices,
|
163616
|
-
default:
|
163619
|
+
default: defaultChoiceIndex
|
163617
163620
|
});
|
163618
163621
|
const org = answers.org;
|
163619
163622
|
return org;
|
@@ -163672,8 +163675,8 @@ var init_create_project = __esm({
|
|
163672
163675
|
});
|
163673
163676
|
|
163674
163677
|
// src/util/projects/detect-projects.ts
|
163675
|
-
async function detectProjects(
|
163676
|
-
const fs15 = new import_fs_detectors.LocalFileSystemDetector(
|
163678
|
+
async function detectProjects(cwd2) {
|
163679
|
+
const fs15 = new import_fs_detectors.LocalFileSystemDetector(cwd2);
|
163677
163680
|
const workspaces = await (0, import_fs_detectors.getWorkspaces)({ fs: fs15 });
|
163678
163681
|
const detectedProjects = /* @__PURE__ */ new Map();
|
163679
163682
|
const packagePaths = (await Promise.all(
|
@@ -163826,8 +163829,8 @@ var init_connect_git_provider = __esm({
|
|
163826
163829
|
});
|
163827
163830
|
|
163828
163831
|
// src/util/link/repo.ts
|
163829
|
-
async function getRepoLink(client2,
|
163830
|
-
const rootPath = await findRepoRoot(client2,
|
163832
|
+
async function getRepoLink(client2, cwd2) {
|
163833
|
+
const rootPath = await findRepoRoot(client2, cwd2);
|
163831
163834
|
if (!rootPath)
|
163832
163835
|
return void 0;
|
163833
163836
|
const repoConfigPath = (0, import_path14.join)(rootPath, VERCEL_DIR2, VERCEL_DIR_REPO);
|
@@ -163839,9 +163842,9 @@ async function getRepoLink(client2, cwd) {
|
|
163839
163842
|
);
|
163840
163843
|
return { rootPath, repoConfig, repoConfigPath };
|
163841
163844
|
}
|
163842
|
-
async function ensureRepoLink(client2,
|
163845
|
+
async function ensureRepoLink(client2, cwd2, { yes, overwrite }) {
|
163843
163846
|
const { output: output2 } = client2;
|
163844
|
-
const repoLink = await getRepoLink(client2,
|
163847
|
+
const repoLink = await getRepoLink(client2, cwd2);
|
163845
163848
|
if (repoLink) {
|
163846
163849
|
output2.debug(`Found Git repository root directory: ${repoLink.rootPath}`);
|
163847
163850
|
} else {
|
@@ -164146,8 +164149,8 @@ var init_repo = __esm({
|
|
164146
164149
|
});
|
164147
164150
|
|
164148
164151
|
// src/util/projects/link.ts
|
164149
|
-
function getVercelDirectory(
|
164150
|
-
const possibleDirs = [(0, import_path15.join)(
|
164152
|
+
function getVercelDirectory(cwd2) {
|
164153
|
+
const possibleDirs = [(0, import_path15.join)(cwd2, VERCEL_DIR2), (0, import_path15.join)(cwd2, VERCEL_DIR_FALLBACK)];
|
164151
164154
|
const existingDirs = possibleDirs.filter((d) => isDirectory(d));
|
164152
164155
|
if (existingDirs.length > 1) {
|
164153
164156
|
throw new import_build_utils6.NowBuildError({
|
@@ -164390,7 +164393,7 @@ var init_link2 = __esm({
|
|
164390
164393
|
});
|
164391
164394
|
|
164392
164395
|
// src/util/projects/project-settings.ts
|
164393
|
-
async function writeProjectSettings(
|
164396
|
+
async function writeProjectSettings(cwd2, project, org, isRepoLinked) {
|
164394
164397
|
let analyticsId;
|
164395
164398
|
if (project.analytics?.id && (!project.analytics.disabledAt || project.analytics.enabledAt && project.analytics.enabledAt > project.analytics.disabledAt)) {
|
164396
164399
|
analyticsId = project.analytics.id;
|
@@ -164411,7 +164414,7 @@ async function writeProjectSettings(cwd, project, org, isRepoLinked) {
|
|
164411
164414
|
analyticsId
|
164412
164415
|
}
|
164413
164416
|
};
|
164414
|
-
const path11 = (0, import_path16.join)(
|
164417
|
+
const path11 = (0, import_path16.join)(cwd2, VERCEL_DIR2, VERCEL_DIR_PROJECT);
|
164415
164418
|
return await (0, import_fs_extra8.outputJSON)(path11, projectLinkAndSettings, {
|
164416
164419
|
spaces: 2
|
164417
164420
|
});
|
@@ -164621,7 +164624,7 @@ function tryReadHeadSync(path11, length) {
|
|
164621
164624
|
}
|
164622
164625
|
}
|
164623
164626
|
}
|
164624
|
-
async function pull(client2, link4, project, environment, opts, args2, output2,
|
164627
|
+
async function pull(client2, link4, project, environment, opts, args2, output2, cwd2, source) {
|
164625
164628
|
if (args2.length > 1) {
|
164626
164629
|
output2.error(
|
164627
164630
|
`Invalid number of arguments. Usage: ${getCommandName(`env pull <file>`)}`
|
@@ -164629,7 +164632,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
164629
164632
|
return 1;
|
164630
164633
|
}
|
164631
164634
|
const [filename = ".env.local"] = args2;
|
164632
|
-
const fullPath = (0, import_path17.resolve)(
|
164635
|
+
const fullPath = (0, import_path17.resolve)(cwd2, filename);
|
164633
164636
|
const skipConfirmation = opts["--yes"];
|
164634
164637
|
const gitBranch = opts["--git-branch"];
|
164635
164638
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
@@ -164673,7 +164676,7 @@ async function pull(client2, link4, project, environment, opts, args2, output2,
|
|
164673
164676
|
}
|
164674
164677
|
let isGitIgnoreUpdated = false;
|
164675
164678
|
if (filename === ".env.local") {
|
164676
|
-
const rootPath = link4.repoRoot ??
|
164679
|
+
const rootPath = link4.repoRoot ?? cwd2;
|
164677
164680
|
isGitIgnoreUpdated = await addToGitIgnore(rootPath, ".env*.local");
|
164678
164681
|
}
|
164679
164682
|
output2.print(
|
@@ -164845,7 +164848,7 @@ var init_input_project = __esm({
|
|
164845
164848
|
});
|
164846
164849
|
|
164847
164850
|
// src/util/validate-paths.ts
|
164848
|
-
async function validateRootDirectory(output2,
|
164851
|
+
async function validateRootDirectory(output2, cwd2, path11, errorSuffix) {
|
164849
164852
|
const pathStat = await (0, import_fs_extra11.lstat)(path11).catch(() => null);
|
164850
164853
|
const suffix = errorSuffix ? ` ${errorSuffix}` : "";
|
164851
164854
|
if (!pathStat) {
|
@@ -164864,7 +164867,7 @@ async function validateRootDirectory(output2, cwd, path11, errorSuffix) {
|
|
164864
164867
|
);
|
164865
164868
|
return false;
|
164866
164869
|
}
|
164867
|
-
if (!path11.startsWith(
|
164870
|
+
if (!path11.startsWith(cwd2)) {
|
164868
164871
|
output2.error(
|
164869
164872
|
`The provided path ${import_chalk38.default.cyan(
|
164870
164873
|
`\u201C${humanizePath(path11)}\u201D`
|
@@ -164920,7 +164923,7 @@ var init_validate_paths = __esm({
|
|
164920
164923
|
});
|
164921
164924
|
|
164922
164925
|
// src/util/input/input-root-directory.ts
|
164923
|
-
async function inputRootDirectory(client2,
|
164926
|
+
async function inputRootDirectory(client2, cwd2, autoConfirm = false) {
|
164924
164927
|
if (autoConfirm) {
|
164925
164928
|
return null;
|
164926
164929
|
}
|
@@ -164940,10 +164943,10 @@ async function inputRootDirectory(client2, cwd, autoConfirm = false) {
|
|
164940
164943
|
if (normal === "." || normal === "./") {
|
164941
164944
|
return null;
|
164942
164945
|
}
|
164943
|
-
const fullPath = import_path18.default.join(
|
164946
|
+
const fullPath = import_path18.default.join(cwd2, normal);
|
164944
164947
|
if (await validateRootDirectory(
|
164945
164948
|
client2.output,
|
164946
|
-
|
164949
|
+
cwd2,
|
164947
164950
|
fullPath,
|
164948
164951
|
"Please choose a different one."
|
164949
164952
|
) === false) {
|
@@ -165134,14 +165137,14 @@ var init_generate_cert_for_deploy = __esm({
|
|
165134
165137
|
});
|
165135
165138
|
|
165136
165139
|
// src/util/deploy/create-deploy.ts
|
165137
|
-
async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject,
|
165140
|
+
async function createDeploy(client2, now, contextName, path11, createArgs, org, isSettingUpProject, cwd2, archive) {
|
165138
165141
|
try {
|
165139
165142
|
return await now.create(
|
165140
165143
|
path11,
|
165141
165144
|
createArgs,
|
165142
165145
|
org,
|
165143
165146
|
isSettingUpProject,
|
165144
|
-
|
165147
|
+
cwd2,
|
165145
165148
|
archive
|
165146
165149
|
);
|
165147
165150
|
} catch (err) {
|
@@ -165207,7 +165210,7 @@ async function createDeploy(client2, now, contextName, path11, createArgs, org,
|
|
165207
165210
|
createArgs,
|
165208
165211
|
org,
|
165209
165212
|
isSettingUpProject,
|
165210
|
-
|
165213
|
+
cwd2
|
165211
165214
|
);
|
165212
165215
|
}
|
165213
165216
|
if (err.code === "not_found") {
|
@@ -165263,7 +165266,7 @@ function printInspectUrl(output2, inspectorUrl, deployStamp) {
|
|
165263
165266
|
}
|
165264
165267
|
async function processDeployment({
|
165265
165268
|
org,
|
165266
|
-
cwd,
|
165269
|
+
cwd: cwd2,
|
165267
165270
|
projectName,
|
165268
165271
|
isSettingUpProject,
|
165269
165272
|
archive,
|
@@ -165358,7 +165361,7 @@ async function processDeployment({
|
|
165358
165361
|
const deployment = event.payload;
|
165359
165362
|
await linkFolderToProject(
|
165360
165363
|
client2,
|
165361
|
-
|
165364
|
+
cwd2,
|
165362
165365
|
{
|
165363
165366
|
orgId: org.id,
|
165364
165367
|
projectId: deployment.projectId
|
@@ -165519,7 +165522,7 @@ var init_util = __esm({
|
|
165519
165522
|
skipAutoDetectionConfirmation,
|
165520
165523
|
noWait,
|
165521
165524
|
autoAssignCustomDomains
|
165522
|
-
}, org, isSettingUpProject,
|
165525
|
+
}, org, isSettingUpProject, cwd2, archive) {
|
165523
165526
|
let hashes = {};
|
165524
165527
|
const uploadStamp = stamp_default();
|
165525
165528
|
let requestBody = {
|
@@ -165554,7 +165557,7 @@ var init_util = __esm({
|
|
165554
165557
|
isSettingUpProject,
|
165555
165558
|
archive,
|
165556
165559
|
skipAutoDetectionConfirmation,
|
165557
|
-
cwd,
|
165560
|
+
cwd: cwd2,
|
165558
165561
|
prebuilt,
|
165559
165562
|
rootDirectory,
|
165560
165563
|
noWait
|
@@ -166086,14 +166089,14 @@ var init_setup_and_link = __esm({
|
|
166086
166089
|
});
|
166087
166090
|
|
166088
166091
|
// src/util/link/ensure-link.ts
|
166089
|
-
async function ensureLink(commandName, client2,
|
166092
|
+
async function ensureLink(commandName, client2, cwd2, opts = {}) {
|
166090
166093
|
let { link: link4 } = opts;
|
166091
166094
|
if (!link4) {
|
166092
|
-
link4 = await getLinkedProject(client2,
|
166095
|
+
link4 = await getLinkedProject(client2, cwd2);
|
166093
166096
|
opts.link = link4;
|
166094
166097
|
}
|
166095
166098
|
if (link4.status === "linked" && opts.forceDelete || link4.status === "not_linked") {
|
166096
|
-
link4 = await setupAndLink(client2,
|
166099
|
+
link4 = await setupAndLink(client2, cwd2, opts);
|
166097
166100
|
if (link4.status === "not_linked") {
|
166098
166101
|
return 0;
|
166099
166102
|
}
|
@@ -166214,7 +166217,7 @@ function parseArgs(client2) {
|
|
166214
166217
|
}
|
166215
166218
|
return argv2;
|
166216
166219
|
}
|
166217
|
-
async function pullAllEnvFiles(environment, client2, link4, project, argv2,
|
166220
|
+
async function pullAllEnvFiles(environment, client2, link4, project, argv2, cwd2) {
|
166218
166221
|
const environmentFile = `.env.${environment}.local`;
|
166219
166222
|
return pull(
|
166220
166223
|
client2,
|
@@ -166224,7 +166227,7 @@ async function pullAllEnvFiles(environment, client2, link4, project, argv2, cwd)
|
|
166224
166227
|
argv2,
|
166225
166228
|
[(0, import_path20.join)(".vercel", environmentFile)],
|
166226
166229
|
client2.output,
|
166227
|
-
|
166230
|
+
cwd2,
|
166228
166231
|
"vercel-cli:pull"
|
166229
166232
|
);
|
166230
166233
|
}
|
@@ -166241,16 +166244,16 @@ async function main(client2) {
|
|
166241
166244
|
if (typeof argv2 === "number") {
|
166242
166245
|
return argv2;
|
166243
166246
|
}
|
166244
|
-
let
|
166247
|
+
let cwd2 = argv2._[1] || client2.cwd;
|
166245
166248
|
const autoConfirm = Boolean(argv2["--yes"]);
|
166246
166249
|
const environment = parseEnvironment(argv2["--environment"] || void 0);
|
166247
|
-
const link4 = await ensureLink("pull", client2,
|
166250
|
+
const link4 = await ensureLink("pull", client2, cwd2, { autoConfirm });
|
166248
166251
|
if (typeof link4 === "number") {
|
166249
166252
|
return link4;
|
166250
166253
|
}
|
166251
166254
|
const { project, org, repoRoot } = link4;
|
166252
166255
|
if (repoRoot) {
|
166253
|
-
|
166256
|
+
cwd2 = (0, import_path20.join)(repoRoot, project.rootDirectory || "");
|
166254
166257
|
}
|
166255
166258
|
client2.config.currentTeam = org.type === "team" ? org.id : void 0;
|
166256
166259
|
const pullResultCode = await pullAllEnvFiles(
|
@@ -166259,7 +166262,7 @@ async function main(client2) {
|
|
166259
166262
|
link4,
|
166260
166263
|
project,
|
166261
166264
|
argv2,
|
166262
|
-
|
166265
|
+
cwd2
|
166263
166266
|
);
|
166264
166267
|
if (pullResultCode !== 0) {
|
166265
166268
|
return pullResultCode;
|
@@ -166267,12 +166270,12 @@ async function main(client2) {
|
|
166267
166270
|
client2.output.print("\n");
|
166268
166271
|
client2.output.log("Downloading project settings");
|
166269
166272
|
const isRepoLinked = typeof repoRoot === "string";
|
166270
|
-
await writeProjectSettings(
|
166273
|
+
await writeProjectSettings(cwd2, project, org, isRepoLinked);
|
166271
166274
|
const settingsStamp = stamp_default();
|
166272
166275
|
client2.output.print(
|
166273
166276
|
`${prependEmoji(
|
166274
166277
|
`Downloaded project settings to ${import_chalk44.default.bold(
|
166275
|
-
humanizePath((0, import_path20.join)(
|
166278
|
+
humanizePath((0, import_path20.join)(cwd2, VERCEL_DIR2, VERCEL_DIR_PROJECT))
|
166276
166279
|
)} ${import_chalk44.default.gray(settingsStamp())}`,
|
166277
166280
|
emoji("success")
|
166278
166281
|
)}
|
@@ -169702,8 +169705,8 @@ var init_static_builder = __esm({
|
|
169702
169705
|
});
|
169703
169706
|
|
169704
169707
|
// src/util/build/import-builders.ts
|
169705
|
-
async function importBuilders(builderSpecs,
|
169706
|
-
const buildersDir = (0, import_path25.join)(
|
169708
|
+
async function importBuilders(builderSpecs, cwd2, output2) {
|
169709
|
+
const buildersDir = (0, import_path25.join)(cwd2, VERCEL_DIR2, "builders");
|
169707
169710
|
let importResult = await resolveBuilders(buildersDir, builderSpecs, output2);
|
169708
169711
|
if ("buildersToAdd" in importResult) {
|
169709
169712
|
const installResult = await installBuilders(
|
@@ -170158,10 +170161,10 @@ var init_validate_config = __esm({
|
|
170158
170161
|
});
|
170159
170162
|
|
170160
170163
|
// src/util/build/monorepo.ts
|
170161
|
-
async function setMonorepoDefaultSettings(
|
170162
|
-
const localFileSystem = new import_fs_detectors3.LocalFileSystemDetector(
|
170164
|
+
async function setMonorepoDefaultSettings(cwd2, workPath, projectSettings, output2) {
|
170165
|
+
const localFileSystem = new import_fs_detectors3.LocalFileSystemDetector(cwd2);
|
170163
170166
|
const projectName = (0, import_path27.basename)(workPath);
|
170164
|
-
const relativeToRoot = (0, import_path27.relative)(workPath,
|
170167
|
+
const relativeToRoot = (0, import_path27.relative)(workPath, cwd2);
|
170165
170168
|
const setCommand = (command, value) => {
|
170166
170169
|
if (projectSettings[command]) {
|
170167
170170
|
(0, import_build_utils12.debug)(
|
@@ -170174,7 +170177,7 @@ async function setMonorepoDefaultSettings(cwd, workPath, projectSettings, output
|
|
170174
170177
|
try {
|
170175
170178
|
const result = await (0, import_fs_detectors3.getMonorepoDefaultSettings)(
|
170176
170179
|
projectName,
|
170177
|
-
(0, import_path27.relative)(
|
170180
|
+
(0, import_path27.relative)(cwd2, workPath),
|
170178
170181
|
relativeToRoot,
|
170179
170182
|
localFileSystem
|
170180
170183
|
);
|
@@ -170293,7 +170296,7 @@ __export3(build_exports, {
|
|
170293
170296
|
default: () => main2
|
170294
170297
|
});
|
170295
170298
|
async function main2(client2) {
|
170296
|
-
let { cwd } = client2;
|
170299
|
+
let { cwd: cwd2 } = client2;
|
170297
170300
|
const { output: output2 } = client2;
|
170298
170301
|
if (process.env.__VERCEL_BUILD_RUNNING) {
|
170299
170302
|
output2.error(
|
@@ -170323,17 +170326,17 @@ async function main2(client2) {
|
|
170323
170326
|
const target = argv2["--prod"] ? "production" : "preview";
|
170324
170327
|
const yes = Boolean(argv2["--yes"]);
|
170325
170328
|
try {
|
170326
|
-
await (0, import_build_utils13.validateNpmrc)(
|
170329
|
+
await (0, import_build_utils13.validateNpmrc)(cwd2);
|
170327
170330
|
} catch (err) {
|
170328
170331
|
output2.prettyError(err);
|
170329
170332
|
return 1;
|
170330
170333
|
}
|
170331
|
-
const link4 = await getProjectLink(client2,
|
170334
|
+
const link4 = await getProjectLink(client2, cwd2);
|
170332
170335
|
const projectRootDirectory = link4?.projectRootDirectory ?? "";
|
170333
170336
|
if (link4?.repoRoot) {
|
170334
|
-
|
170337
|
+
cwd2 = client2.cwd = link4.repoRoot;
|
170335
170338
|
}
|
170336
|
-
const vercelDir = (0, import_path28.join)(
|
170339
|
+
const vercelDir = (0, import_path28.join)(cwd2, projectRootDirectory, VERCEL_DIR2);
|
170337
170340
|
let project = await readProjectSettings(vercelDir);
|
170338
170341
|
const isTTY3 = process.stdin.isTTY;
|
170339
170342
|
while (!project?.settings) {
|
@@ -170361,7 +170364,7 @@ async function main2(client2) {
|
|
170361
170364
|
return 0;
|
170362
170365
|
}
|
170363
170366
|
const { argv: originalArgv } = client2;
|
170364
|
-
client2.cwd = (0, import_path28.join)(
|
170367
|
+
client2.cwd = (0, import_path28.join)(cwd2, projectRootDirectory);
|
170365
170368
|
client2.argv = [
|
170366
170369
|
...originalArgv.slice(0, 2),
|
170367
170370
|
"pull",
|
@@ -170372,11 +170375,11 @@ async function main2(client2) {
|
|
170372
170375
|
if (result !== 0) {
|
170373
170376
|
return result;
|
170374
170377
|
}
|
170375
|
-
client2.cwd =
|
170378
|
+
client2.cwd = cwd2;
|
170376
170379
|
client2.argv = originalArgv;
|
170377
170380
|
project = await readProjectSettings(vercelDir);
|
170378
170381
|
}
|
170379
|
-
const defaultOutputDir = (0, import_path28.join)(
|
170382
|
+
const defaultOutputDir = (0, import_path28.join)(cwd2, projectRootDirectory, OUTPUT_DIR);
|
170380
170383
|
const outputDir = argv2["--output"] ? (0, import_path28.resolve)(argv2["--output"]) : defaultOutputDir;
|
170381
170384
|
await Promise.all([
|
170382
170385
|
import_fs_extra18.default.remove(outputDir),
|
@@ -170391,7 +170394,7 @@ async function main2(client2) {
|
|
170391
170394
|
const envToUnset = /* @__PURE__ */ new Set(["VERCEL", "NOW_BUILDER"]);
|
170392
170395
|
try {
|
170393
170396
|
const envPath = (0, import_path28.join)(
|
170394
|
-
|
170397
|
+
cwd2,
|
170395
170398
|
projectRootDirectory,
|
170396
170399
|
VERCEL_DIR2,
|
170397
170400
|
`.env.${target}.local`
|
@@ -170416,7 +170419,7 @@ async function main2(client2) {
|
|
170416
170419
|
}
|
170417
170420
|
process.env.VERCEL = "1";
|
170418
170421
|
process.env.NOW_BUILDER = "1";
|
170419
|
-
await doBuild(client2, project, buildsJson,
|
170422
|
+
await doBuild(client2, project, buildsJson, cwd2, outputDir);
|
170420
170423
|
return 0;
|
170421
170424
|
} catch (err) {
|
170422
170425
|
output2.prettyError(err);
|
@@ -170434,9 +170437,9 @@ async function main2(client2) {
|
|
170434
170437
|
}
|
170435
170438
|
}
|
170436
170439
|
}
|
170437
|
-
async function doBuild(client2, project, buildsJson,
|
170440
|
+
async function doBuild(client2, project, buildsJson, cwd2, outputDir) {
|
170438
170441
|
const { localConfigPath, output: output2 } = client2;
|
170439
|
-
const workPath = (0, import_path28.join)(
|
170442
|
+
const workPath = (0, import_path28.join)(cwd2, project.settings.rootDirectory || ".");
|
170440
170443
|
const [pkg, vercelConfig, nowConfig] = await Promise.all([
|
170441
170444
|
readJSONFile((0, import_path28.join)(workPath, "package.json")),
|
170442
170445
|
readJSONFile(
|
@@ -170465,7 +170468,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170465
170468
|
...pickOverrides(localConfig)
|
170466
170469
|
};
|
170467
170470
|
if (process.env.VERCEL_BUILD_MONOREPO_SUPPORT === "1" && pkg?.scripts?.["vercel-build"] === void 0 && projectSettings.rootDirectory !== null && projectSettings.rootDirectory !== ".") {
|
170468
|
-
await setMonorepoDefaultSettings(
|
170471
|
+
await setMonorepoDefaultSettings(cwd2, workPath, projectSettings, output2);
|
170469
170472
|
}
|
170470
170473
|
const files = (await staticFiles(workPath, client2)).map(
|
170471
170474
|
(f) => (0, import_build_utils13.normalizePath)((0, import_path28.relative)(workPath, f))
|
@@ -170526,7 +170529,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170526
170529
|
zeroConfigRoutes.push(...detectedBuilders.defaultRoutes || []);
|
170527
170530
|
}
|
170528
170531
|
const builderSpecs = new Set(builds.map((b) => b.use));
|
170529
|
-
const buildersWithPkgs = await importBuilders(builderSpecs,
|
170532
|
+
const buildersWithPkgs = await importBuilders(builderSpecs, cwd2, output2);
|
170530
170533
|
const filesMap = {};
|
170531
170534
|
for (const path11 of files) {
|
170532
170535
|
const fsPath = (0, import_path28.join)(workPath, path11);
|
@@ -170536,27 +170539,6 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170536
170539
|
const buildStamp = stamp_default();
|
170537
170540
|
await import_fs_extra18.default.mkdirp(outputDir);
|
170538
170541
|
const ops = [];
|
170539
|
-
const dependencyMap = makeDepencyMap(pkg);
|
170540
|
-
const speedInsighsVersion = dependencyMap.get("@vercel/speed-insights");
|
170541
|
-
if (speedInsighsVersion) {
|
170542
|
-
if (process.env.VERCEL_ANALYTICS_ID) {
|
170543
|
-
output2.warn(
|
170544
|
-
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
|
170545
|
-
);
|
170546
|
-
delete process.env.VERCEL_ANALYTICS_ID;
|
170547
|
-
}
|
170548
|
-
buildsJson.features = {
|
170549
|
-
...buildsJson.features ?? {},
|
170550
|
-
speedInsightsVersion: speedInsighsVersion
|
170551
|
-
};
|
170552
|
-
}
|
170553
|
-
const webAnalyticsVersion = dependencyMap.get("@vercel/analytics");
|
170554
|
-
if (webAnalyticsVersion) {
|
170555
|
-
buildsJson.features = {
|
170556
|
-
...buildsJson.features ?? {},
|
170557
|
-
webAnalyticsVersion
|
170558
|
-
};
|
170559
|
-
}
|
170560
170542
|
const buildsJsonBuilds = new Map(
|
170561
170543
|
builds.map((build2) => {
|
170562
170544
|
const builderWithPkg = buildersWithPkgs.get(build2.use);
|
@@ -170576,9 +170558,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170576
170558
|
})
|
170577
170559
|
);
|
170578
170560
|
buildsJson.builds = Array.from(buildsJsonBuilds.values());
|
170579
|
-
await
|
170580
|
-
spaces: 2
|
170581
|
-
});
|
170561
|
+
await writeBuildJson(buildsJson, outputDir);
|
170582
170562
|
const meta = {
|
170583
170563
|
skipDownload: true,
|
170584
170564
|
cliVersion: pkg_default.version
|
@@ -170586,7 +170566,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170586
170566
|
const sortedBuilders = sortBuilders(builds);
|
170587
170567
|
const buildResults = /* @__PURE__ */ new Map();
|
170588
170568
|
const overrides = [];
|
170589
|
-
const repoRootPath =
|
170569
|
+
const repoRootPath = cwd2;
|
170590
170570
|
const corepackShimDir = await initCorepack({ repoRootPath });
|
170591
170571
|
for (const build2 of sortedBuilders) {
|
170592
170572
|
if (typeof build2.src !== "string")
|
@@ -170676,6 +170656,31 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170676
170656
|
throw error4;
|
170677
170657
|
}
|
170678
170658
|
}
|
170659
|
+
let needBuildsJsonOverride = false;
|
170660
|
+
const { speedInsightsVersion, webAnalyticsVersion } = await readPackageVersions(pkg);
|
170661
|
+
if (speedInsightsVersion) {
|
170662
|
+
if (process.env.VERCEL_ANALYTICS_ID) {
|
170663
|
+
output2.warn(
|
170664
|
+
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
|
170665
|
+
);
|
170666
|
+
delete process.env.VERCEL_ANALYTICS_ID;
|
170667
|
+
}
|
170668
|
+
buildsJson.features = {
|
170669
|
+
...buildsJson.features ?? {},
|
170670
|
+
speedInsightsVersion
|
170671
|
+
};
|
170672
|
+
needBuildsJsonOverride = true;
|
170673
|
+
}
|
170674
|
+
if (webAnalyticsVersion) {
|
170675
|
+
buildsJson.features = {
|
170676
|
+
...buildsJson.features ?? {},
|
170677
|
+
webAnalyticsVersion
|
170678
|
+
};
|
170679
|
+
needBuildsJsonOverride = true;
|
170680
|
+
}
|
170681
|
+
if (needBuildsJsonOverride) {
|
170682
|
+
await writeBuildJson(buildsJson, outputDir);
|
170683
|
+
}
|
170679
170684
|
const configPath = (0, import_path28.join)(outputDir, "config.json");
|
170680
170685
|
const existingConfig = await readJSONFile(configPath);
|
170681
170686
|
if (existingConfig instanceof CantParseJSONFile) {
|
@@ -170718,7 +170723,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170718
170723
|
const mergedWildcard = mergeWildcard(buildResults.values());
|
170719
170724
|
const mergedOverrides = overrides.length > 0 ? Object.assign({}, ...overrides) : void 0;
|
170720
170725
|
const mergedFlags = mergeFlags(buildResults.values());
|
170721
|
-
const framework = await getFramework(
|
170726
|
+
const framework = await getFramework(cwd2, buildResults);
|
170722
170727
|
const config3 = {
|
170723
170728
|
version: 3,
|
170724
170729
|
routes: mergedRoutes,
|
@@ -170730,7 +170735,7 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170730
170735
|
flags: mergedFlags
|
170731
170736
|
};
|
170732
170737
|
await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "config.json"), config3, { spaces: 2 });
|
170733
|
-
const relOutputDir = (0, import_path28.relative)(
|
170738
|
+
const relOutputDir = (0, import_path28.relative)(cwd2, outputDir);
|
170734
170739
|
output2.print(
|
170735
170740
|
`${prependEmoji(
|
170736
170741
|
`Build Completed in ${import_chalk45.default.bold(
|
@@ -170741,9 +170746,9 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
|
|
170741
170746
|
`
|
170742
170747
|
);
|
170743
170748
|
}
|
170744
|
-
async function getFramework(
|
170749
|
+
async function getFramework(cwd2, buildResults) {
|
170745
170750
|
const detectedFramework = await (0, import_fs_detectors4.detectFrameworkRecord)({
|
170746
|
-
fs: new import_fs_detectors4.LocalFileSystemDetector(
|
170751
|
+
fs: new import_fs_detectors4.LocalFileSystemDetector(cwd2),
|
170747
170752
|
frameworkList: import_frameworks4.default
|
170748
170753
|
});
|
170749
170754
|
if (!detectedFramework) {
|
@@ -170842,7 +170847,39 @@ function makeDepencyMap(pkg) {
|
|
170842
170847
|
...Object.entries(pkg?.dependencies ?? {})
|
170843
170848
|
]);
|
170844
170849
|
}
|
170845
|
-
|
170850
|
+
async function writeBuildJson(buildsJson, outputDir) {
|
170851
|
+
await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "builds.json"), buildsJson, { spaces: 2 });
|
170852
|
+
}
|
170853
|
+
async function readPackageVersions(descriptor2) {
|
170854
|
+
const referencedDependencies = makeDepencyMap(descriptor2);
|
170855
|
+
const [speedInsightsVersion, webAnalyticsVersion] = await Promise.all([
|
170856
|
+
readPackageVersion("@vercel/speed-insights", referencedDependencies),
|
170857
|
+
readPackageVersion("@vercel/analytics", referencedDependencies)
|
170858
|
+
]);
|
170859
|
+
return { webAnalyticsVersion, speedInsightsVersion };
|
170860
|
+
}
|
170861
|
+
async function readPackageVersion(pkgName, dependencies) {
|
170862
|
+
let version2 = void 0;
|
170863
|
+
try {
|
170864
|
+
const descriptorPath = require.resolve(`${pkgName}/package.json`, {
|
170865
|
+
paths: [(0, import_process.cwd)()]
|
170866
|
+
});
|
170867
|
+
const descriptor2 = await readJSONFile(descriptorPath);
|
170868
|
+
if (descriptor2 instanceof CantParseJSONFile)
|
170869
|
+
throw descriptor2;
|
170870
|
+
version2 = descriptor2?.version;
|
170871
|
+
} catch {
|
170872
|
+
}
|
170873
|
+
if (version2 && !dependencies.has(pkgName)) {
|
170874
|
+
throw new import_build_utils13.NowBuildError({
|
170875
|
+
code: "INVALID_CONFIGURATION",
|
170876
|
+
message: `Package \`${pkgName}\` is globally installed, which is not supported. Please move the dependency to your deployed application's package.json`,
|
170877
|
+
link: "https://vercel.link/global-observability-package"
|
170878
|
+
});
|
170879
|
+
}
|
170880
|
+
return version2;
|
170881
|
+
}
|
170882
|
+
var import_fs_extra18, import_chalk45, import_dotenv, import_semver3, import_minimatch2, import_path28, import_process, import_frameworks4, import_build_utils13, import_fs_detectors4, import_routing_utils2, import_client8;
|
170846
170883
|
var init_build = __esm({
|
170847
170884
|
"src/commands/build/index.ts"() {
|
170848
170885
|
"use strict";
|
@@ -170852,6 +170889,7 @@ var init_build = __esm({
|
|
170852
170889
|
import_semver3 = __toESM3(require_semver());
|
170853
170890
|
import_minimatch2 = __toESM3(require_minimatch2());
|
170854
170891
|
import_path28 = require("path");
|
170892
|
+
import_process = require("process");
|
170855
170893
|
import_frameworks4 = __toESM3(require_frameworks());
|
170856
170894
|
import_build_utils13 = require("@vercel/build-utils");
|
170857
170895
|
import_fs_detectors4 = __toESM3(require_dist27());
|
@@ -172285,7 +172323,7 @@ var init_deploy = __esm({
|
|
172285
172323
|
}
|
172286
172324
|
const { log: log2, debug: debug3, error: error4, prettyError } = output2;
|
172287
172325
|
const quiet = !client2.stdout.isTTY;
|
172288
|
-
let { path:
|
172326
|
+
let { path: cwd2 } = pathValidation;
|
172289
172327
|
const autoConfirm = argv2["--yes"];
|
172290
172328
|
if (argv2["--name"]) {
|
172291
172329
|
output2.print(
|
@@ -172318,7 +172356,7 @@ var init_deploy = __esm({
|
|
172318
172356
|
output2.error(`Format must be one of: ${import_client10.VALID_ARCHIVE_FORMATS.join(", ")}`);
|
172319
172357
|
return 1;
|
172320
172358
|
}
|
172321
|
-
const link4 = await getLinkedProject(client2,
|
172359
|
+
const link4 = await getLinkedProject(client2, cwd2);
|
172322
172360
|
if (link4.status === "error") {
|
172323
172361
|
return link4.exitCode;
|
172324
172362
|
}
|
@@ -172329,7 +172367,7 @@ var init_deploy = __esm({
|
|
172329
172367
|
if (status === "not_linked") {
|
172330
172368
|
const shouldStartSetup = autoConfirm || await confirm(
|
172331
172369
|
client2,
|
172332
|
-
`Set up and deploy ${import_chalk53.default.cyan(`\u201C${humanizePath(
|
172370
|
+
`Set up and deploy ${import_chalk53.default.cyan(`\u201C${humanizePath(cwd2)}\u201D`)}?`,
|
172333
172371
|
true
|
172334
172372
|
);
|
172335
172373
|
if (!shouldStartSetup) {
|
@@ -172363,14 +172401,14 @@ var init_deploy = __esm({
|
|
172363
172401
|
);
|
172364
172402
|
if (typeof projectOrNewProjectName === "string") {
|
172365
172403
|
newProjectName = projectOrNewProjectName;
|
172366
|
-
rootDirectory = await inputRootDirectory(client2,
|
172404
|
+
rootDirectory = await inputRootDirectory(client2, cwd2, autoConfirm);
|
172367
172405
|
} else {
|
172368
172406
|
project = projectOrNewProjectName;
|
172369
172407
|
rootDirectory = project.rootDirectory;
|
172370
172408
|
sourceFilesOutsideRootDirectory = project.sourceFilesOutsideRootDirectory;
|
172371
172409
|
await linkFolderToProject(
|
172372
172410
|
client2,
|
172373
|
-
|
172411
|
+
cwd2,
|
172374
172412
|
{
|
172375
172413
|
projectId: project.id,
|
172376
172414
|
orgId: org.id
|
@@ -172382,16 +172420,16 @@ var init_deploy = __esm({
|
|
172382
172420
|
}
|
172383
172421
|
}
|
172384
172422
|
if (link4.status === "linked" && link4.repoRoot) {
|
172385
|
-
|
172423
|
+
cwd2 = link4.repoRoot;
|
172386
172424
|
}
|
172387
172425
|
if (!org) {
|
172388
172426
|
throw new Error(`"org" is not defined`);
|
172389
172427
|
}
|
172390
172428
|
if (argv2["--prebuilt"]) {
|
172391
172429
|
if (link4.status === "linked" && link4.repoRoot && link4.project.rootDirectory) {
|
172392
|
-
|
172430
|
+
cwd2 = (0, import_path32.join)(cwd2, link4.project.rootDirectory);
|
172393
172431
|
}
|
172394
|
-
const prebuiltExists = await import_fs_extra20.default.pathExists((0, import_path32.join)(
|
172432
|
+
const prebuiltExists = await import_fs_extra20.default.pathExists((0, import_path32.join)(cwd2, ".vercel/output"));
|
172395
172433
|
if (!prebuiltExists) {
|
172396
172434
|
error4(
|
172397
172435
|
`The ${param(
|
@@ -172402,7 +172440,7 @@ var init_deploy = __esm({
|
|
172402
172440
|
);
|
172403
172441
|
return 1;
|
172404
172442
|
}
|
172405
|
-
const prebuiltBuild = await getPrebuiltJson(
|
172443
|
+
const prebuiltBuild = await getPrebuiltJson(cwd2);
|
172406
172444
|
const prebuiltError = prebuiltBuild?.error || prebuiltBuild?.builds?.find((build2) => "error" in build2)?.error;
|
172407
172445
|
if (prebuiltError) {
|
172408
172446
|
output2.log(
|
@@ -172431,17 +172469,17 @@ var init_deploy = __esm({
|
|
172431
172469
|
}
|
172432
172470
|
const contextName = org.slug;
|
172433
172471
|
client2.config.currentTeam = org.type === "team" ? org.id : void 0;
|
172434
|
-
const sourcePath = rootDirectory && !sourceFilesOutsideRootDirectory ? (0, import_path32.join)(
|
172472
|
+
const sourcePath = rootDirectory && !sourceFilesOutsideRootDirectory ? (0, import_path32.join)(cwd2, rootDirectory) : cwd2;
|
172435
172473
|
if (rootDirectory && await validateRootDirectory(
|
172436
172474
|
output2,
|
172437
|
-
|
172475
|
+
cwd2,
|
172438
172476
|
sourcePath,
|
172439
172477
|
project ? `To change your Project Settings, go to https://vercel.com/${org?.slug}/${project.name}/settings` : ""
|
172440
172478
|
) === false) {
|
172441
172479
|
return 1;
|
172442
172480
|
}
|
172443
172481
|
if (rootDirectory) {
|
172444
|
-
const rootDirectoryConfig = readLocalConfig((0, import_path32.join)(
|
172482
|
+
const rootDirectoryConfig = readLocalConfig((0, import_path32.join)(cwd2, rootDirectory));
|
172445
172483
|
if (rootDirectoryConfig) {
|
172446
172484
|
debug3(`Read local config from root directory (${rootDirectory})`);
|
172447
172485
|
localConfig = rootDirectoryConfig;
|
@@ -172501,7 +172539,7 @@ var init_deploy = __esm({
|
|
172501
172539
|
parseMeta(localConfig.meta),
|
172502
172540
|
parseMeta(argv2["--meta"])
|
172503
172541
|
);
|
172504
|
-
const gitMetadata = await createGitMeta(
|
172542
|
+
const gitMetadata = await createGitMeta(cwd2, output2, project);
|
172505
172543
|
const deploymentEnv = Object.assign(
|
172506
172544
|
{},
|
172507
172545
|
parseEnv(localConfig.env),
|
@@ -172576,7 +172614,7 @@ var init_deploy = __esm({
|
|
172576
172614
|
createArgs,
|
172577
172615
|
org,
|
172578
172616
|
!project,
|
172579
|
-
|
172617
|
+
cwd2,
|
172580
172618
|
archive
|
172581
172619
|
);
|
172582
172620
|
if (deployment.code === "missing_project_settings") {
|
@@ -172605,7 +172643,7 @@ var init_deploy = __esm({
|
|
172605
172643
|
createArgs,
|
172606
172644
|
org,
|
172607
172645
|
false,
|
172608
|
-
|
172646
|
+
cwd2
|
172609
172647
|
);
|
172610
172648
|
}
|
172611
172649
|
if (deployment instanceof NotDomainOwner) {
|
@@ -184682,8 +184720,8 @@ var require_src3 = __commonJS2({
|
|
184682
184720
|
sendError
|
184683
184721
|
}, methods);
|
184684
184722
|
module2.exports = async (request, response, config3 = {}, methods = {}) => {
|
184685
|
-
const
|
184686
|
-
const current = config3.public ? path11.resolve(
|
184723
|
+
const cwd2 = process.cwd();
|
184724
|
+
const current = config3.public ? path11.resolve(cwd2, config3.public) : cwd2;
|
184687
184725
|
const handlers = getHandlers(methods);
|
184688
184726
|
let relativePath = null;
|
184689
184727
|
let acceptsJSON = null;
|
@@ -185734,7 +185772,7 @@ Please run \`${await getUpdateCommand()}\` to update to the latest CLI.`
|
|
185734
185772
|
);
|
185735
185773
|
}
|
185736
185774
|
}
|
185737
|
-
async function getBuildMatches(vercelConfig,
|
185775
|
+
async function getBuildMatches(vercelConfig, cwd2, output2, devServer, fileList) {
|
185738
185776
|
const matches = [];
|
185739
185777
|
if (fileList.length === 0) {
|
185740
185778
|
return matches;
|
@@ -185742,7 +185780,7 @@ async function getBuildMatches(vercelConfig, cwd, output2, devServer, fileList)
|
|
185742
185780
|
const noMatches = [];
|
185743
185781
|
const builds = vercelConfig.builds || [{ src: "**", use: "@vercel/static" }];
|
185744
185782
|
const builderSpecs = new Set(builds.map((b) => b.use).filter(Boolean));
|
185745
|
-
const buildersWithPkgs = await importBuilders(builderSpecs,
|
185783
|
+
const buildersWithPkgs = await importBuilders(builderSpecs, cwd2, output2);
|
185746
185784
|
for (const buildConfig of builds) {
|
185747
185785
|
let { src = "**", use, config: config3 = {} } = buildConfig;
|
185748
185786
|
if (!use) {
|
@@ -185757,12 +185795,12 @@ async function getBuildMatches(vercelConfig, cwd, output2, devServer, fileList)
|
|
185757
185795
|
mapToEntrypoint.set(extensionless, src);
|
185758
185796
|
src = extensionless;
|
185759
185797
|
}
|
185760
|
-
const files = fileList.filter((name) => name === src || (0, import_minimatch3.default)(name, src, { dot: true })).map((name) => (0, import_path35.join)(
|
185798
|
+
const files = fileList.filter((name) => name === src || (0, import_minimatch3.default)(name, src, { dot: true })).map((name) => (0, import_path35.join)(cwd2, name));
|
185761
185799
|
if (files.length === 0) {
|
185762
185800
|
noMatches.push(buildConfig);
|
185763
185801
|
}
|
185764
185802
|
for (const file of files) {
|
185765
|
-
src = relative6(
|
185803
|
+
src = relative6(cwd2, file);
|
185766
185804
|
const entrypoint = mapToEntrypoint.get(src) || src;
|
185767
185805
|
if (config3.zeroConfig && config3.outputDirectory) {
|
185768
185806
|
const outputMatch = config3.outputDirectory + "/";
|
@@ -186184,9 +186222,9 @@ function proxyPass(req, res, dest, devServer, requestId, ignorePath = true) {
|
|
186184
186222
|
}
|
186185
186223
|
);
|
186186
186224
|
}
|
186187
|
-
function serveStaticFile(req, res,
|
186225
|
+
function serveStaticFile(req, res, cwd2, opts) {
|
186188
186226
|
return (0, import_serve_handler.default)(req, res, {
|
186189
|
-
public:
|
186227
|
+
public: cwd2,
|
186190
186228
|
cleanUrls: false,
|
186191
186229
|
etag: true,
|
186192
186230
|
...opts
|
@@ -186443,7 +186481,7 @@ var init_server = __esm({
|
|
186443
186481
|
import_frameworks5.default.map((f) => f.useRuntime?.use || "@vercel/static-build")
|
186444
186482
|
);
|
186445
186483
|
DevServer = class {
|
186446
|
-
constructor(
|
186484
|
+
constructor(cwd2, options) {
|
186447
186485
|
this.clearVercelConfigPromise = () => {
|
186448
186486
|
this.getVercelConfigPromise = null;
|
186449
186487
|
};
|
@@ -187088,8 +187126,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
187088
187126
|
await this.sendError(req, res, requestId, "UNKNOWN_ASSET_TYPE");
|
187089
187127
|
}
|
187090
187128
|
};
|
187091
|
-
this.cwd =
|
187092
|
-
this.repoRoot = options.repoRoot ??
|
187129
|
+
this.cwd = cwd2;
|
187130
|
+
this.repoRoot = options.repoRoot ?? cwd2;
|
187093
187131
|
this.output = options.output;
|
187094
187132
|
this.envConfigs = { buildEnv: {}, runEnv: {}, allEnv: {} };
|
187095
187133
|
this.envValues = options.envValues || {};
|
@@ -187112,7 +187150,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
|
|
187112
187150
|
this.stopping = false;
|
187113
187151
|
this.buildMatches = /* @__PURE__ */ new Map();
|
187114
187152
|
this.inProgressBuilds = /* @__PURE__ */ new Map();
|
187115
|
-
this.devCacheDir = (0, import_path36.join)(getVercelDirectory(
|
187153
|
+
this.devCacheDir = (0, import_path36.join)(getVercelDirectory(cwd2), "cache");
|
187116
187154
|
this.vercelConfigWarning = false;
|
187117
187155
|
this.getVercelConfigPromise = null;
|
187118
187156
|
this.blockingBuildsPromise = null;
|
@@ -188023,7 +188061,7 @@ ${error_code}
|
|
188023
188061
|
return this.caseSensitive;
|
188024
188062
|
}
|
188025
188063
|
async runDevCommand() {
|
188026
|
-
const { devCommand: devCommand2, cwd } = this;
|
188064
|
+
const { devCommand: devCommand2, cwd: cwd2 } = this;
|
188027
188065
|
if (devCommand2 === this.currentDevCommand) {
|
188028
188066
|
return;
|
188029
188067
|
}
|
@@ -188054,13 +188092,13 @@ ${error_code}
|
|
188054
188092
|
PORT: `${port}`
|
188055
188093
|
}
|
188056
188094
|
);
|
188057
|
-
const nodeBinPaths = (0, import_build_utils17.getNodeBinPaths)({ base: this.repoRoot, start:
|
188095
|
+
const nodeBinPaths = (0, import_build_utils17.getNodeBinPaths)({ base: this.repoRoot, start: cwd2 });
|
188058
188096
|
const nodeBinPath = nodeBinPaths.join(import_path36.default.delimiter);
|
188059
188097
|
env.PATH = `${nodeBinPath}${import_path36.default.delimiter}${env.PATH}`;
|
188060
188098
|
let command = devCommand2.replace(/\$PORT/g, `${port}`).replace(/%PORT%/g, `${port}`);
|
188061
188099
|
this.output.debug(
|
188062
188100
|
`Starting dev command with parameters: ${JSON.stringify({
|
188063
|
-
cwd,
|
188101
|
+
cwd: cwd2,
|
188064
188102
|
command,
|
188065
188103
|
port
|
188066
188104
|
})}`
|
@@ -188069,7 +188107,7 @@ ${error_code}
|
|
188069
188107
|
const proxyPort = new RegExp(port.toString(), "g");
|
188070
188108
|
const p = (0, import_build_utils17.spawnCommand)(command, {
|
188071
188109
|
stdio: ["inherit", "pipe", "pipe"],
|
188072
|
-
cwd,
|
188110
|
+
cwd: cwd2,
|
188073
188111
|
env
|
188074
188112
|
});
|
188075
188113
|
this.devProcess = p;
|
@@ -188099,11 +188137,11 @@ ${error_code}
|
|
188099
188137
|
async function dev(client2, opts, args2) {
|
188100
188138
|
const { output: output2 } = client2;
|
188101
188139
|
const [dir = "."] = args2;
|
188102
|
-
let
|
188140
|
+
let cwd2 = (0, import_path37.resolve)(dir);
|
188103
188141
|
const listen4 = parseListen(opts["--listen"] || "3000");
|
188104
|
-
let link4 = await getLinkedProject(client2,
|
188142
|
+
let link4 = await getLinkedProject(client2, cwd2);
|
188105
188143
|
if (link4.status === "not_linked" && !process.env.__VERCEL_SKIP_DEV_CMD) {
|
188106
|
-
link4 = await setupAndLink(client2,
|
188144
|
+
link4 = await setupAndLink(client2, cwd2, {
|
188107
188145
|
autoConfirm: opts["--yes"],
|
188108
188146
|
link: link4,
|
188109
188147
|
successEmoji: "link",
|
@@ -188129,16 +188167,16 @@ async function dev(client2, opts, args2) {
|
|
188129
188167
|
if (link4.status === "linked") {
|
188130
188168
|
const { project, org } = link4;
|
188131
188169
|
if (link4.repoRoot) {
|
188132
|
-
repoRoot =
|
188170
|
+
repoRoot = cwd2 = link4.repoRoot;
|
188133
188171
|
}
|
188134
188172
|
client2.config.currentTeam = org.type === "team" ? org.id : void 0;
|
188135
188173
|
projectSettings = project;
|
188136
188174
|
if (project.rootDirectory) {
|
188137
|
-
|
188175
|
+
cwd2 = (0, import_path37.join)(cwd2, project.rootDirectory);
|
188138
188176
|
}
|
188139
188177
|
envValues = (await pullEnvRecords(output2, client2, project.id, "vercel-cli:dev")).env;
|
188140
188178
|
}
|
188141
|
-
const devServer = new DevServer(
|
188179
|
+
const devServer = new DevServer(cwd2, {
|
188142
188180
|
output: output2,
|
188143
188181
|
projectSettings,
|
188144
188182
|
envValues,
|
@@ -188146,7 +188184,7 @@ async function dev(client2, opts, args2) {
|
|
188146
188184
|
});
|
188147
188185
|
process.on("SIGTERM", () => devServer.stop());
|
188148
188186
|
if (!devServer.devCommand) {
|
188149
|
-
const outputDir = (0, import_path37.join)(
|
188187
|
+
const outputDir = (0, import_path37.join)(cwd2, OUTPUT_DIR);
|
188150
188188
|
if (await import_fs_extra22.default.pathExists(outputDir)) {
|
188151
188189
|
output2.log(`Removing ${OUTPUT_DIR}`);
|
188152
188190
|
await import_fs_extra22.default.remove(outputDir);
|
@@ -191935,7 +191973,7 @@ async function main6(client2) {
|
|
191935
191973
|
}
|
191936
191974
|
const subArgs = argv2._.slice(1);
|
191937
191975
|
const { subcommand: subcommand2, args: args2 } = getSubcommand(subArgs, COMMAND_CONFIG6);
|
191938
|
-
const { cwd, output: output2, config: config3 } = client2;
|
191976
|
+
const { cwd: cwd2, output: output2, config: config3 } = client2;
|
191939
191977
|
const target = argv2["--environment"]?.toLowerCase() || "development";
|
191940
191978
|
if (!isValidEnvTarget(target)) {
|
191941
191979
|
output2.error(
|
@@ -191945,7 +191983,7 @@ async function main6(client2) {
|
|
191945
191983
|
);
|
191946
191984
|
return 1;
|
191947
191985
|
}
|
191948
|
-
const link4 = await getLinkedProject(client2,
|
191986
|
+
const link4 = await getLinkedProject(client2, cwd2);
|
191949
191987
|
if (link4.status === "error") {
|
191950
191988
|
return link4.exitCode;
|
191951
191989
|
} else if (link4.status === "not_linked") {
|
@@ -191974,7 +192012,7 @@ async function main6(client2) {
|
|
191974
192012
|
argv2,
|
191975
192013
|
args2,
|
191976
192014
|
output2,
|
191977
|
-
|
192015
|
+
cwd2,
|
191978
192016
|
"vercel-cli:env:pull"
|
191979
192017
|
);
|
191980
192018
|
default:
|
@@ -192015,7 +192053,7 @@ var init_env = __esm({
|
|
192015
192053
|
|
192016
192054
|
// src/commands/git/connect.ts
|
192017
192055
|
async function connect(client2, argv2, args2, project, org) {
|
192018
|
-
const { cwd, output: output2 } = client2;
|
192056
|
+
const { cwd: cwd2, output: output2 } = client2;
|
192019
192057
|
const confirm2 = Boolean(argv2["--yes"]);
|
192020
192058
|
const repoArg = argv2._[1];
|
192021
192059
|
if (args2.length > 1) {
|
@@ -192036,7 +192074,7 @@ async function connect(client2, argv2, args2, project, org) {
|
|
192036
192074
|
}
|
192037
192075
|
const gitProviderLink = project.link;
|
192038
192076
|
client2.config.currentTeam = org.type === "team" ? org.id : void 0;
|
192039
|
-
const gitConfigPath = (0, import_path41.join)(
|
192077
|
+
const gitConfigPath = (0, import_path41.join)(cwd2, ".git/config");
|
192040
192078
|
const gitConfig = await parseGitConfig(gitConfigPath, output2);
|
192041
192079
|
if (repoArg) {
|
192042
192080
|
const parsedUrlArg = parseRepoUrl(repoArg);
|
@@ -192491,8 +192529,8 @@ async function main7(client2) {
|
|
192491
192529
|
subcommand2 = argv2._[0];
|
192492
192530
|
const args2 = argv2._.slice(1);
|
192493
192531
|
const autoConfirm = Boolean(argv2["--yes"]);
|
192494
|
-
const { cwd, output: output2 } = client2;
|
192495
|
-
const linkedProject = await ensureLink("git", client2,
|
192532
|
+
const { cwd: cwd2, output: output2 } = client2;
|
192533
|
+
const linkedProject = await ensureLink("git", client2, cwd2, { autoConfirm });
|
192496
192534
|
if (typeof linkedProject === "number") {
|
192497
192535
|
return linkedProject;
|
192498
192536
|
}
|
@@ -192746,8 +192784,8 @@ ${deployHint}`);
|
|
192746
192784
|
throw e2;
|
192747
192785
|
});
|
192748
192786
|
}
|
192749
|
-
function prepareFolder(
|
192750
|
-
const dest = import_path42.default.join(
|
192787
|
+
function prepareFolder(cwd2, folder, force) {
|
192788
|
+
const dest = import_path42.default.join(cwd2, folder);
|
192751
192789
|
if (import_fs8.default.existsSync(dest)) {
|
192752
192790
|
if (!import_fs8.default.lstatSync(dest).isDirectory()) {
|
192753
192791
|
throw new Error(
|
@@ -192765,7 +192803,7 @@ function prepareFolder(cwd, folder, force) {
|
|
192765
192803
|
)} or ${cmd("-f")} to override it.`
|
192766
192804
|
);
|
192767
192805
|
}
|
192768
|
-
} else if (dest !==
|
192806
|
+
} else if (dest !== cwd2) {
|
192769
192807
|
try {
|
192770
192808
|
import_fs8.default.mkdirSync(dest);
|
192771
192809
|
} catch (e2) {
|
@@ -193553,23 +193591,23 @@ async function link3(client2) {
|
|
193553
193591
|
argv2["--yes"] = argv2["--confirm"];
|
193554
193592
|
}
|
193555
193593
|
const yes = !!argv2["--yes"];
|
193556
|
-
let
|
193557
|
-
if (
|
193594
|
+
let cwd2 = argv2._[1];
|
193595
|
+
if (cwd2) {
|
193558
193596
|
client2.output.warn(
|
193559
193597
|
`The ${cmd("vc link <directory>")} syntax is deprecated, please use ${cmd(
|
193560
|
-
`vc link --cwd ${
|
193598
|
+
`vc link --cwd ${cwd2}`
|
193561
193599
|
)} instead`
|
193562
193600
|
);
|
193563
193601
|
} else {
|
193564
|
-
|
193602
|
+
cwd2 = client2.cwd;
|
193565
193603
|
}
|
193566
193604
|
if (argv2["--repo"]) {
|
193567
193605
|
client2.output.warn(
|
193568
193606
|
`The ${cmd("--repo")} flag is in alpha, please report issues`
|
193569
193607
|
);
|
193570
|
-
await ensureRepoLink(client2,
|
193608
|
+
await ensureRepoLink(client2, cwd2, { yes, overwrite: true });
|
193571
193609
|
} else {
|
193572
|
-
const link4 = await ensureLink("link", client2,
|
193610
|
+
const link4 = await ensureLink("link", client2, cwd2, {
|
193573
193611
|
autoConfirm: yes,
|
193574
193612
|
forceDelete: true,
|
193575
193613
|
projectName: argv2["--project"],
|
@@ -193687,7 +193725,7 @@ async function list2(client2) {
|
|
193687
193725
|
handleError(err);
|
193688
193726
|
return 1;
|
193689
193727
|
}
|
193690
|
-
const { cwd, output: output2, config: config3 } = client2;
|
193728
|
+
const { cwd: cwd2, output: output2, config: config3 } = client2;
|
193691
193729
|
if ("--confirm" in argv2) {
|
193692
193730
|
output2.warn("`--confirm` is deprecated, please use `--yes` instead");
|
193693
193731
|
argv2["--yes"] = argv2["--confirm"];
|
@@ -193704,7 +193742,7 @@ async function list2(client2) {
|
|
193704
193742
|
const autoConfirm = !!argv2["--yes"];
|
193705
193743
|
const meta = parseMeta(argv2["--meta"]);
|
193706
193744
|
const target = argv2["--prod"] ? "production" : typeof argv2["--environment"] === "string" ? argv2["--environment"].toLowerCase() : void 0;
|
193707
|
-
let link4 = await getLinkedProject(client2,
|
193745
|
+
let link4 = await getLinkedProject(client2, cwd2);
|
193708
193746
|
if (link4.status === "error") {
|
193709
193747
|
return link4.exitCode;
|
193710
193748
|
}
|
@@ -193717,7 +193755,7 @@ async function list2(client2) {
|
|
193717
193755
|
return 1;
|
193718
193756
|
}
|
193719
193757
|
if (status === "not_linked" && !app) {
|
193720
|
-
const linkedProject = await ensureLink("list", client2,
|
193758
|
+
const linkedProject = await ensureLink("list", client2, cwd2, {
|
193721
193759
|
autoConfirm,
|
193722
193760
|
link: link4
|
193723
193761
|
});
|
@@ -195114,7 +195152,7 @@ async function getProjectByCwdOrLink({
|
|
195114
195152
|
autoConfirm,
|
195115
195153
|
client: client2,
|
195116
195154
|
commandName,
|
195117
|
-
cwd,
|
195155
|
+
cwd: cwd2,
|
195118
195156
|
projectNameOrId
|
195119
195157
|
}) {
|
195120
195158
|
if (projectNameOrId) {
|
@@ -195124,7 +195162,7 @@ async function getProjectByCwdOrLink({
|
|
195124
195162
|
}
|
195125
195163
|
return project;
|
195126
195164
|
}
|
195127
|
-
const linkedProject = await ensureLink(commandName, client2,
|
195165
|
+
const linkedProject = await ensureLink(commandName, client2, cwd2, {
|
195128
195166
|
autoConfirm
|
195129
195167
|
});
|
195130
195168
|
if (typeof linkedProject === "number") {
|
@@ -198463,16 +198501,16 @@ function createProxy(client2) {
|
|
198463
198501
|
}
|
198464
198502
|
|
198465
198503
|
// src/util/extension/exec.ts
|
198466
|
-
async function execExtension(client2, name, args2,
|
198504
|
+
async function execExtension(client2, name, args2, cwd2) {
|
198467
198505
|
const { debug: debug3 } = client2.output;
|
198468
198506
|
const extensionCommand = `vercel-${name}`;
|
198469
|
-
const { packageJsonPath, lockfilePath } = await (0, import_build_utils4.scanParentDirs)(
|
198507
|
+
const { packageJsonPath, lockfilePath } = await (0, import_build_utils4.scanParentDirs)(cwd2);
|
198470
198508
|
const baseFile = lockfilePath || packageJsonPath;
|
198471
198509
|
let extensionPath = null;
|
198472
198510
|
if (baseFile) {
|
198473
198511
|
extensionPath = await (0, import_build_utils4.walkParentDirs)({
|
198474
198512
|
base: (0, import_path8.dirname)(baseFile),
|
198475
|
-
start:
|
198513
|
+
start: cwd2,
|
198476
198514
|
filename: `node_modules/.bin/${extensionCommand}`
|
198477
198515
|
});
|
198478
198516
|
}
|
@@ -198492,7 +198530,7 @@ async function execExtension(client2, name, args2, cwd) {
|
|
198492
198530
|
const VERCEL_API = proxyUrl.href.replace(/\/$/, "");
|
198493
198531
|
debug3(`extension proxy server listening at ${VERCEL_API}`);
|
198494
198532
|
const result = await (0, import_execa.default)(extensionPath, args2, {
|
198495
|
-
cwd,
|
198533
|
+
cwd: cwd2,
|
198496
198534
|
reject: false,
|
198497
198535
|
stdio: "inherit",
|
198498
198536
|
env: {
|
@@ -198792,10 +198830,10 @@ var main13 = async () => {
|
|
198792
198830
|
if (argv2["--cwd"]) {
|
198793
198831
|
client.cwd = argv2["--cwd"];
|
198794
198832
|
}
|
198795
|
-
const { cwd } = client;
|
198833
|
+
const { cwd: cwd2 } = client;
|
198796
198834
|
let subcommand2 = void 0;
|
198797
198835
|
if (targetOrSubcommand) {
|
198798
|
-
const targetPath = (0, import_path43.join)(
|
198836
|
+
const targetPath = (0, import_path43.join)(cwd2, targetOrSubcommand);
|
198799
198837
|
const targetPathExists = (0, import_fs9.existsSync)(targetPath);
|
198800
198838
|
const subcommandExists = GLOBAL_COMMANDS.has(targetOrSubcommand) || commands_default.has(targetOrSubcommand);
|
198801
198839
|
if (targetPathExists && subcommandExists && !argv2["--cwd"] && !process.env.NOW_BUILDER) {
|
@@ -198943,7 +198981,7 @@ var main13 = async () => {
|
|
198943
198981
|
client,
|
198944
198982
|
targetCommand,
|
198945
198983
|
argv2._.slice(3),
|
198946
|
-
|
198984
|
+
cwd2
|
198947
198985
|
);
|
198948
198986
|
} catch (err) {
|
198949
198987
|
if ((0, import_error_utils33.isErrnoException)(err) && err.code === "ENOENT") {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "32.
|
3
|
+
"version": "32.6.0",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -23,15 +23,15 @@
|
|
23
23
|
"dependencies": {
|
24
24
|
"@vercel/build-utils": "7.2.5",
|
25
25
|
"@vercel/fun": "1.1.0",
|
26
|
-
"@vercel/go": "3.0.
|
26
|
+
"@vercel/go": "3.0.4",
|
27
27
|
"@vercel/hydrogen": "1.0.1",
|
28
28
|
"@vercel/next": "4.0.15",
|
29
29
|
"@vercel/node": "3.0.11",
|
30
30
|
"@vercel/python": "4.1.0",
|
31
31
|
"@vercel/redwood": "2.0.5",
|
32
|
-
"@vercel/remix-builder": "2.0.
|
32
|
+
"@vercel/remix-builder": "2.0.12",
|
33
33
|
"@vercel/ruby": "2.0.3",
|
34
|
-
"@vercel/static-build": "2.0.
|
34
|
+
"@vercel/static-build": "2.0.13",
|
35
35
|
"chokidar": "3.3.1"
|
36
36
|
},
|
37
37
|
"devDependencies": {
|
@@ -81,8 +81,8 @@
|
|
81
81
|
"@vercel-internals/types": "1.0.16",
|
82
82
|
"@vercel/client": "13.0.9",
|
83
83
|
"@vercel/error-utils": "2.0.2",
|
84
|
-
"@vercel/frameworks": "2.0.
|
85
|
-
"@vercel/fs-detectors": "5.1.
|
84
|
+
"@vercel/frameworks": "2.0.4",
|
85
|
+
"@vercel/fs-detectors": "5.1.4",
|
86
86
|
"@vercel/routing-utils": "3.1.0",
|
87
87
|
"ajv": "6.12.2",
|
88
88
|
"alpha-sort": "2.0.1",
|