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.
Files changed (41) hide show
  1. package/dist/chunks/{chunk-AXOANVOG.js → chunk-3I3UP3EV.js} +171 -23
  2. package/dist/chunks/{chunk-ICF3EEZZ.js → chunk-4MZDTR5P.js} +1 -1
  3. package/dist/chunks/{chunk-HYML6AJ3.js → chunk-7FIZZGGM.js} +3 -3
  4. package/dist/chunks/{chunk-2627GXHB.js → chunk-CJOJGC52.js} +1 -1
  5. package/dist/chunks/{chunk-4BKWSSVR.js → chunk-ER5LLAJ6.js} +1 -1
  6. package/dist/chunks/{chunk-VZRUZWK4.js → chunk-F4R4S5SZ.js} +1 -1
  7. package/dist/chunks/{chunk-67MQ4YV2.js → chunk-HBTEU7F4.js} +1 -1
  8. package/dist/chunks/{chunk-VKJ2MX4B.js → chunk-NT3RI4UZ.js} +2 -2
  9. package/dist/chunks/{chunk-5LPNH6LU.js → chunk-OC2OLW2J.js} +1 -1
  10. package/dist/chunks/{chunk-BU4TV4NY.js → chunk-PCFBWAJO.js} +3 -3
  11. package/dist/chunks/{chunk-FOGOG6EI.js → chunk-TZTFRKQP.js} +4 -4
  12. package/dist/chunks/{chunk-VOUOJAPB.js → chunk-URWUVSGJ.js} +4 -4
  13. package/dist/chunks/{chunk-HXL4RKQ7.js → chunk-V5FUID6S.js} +346 -10
  14. package/dist/chunks/{chunk-3GF7O7DF.js → chunk-VRPR7GUR.js} +1 -1
  15. package/dist/chunks/{chunk-6LLAZLXP.js → chunk-W2M6PJ7F.js} +2 -2
  16. package/dist/chunks/{chunk-5N2LMLYN.js → chunk-WGMPIQHN.js} +1 -1
  17. package/dist/chunks/{chunk-FGUZP3AB.js → chunk-WILFGAOT.js} +26 -3
  18. package/dist/chunks/{chunk-SAGSFQ5F.js → chunk-YXPDMJDR.js} +1 -1
  19. package/dist/chunks/{compile-vercel-config-IRB2ROU6.js → compile-vercel-config-FR2YWUTQ.js} +1 -1
  20. package/dist/chunks/{delete-ENKLG5OJ.js → delete-WNTEO77M.js} +2 -2
  21. package/dist/chunks/{disable-WHPCCVGJ.js → disable-77Z5767C.js} +2 -2
  22. package/dist/chunks/{discard-ZSMYLHMX.js → discard-Y5Q5M7UN.js} +2 -2
  23. package/dist/chunks/{edit-EPWZER7H.js → edit-WOPMJTMZ.js} +3 -3
  24. package/dist/chunks/{enable-7N4RJVTP.js → enable-O24LJFM4.js} +2 -2
  25. package/dist/chunks/{export-AFSODWYQ.js → export-I2PM6DJW.js} +2 -2
  26. package/dist/chunks/{list-GP4ICPAQ.js → list-TSVT6OUQ.js} +1 -1
  27. package/dist/chunks/{list-XPTOW5YJ.js → list-UZITU56D.js} +1 -1
  28. package/dist/chunks/{publish-6MTUNHWF.js → publish-H6G2AB5C.js} +2 -2
  29. package/dist/chunks/{query-74Q2S6VL.js → query-MS5CFVOU.js} +1 -1
  30. package/dist/chunks/{reorder-RRPZTEHN.js → reorder-XD7S74TB.js} +2 -2
  31. package/dist/chunks/{restore-5W5NSTPI.js → restore-XCT2KIQJ.js} +2 -2
  32. package/dist/commands/build/index.js +9 -9
  33. package/dist/commands/deploy/index.js +10 -10
  34. package/dist/commands/dev/index.js +8 -8
  35. package/dist/commands/env/index.js +5 -5
  36. package/dist/commands/link/index.js +9 -8
  37. package/dist/commands/list/index.js +2 -2
  38. package/dist/commands-bulk.js +187 -94
  39. package/dist/index.js +9 -9
  40. package/dist/version.mjs +1 -1
  41. 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-3GF7O7DF.js";
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-HXL4RKQ7.js";
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
- output_manager_default.spinner("Searching for existing projects\u2026", 1e3);
269
- const [project, slugifiedProject] = await Promise.all([
270
- getProjectByNameOrId(client, detectedProjectName, org.id),
271
- slugifiedName !== detectedProjectName ? getProjectByNameOrId(client, slugifiedName, org.id) : null
272
- ]);
273
- detectedProject = !(project instanceof ProjectNotFound) ? project : !(slugifiedProject instanceof ProjectNotFound) ? slugifiedProject : null;
274
- if (detectedProject && !detectedProject.id) {
275
- throw new Error(`Detected linked project does not have "id".`);
276
- }
277
- output_manager_default.stopSpinner();
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 project2 = await getProjectByNameOrId(client, val, org.id);
323
- if (project2 instanceof ProjectNotFound) {
328
+ const project = await getProjectByNameOrId(client, val, org.id);
329
+ if (project instanceof ProjectNotFound) {
324
330
  return "Project not found";
325
331
  }
326
- toLink = project2;
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((project2) => ({
333
- name: project2.name,
334
- value: project2
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 project2 = await getProjectByNameOrId(client, val, org.id);
351
- if (!(project2 instanceof ProjectNotFound)) {
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,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  STANDARD_ENVIRONMENTS
9
- } from "./chunk-HXL4RKQ7.js";
9
+ } from "./chunk-V5FUID6S.js";
10
10
  import {
11
11
  getCommandName,
12
12
  require_lib
@@ -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-SAGSFQ5F.js";
9
+ } from "./chunk-YXPDMJDR.js";
10
10
  import {
11
11
  login
12
- } from "./chunk-BU4TV4NY.js";
12
+ } from "./chunk-PCFBWAJO.js";
13
13
  import {
14
14
  loginCommand
15
- } from "./chunk-FGUZP3AB.js";
15
+ } from "./chunk-WILFGAOT.js";
16
16
  import {
17
17
  help
18
18
  } from "./chunk-O5OD4JWH.js";
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  global_path_default
9
- } from "./chunk-HXL4RKQ7.js";
9
+ } from "./chunk-V5FUID6S.js";
10
10
  import {
11
11
  output_manager_default
12
12
  } from "./chunk-FDJURQMQ.js";
@@ -8,7 +8,7 @@ import {
8
8
  VERCEL_DIR,
9
9
  VERCEL_DIR_PROJECT,
10
10
  require_lib
11
- } from "./chunk-HXL4RKQ7.js";
11
+ } from "./chunk-V5FUID6S.js";
12
12
  import {
13
13
  require_dist
14
14
  } from "./chunk-FDJURQMQ.js";
@@ -12,7 +12,7 @@ import {
12
12
  buildCommandWithYes,
13
13
  getLinkedProject,
14
14
  outputAgentError
15
- } from "./chunk-HXL4RKQ7.js";
15
+ } from "./chunk-V5FUID6S.js";
16
16
  import {
17
17
  getCommandName,
18
18
  getCommandNamePlain,
@@ -7,7 +7,7 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_end_of_stream,
9
9
  require_once
10
- } from "./chunk-HXL4RKQ7.js";
10
+ } from "./chunk-V5FUID6S.js";
11
11
  import {
12
12
  require_signal_exit
13
13
  } from "./chunk-FDJURQMQ.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-AXOANVOG.js";
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-HXL4RKQ7.js";
16
+ } from "./chunk-V5FUID6S.js";
17
17
  import {
18
18
  getCommandName,
19
19
  getCommandNamePlain
@@ -7,7 +7,7 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  formatCondition,
9
9
  formatTransform
10
- } from "./chunk-VZRUZWK4.js";
10
+ } from "./chunk-F4R4S5SZ.js";
11
11
  import {
12
12
  output_manager_default
13
13
  } from "./chunk-FDJURQMQ.js";
@@ -9,13 +9,13 @@ import {
9
9
  } from "./chunk-V5P25P7F.js";
10
10
  import {
11
11
  autoInstallAgentTooling
12
- } from "./chunk-2627GXHB.js";
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-3GF7O7DF.js";
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-HXL4RKQ7.js";
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-4BKWSSVR.js";
9
+ } from "./chunk-ER5LLAJ6.js";
10
10
  import {
11
11
  ensureLink
12
- } from "./chunk-VKJ2MX4B.js";
12
+ } from "./chunk-NT3RI4UZ.js";
13
13
  import {
14
14
  pullCommand
15
- } from "./chunk-5N2LMLYN.js";
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-HXL4RKQ7.js";
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-BU4TV4NY.js";
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-2627GXHB.js";
25
+ } from "./chunk-CJOJGC52.js";
26
26
  import {
27
27
  CommandTimeout
28
- } from "./chunk-FGUZP3AB.js";
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-HXL4RKQ7.js";
37
+ } from "./chunk-V5FUID6S.js";
38
38
  import {
39
39
  stamp_default
40
40
  } from "./chunk-SOTR4CXR.js";