vercel 58.8.0 → 58.9.1

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 (83) hide show
  1. package/dist/chunks/{add-RVZD257F.js → add-5NFS6DS7.js} +2 -2
  2. package/dist/chunks/{add-OJLNBYCB.js → add-NIBAFBPP.js} +6 -6
  3. package/dist/chunks/{add-GEI53S56.js → add-PJLLOYOB.js} +2 -2
  4. package/dist/chunks/{build-KAOW7IJ6.js → build-MF4TD2RD.js} +2 -2
  5. package/dist/chunks/{chunk-IFNTK75I.js → chunk-24TPLHEI.js} +9 -2
  6. package/dist/chunks/{chunk-IOBULT7M.js → chunk-4IFEBYTL.js} +216 -100
  7. package/dist/chunks/{chunk-N7C5X53Q.js → chunk-4RXXF7V7.js} +1 -1
  8. package/dist/chunks/{chunk-XTIQ7DV7.js → chunk-4XO6B3JD.js} +1 -1
  9. package/dist/chunks/{chunk-HJEZQCMB.js → chunk-6BEMCJFX.js} +2 -2
  10. package/dist/chunks/{chunk-7ZEPVL6J.js → chunk-6LBPHFMP.js} +2 -2
  11. package/dist/chunks/{chunk-55JM5YCD.js → chunk-BEKBCDTM.js} +1 -1
  12. package/dist/chunks/{chunk-4BQZVTJ2.js → chunk-DGDUIC5A.js} +1 -1
  13. package/dist/chunks/{chunk-FWZGQKRP.js → chunk-DJPFR2DG.js} +1 -1
  14. package/dist/chunks/{chunk-KPDA6YEP.js → chunk-GCSUBTKN.js} +8 -6
  15. package/dist/chunks/{chunk-ASSWFLX7.js → chunk-L7LKHLFB.js} +2 -2
  16. package/dist/chunks/{chunk-V3FYICX7.js → chunk-LIPSDQMJ.js} +1 -1
  17. package/dist/chunks/{chunk-AX2PTUXP.js → chunk-MAQ6U5X2.js} +1 -1
  18. package/dist/chunks/{chunk-YRYC7WDR.js → chunk-N6ZAAUNN.js} +4 -4
  19. package/dist/chunks/{chunk-SPQSJERL.js → chunk-NFIGIDOY.js} +1 -1
  20. package/dist/chunks/{chunk-LCZDGAXC.js → chunk-SHXS3ZJD.js} +1 -1
  21. package/dist/chunks/{chunk-4IVGF3OR.js → chunk-U6FXU4WS.js} +1 -1
  22. package/dist/chunks/{chunk-AF7S35K3.js → chunk-V3W6GV3A.js} +1 -1
  23. package/dist/chunks/{chunk-53LZ5BMD.js → chunk-VBAIEFLF.js} +2 -2
  24. package/dist/chunks/{chunk-EMD7HCIW.js → chunk-VNNVJGKE.js} +1 -1
  25. package/dist/chunks/{chunk-JFJGWMAL.js → chunk-VX6VORWT.js} +1 -1
  26. package/dist/chunks/{chunk-N2A6HWBD.js → chunk-W24ZG3GV.js} +1 -1
  27. package/dist/chunks/chunk-YRV4A73W.js +2910 -0
  28. package/dist/chunks/{clear-DWPIGPO2.js → clear-M3QWP3HM.js} +2 -2
  29. package/dist/chunks/{compile-vercel-config-FSU42P2X.js → compile-vercel-config-6DMGPMCK.js} +1 -1
  30. package/dist/chunks/{config-V42N5SNP.js → config-5D4R6677.js} +2 -2
  31. package/dist/chunks/{delete-5KRNKCYI.js → delete-CJG3FHU7.js} +2 -2
  32. package/dist/chunks/{delete-EQ5NJWPR.js → delete-ZWUWQT5H.js} +2 -2
  33. package/dist/chunks/{disable-KO6WDHRC.js → disable-CJKTITTQ.js} +2 -2
  34. package/dist/chunks/{discard-E7PLPNUL.js → discard-ABXIPZHK.js} +2 -2
  35. package/dist/chunks/{edit-OIXKTSXJ.js → edit-VJ43TKOX.js} +2 -2
  36. package/dist/chunks/{edit-55TQT6RK.js → edit-VNVPLLF7.js} +3 -3
  37. package/dist/chunks/{enable-UOEAVAUU.js → enable-L7ERJOO5.js} +2 -2
  38. package/dist/chunks/{export-X2XFUNPV.js → export-BDAKZGOD.js} +2 -2
  39. package/dist/chunks/{image-JAAMXTIA.js → image-MGZR4VEH.js} +3 -3
  40. package/dist/chunks/{import-builders-YDOLGBXS.js → import-builders-RBYAQIPN.js} +2 -2
  41. package/dist/chunks/{inspect-EYUJ32YM.js → inspect-3V6PPUA3.js} +3 -3
  42. package/dist/chunks/{inspect-W4AH3EKN.js → inspect-E6IHZHQI.js} +2 -2
  43. package/dist/chunks/{inspect-SQXG4BFZ.js → inspect-IO5JFCCX.js} +2 -2
  44. package/dist/chunks/{inspect-IP6EMMGZ.js → inspect-KQBV3ALQ.js} +2 -2
  45. package/dist/chunks/{inspect-S52AEYAQ.js → inspect-XDKWDIUB.js} +2 -2
  46. package/dist/chunks/{list-ZFHW4YYW.js → list-FTWJF5YO.js} +2 -2
  47. package/dist/chunks/{list-W2HMCZT7.js → list-RQB5Q7IJ.js} +16 -5
  48. package/dist/chunks/{list-KODWTHC2.js → list-S2ZEK7DX.js} +1 -1
  49. package/dist/chunks/{login-QA4765QP.js → login-AVIFCN4G.js} +2 -2
  50. package/dist/chunks/{ls-A3RJWHNR.js → ls-44QDBZEW.js} +2 -2
  51. package/dist/chunks/{ls-GZ5K57Y6.js → ls-BKZZIR53.js} +3 -3
  52. package/dist/chunks/{ls-GHFI6RDD.js → ls-FI4MV46I.js} +2 -2
  53. package/dist/chunks/{ls-GLFSM2NL.js → ls-JI2KIY4O.js} +2 -2
  54. package/dist/chunks/{ls-ESCK2JMH.js → ls-ZG43UJTR.js} +2 -2
  55. package/dist/chunks/{open-EE7WS2UB.js → open-FGSEFGJL.js} +2 -2
  56. package/dist/chunks/{permissions-L7NPGX2M.js → permissions-BDINZ7RC.js} +4 -4
  57. package/dist/chunks/{publish-7BIMCBQ6.js → publish-7FXAFWWN.js} +2 -2
  58. package/dist/chunks/{push-IKPIV52M.js → push-3P3NKZEG.js} +2 -2
  59. package/dist/chunks/{query-DFRPIOZM.js → query-7MQN4S3S.js} +1 -1
  60. package/dist/chunks/{reorder-GA5FVDKD.js → reorder-42YNZL7R.js} +2 -2
  61. package/dist/chunks/{reply-C3375THE.js → reply-36KQN23N.js} +2 -2
  62. package/dist/chunks/{resolve-MBWHKHSW.js → resolve-ESN7P6O3.js} +2 -2
  63. package/dist/chunks/{restore-WGSD5LXC.js → restore-RCNRC3YJ.js} +2 -2
  64. package/dist/chunks/{rm-KOUNSG5Y.js → rm-E2WEJZPW.js} +2 -2
  65. package/dist/chunks/{rm-XITL2VK4.js → rm-MMYOJPW4.js} +3 -3
  66. package/dist/chunks/{rm-PXBJERO4.js → rm-ODFQSS2C.js} +2 -2
  67. package/dist/chunks/{rm-UEFME3MH.js → rm-R77FI255.js} +2 -2
  68. package/dist/chunks/{rule-inspect-7MJ6F3H6.js → rule-inspect-FDBIBPKM.js} +3 -3
  69. package/dist/chunks/{rules-YBSW4TND.js → rules-3GSC27DA.js} +6 -6
  70. package/dist/chunks/{schema-JP4Z36AT.js → schema-QDU3FPNC.js} +1 -1
  71. package/dist/chunks/{tags-XEZOWSS3.js → tags-WZBKHB6D.js} +2 -2
  72. package/dist/chunks/{update-236TLBCO.js → update-KNN7C6KN.js} +6 -6
  73. package/dist/commands/build/index.js +16 -2718
  74. package/dist/commands/deploy/index.js +9 -9
  75. package/dist/commands/dev/index.js +8 -8
  76. package/dist/commands/env/index.js +4 -4
  77. package/dist/commands/link/index.js +6 -6
  78. package/dist/commands/list/index.js +2 -2
  79. package/dist/commands-bulk.js +1712 -745
  80. package/dist/index.js +64 -57
  81. package/dist/version.mjs +1 -1
  82. package/package.json +46 -46
  83. package/dist/chunks/chunk-ZGXTMIJX.js +0 -206
package/dist/index.js CHANGED
@@ -18,11 +18,11 @@ import {
18
18
  require_ci_info,
19
19
  setAutoUpdate,
20
20
  tryOpenApiFallback
21
- } from "./chunks/chunk-YRYC7WDR.js";
21
+ } from "./chunks/chunk-N6ZAAUNN.js";
22
22
  import "./chunks/chunk-FGDKMNEN.js";
23
23
  import {
24
24
  getUpdateCommand
25
- } from "./chunks/chunk-EMD7HCIW.js";
25
+ } from "./chunks/chunk-VNNVJGKE.js";
26
26
  import "./chunks/chunk-I2XE3GMB.js";
27
27
  import {
28
28
  Client,
@@ -32,7 +32,7 @@ import {
32
32
  readAuthConfigFile,
33
33
  readConfigFile,
34
34
  writeToConfigFile
35
- } from "./chunks/chunk-HJEZQCMB.js";
35
+ } from "./chunks/chunk-6BEMCJFX.js";
36
36
  import {
37
37
  highlight
38
38
  } from "./chunks/chunk-V5P25P7F.js";
@@ -43,7 +43,7 @@ import {
43
43
  import {
44
44
  commandNames,
45
45
  commands
46
- } from "./chunks/chunk-IFNTK75I.js";
46
+ } from "./chunks/chunk-24TPLHEI.js";
47
47
  import "./chunks/chunk-ELA5VN3A.js";
48
48
  import "./chunks/chunk-B3JTF4CF.js";
49
49
  import "./chunks/chunk-A5KP5HAI.js";
@@ -59,8 +59,8 @@ import "./chunks/chunk-O5GNPPTU.js";
59
59
  import {
60
60
  require_semver
61
61
  } from "./chunks/chunk-IB5L4LKZ.js";
62
- import "./chunks/chunk-N2A6HWBD.js";
63
- import "./chunks/chunk-AF7S35K3.js";
62
+ import "./chunks/chunk-W24ZG3GV.js";
63
+ import "./chunks/chunk-V3W6GV3A.js";
64
64
  import "./chunks/chunk-ZX2FSPWV.js";
65
65
  import "./chunks/chunk-KT4XXKJK.js";
66
66
  import {
@@ -70,11 +70,13 @@ import {
70
70
  getUser,
71
71
  getVercelDirectory,
72
72
  humanizePath,
73
+ isAppPrincipalEnabled,
73
74
  param,
74
75
  readJSONFile,
75
76
  require_dist as require_dist2,
76
- require_lib
77
- } from "./chunks/chunk-IOBULT7M.js";
77
+ require_lib,
78
+ resolveAppTokenScope
79
+ } from "./chunks/chunk-4IFEBYTL.js";
78
80
  import {
79
81
  TelemetryClient,
80
82
  TelemetryEventStore,
@@ -1932,63 +1934,68 @@ var main = async () => {
1932
1934
  if (err instanceof Error) {
1933
1935
  output_manager_default.debug(err.stack || err.toString());
1934
1936
  }
1935
- if ((0, import_error_utils3.isErrnoException)(err) && err.code === "NOT_AUTHORIZED") {
1936
- output_manager_default.prettyError({
1937
- message: `You do not have access to the specified account`,
1938
- link: "https://err.sh/vercel/scope-not-accessible"
1939
- });
1937
+ const appTokenScopeResolved = (0, import_error_utils3.isErrnoException)(err) && err.code === "NOT_AUTHORIZED" && isAppPrincipalEnabled() && await resolveAppTokenScope(client, scope);
1938
+ if (!appTokenScopeResolved) {
1939
+ if ((0, import_error_utils3.isErrnoException)(err) && err.code === "NOT_AUTHORIZED") {
1940
+ output_manager_default.prettyError({
1941
+ message: `You do not have access to the specified account`,
1942
+ link: "https://err.sh/vercel/scope-not-accessible"
1943
+ });
1944
+ trackAgenticErrorTelemetry(err);
1945
+ return finishWithExitCode(1);
1946
+ }
1947
+ output_manager_default.error(
1948
+ `Not able to load user because of unexpected error: ${(0, import_error_utils3.errorToString)(err)}`
1949
+ );
1940
1950
  trackAgenticErrorTelemetry(err);
1941
1951
  return finishWithExitCode(1);
1942
1952
  }
1943
- output_manager_default.error(
1944
- `Not able to load user because of unexpected error: ${(0, import_error_utils3.errorToString)(err)}`
1945
- );
1946
- trackAgenticErrorTelemetry(err);
1947
- return finishWithExitCode(1);
1948
1953
  }
1949
- const scopeMatchesUserIdentity = user.id === scope || user.email === scope || user.username === scope;
1950
- let teams = [];
1951
- try {
1952
- teams = await getTeams(client);
1953
- } catch (err) {
1954
- if (scopeMatchesUserIdentity) {
1955
- output_manager_default.debug(
1956
- `Ignoring failure to load teams; scope matches the current user's identity`
1957
- );
1958
- } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "not_authorized") {
1959
- output_manager_default.prettyError({
1960
- message: `You do not have access to the specified team`,
1961
- link: "https://err.sh/vercel/scope-not-accessible"
1962
- });
1963
- trackAgenticErrorTelemetry(err);
1964
- return finishWithExitCode(1);
1965
- } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "rate_limited") {
1954
+ if (user) {
1955
+ const scopeMatchesUserIdentity = user.id === scope || user.email === scope || user.username === scope;
1956
+ let teams = [];
1957
+ try {
1958
+ teams = await getTeams(client);
1959
+ } catch (err) {
1960
+ if (scopeMatchesUserIdentity) {
1961
+ output_manager_default.debug(
1962
+ `Ignoring failure to load teams; scope matches the current user's identity`
1963
+ );
1964
+ } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "not_authorized") {
1965
+ output_manager_default.prettyError({
1966
+ message: `You do not have access to the specified team`,
1967
+ link: "https://err.sh/vercel/scope-not-accessible"
1968
+ });
1969
+ trackAgenticErrorTelemetry(err);
1970
+ return finishWithExitCode(1);
1971
+ } else if ((0, import_error_utils3.isErrnoException)(err) && err.code === "rate_limited") {
1972
+ output_manager_default.prettyError({
1973
+ message: "Rate limited. Too many requests to the same endpoint: /teams"
1974
+ });
1975
+ trackAgenticErrorTelemetry(err);
1976
+ return finishWithExitCode(1);
1977
+ } else {
1978
+ output_manager_default.error("Not able to load teams");
1979
+ trackAgenticErrorTelemetry(err);
1980
+ return finishWithExitCode(1);
1981
+ }
1982
+ }
1983
+ const related = teams && teams.find((team) => team.id === scope || team.slug === scope);
1984
+ if (related) {
1985
+ client.config.currentTeam = related.id;
1986
+ } else if (scopeMatchesUserIdentity) {
1987
+ if (user.version === "northstar") {
1988
+ output_manager_default.error("You cannot set your Personal Account as the scope.");
1989
+ return finishWithExitCode(1);
1990
+ }
1991
+ delete client.config.currentTeam;
1992
+ } else {
1966
1993
  output_manager_default.prettyError({
1967
- message: "Rate limited. Too many requests to the same endpoint: /teams"
1994
+ message: "The specified scope does not exist",
1995
+ link: "https://err.sh/vercel/scope-not-existent"
1968
1996
  });
1969
- trackAgenticErrorTelemetry(err);
1970
- return finishWithExitCode(1);
1971
- } else {
1972
- output_manager_default.error("Not able to load teams");
1973
- trackAgenticErrorTelemetry(err);
1974
- return finishWithExitCode(1);
1975
- }
1976
- }
1977
- const related = teams && teams.find((team) => team.id === scope || team.slug === scope);
1978
- if (related) {
1979
- client.config.currentTeam = related.id;
1980
- } else if (scopeMatchesUserIdentity) {
1981
- if (user.version === "northstar") {
1982
- output_manager_default.error("You cannot set your Personal Account as the scope.");
1983
1997
  return finishWithExitCode(1);
1984
1998
  }
1985
- delete client.config.currentTeam;
1986
- } else {
1987
- output_manager_default.prettyError({
1988
- message: "The specified scope does not exist",
1989
- link: "https://err.sh/vercel/scope-not-existent"
1990
- });
1991
- return finishWithExitCode(1);
1992
1999
  }
1993
2000
  }
1994
2001
  let exitCode;
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "58.8.0";
1
+ export const version = "58.9.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "58.8.0",
3
+ "version": "58.9.1",
4
4
  "type": "module",
5
5
  "preferGlobal": true,
6
6
  "license": "Apache-2.0",
@@ -33,51 +33,52 @@
33
33
  "sandbox": "3.4.0",
34
34
  "smol-toml": "1.5.2",
35
35
  "undici": "5.29.0",
36
+ "uuid": "14.0.1",
36
37
  "zod": "4.1.11",
37
- "@vercel/backends": "0.8.33",
38
- "@vercel/cli-auth": "0.3.2",
39
- "@vercel/build-utils": "14.0.2",
40
- "@vercel/cli-config": "0.2.2",
38
+ "@vercel/backends": "0.8.35",
39
+ "@vercel/build-utils": "14.0.4",
40
+ "@vercel/cli-auth": "0.3.3",
41
+ "@vercel/cli-config": "0.2.3",
41
42
  "@vercel/container": "0.1.1",
42
43
  "@vercel/detect-agent": "1.2.4",
43
- "@vercel/elysia": "0.1.110",
44
- "@vercel/express": "0.1.124",
45
- "@vercel/fastify": "0.1.113",
44
+ "@vercel/elysia": "0.1.112",
45
+ "@vercel/express": "0.1.126",
46
+ "@vercel/fastify": "0.1.115",
46
47
  "@vercel/go": "3.10.4",
47
- "@vercel/hono": "0.2.113",
48
- "@vercel/h3": "0.1.119",
48
+ "@vercel/h3": "0.1.121",
49
+ "@vercel/hono": "0.2.115",
49
50
  "@vercel/hydrogen": "1.4.1",
50
- "@vercel/koa": "0.1.93",
51
- "@vercel/nestjs": "0.2.114",
52
- "@vercel/next": "4.21.1",
53
- "@vercel/node": "5.9.6",
51
+ "@vercel/koa": "0.1.95",
52
+ "@vercel/nestjs": "0.2.116",
53
+ "@vercel/next": "4.21.3",
54
+ "@vercel/node": "5.9.8",
55
+ "@vercel/python": "6.56.0",
54
56
  "@vercel/redwood": "2.5.1",
55
- "@vercel/python": "6.55.3",
56
57
  "@vercel/remix-builder": "5.9.2",
57
58
  "@vercel/ruby": "2.5.1",
58
59
  "@vercel/rust": "1.4.1",
59
- "@vercel/static-build": "2.12.2"
60
+ "@vercel/static-build": "2.12.4"
60
61
  },
61
62
  "builders": {
62
- "@vercel/backends": "0.8.33",
63
+ "@vercel/backends": "0.8.35",
63
64
  "@vercel/container": "0.1.1",
64
- "@vercel/elysia": "0.1.110",
65
- "@vercel/express": "0.1.124",
66
- "@vercel/fastify": "0.1.113",
65
+ "@vercel/elysia": "0.1.112",
66
+ "@vercel/express": "0.1.126",
67
+ "@vercel/fastify": "0.1.115",
67
68
  "@vercel/go": "3.10.4",
68
- "@vercel/h3": "0.1.119",
69
- "@vercel/hono": "0.2.113",
69
+ "@vercel/h3": "0.1.121",
70
+ "@vercel/hono": "0.2.115",
70
71
  "@vercel/hydrogen": "1.4.1",
71
- "@vercel/koa": "0.1.93",
72
- "@vercel/nestjs": "0.2.114",
73
- "@vercel/next": "4.21.1",
74
- "@vercel/node": "5.9.6",
75
- "@vercel/python": "6.55.3",
72
+ "@vercel/koa": "0.1.95",
73
+ "@vercel/nestjs": "0.2.116",
74
+ "@vercel/next": "4.21.3",
75
+ "@vercel/node": "5.9.8",
76
+ "@vercel/python": "6.56.0",
76
77
  "@vercel/redwood": "2.5.1",
77
78
  "@vercel/remix-builder": "5.9.2",
78
79
  "@vercel/ruby": "2.5.1",
79
80
  "@vercel/rust": "1.4.1",
80
- "@vercel/static-build": "2.12.2"
81
+ "@vercel/static-build": "2.12.4"
81
82
  },
82
83
  "devDependencies": {
83
84
  "@edge-runtime/node-utils": "2.3.0",
@@ -123,7 +124,7 @@
123
124
  "@types/yauzl-promise": "2.1.0",
124
125
  "@vercel/agent-eval": "^0.7.1",
125
126
  "@vercel/sdk": "^1.19.6",
126
- "@vitest/expect": "2.1.3",
127
+ "@vitest/expect": "4.1.10",
127
128
  "@yao-pkg/pkg": "6.19.0",
128
129
  "ajv": "6.12.3",
129
130
  "alpha-sort": "2.0.1",
@@ -194,8 +195,8 @@
194
195
  "ts-node": "10.9.1",
195
196
  "tsx": "^4.20.4",
196
197
  "utility-types": "2.1.0",
197
- "vite": "^5.1.6",
198
- "vitest": "^2.1.3",
198
+ "vite": "^6.4.3",
199
+ "vitest": "^4.1.10",
199
200
  "which": "3.0.0",
200
201
  "write-json-file": "2.2.0",
201
202
  "xdg-app-paths": "5.1.0",
@@ -203,29 +204,27 @@
203
204
  "@vercel-internals/constants": "1.0.4",
204
205
  "@vercel-internals/get-package-json": "1.0.0",
205
206
  "@vercel-internals/types": "3.0.6",
206
- "@vercel/client": "18.2.6",
207
+ "@vercel/client": "18.2.8",
207
208
  "@vercel/error-utils": "2.2.1",
208
209
  "@vercel/frameworks": "3.30.9",
209
- "@vercel/fs-detectors": "6.15.2",
210
+ "@vercel/fs-detectors": "6.15.4",
210
211
  "@vercel/routing-utils": "6.4.1"
211
212
  },
212
213
  "optionalDependencies": {
213
- "@vercel/vc-native-darwin-arm64": "58.8.0",
214
- "@vercel/vc-native-darwin-x64": "58.8.0",
215
- "@vercel/vc-native-linux-arm64": "58.8.0",
216
- "@vercel/vc-native-linux-x64": "58.8.0"
214
+ "@vercel/vc-native-darwin-arm64": "58.9.1",
215
+ "@vercel/vc-native-darwin-x64": "58.9.1",
216
+ "@vercel/vc-native-linux-arm64": "58.9.1",
217
+ "@vercel/vc-native-linux-x64": "58.9.1"
217
218
  },
218
219
  "scripts": {
219
- "test": "vitest run --config ./vitest.config.mts",
220
- "vitest-run": "node scripts/vitest-run.mjs",
221
- "vitest-unit": "pnpm vitest-run --run test/unit/",
222
- "vitest-e2e": "glob --absolute 'test/e2e-*.test.ts'",
223
- "test-e2e-node-all-versions": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts test/integration-link-env-pull.test.ts",
224
- "test-dev": "pnpm test test/dev/",
220
+ "test": "node scripts/test.mjs --run",
221
+ "test-e2e": "node scripts/test.mjs --run test/e2e-",
222
+ "test-e2e-node-all-versions": "rimraf test/fixtures/integration && vitest run --config ./vitest.config.mts test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts test/integration-link-env-pull.test.ts",
223
+ "test-dev": "vitest run --config ./vitest.config.mts test/dev/",
225
224
  "coverage": "codecov",
226
225
  "build": "node scripts/build.mjs",
227
- "build-binary": "pnpm --filter vercel... build && node scripts/build-binary.mjs",
228
- "build-binary:host": "pnpm --filter vercel... build && node scripts/build-binary.mjs --target host --output ./dist-bin/vercel",
226
+ "build-binary": "node scripts/build-binary.mjs",
227
+ "build-binary:host": "node scripts/build-binary.mjs --target host --output ./dist-bin/vercel",
229
228
  "build-binary-node": "node scripts/build-binary-node.mjs",
230
229
  "smoke-binary": "node scripts/smoke-test-binary.mjs",
231
230
  "dev": "echo \"'pnpm dev [command]' has been removed. Use 'pnpm vercel [command]' instead.\" && exit 1",
@@ -235,6 +234,7 @@
235
234
  "test:evals": "tsx evals/run.ts",
236
235
  "test:evals:smoke": "tsx evals/run.ts smoke --smoke",
237
236
  "test:evals:dry": "tsx evals/run.ts --dry",
238
- "test:evals:local-fixture": "tsx evals/run.ts --local-fixture"
237
+ "test:evals:local-fixture": "tsx evals/run.ts --local-fixture",
238
+ "test-unit": "node scripts/test.mjs --run test/unit/"
239
239
  }
240
240
  }
@@ -1,206 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __dirname_ } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- const __filename = __fileURLToPath(import.meta.url);
6
- const __dirname = __dirname_(__filename);
7
- import {
8
- writeProjectSettings
9
- } from "./chunk-55JM5YCD.js";
10
- import {
11
- autoInstallVercelPlugin
12
- } from "./chunk-HT2XWSAJ.js";
13
- import {
14
- stamp_default
15
- } from "./chunk-64IF634X.js";
16
- import {
17
- ensureLink
18
- } from "./chunk-53LZ5BMD.js";
19
- import {
20
- pullCommand
21
- } from "./chunk-AF7S35K3.js";
22
- import {
23
- help
24
- } from "./chunk-ZX2FSPWV.js";
25
- import {
26
- VERCEL_DIR,
27
- VERCEL_DIR_PROJECT,
28
- envPullCommandLogic,
29
- humanizePath,
30
- parseTarget
31
- } from "./chunk-IOBULT7M.js";
32
- import {
33
- TelemetryClient
34
- } from "./chunk-ECCWJHC6.js";
35
- import {
36
- printError
37
- } from "./chunk-KBEX5MYS.js";
38
- import {
39
- parseArguments
40
- } from "./chunk-XLKFJPMT.js";
41
- import {
42
- getFlagsSpecification
43
- } from "./chunk-SOFC4MLS.js";
44
- import {
45
- emoji,
46
- output_manager_default,
47
- prependEmoji
48
- } from "./chunk-OX7KI3LF.js";
49
- import {
50
- require_source
51
- } from "./chunk-S7KYDPEM.js";
52
- import {
53
- __toESM
54
- } from "./chunk-TZ2YI2VH.js";
55
-
56
- // src/commands/pull/index.ts
57
- var import_chalk = __toESM(require_source(), 1);
58
- import { join } from "path";
59
-
60
- // src/util/telemetry/commands/pull/index.ts
61
- var PullTelemetryClient = class extends TelemetryClient {
62
- trackCliArgumentProjectPath(value) {
63
- if (value) {
64
- this.trackCliArgument({
65
- arg: "projectPath",
66
- value: this.redactedValue
67
- });
68
- }
69
- }
70
- trackCliOptionEnvironment(environment) {
71
- if (environment) {
72
- this.trackCliOption({
73
- option: "environment",
74
- value: this.redactedTargetName(environment)
75
- });
76
- }
77
- }
78
- trackCliOptionGitBranch(gitBranch) {
79
- if (gitBranch) {
80
- this.trackCliOption({
81
- option: "git-branch",
82
- value: this.redactedValue
83
- });
84
- }
85
- }
86
- trackCliFlagProd(isProduction) {
87
- if (isProduction) {
88
- this.trackCliFlag("prod");
89
- }
90
- }
91
- trackCliFlagYes(yes) {
92
- if (yes) {
93
- this.trackCliFlag("yes");
94
- }
95
- }
96
- };
97
-
98
- // src/commands/pull/index.ts
99
- async function pullAllEnvFiles(environment, client, link, flags, cwd) {
100
- const environmentFile = `.env.${environment}.local`;
101
- await envPullCommandLogic(
102
- client,
103
- join(".vercel", environmentFile),
104
- !!flags["--yes"],
105
- environment,
106
- link,
107
- flags["--git-branch"],
108
- cwd,
109
- "vercel-cli:pull"
110
- );
111
- return 0;
112
- }
113
- async function main(client) {
114
- let parsedArgs = null;
115
- const flagsSpecification = getFlagsSpecification(pullCommand.options);
116
- try {
117
- parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
118
- } catch (error) {
119
- printError(error);
120
- return 1;
121
- }
122
- const telemetryClient = new PullTelemetryClient({
123
- opts: {
124
- store: client.telemetryEventStore
125
- }
126
- });
127
- if (parsedArgs.flags["--help"]) {
128
- telemetryClient.trackCliFlagHelp("pull");
129
- output_manager_default.print(help(pullCommand, { columns: client.stderr.columns }));
130
- return 2;
131
- }
132
- const cwd = parsedArgs.args[1] || client.cwd;
133
- const autoConfirm = Boolean(parsedArgs.flags["--yes"]);
134
- const isProduction = Boolean(parsedArgs.flags["--prod"]);
135
- const environment = parseTarget({
136
- flagName: "environment",
137
- flags: parsedArgs.flags
138
- }) || "development";
139
- telemetryClient.trackCliArgumentProjectPath(parsedArgs.args[1]);
140
- telemetryClient.trackCliFlagYes(autoConfirm);
141
- telemetryClient.trackCliFlagProd(isProduction);
142
- telemetryClient.trackCliOptionGitBranch(parsedArgs.flags["--git-branch"]);
143
- telemetryClient.trackCliOptionEnvironment(parsedArgs.flags["--environment"]);
144
- telemetryClient.trackCliOptionProject(parsedArgs.flags["--project"]);
145
- const returnCode = await pullCommandLogic(
146
- client,
147
- cwd,
148
- autoConfirm,
149
- environment,
150
- parsedArgs.flags,
151
- parsedArgs.flags["--project"]
152
- );
153
- if (returnCode === 0 && !autoConfirm) {
154
- await autoInstallVercelPlugin(client);
155
- }
156
- return returnCode;
157
- }
158
- async function pullCommandLogic(client, cwd, autoConfirm, environment, flags, projectNameOrId) {
159
- const link = await ensureLink("pull", client, cwd, {
160
- autoConfirm,
161
- pullEnv: false,
162
- projectName: projectNameOrId,
163
- failIfNotFound: !!projectNameOrId
164
- });
165
- if (typeof link === "number") {
166
- return link;
167
- }
168
- const { project, org, repoRoot } = link;
169
- let currentDirectory;
170
- if (repoRoot) {
171
- currentDirectory = join(repoRoot, project.rootDirectory || "");
172
- } else {
173
- currentDirectory = cwd;
174
- }
175
- client.config.currentTeam = org.type === "team" ? org.id : void 0;
176
- const pullResultCode = await pullAllEnvFiles(
177
- environment,
178
- client,
179
- link,
180
- flags,
181
- currentDirectory
182
- );
183
- if (pullResultCode !== 0) {
184
- return pullResultCode;
185
- }
186
- output_manager_default.print("\n");
187
- output_manager_default.log("Downloading project settings");
188
- const isRepoLinked = typeof repoRoot === "string";
189
- await writeProjectSettings(currentDirectory, project, org, isRepoLinked);
190
- const settingsStamp = stamp_default();
191
- output_manager_default.print(
192
- `${prependEmoji(
193
- `Downloaded project settings to ${import_chalk.default.bold(
194
- humanizePath(join(currentDirectory, VERCEL_DIR, VERCEL_DIR_PROJECT))
195
- )} ${import_chalk.default.gray(settingsStamp())}`,
196
- emoji("success")
197
- )}
198
- `
199
- );
200
- return 0;
201
- }
202
-
203
- export {
204
- main,
205
- pullCommandLogic
206
- };