vercel 58.9.3 → 58.9.5
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-DDUZR2RD.js → add-5KFK4EFH.js} +6 -6
- package/dist/chunks/{add-XZ2HRB22.js → add-NMYLVDBN.js} +2 -2
- package/dist/chunks/{add-LVQP3SR2.js → add-W4XR5GYX.js} +2 -2
- package/dist/chunks/{build-L3WNBFT6.js → build-BCMSG7TU.js} +2 -2
- package/dist/chunks/{chunk-EPAVMBXG.js → chunk-2J7BL7IF.js} +2 -2
- package/dist/chunks/{chunk-2Z66EK7E.js → chunk-2SEBBSKD.js} +1 -1
- package/dist/chunks/{chunk-J5PH3SFB.js → chunk-3MELKK7A.js} +9 -32
- package/dist/chunks/{chunk-J4YKPKVD.js → chunk-4GUI4FQR.js} +4 -4
- package/dist/chunks/{chunk-S6CMPUF4.js → chunk-5MERQE7H.js} +1 -1
- package/dist/chunks/{chunk-R7FRJJSO.js → chunk-6SXIT6Q3.js} +109 -31
- package/dist/chunks/{chunk-CMS7PTFB.js → chunk-6WWATEWK.js} +1 -1
- package/dist/chunks/{chunk-Z7LH63PK.js → chunk-7RUZPHW7.js} +1 -1
- package/dist/chunks/{chunk-DSJHGENE.js → chunk-AZCZV4XI.js} +1 -1
- package/dist/chunks/{chunk-74ZES62J.js → chunk-BZGIBXY6.js} +1 -1
- package/dist/chunks/{chunk-6YFPNNA5.js → chunk-DQDAQYQI.js} +1 -1
- package/dist/chunks/{chunk-KIGRD7TV.js → chunk-ELJ56NBY.js} +1 -1
- package/dist/chunks/{chunk-FKN6MI3N.js → chunk-GBXTATOJ.js} +2 -2
- package/dist/chunks/{chunk-J23MTK5H.js → chunk-IBIZT5M4.js} +7 -44
- package/dist/chunks/{chunk-3T3AIIEO.js → chunk-KUZCVMVA.js} +3 -4
- package/dist/chunks/{chunk-DGVJNQI3.js → chunk-MAZ2BUBX.js} +2 -2
- package/dist/chunks/{chunk-Z7RSIWNT.js → chunk-MGCBTAA7.js} +1 -1
- package/dist/chunks/{chunk-BW7BH66H.js → chunk-N5YCPDWG.js} +1 -1
- package/dist/chunks/{chunk-DZAP2FIC.js → chunk-NDOZRKTB.js} +1 -1
- package/dist/chunks/{chunk-446IAD7O.js → chunk-PTZ6X4P4.js} +1 -1
- package/dist/chunks/{chunk-5LPWBMQG.js → chunk-TNKTZDOL.js} +1 -1
- package/dist/chunks/{chunk-DBMBKXZO.js → chunk-U4LWFSR4.js} +1 -1
- package/dist/chunks/{chunk-77FZZ73F.js → chunk-UDHYVIJL.js} +4 -4
- package/dist/chunks/{clear-QD7QNE2X.js → clear-54WX3NA2.js} +2 -2
- package/dist/chunks/{compile-vercel-config-G46NO752.js → compile-vercel-config-LSW4TWGX.js} +1 -1
- package/dist/chunks/{config-MRWCWMFM.js → config-WXQTPQW7.js} +2 -2
- package/dist/chunks/{delete-THAK6PDA.js → delete-HQMI44SG.js} +2 -2
- package/dist/chunks/{delete-IJDA6IJT.js → delete-OGP3RVWM.js} +2 -2
- package/dist/chunks/{disable-XJLSQWDP.js → disable-HC266OB7.js} +2 -2
- package/dist/chunks/{discard-MDTDXLPM.js → discard-3RFIPLXY.js} +2 -2
- package/dist/chunks/{edit-XWMGSV5O.js → edit-NXPQFWM6.js} +3 -3
- package/dist/chunks/{edit-TBUQIBCG.js → edit-TZOCRGG6.js} +2 -2
- package/dist/chunks/{enable-D4ZEFA7B.js → enable-OGFRN4CG.js} +2 -2
- package/dist/chunks/{export-35THNYMQ.js → export-AEESZFZX.js} +2 -2
- package/dist/chunks/{image-ONVF2WQF.js → image-EIAO7LVN.js} +3 -3
- package/dist/chunks/{import-builders-4PL2UTKQ.js → import-builders-KCQLA2YR.js} +2 -2
- package/dist/chunks/{inspect-UKWD7EKB.js → inspect-EM34BOTE.js} +3 -3
- package/dist/chunks/{inspect-22HFUKUL.js → inspect-HHSDXTII.js} +2 -2
- package/dist/chunks/{inspect-JPKI7TUF.js → inspect-MGIECVLH.js} +2 -2
- package/dist/chunks/{inspect-P2MVWGGX.js → inspect-RUGPLO7A.js} +2 -2
- package/dist/chunks/{inspect-K5URFDTI.js → inspect-TTHC6L7Q.js} +2 -2
- package/dist/chunks/{list-2GKTKNSP.js → list-A74MGEOB.js} +2 -2
- package/dist/chunks/{list-RTALDLVZ.js → list-EOG3TYBE.js} +1 -1
- package/dist/chunks/{list-QOKS7OXY.js → list-GQDUIRBU.js} +3 -3
- package/dist/chunks/{login-VTT2OSLJ.js → login-L4EWZOGH.js} +2 -2
- package/dist/chunks/{ls-6M25LDJ3.js → ls-D5ESYWG5.js} +2 -2
- package/dist/chunks/{ls-DPQN66HC.js → ls-F6WCPVB7.js} +2 -2
- package/dist/chunks/{ls-5FYZ5VEP.js → ls-OJGSWVWO.js} +2 -2
- package/dist/chunks/{ls-4VTPS4H3.js → ls-OWHNAGNT.js} +2 -2
- package/dist/chunks/{ls-3XZ54CAA.js → ls-VBFBWSWD.js} +3 -3
- package/dist/chunks/{open-LSQVBKRQ.js → open-FHER5QV2.js} +2 -2
- package/dist/chunks/{permissions-KHCRKKCJ.js → permissions-JSXC7BRD.js} +4 -4
- package/dist/chunks/{publish-OQZQOC3A.js → publish-CM6ZGWIE.js} +2 -2
- package/dist/chunks/{push-O22DZTSK.js → push-5NYG7HIR.js} +2 -2
- package/dist/chunks/{query-X2SX26DL.js → query-5GQLF2BR.js} +1 -1
- package/dist/chunks/{reorder-E53PSWXQ.js → reorder-5GCNY75W.js} +2 -2
- package/dist/chunks/{reply-NQD2F6SH.js → reply-B2XCK5XR.js} +2 -2
- package/dist/chunks/{resolve-6ZPARPEF.js → resolve-YQP5C2QY.js} +2 -2
- package/dist/chunks/{restore-UJYDYOZO.js → restore-VHX4JV5J.js} +2 -2
- package/dist/chunks/{rm-TCPTNK5O.js → rm-AUUT2YIT.js} +2 -2
- package/dist/chunks/{rm-A6S57TZX.js → rm-OILUGCTW.js} +2 -2
- package/dist/chunks/{rm-5T3LQY2T.js → rm-QVVQDCDX.js} +3 -3
- package/dist/chunks/{rm-BYF6J53M.js → rm-VDFSX3LH.js} +2 -2
- package/dist/chunks/{rule-inspect-Q7G2H534.js → rule-inspect-LKTUPW4B.js} +3 -3
- package/dist/chunks/{rules-5EI4AZ2N.js → rules-J5JM5VFQ.js} +6 -6
- package/dist/chunks/{schema-CFEL4DGE.js → schema-OIKSCLDU.js} +1 -1
- package/dist/chunks/{tags-GWQZQY3Q.js → tags-AMTMNRLQ.js} +2 -2
- package/dist/chunks/{update-SHTZVWMD.js → update-AFL3GHKB.js} +6 -6
- package/dist/commands/build/index.js +13 -10
- package/dist/commands/deploy/index.js +12 -17
- 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 +49 -49
- package/dist/index.js +7 -7
- package/dist/version.mjs +1 -1
- package/package.json +18 -18
|
@@ -8,21 +8,21 @@ import {
|
|
|
8
8
|
parseCustomAlertQueryBody,
|
|
9
9
|
resolveCustomAlertProjectName,
|
|
10
10
|
setMissingCustomAlertProjectScope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2J7BL7IF.js";
|
|
12
12
|
import {
|
|
13
13
|
emitRulesArgParseError,
|
|
14
14
|
handleRulesApiError,
|
|
15
15
|
parseRulesFlagsAndScope,
|
|
16
16
|
rulesCollectionPath
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7RUZPHW7.js";
|
|
18
18
|
import {
|
|
19
19
|
isCustomAlertRule
|
|
20
20
|
} from "./chunk-TEQKKTJQ.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-DQDAQYQI.js";
|
|
22
22
|
import "./chunk-A3NYPUKZ.js";
|
|
23
23
|
import "./chunk-P65EEFTR.js";
|
|
24
24
|
import "./chunk-FGDKMNEN.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-MAZ2BUBX.js";
|
|
26
26
|
import "./chunk-JKQWQA2T.js";
|
|
27
27
|
import "./chunk-RQ7H43CJ.js";
|
|
28
28
|
import {
|
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
rulesAddSubcommand
|
|
33
33
|
} from "./chunk-UMA66MKW.js";
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-MGCBTAA7.js";
|
|
35
35
|
import "./chunk-KT4XXKJK.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-IBIZT5M4.js";
|
|
37
37
|
import "./chunk-ECCWJHC6.js";
|
|
38
38
|
import {
|
|
39
39
|
AGENT_REASON,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
handleVcrApiError,
|
|
10
10
|
resolveVcrScope,
|
|
11
11
|
validateVcrJsonOutput
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6WWATEWK.js";
|
|
13
13
|
import "./chunk-G75NFPIT.js";
|
|
14
14
|
import {
|
|
15
15
|
outputError
|
|
@@ -22,7 +22,7 @@ import "./chunk-B3JTF4CF.js";
|
|
|
22
22
|
import "./chunk-A5KP5HAI.js";
|
|
23
23
|
import "./chunk-J6LK45HT.js";
|
|
24
24
|
import "./chunk-R6IGDGX3.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-IBIZT5M4.js";
|
|
26
26
|
import "./chunk-ECCWJHC6.js";
|
|
27
27
|
import {
|
|
28
28
|
AGENT_REASON,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
emitVcrArgParseError,
|
|
18
18
|
resolveVcrScope,
|
|
19
19
|
validateVcrJsonOutput
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-6WWATEWK.js";
|
|
21
21
|
import "./chunk-G75NFPIT.js";
|
|
22
22
|
import {
|
|
23
23
|
outputError
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
permissionsAddSubcommand
|
|
28
28
|
} from "./chunk-J6LK45HT.js";
|
|
29
29
|
import "./chunk-R6IGDGX3.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-IBIZT5M4.js";
|
|
31
31
|
import "./chunk-ECCWJHC6.js";
|
|
32
32
|
import {
|
|
33
33
|
AGENT_REASON,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
runEngine,
|
|
24
24
|
splitPassthrough,
|
|
25
25
|
validateVcrChoice
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6WWATEWK.js";
|
|
27
27
|
import "./chunk-G75NFPIT.js";
|
|
28
28
|
import {
|
|
29
29
|
outputError
|
|
@@ -36,7 +36,7 @@ import "./chunk-B3JTF4CF.js";
|
|
|
36
36
|
import "./chunk-A5KP5HAI.js";
|
|
37
37
|
import "./chunk-J6LK45HT.js";
|
|
38
38
|
import "./chunk-R6IGDGX3.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-IBIZT5M4.js";
|
|
40
40
|
import "./chunk-ECCWJHC6.js";
|
|
41
41
|
import {
|
|
42
42
|
AGENT_REASON,
|
|
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
isJSONObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MAZ2BUBX.js";
|
|
10
10
|
import {
|
|
11
11
|
getProjectByNameOrId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IBIZT5M4.js";
|
|
13
13
|
import {
|
|
14
14
|
AGENT_REASON,
|
|
15
15
|
outputAgentError
|
|
@@ -15,13 +15,13 @@ import {
|
|
|
15
15
|
printIndications,
|
|
16
16
|
require_dist as require_dist2,
|
|
17
17
|
sleep
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MAZ2BUBX.js";
|
|
19
19
|
import {
|
|
20
20
|
suggestNextCommands
|
|
21
21
|
} from "./chunk-XBN2O34P.js";
|
|
22
22
|
import {
|
|
23
23
|
CommandTimeout
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GBXTATOJ.js";
|
|
25
25
|
import {
|
|
26
26
|
showPluginTipIfNeeded
|
|
27
27
|
} from "./chunk-HT2XWSAJ.js";
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
require_dist as require_dist3,
|
|
39
39
|
require_pluralize,
|
|
40
40
|
ua_default
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-IBIZT5M4.js";
|
|
42
42
|
import {
|
|
43
43
|
require_ms
|
|
44
44
|
} from "./chunk-GGP5R3FU.js";
|
|
@@ -1171,7 +1171,6 @@ async function processDeployment({
|
|
|
1171
1171
|
manual,
|
|
1172
1172
|
jsonOutput,
|
|
1173
1173
|
linkedProject,
|
|
1174
|
-
linkedProjectIsPartial,
|
|
1175
1174
|
...args
|
|
1176
1175
|
}) {
|
|
1177
1176
|
const {
|
|
@@ -1217,9 +1216,7 @@ async function processDeployment({
|
|
|
1217
1216
|
manual,
|
|
1218
1217
|
aliasAssignedSignal: aliasAssignedController.signal
|
|
1219
1218
|
};
|
|
1220
|
-
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${import_chalk2.default.bold(
|
|
1221
|
-
org.slug ? `${org.slug}/${projectName}` : projectName
|
|
1222
|
-
)}`;
|
|
1219
|
+
const deployingSpinnerVal = isSettingUpProject ? "Setting up project" : `Deploying ${import_chalk2.default.bold(`${org.slug}/${projectName}`)}`;
|
|
1223
1220
|
output_manager_default.spinner(deployingSpinnerVal, 0);
|
|
1224
1221
|
const indications = [];
|
|
1225
1222
|
let abortController;
|
|
@@ -1227,27 +1224,9 @@ async function processDeployment({
|
|
|
1227
1224
|
abortController?.abort();
|
|
1228
1225
|
output_manager_default.stopSpinner();
|
|
1229
1226
|
}
|
|
1230
|
-
const linkedProjectLookup = linkedProjectIsPartial && linkedProject && !noWait ? getProjectByNameOrId(
|
|
1231
|
-
client,
|
|
1232
|
-
linkedProject.id,
|
|
1233
|
-
linkedProject.accountId
|
|
1234
|
-
).then(
|
|
1235
|
-
(project2) => ({ project: project2 }),
|
|
1236
|
-
(error) => ({ error })
|
|
1237
|
-
) : void 0;
|
|
1238
1227
|
let rollingRelease = linkedProject?.rollingRelease;
|
|
1239
|
-
let project =
|
|
1228
|
+
let project = linkedProject;
|
|
1240
1229
|
let latestLogMessage = "";
|
|
1241
|
-
async function resolveProject() {
|
|
1242
|
-
if (!linkedProjectLookup) {
|
|
1243
|
-
return getProjectByNameOrId(client, projectName);
|
|
1244
|
-
}
|
|
1245
|
-
const result = await linkedProjectLookup;
|
|
1246
|
-
if ("error" in result) {
|
|
1247
|
-
throw result.error;
|
|
1248
|
-
}
|
|
1249
|
-
return result.project;
|
|
1250
|
-
}
|
|
1251
1230
|
try {
|
|
1252
1231
|
for await (const event of (0, import_client.createDeployment)(clientOptions, requestBody)) {
|
|
1253
1232
|
if (["tip", "notice", "warning"].includes(event.type)) {
|
|
@@ -1372,8 +1351,8 @@ async function processDeployment({
|
|
|
1372
1351
|
stopSpinner();
|
|
1373
1352
|
return event.payload;
|
|
1374
1353
|
}
|
|
1375
|
-
if (project === void 0
|
|
1376
|
-
project = await
|
|
1354
|
+
if (project === void 0) {
|
|
1355
|
+
project = await getProjectByNameOrId(client, projectName);
|
|
1377
1356
|
rollingRelease = project?.rollingRelease;
|
|
1378
1357
|
}
|
|
1379
1358
|
if (event.type === "ready" && rollingRelease) {
|
|
@@ -1523,8 +1502,7 @@ var Now = class {
|
|
|
1523
1502
|
agentName,
|
|
1524
1503
|
manual,
|
|
1525
1504
|
jsonOutput = false,
|
|
1526
|
-
linkedProject
|
|
1527
|
-
linkedProjectIsPartial
|
|
1505
|
+
linkedProject
|
|
1528
1506
|
}, org, isSettingUpProject, archive) {
|
|
1529
1507
|
const requestBody = {
|
|
1530
1508
|
...nowConfig,
|
|
@@ -1564,8 +1542,7 @@ var Now = class {
|
|
|
1564
1542
|
bulkRedirectsPath: nowConfig.bulkRedirectsPath,
|
|
1565
1543
|
manual,
|
|
1566
1544
|
jsonOutput,
|
|
1567
|
-
linkedProject
|
|
1568
|
-
linkedProjectIsPartial
|
|
1545
|
+
linkedProject
|
|
1569
1546
|
});
|
|
1570
1547
|
if (deployment && deployment.warnings) {
|
|
1571
1548
|
let sizeExceeded = 0;
|
|
@@ -7,13 +7,13 @@ const __dirname = __dirname_(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getUpdateCommandInfo,
|
|
9
9
|
isGlobal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NDOZRKTB.js";
|
|
11
11
|
import {
|
|
12
12
|
progress
|
|
13
13
|
} from "./chunk-I2XE3GMB.js";
|
|
14
14
|
import {
|
|
15
15
|
writeToConfigFile
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MAZ2BUBX.js";
|
|
17
17
|
import {
|
|
18
18
|
getGlobalPathConfig
|
|
19
19
|
} from "./chunk-JKQWQA2T.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
apiCommand,
|
|
25
25
|
listSubcommand4 as listSubcommand,
|
|
26
26
|
loginCommand
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GBXTATOJ.js";
|
|
28
28
|
import {
|
|
29
29
|
require_semver
|
|
30
30
|
} from "./chunk-IB5L4LKZ.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
require_mkdirp,
|
|
38
38
|
require_pump,
|
|
39
39
|
require_tar_stream
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-IBIZT5M4.js";
|
|
41
41
|
import {
|
|
42
42
|
TelemetryClient,
|
|
43
43
|
isNativeBinaryInstall
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getLocalPathConfig,
|
|
9
9
|
isPromptBackError,
|
|
10
10
|
isPromptCanceledError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MGCBTAA7.js";
|
|
12
12
|
import {
|
|
13
13
|
table
|
|
14
14
|
} from "./chunk-KT4XXKJK.js";
|
|
@@ -25,8 +25,10 @@ import {
|
|
|
25
25
|
findProjectsFromPath,
|
|
26
26
|
findRepoRoot,
|
|
27
27
|
findSourceVercelConfigFile,
|
|
28
|
+
getGitConfigPath,
|
|
28
29
|
getLinkedProject,
|
|
29
30
|
getProjectByNameOrId,
|
|
31
|
+
getRemoteUrls,
|
|
30
32
|
getServicesConfigWriteBlocker,
|
|
31
33
|
getVercelDirectory,
|
|
32
34
|
humanizePath,
|
|
@@ -34,6 +36,7 @@ import {
|
|
|
34
36
|
linkFolderToProject,
|
|
35
37
|
linkRepoProject,
|
|
36
38
|
parseGitConfig,
|
|
39
|
+
parseRepoUrl,
|
|
37
40
|
pluckRemoteUrls,
|
|
38
41
|
printAlignedLabel,
|
|
39
42
|
pull,
|
|
@@ -46,7 +49,7 @@ import {
|
|
|
46
49
|
selectAndParseRemoteUrl,
|
|
47
50
|
selectOrg,
|
|
48
51
|
writeServicesConfig
|
|
49
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-IBIZT5M4.js";
|
|
50
53
|
import {
|
|
51
54
|
printError
|
|
52
55
|
} from "./chunk-KBEX5MYS.js";
|
|
@@ -305,7 +308,7 @@ function displayServiceErrors(errors) {
|
|
|
305
308
|
// src/util/link/setup-and-link.ts
|
|
306
309
|
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
307
310
|
var import_fs_detectors2 = __toESM(require_dist(), 1);
|
|
308
|
-
import { join as
|
|
311
|
+
import { join as join3, basename } from "path";
|
|
309
312
|
import { getPlatformEnv } from "@vercel/build-utils";
|
|
310
313
|
|
|
311
314
|
// src/util/input/input-project.ts
|
|
@@ -315,6 +318,7 @@ var SEARCH_ALL_PROJECTS = "search-all-projects";
|
|
|
315
318
|
var CREATE_NEW_PROJECT = "create-new-project";
|
|
316
319
|
var BACK_TO_PROJECT_SELECTION = Symbol("back-to-project-selection");
|
|
317
320
|
var BACK_TO_TEAM_SELECTION = Symbol("back-to-team-selection");
|
|
321
|
+
var SWITCH_GIT_REMOTE = Symbol("switch-git-remote");
|
|
318
322
|
var NO_EXISTING_PROJECTS = Symbol("no-existing-projects");
|
|
319
323
|
async function inputProjectDecision(client, defaultDecision) {
|
|
320
324
|
const createChoice = {
|
|
@@ -439,8 +443,9 @@ async function searchExistingProjects(client, org, allowBack) {
|
|
|
439
443
|
}
|
|
440
444
|
});
|
|
441
445
|
}
|
|
442
|
-
async function inputProject(client, org, detectedProjectName, autoConfirm = false, skipAutoDetect = false, showProjectSuggestions = false, allowTeamSelectionBack = false, repoMatches = []) {
|
|
446
|
+
async function inputProject(client, org, detectedProjectName, autoConfirm = false, skipAutoDetect = false, showProjectSuggestions = false, allowTeamSelectionBack = false, repoMatches = [], gitRemoteOptions) {
|
|
443
447
|
const slugifiedName = (0, import_slugify.default)(detectedProjectName);
|
|
448
|
+
const canSwitchGitRemote = (gitRemoteOptions?.remoteNames.length ?? 0) > 1;
|
|
444
449
|
let detectedProject = null;
|
|
445
450
|
if (!skipAutoDetect && repoMatches.length === 0) {
|
|
446
451
|
output_manager_default.spinner("Searching for existing projects\u2026", 1e3);
|
|
@@ -514,6 +519,14 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
|
|
|
514
519
|
description: `Create it under ${org.slug}`
|
|
515
520
|
}
|
|
516
521
|
);
|
|
522
|
+
if (canSwitchGitRemote) {
|
|
523
|
+
const current = gitRemoteOptions?.currentRemoteName;
|
|
524
|
+
choices.push({
|
|
525
|
+
name: "Switch Git remote",
|
|
526
|
+
value: SWITCH_GIT_REMOTE,
|
|
527
|
+
description: current ? `Suggestions are from ${current}` : "Search projects linked to a different remote"
|
|
528
|
+
});
|
|
529
|
+
}
|
|
517
530
|
if (allowTeamSelectionBack) {
|
|
518
531
|
choices.push({
|
|
519
532
|
name: "Choose a different team",
|
|
@@ -528,6 +541,9 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
|
|
|
528
541
|
if (selected === BACK_TO_TEAM_SELECTION) {
|
|
529
542
|
return BACK_TO_TEAM_SELECTION;
|
|
530
543
|
}
|
|
544
|
+
if (selected === SWITCH_GIT_REMOTE) {
|
|
545
|
+
return SWITCH_GIT_REMOTE;
|
|
546
|
+
}
|
|
531
547
|
if (selected === CREATE_NEW_PROJECT) {
|
|
532
548
|
const projectName = await promptForProjectNameWithBack(
|
|
533
549
|
client,
|
|
@@ -908,33 +924,37 @@ async function promptForInferredServicesSetup({
|
|
|
908
924
|
|
|
909
925
|
// src/util/projects/search-project-across-teams.ts
|
|
910
926
|
var import_slugify2 = __toESM(require_slugify(), 1);
|
|
911
|
-
import { relative as relative2 } from "path";
|
|
927
|
+
import { join as join2, relative as relative2 } from "path";
|
|
912
928
|
async function searchProjectsByRepoRoot({
|
|
913
929
|
client,
|
|
914
930
|
cwd,
|
|
915
931
|
gitProjectName,
|
|
916
932
|
orgs,
|
|
917
|
-
|
|
918
|
-
nonInteractive
|
|
933
|
+
remoteName
|
|
919
934
|
}) {
|
|
935
|
+
const empty = { matches: [], remoteNames: [] };
|
|
920
936
|
const rootPath = await findRepoRoot(cwd);
|
|
921
937
|
if (!rootPath) {
|
|
922
|
-
return
|
|
938
|
+
return empty;
|
|
923
939
|
}
|
|
940
|
+
const gitConfigPath = getGitConfigPath({ cwd: rootPath }) ?? join2(rootPath, ".git/config");
|
|
941
|
+
const remoteUrls = await getRemoteUrls(gitConfigPath);
|
|
942
|
+
const remoteNames = remoteUrls ? Object.keys(remoteUrls).sort() : [];
|
|
924
943
|
let remote;
|
|
925
944
|
try {
|
|
926
945
|
remote = await resolveGitRemote(client, rootPath, {
|
|
927
|
-
yes:
|
|
946
|
+
yes: true,
|
|
947
|
+
existingRemoteName: remoteName
|
|
928
948
|
});
|
|
929
949
|
} catch (error) {
|
|
930
950
|
if (isPromptCanceledError(error)) {
|
|
931
951
|
throw error;
|
|
932
952
|
}
|
|
933
953
|
output_manager_default.debug(`Failed to resolve Git remote for project search: ${error}`);
|
|
934
|
-
return [];
|
|
954
|
+
return { matches: [], remoteNames };
|
|
935
955
|
}
|
|
936
956
|
if (!remote) {
|
|
937
|
-
return [];
|
|
957
|
+
return { matches: [], remoteNames };
|
|
938
958
|
}
|
|
939
959
|
const relativePath = relative2(rootPath, cwd);
|
|
940
960
|
const results = await Promise.all(
|
|
@@ -983,7 +1003,11 @@ async function searchProjectsByRepoRoot({
|
|
|
983
1003
|
}
|
|
984
1004
|
})
|
|
985
1005
|
);
|
|
986
|
-
return
|
|
1006
|
+
return {
|
|
1007
|
+
matches: results.flat(),
|
|
1008
|
+
remote,
|
|
1009
|
+
remoteNames
|
|
1010
|
+
};
|
|
987
1011
|
}
|
|
988
1012
|
|
|
989
1013
|
// src/util/link/setup-and-link.ts
|
|
@@ -1171,8 +1195,8 @@ async function setupAndLink(client, path2, {
|
|
|
1171
1195
|
}
|
|
1172
1196
|
if (forceDelete) {
|
|
1173
1197
|
const vercelDir = getVercelDirectory(path2);
|
|
1174
|
-
(0, import_fs_extra2.remove)(
|
|
1175
|
-
(0, import_fs_extra2.remove)(
|
|
1198
|
+
(0, import_fs_extra2.remove)(join3(vercelDir, VERCEL_DIR_README));
|
|
1199
|
+
(0, import_fs_extra2.remove)(join3(vercelDir, VERCEL_DIR_PROJECT));
|
|
1176
1200
|
}
|
|
1177
1201
|
output_manager_default.print("\n");
|
|
1178
1202
|
printAlignedLabel("Directory", humanizePath(path2));
|
|
@@ -1182,6 +1206,7 @@ async function setupAndLink(client, path2, {
|
|
|
1182
1206
|
const showProjectSuggestions = interactive && !gitProjectName;
|
|
1183
1207
|
let projectOrNewProjectName;
|
|
1184
1208
|
let teamAutoSelected = false;
|
|
1209
|
+
let selectedGitRemoteName;
|
|
1185
1210
|
for (; ; ) {
|
|
1186
1211
|
if (!org) {
|
|
1187
1212
|
const orgMeta = {};
|
|
@@ -1198,17 +1223,21 @@ async function setupAndLink(client, path2, {
|
|
|
1198
1223
|
teamAutoSelected = orgMeta.choiceCount === 1;
|
|
1199
1224
|
}
|
|
1200
1225
|
let repoMatches = [];
|
|
1226
|
+
let gitRemoteNames = [];
|
|
1227
|
+
let currentGitRemoteName;
|
|
1201
1228
|
if (showProjectSuggestions) {
|
|
1202
1229
|
output_manager_default.spinner("Searching for existing projects\u2026", 1e3);
|
|
1203
1230
|
try {
|
|
1204
|
-
|
|
1231
|
+
const repoSearch = await searchProjectsByRepoRoot({
|
|
1205
1232
|
client,
|
|
1206
1233
|
cwd: path2,
|
|
1207
1234
|
gitProjectName,
|
|
1208
1235
|
orgs: [org],
|
|
1209
|
-
|
|
1210
|
-
nonInteractive
|
|
1236
|
+
remoteName: selectedGitRemoteName
|
|
1211
1237
|
});
|
|
1238
|
+
repoMatches = repoSearch.matches;
|
|
1239
|
+
gitRemoteNames = repoSearch.remoteNames;
|
|
1240
|
+
currentGitRemoteName = repoSearch.remote?.remoteName;
|
|
1212
1241
|
} catch (err) {
|
|
1213
1242
|
if (isPromptCanceledError(err)) {
|
|
1214
1243
|
throw err;
|
|
@@ -1227,7 +1256,11 @@ async function setupAndLink(client, path2, {
|
|
|
1227
1256
|
false,
|
|
1228
1257
|
showProjectSuggestions,
|
|
1229
1258
|
searchableTeamPicker && !selectedOrg && !teamAutoSelected,
|
|
1230
|
-
repoMatches
|
|
1259
|
+
repoMatches,
|
|
1260
|
+
{
|
|
1261
|
+
remoteNames: gitRemoteNames,
|
|
1262
|
+
currentRemoteName: currentGitRemoteName
|
|
1263
|
+
}
|
|
1231
1264
|
);
|
|
1232
1265
|
} catch (err) {
|
|
1233
1266
|
if (err instanceof Error && err.code === "HEADLESS") {
|
|
@@ -1237,6 +1270,25 @@ async function setupAndLink(client, path2, {
|
|
|
1237
1270
|
}
|
|
1238
1271
|
if (projectOrNewProjectName === BACK_TO_TEAM_SELECTION) {
|
|
1239
1272
|
org = void 0;
|
|
1273
|
+
selectedGitRemoteName = void 0;
|
|
1274
|
+
continue;
|
|
1275
|
+
}
|
|
1276
|
+
if (projectOrNewProjectName === SWITCH_GIT_REMOTE) {
|
|
1277
|
+
const rootPath = await findRepoRoot(path2);
|
|
1278
|
+
if (!rootPath) {
|
|
1279
|
+
continue;
|
|
1280
|
+
}
|
|
1281
|
+
try {
|
|
1282
|
+
const remote = await resolveGitRemote(client, rootPath, {
|
|
1283
|
+
yes: false
|
|
1284
|
+
});
|
|
1285
|
+
selectedGitRemoteName = remote?.remoteName;
|
|
1286
|
+
} catch (err) {
|
|
1287
|
+
if (isPromptCanceledError(err)) {
|
|
1288
|
+
throw err;
|
|
1289
|
+
}
|
|
1290
|
+
output_manager_default.debug(`Failed to switch Git remote: ${err}`);
|
|
1291
|
+
}
|
|
1240
1292
|
continue;
|
|
1241
1293
|
}
|
|
1242
1294
|
break;
|
|
@@ -1270,6 +1322,11 @@ async function setupAndLink(client, path2, {
|
|
|
1270
1322
|
return { status: "linked", org, project };
|
|
1271
1323
|
}
|
|
1272
1324
|
config.currentTeam = org.type === "team" ? org.id : void 0;
|
|
1325
|
+
const gitConnectIntent = await resolveGitConnectIntent(
|
|
1326
|
+
client,
|
|
1327
|
+
path2,
|
|
1328
|
+
autoConfirm
|
|
1329
|
+
);
|
|
1273
1330
|
const rootServicesSetup = await getServicesSetupState(path2);
|
|
1274
1331
|
const configFileName = await findSourceVercelConfigFile(path2) ?? "vercel.json";
|
|
1275
1332
|
try {
|
|
@@ -1309,7 +1366,7 @@ async function setupAndLink(client, path2, {
|
|
|
1309
1366
|
});
|
|
1310
1367
|
if (shouldPromptRoot) {
|
|
1311
1368
|
rootDirectory = await inputRootDirectory(client, path2, autoConfirm);
|
|
1312
|
-
if (rootDirectory && !await validateRootDirectory(path2,
|
|
1369
|
+
if (rootDirectory && !await validateRootDirectory(path2, join3(path2, rootDirectory))) {
|
|
1313
1370
|
return {
|
|
1314
1371
|
status: "error",
|
|
1315
1372
|
exitCode: 1,
|
|
@@ -1318,7 +1375,7 @@ async function setupAndLink(client, path2, {
|
|
|
1318
1375
|
}
|
|
1319
1376
|
}
|
|
1320
1377
|
}
|
|
1321
|
-
pathWithRootDirectory = rootDirectory ?
|
|
1378
|
+
pathWithRootDirectory = rootDirectory ? join3(path2, rootDirectory) : path2;
|
|
1322
1379
|
const selectedRootServicesSetup = pathWithRootDirectory === path2 ? null : await getServicesSetupState(pathWithRootDirectory);
|
|
1323
1380
|
let selectedRootInferredServicesChoice = null;
|
|
1324
1381
|
if (!skipSelectedRootInferredServicesPrompt) {
|
|
@@ -1345,7 +1402,7 @@ async function setupAndLink(client, path2, {
|
|
|
1345
1402
|
path2,
|
|
1346
1403
|
selectedRootInferredServicesChoice.selectedPath
|
|
1347
1404
|
);
|
|
1348
|
-
pathWithRootDirectory = rootDirectory ?
|
|
1405
|
+
pathWithRootDirectory = rootDirectory ? join3(path2, rootDirectory) : path2;
|
|
1349
1406
|
}
|
|
1350
1407
|
const localConfig = await readConfig(pathWithRootDirectory);
|
|
1351
1408
|
if (localConfig instanceof CantParseJSONFile) {
|
|
@@ -1409,7 +1466,13 @@ async function setupAndLink(client, path2, {
|
|
|
1409
1466
|
// don't prompt to pull env for newly created projects
|
|
1410
1467
|
"Created"
|
|
1411
1468
|
);
|
|
1412
|
-
await
|
|
1469
|
+
await applyGitConnectIntent(
|
|
1470
|
+
client,
|
|
1471
|
+
gitConnectIntent,
|
|
1472
|
+
project,
|
|
1473
|
+
autoConfirm,
|
|
1474
|
+
org
|
|
1475
|
+
);
|
|
1413
1476
|
return { status: "linked", org, project };
|
|
1414
1477
|
} catch (err) {
|
|
1415
1478
|
if (isPromptCanceledError(err)) {
|
|
@@ -1426,25 +1489,40 @@ async function setupAndLink(client, path2, {
|
|
|
1426
1489
|
return { status: "error", exitCode: 1 };
|
|
1427
1490
|
}
|
|
1428
1491
|
}
|
|
1429
|
-
async function
|
|
1492
|
+
async function resolveGitConnectIntent(client, path2, autoConfirm) {
|
|
1430
1493
|
try {
|
|
1431
|
-
const gitConfig = await parseGitConfig(
|
|
1494
|
+
const gitConfig = await parseGitConfig(join3(path2, ".git/config"));
|
|
1432
1495
|
if (!gitConfig) {
|
|
1433
|
-
return;
|
|
1496
|
+
return null;
|
|
1434
1497
|
}
|
|
1435
1498
|
const remoteUrls = pluckRemoteUrls(gitConfig);
|
|
1436
1499
|
if (!remoteUrls || Object.keys(remoteUrls).length === 0) {
|
|
1437
|
-
return;
|
|
1500
|
+
return null;
|
|
1438
1501
|
}
|
|
1439
|
-
|
|
1440
|
-
const shouldConnect =
|
|
1502
|
+
const skipPrompts = autoConfirm || client.nonInteractive;
|
|
1503
|
+
const shouldConnect = skipPrompts || await client.input.confirm(`Connect detected Git repository?`, false);
|
|
1441
1504
|
if (!shouldConnect) {
|
|
1442
|
-
return;
|
|
1505
|
+
return null;
|
|
1443
1506
|
}
|
|
1444
|
-
const repoInfo = await selectAndParseRemoteUrl(client, remoteUrls);
|
|
1507
|
+
const repoInfo = skipPrompts ? parseRepoUrl(remoteUrls.origin ?? Object.values(remoteUrls)[0]) : await selectAndParseRemoteUrl(client, remoteUrls);
|
|
1445
1508
|
if (!repoInfo) {
|
|
1446
|
-
return;
|
|
1509
|
+
return null;
|
|
1510
|
+
}
|
|
1511
|
+
return { repoInfo };
|
|
1512
|
+
} catch (error) {
|
|
1513
|
+
if (isPromptCanceledError(error)) {
|
|
1514
|
+
throw error;
|
|
1447
1515
|
}
|
|
1516
|
+
output_manager_default.debug(`Failed to detect git repository: ${error}`);
|
|
1517
|
+
return null;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
async function applyGitConnectIntent(client, intent, project, autoConfirm, org) {
|
|
1521
|
+
if (!intent) {
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
const { repoInfo } = intent;
|
|
1525
|
+
try {
|
|
1448
1526
|
await checkExistsAndConnect({
|
|
1449
1527
|
client,
|
|
1450
1528
|
confirm: autoConfirm,
|
|
@@ -31,10 +31,10 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
buildCommand,
|
|
33
33
|
pullCommand
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-2SEBBSKD.js";
|
|
35
35
|
import {
|
|
36
36
|
envCommand
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-IBIZT5M4.js";
|
|
38
38
|
import {
|
|
39
39
|
confirmOption,
|
|
40
40
|
deploymentOption,
|