vercel 50.38.2 → 50.38.3
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/{chunk-AXOANVOG.js → chunk-3I3UP3EV.js} +171 -23
- package/dist/chunks/{chunk-ICF3EEZZ.js → chunk-4MZDTR5P.js} +1 -1
- package/dist/chunks/{chunk-HYML6AJ3.js → chunk-7FIZZGGM.js} +3 -3
- package/dist/chunks/{chunk-2627GXHB.js → chunk-CJOJGC52.js} +1 -1
- package/dist/chunks/{chunk-4BKWSSVR.js → chunk-ER5LLAJ6.js} +1 -1
- package/dist/chunks/{chunk-VZRUZWK4.js → chunk-F4R4S5SZ.js} +1 -1
- package/dist/chunks/{chunk-67MQ4YV2.js → chunk-HBTEU7F4.js} +1 -1
- package/dist/chunks/{chunk-VKJ2MX4B.js → chunk-NT3RI4UZ.js} +2 -2
- package/dist/chunks/{chunk-5LPNH6LU.js → chunk-OC2OLW2J.js} +1 -1
- package/dist/chunks/{chunk-BU4TV4NY.js → chunk-PCFBWAJO.js} +3 -3
- package/dist/chunks/{chunk-FOGOG6EI.js → chunk-TZTFRKQP.js} +4 -4
- package/dist/chunks/{chunk-VOUOJAPB.js → chunk-URWUVSGJ.js} +4 -4
- package/dist/chunks/{chunk-HXL4RKQ7.js → chunk-V5FUID6S.js} +346 -10
- package/dist/chunks/{chunk-3GF7O7DF.js → chunk-VRPR7GUR.js} +1 -1
- package/dist/chunks/{chunk-6LLAZLXP.js → chunk-W2M6PJ7F.js} +2 -2
- package/dist/chunks/{chunk-5N2LMLYN.js → chunk-WGMPIQHN.js} +1 -1
- package/dist/chunks/{chunk-FGUZP3AB.js → chunk-WILFGAOT.js} +26 -3
- package/dist/chunks/{chunk-SAGSFQ5F.js → chunk-YXPDMJDR.js} +1 -1
- package/dist/chunks/{compile-vercel-config-IRB2ROU6.js → compile-vercel-config-FR2YWUTQ.js} +1 -1
- package/dist/chunks/{delete-ENKLG5OJ.js → delete-WNTEO77M.js} +2 -2
- package/dist/chunks/{disable-WHPCCVGJ.js → disable-77Z5767C.js} +2 -2
- package/dist/chunks/{discard-ZSMYLHMX.js → discard-Y5Q5M7UN.js} +2 -2
- package/dist/chunks/{edit-EPWZER7H.js → edit-WOPMJTMZ.js} +3 -3
- package/dist/chunks/{enable-7N4RJVTP.js → enable-O24LJFM4.js} +2 -2
- package/dist/chunks/{export-AFSODWYQ.js → export-I2PM6DJW.js} +2 -2
- package/dist/chunks/{list-GP4ICPAQ.js → list-TSVT6OUQ.js} +1 -1
- package/dist/chunks/{list-XPTOW5YJ.js → list-UZITU56D.js} +1 -1
- package/dist/chunks/{publish-6MTUNHWF.js → publish-H6G2AB5C.js} +2 -2
- package/dist/chunks/{query-74Q2S6VL.js → query-MS5CFVOU.js} +1 -1
- package/dist/chunks/{reorder-RRPZTEHN.js → reorder-XD7S74TB.js} +2 -2
- package/dist/chunks/{restore-5W5NSTPI.js → restore-XCT2KIQJ.js} +2 -2
- package/dist/commands/build/index.js +9 -9
- package/dist/commands/deploy/index.js +10 -10
- package/dist/commands/dev/index.js +8 -8
- package/dist/commands/env/index.js +5 -5
- package/dist/commands/link/index.js +9 -8
- package/dist/commands/list/index.js +2 -2
- package/dist/commands-bulk.js +187 -94
- package/dist/index.js +9 -9
- package/dist/version.mjs +1 -1
- package/package.json +13 -13
|
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
getLocalPathConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VRPR7GUR.js";
|
|
10
10
|
import {
|
|
11
11
|
VERCEL_DIR_PROJECT,
|
|
12
12
|
VERCEL_DIR_README,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
getLinkedProject,
|
|
18
18
|
getProjectByNameOrId,
|
|
19
19
|
getServicesConfigWriteBlocker,
|
|
20
|
+
getTeams,
|
|
20
21
|
getVercelDirectory,
|
|
21
22
|
humanizePath,
|
|
22
23
|
isDirectory,
|
|
@@ -31,10 +32,13 @@ import {
|
|
|
31
32
|
selectAndParseRemoteUrl,
|
|
32
33
|
selectOrg,
|
|
33
34
|
writeServicesConfig
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-V5FUID6S.js";
|
|
35
36
|
import {
|
|
36
37
|
table
|
|
37
38
|
} from "./chunk-CTY6ZEQZ.js";
|
|
39
|
+
import {
|
|
40
|
+
getUser
|
|
41
|
+
} from "./chunk-AY4LBM3J.js";
|
|
38
42
|
import {
|
|
39
43
|
CantParseJSONFile,
|
|
40
44
|
ProjectNotFound,
|
|
@@ -262,19 +266,21 @@ import { join as join2, basename } from "path";
|
|
|
262
266
|
// src/util/input/input-project.ts
|
|
263
267
|
var import_chalk2 = __toESM(require_source(), 1);
|
|
264
268
|
var import_slugify = __toESM(require_slugify(), 1);
|
|
265
|
-
async function inputProject(client, org, detectedProjectName, autoConfirm = false) {
|
|
269
|
+
async function inputProject(client, org, detectedProjectName, autoConfirm = false, skipAutoDetect = false) {
|
|
266
270
|
const slugifiedName = (0, import_slugify.default)(detectedProjectName);
|
|
267
271
|
let detectedProject = null;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
if (!skipAutoDetect) {
|
|
273
|
+
output_manager_default.spinner("Searching for existing projects\u2026", 1e3);
|
|
274
|
+
const [project, slugifiedProject] = await Promise.all([
|
|
275
|
+
getProjectByNameOrId(client, detectedProjectName, org.id),
|
|
276
|
+
slugifiedName !== detectedProjectName ? getProjectByNameOrId(client, slugifiedName, org.id) : null
|
|
277
|
+
]);
|
|
278
|
+
detectedProject = !(project instanceof ProjectNotFound) ? project : !(slugifiedProject instanceof ProjectNotFound) ? slugifiedProject : null;
|
|
279
|
+
if (detectedProject && !detectedProject.id) {
|
|
280
|
+
throw new Error(`Detected linked project does not have "id".`);
|
|
281
|
+
}
|
|
282
|
+
output_manager_default.stopSpinner();
|
|
283
|
+
}
|
|
278
284
|
if (autoConfirm) {
|
|
279
285
|
return detectedProject || detectedProjectName;
|
|
280
286
|
}
|
|
@@ -319,19 +325,19 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
|
|
|
319
325
|
if (!val) {
|
|
320
326
|
return "Project name cannot be empty";
|
|
321
327
|
}
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
328
|
+
const project = await getProjectByNameOrId(client, val, org.id);
|
|
329
|
+
if (project instanceof ProjectNotFound) {
|
|
324
330
|
return "Project not found";
|
|
325
331
|
}
|
|
326
|
-
toLink =
|
|
332
|
+
toLink = project;
|
|
327
333
|
return true;
|
|
328
334
|
}
|
|
329
335
|
});
|
|
330
336
|
return toLink;
|
|
331
337
|
} else {
|
|
332
|
-
const choices = projects.sort((a, b) => b.updatedAt - a.updatedAt).map((
|
|
333
|
-
name:
|
|
334
|
-
value:
|
|
338
|
+
const choices = projects.sort((a, b) => b.updatedAt - a.updatedAt).map((project) => ({
|
|
339
|
+
name: project.name,
|
|
340
|
+
value: project
|
|
335
341
|
}));
|
|
336
342
|
const toLink = await client.input.select({
|
|
337
343
|
message: "Which existing project do you want to link?",
|
|
@@ -347,8 +353,8 @@ async function inputProject(client, org, detectedProjectName, autoConfirm = fals
|
|
|
347
353
|
if (!val) {
|
|
348
354
|
return "Project name cannot be empty";
|
|
349
355
|
}
|
|
350
|
-
const
|
|
351
|
-
if (!(
|
|
356
|
+
const project = await getProjectByNameOrId(client, val, org.id);
|
|
357
|
+
if (!(project instanceof ProjectNotFound)) {
|
|
352
358
|
return "Project already exists";
|
|
353
359
|
}
|
|
354
360
|
return true;
|
|
@@ -668,6 +674,42 @@ async function promptForInferredServicesSetup({
|
|
|
668
674
|
return { type: "services" };
|
|
669
675
|
}
|
|
670
676
|
|
|
677
|
+
// src/util/projects/search-project-across-teams.ts
|
|
678
|
+
var import_slugify2 = __toESM(require_slugify(), 1);
|
|
679
|
+
async function searchProjectAcrossTeams(client, projectName) {
|
|
680
|
+
const [user, teams] = await Promise.all([getUser(client), getTeams(client)]);
|
|
681
|
+
const orgs = [
|
|
682
|
+
...user.version === "northstar" ? [] : [{ type: "user", id: user.id, slug: user.username }],
|
|
683
|
+
...teams.map((t) => ({
|
|
684
|
+
type: "team",
|
|
685
|
+
id: t.id,
|
|
686
|
+
slug: t.slug
|
|
687
|
+
}))
|
|
688
|
+
];
|
|
689
|
+
const slugifiedName = (0, import_slugify2.default)(projectName);
|
|
690
|
+
const searchNames = [projectName];
|
|
691
|
+
if (slugifiedName !== projectName) {
|
|
692
|
+
searchNames.push(slugifiedName);
|
|
693
|
+
}
|
|
694
|
+
const searchPromises = orgs.flatMap(
|
|
695
|
+
(org) => searchNames.map(
|
|
696
|
+
(name) => getProjectByNameOrId(client, name, org.id).then(
|
|
697
|
+
(result) => result instanceof ProjectNotFound ? null : { project: result, org }
|
|
698
|
+
).catch(() => null)
|
|
699
|
+
)
|
|
700
|
+
);
|
|
701
|
+
const results = await Promise.all(searchPromises);
|
|
702
|
+
const seen = /* @__PURE__ */ new Set();
|
|
703
|
+
const matches = [];
|
|
704
|
+
for (const r of results) {
|
|
705
|
+
if (r && r.project.id && !seen.has(r.project.id)) {
|
|
706
|
+
seen.add(r.project.id);
|
|
707
|
+
matches.push(r);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return matches;
|
|
711
|
+
}
|
|
712
|
+
|
|
671
713
|
// src/util/link/setup-and-link.ts
|
|
672
714
|
async function setupAndLink(client, path2, {
|
|
673
715
|
autoConfirm = false,
|
|
@@ -678,7 +720,8 @@ async function setupAndLink(client, path2, {
|
|
|
678
720
|
projectName = basename(path2),
|
|
679
721
|
nonInteractive = false,
|
|
680
722
|
pullEnv = true,
|
|
681
|
-
v0
|
|
723
|
+
v0,
|
|
724
|
+
searchAcrossTeams = false
|
|
682
725
|
}) {
|
|
683
726
|
const { config } = client;
|
|
684
727
|
if (!isDirectory(path2)) {
|
|
@@ -712,6 +755,110 @@ async function setupAndLink(client, path2, {
|
|
|
712
755
|
`);
|
|
713
756
|
return { status: "not_linked", org: null, project: null };
|
|
714
757
|
}
|
|
758
|
+
let skipAutoDetect = false;
|
|
759
|
+
if (searchAcrossTeams) {
|
|
760
|
+
let crossTeamMatches = [];
|
|
761
|
+
output_manager_default.spinner("Searching for existing projects\u2026", 1e3);
|
|
762
|
+
try {
|
|
763
|
+
crossTeamMatches = await searchProjectAcrossTeams(client, projectName);
|
|
764
|
+
} catch (err) {
|
|
765
|
+
output_manager_default.debug(`Cross-team search failed: ${err}`);
|
|
766
|
+
} finally {
|
|
767
|
+
output_manager_default.stopSpinner();
|
|
768
|
+
}
|
|
769
|
+
if (crossTeamMatches.length === 1) {
|
|
770
|
+
const match = crossTeamMatches[0];
|
|
771
|
+
if (autoConfirm || nonInteractive) {
|
|
772
|
+
config.currentTeam = match.org.type === "team" ? match.org.id : void 0;
|
|
773
|
+
await linkFolderToProject(
|
|
774
|
+
client,
|
|
775
|
+
path2,
|
|
776
|
+
{ projectId: match.project.id, orgId: match.org.id },
|
|
777
|
+
match.project.name,
|
|
778
|
+
match.org.slug,
|
|
779
|
+
successEmoji,
|
|
780
|
+
autoConfirm,
|
|
781
|
+
pullEnv
|
|
782
|
+
);
|
|
783
|
+
return { status: "linked", org: match.org, project: match.project };
|
|
784
|
+
}
|
|
785
|
+
const confirmed = await client.input.confirm(
|
|
786
|
+
`Found project ${import_chalk6.default.blue(match.org.slug)}/${match.project.name}. Link to it?`,
|
|
787
|
+
true
|
|
788
|
+
);
|
|
789
|
+
if (confirmed) {
|
|
790
|
+
config.currentTeam = match.org.type === "team" ? match.org.id : void 0;
|
|
791
|
+
await linkFolderToProject(
|
|
792
|
+
client,
|
|
793
|
+
path2,
|
|
794
|
+
{ projectId: match.project.id, orgId: match.org.id },
|
|
795
|
+
match.project.name,
|
|
796
|
+
match.org.slug,
|
|
797
|
+
successEmoji,
|
|
798
|
+
autoConfirm,
|
|
799
|
+
pullEnv
|
|
800
|
+
);
|
|
801
|
+
return { status: "linked", org: match.org, project: match.project };
|
|
802
|
+
}
|
|
803
|
+
skipAutoDetect = true;
|
|
804
|
+
} else if (crossTeamMatches.length > 1) {
|
|
805
|
+
const currentTeamMatch = autoConfirm ? crossTeamMatches.find((m) => m.org.id === config.currentTeam) : void 0;
|
|
806
|
+
if (currentTeamMatch) {
|
|
807
|
+
config.currentTeam = currentTeamMatch.org.type === "team" ? currentTeamMatch.org.id : void 0;
|
|
808
|
+
await linkFolderToProject(
|
|
809
|
+
client,
|
|
810
|
+
path2,
|
|
811
|
+
{
|
|
812
|
+
projectId: currentTeamMatch.project.id,
|
|
813
|
+
orgId: currentTeamMatch.org.id
|
|
814
|
+
},
|
|
815
|
+
currentTeamMatch.project.name,
|
|
816
|
+
currentTeamMatch.org.slug,
|
|
817
|
+
successEmoji,
|
|
818
|
+
autoConfirm,
|
|
819
|
+
pullEnv
|
|
820
|
+
);
|
|
821
|
+
return {
|
|
822
|
+
status: "linked",
|
|
823
|
+
org: currentTeamMatch.org,
|
|
824
|
+
project: currentTeamMatch.project
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
if (!nonInteractive) {
|
|
828
|
+
const choices = crossTeamMatches.map((m) => ({
|
|
829
|
+
name: `${import_chalk6.default.blue(m.org.slug)}/${m.project.name}`,
|
|
830
|
+
value: m
|
|
831
|
+
}));
|
|
832
|
+
choices.push({
|
|
833
|
+
name: "Don't link to an existing project",
|
|
834
|
+
value: null
|
|
835
|
+
});
|
|
836
|
+
const selected = await client.input.select({
|
|
837
|
+
message: "Found matching projects across teams. Which one do you want to link?",
|
|
838
|
+
choices
|
|
839
|
+
});
|
|
840
|
+
if (selected) {
|
|
841
|
+
config.currentTeam = selected.org.type === "team" ? selected.org.id : void 0;
|
|
842
|
+
await linkFolderToProject(
|
|
843
|
+
client,
|
|
844
|
+
path2,
|
|
845
|
+
{ projectId: selected.project.id, orgId: selected.org.id },
|
|
846
|
+
selected.project.name,
|
|
847
|
+
selected.org.slug,
|
|
848
|
+
successEmoji,
|
|
849
|
+
autoConfirm,
|
|
850
|
+
pullEnv
|
|
851
|
+
);
|
|
852
|
+
return {
|
|
853
|
+
status: "linked",
|
|
854
|
+
org: selected.org,
|
|
855
|
+
project: selected.project
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
skipAutoDetect = true;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
715
862
|
try {
|
|
716
863
|
org = await selectOrg(
|
|
717
864
|
client,
|
|
@@ -737,7 +884,8 @@ async function setupAndLink(client, path2, {
|
|
|
737
884
|
client,
|
|
738
885
|
org,
|
|
739
886
|
projectName,
|
|
740
|
-
autoConfirm
|
|
887
|
+
autoConfirm,
|
|
888
|
+
skipAutoDetect
|
|
741
889
|
);
|
|
742
890
|
} catch (err) {
|
|
743
891
|
if (err instanceof Error && err.code === "HEADLESS") {
|
|
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
getUpdateCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YXPDMJDR.js";
|
|
10
10
|
import {
|
|
11
11
|
login
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PCFBWAJO.js";
|
|
13
13
|
import {
|
|
14
14
|
loginCommand
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WILFGAOT.js";
|
|
16
16
|
import {
|
|
17
17
|
help
|
|
18
18
|
} from "./chunk-O5OD4JWH.js";
|
|
@@ -6,14 +6,14 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
setupAndLink
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3I3UP3EV.js";
|
|
10
10
|
import {
|
|
11
11
|
buildCommandWithYes,
|
|
12
12
|
getLinkedProject,
|
|
13
13
|
outputActionRequired,
|
|
14
14
|
param,
|
|
15
15
|
resolveProjectCwd
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-V5FUID6S.js";
|
|
17
17
|
import {
|
|
18
18
|
getCommandName,
|
|
19
19
|
getCommandNamePlain
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./chunk-V5P25P7F.js";
|
|
10
10
|
import {
|
|
11
11
|
autoInstallAgentTooling
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CJOJGC52.js";
|
|
13
13
|
import {
|
|
14
14
|
ua_default
|
|
15
15
|
} from "./chunk-5ZVJYXLU.js";
|
|
16
16
|
import {
|
|
17
17
|
getLocalPathConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VRPR7GUR.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_VERCEL_CONFIG_FILENAME,
|
|
21
21
|
VERCEL_CONFIG_EXTENSIONS,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
useKeypress,
|
|
41
41
|
usePrefix,
|
|
42
42
|
useState
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-V5FUID6S.js";
|
|
44
44
|
import {
|
|
45
45
|
getUser
|
|
46
46
|
} from "./chunk-AY4LBM3J.js";
|
|
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
8
|
writeProjectSettings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ER5LLAJ6.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NT3RI4UZ.js";
|
|
13
13
|
import {
|
|
14
14
|
pullCommand
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WGMPIQHN.js";
|
|
16
16
|
import {
|
|
17
17
|
help
|
|
18
18
|
} from "./chunk-O5OD4JWH.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
envPullCommandLogic,
|
|
23
23
|
humanizePath,
|
|
24
24
|
parseTarget
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-V5FUID6S.js";
|
|
26
26
|
import {
|
|
27
27
|
TelemetryClient
|
|
28
28
|
} from "./chunk-MXPZBZ2X.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
printIndications,
|
|
10
10
|
require_dist as require_dist2,
|
|
11
11
|
sleep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PCFBWAJO.js";
|
|
13
13
|
import {
|
|
14
14
|
suggestNextCommands
|
|
15
15
|
} from "./chunk-XR53KVJD.js";
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
} from "./chunk-QIZEWDZG.js";
|
|
23
23
|
import {
|
|
24
24
|
showPluginTipIfNeeded
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CJOJGC52.js";
|
|
26
26
|
import {
|
|
27
27
|
CommandTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WILFGAOT.js";
|
|
29
29
|
import {
|
|
30
30
|
ua_default
|
|
31
31
|
} from "./chunk-5ZVJYXLU.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
param,
|
|
35
35
|
require_dist as require_dist3,
|
|
36
36
|
require_lib3 as require_lib
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-V5FUID6S.js";
|
|
38
38
|
import {
|
|
39
39
|
stamp_default
|
|
40
40
|
} from "./chunk-SOTR4CXR.js";
|