vercel 58.0.0 → 58.1.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.
Files changed (99) hide show
  1. package/dist/chunks/{add-E4KH6P4A.js → add-QKP6ZCHQ.js} +7 -7
  2. package/dist/chunks/{add-7PPD4ZUJ.js → add-WKV7KU4Y.js} +10 -8
  3. package/dist/chunks/build-ZXEK6YEA.js +240 -0
  4. package/dist/chunks/{chunk-B2MTCHPO.js → chunk-2D22CMQ7.js} +3 -3
  5. package/dist/chunks/{chunk-YA3WQFLY.js → chunk-32IPC6RB.js} +1 -1
  6. package/dist/chunks/{chunk-WDE2EDYX.js → chunk-3YARBN7P.js} +4 -4
  7. package/dist/chunks/{chunk-QZD5DKUR.js → chunk-4I7DTZAJ.js} +2 -2
  8. package/dist/chunks/{chunk-DGFASMSE.js → chunk-4LSERVQQ.js} +4 -4
  9. package/dist/chunks/{chunk-L4WYMJB3.js → chunk-552YY6QY.js} +25 -11
  10. package/dist/chunks/{chunk-OQGN4TEC.js → chunk-5AG7MR7W.js} +3 -3
  11. package/dist/chunks/{chunk-WANVKOVB.js → chunk-6QUKJKFX.js} +487 -240
  12. package/dist/chunks/{chunk-KCF6S3XF.js → chunk-75MDJ6TK.js} +10 -6
  13. package/dist/chunks/{chunk-FHEMFAHB.js → chunk-AX3N4MO2.js} +15 -9
  14. package/dist/chunks/{chunk-KGVT2RSG.js → chunk-BAUVB2VF.js} +5 -11
  15. package/dist/chunks/{chunk-RSCSALZH.js → chunk-C267R2FA.js} +6 -5
  16. package/dist/chunks/{chunk-FB4UFWEC.js → chunk-CSI7GEDD.js} +4 -4
  17. package/dist/chunks/{chunk-FYR7WEUJ.js → chunk-CXICXWXJ.js} +3 -3
  18. package/dist/chunks/{chunk-TPX7RZBM.js → chunk-DKS4XDVC.js} +5 -3
  19. package/dist/chunks/{chunk-DWMH5M4Q.js → chunk-E4LXCO7U.js} +1 -1
  20. package/dist/chunks/{chunk-ZVLPUREX.js → chunk-FBPCJV72.js} +2 -2
  21. package/dist/chunks/{chunk-VZSZBD4V.js → chunk-FR352QKR.js} +1 -1
  22. package/dist/chunks/{chunk-R54DAHCL.js → chunk-HXTQVMJZ.js} +2 -2
  23. package/dist/chunks/{chunk-EA22NMFU.js → chunk-JA3QX2H6.js} +2 -2
  24. package/dist/chunks/{chunk-ZMVFTCQF.js → chunk-JNP3FQR3.js} +1 -1
  25. package/dist/chunks/{chunk-YZMZCQP3.js → chunk-KLNWR2JI.js} +7 -7
  26. package/dist/chunks/{chunk-LHFNIZ2P.js → chunk-KY3ZOYJW.js} +4 -2
  27. package/dist/chunks/{chunk-NZRWTCRM.js → chunk-LA3BQQQK.js} +1 -1
  28. package/dist/chunks/{chunk-R5FOIIHT.js → chunk-LXA2GZ7U.js} +1 -1
  29. package/dist/chunks/{chunk-GIL3VAUR.js → chunk-NGYOR3MN.js} +5 -3
  30. package/dist/chunks/{chunk-3PKFXNJZ.js → chunk-NYURBHZJ.js} +7 -5
  31. package/dist/chunks/{chunk-MDQJLTGN.js → chunk-OG7DIS52.js} +1 -1
  32. package/dist/chunks/{chunk-AZTV7WPZ.js → chunk-OVW5WUCR.js} +1 -1
  33. package/dist/chunks/{chunk-DMSLNAVH.js → chunk-P7IO46BQ.js} +2 -2
  34. package/dist/chunks/{chunk-TEWJ7TIW.js → chunk-QCB22TQG.js} +2 -2
  35. package/dist/chunks/chunk-RBIFXFZX.js +52 -0
  36. package/dist/chunks/{chunk-SZXT3PDQ.js → chunk-RL7X7JGK.js} +1 -1
  37. package/dist/chunks/{chunk-UDWRZXIT.js → chunk-S7LXRKLD.js} +2 -1
  38. package/dist/chunks/{chunk-FYQPTH5C.js → chunk-TCBOCSWF.js} +7 -5
  39. package/dist/chunks/{chunk-OF2GNB42.js → chunk-TF627KEI.js} +1 -1
  40. package/dist/chunks/{chunk-4G6QZSBL.js → chunk-TPB4F5XN.js} +6 -4
  41. package/dist/chunks/{chunk-KSSNLCL4.js → chunk-U6PPDPR5.js} +2 -3
  42. package/dist/chunks/{chunk-3VS4DTAU.js → chunk-V6WHZAPP.js} +101 -11
  43. package/dist/chunks/{chunk-OGG6UBXK.js → chunk-VSMCQSGH.js} +1 -1
  44. package/dist/chunks/{chunk-3PGXYIKC.js → chunk-XAWGGWSG.js} +2 -2
  45. package/dist/chunks/{chunk-2MJROFVC.js → chunk-XTLNPNWY.js} +8 -5
  46. package/dist/chunks/{chunk-VUESC3YO.js → chunk-XTQADJ6S.js} +207 -4
  47. package/dist/chunks/{chunk-BYQQLGCT.js → chunk-YITWM37U.js} +2 -2
  48. package/dist/chunks/{compile-vercel-config-G2IVBXEI.js → compile-vercel-config-AFGCQEYG.js} +4 -4
  49. package/dist/chunks/{delete-2EIVGM6P.js → delete-UGSJQBE7.js} +6 -6
  50. package/dist/chunks/{delete-E6ZQNE5X.js → delete-Y5LNEZXI.js} +6 -6
  51. package/dist/chunks/{disable-M3Q6BBB7.js → disable-IF3AHKJD.js} +6 -6
  52. package/dist/chunks/{discard-3R6ETBPS.js → discard-Y6GZBIHJ.js} +6 -6
  53. package/dist/chunks/{edit-7JUDPVXD.js → edit-6TGJKUI5.js} +7 -7
  54. package/dist/chunks/{edit-ICVMGRRU.js → edit-HNMKZ3YT.js} +6 -6
  55. package/dist/chunks/{enable-HLTA35QL.js → enable-SE4QM4X3.js} +6 -6
  56. package/dist/chunks/{export-E6XZUFW3.js → export-5AYL7HCJ.js} +6 -6
  57. package/dist/chunks/{image-SIRPPQZT.js → image-6BYNQVGW.js} +5 -5
  58. package/dist/chunks/{inspect-NFOURIGN.js → inspect-3KCFHDWA.js} +11 -11
  59. package/dist/chunks/{inspect-OEWWGAHZ.js → inspect-DPTRYDFH.js} +7 -7
  60. package/dist/chunks/{inspect-6TQWDIBG.js → inspect-FGYXO4K5.js} +10 -10
  61. package/dist/chunks/{inspect-65YX7L3O.js → inspect-LTHZUXA2.js} +10 -10
  62. package/dist/chunks/{inspect-4FYBOOM5.js → inspect-MA36GG73.js} +10 -10
  63. package/dist/chunks/{list-APFMKZJO.js → list-BTOXZBQK.js} +10 -10
  64. package/dist/chunks/{list-XQCZVLES.js → list-OCW34SRV.js} +7 -7
  65. package/dist/chunks/{list-27DCGMBI.js → list-VTQZSIIT.js} +5 -5
  66. package/dist/chunks/{login-FMU4CQOV.js → login-VSXLK5ZU.js} +18 -50
  67. package/dist/chunks/{ls-3L6EN4YU.js → ls-3UA57DZZ.js} +10 -10
  68. package/dist/chunks/{ls-24BRCAZR.js → ls-76YTWNKD.js} +11 -11
  69. package/dist/chunks/{ls-BFACWH6C.js → ls-DRI2AOFB.js} +12 -12
  70. package/dist/chunks/{ls-T5RGDBCV.js → ls-ZBLTJ5RE.js} +11 -11
  71. package/dist/chunks/{open-AG3VYJZM.js → open-DVKAE5HP.js} +6 -6
  72. package/dist/chunks/{publish-5OVCPS4J.js → publish-F5C4ZA7M.js} +6 -6
  73. package/dist/chunks/push-PKJFQTLO.js +180 -0
  74. package/dist/chunks/{query-QS4VKBXJ.js → query-GT5LCT45.js} +9 -9
  75. package/dist/chunks/{reorder-B5V2P7YM.js → reorder-AQW4XFDS.js} +6 -6
  76. package/dist/chunks/{reply-JBLWE6RS.js → reply-FI7SADGU.js} +6 -6
  77. package/dist/chunks/{resolve-2I6XH2G3.js → resolve-C5G7JJZJ.js} +6 -6
  78. package/dist/chunks/{restore-O63FZXCL.js → restore-5TLSHQOS.js} +6 -6
  79. package/dist/chunks/{rm-P3NJSCMY.js → rm-2EN66OYO.js} +8 -6
  80. package/dist/chunks/{rm-HUED5R3Q.js → rm-C37BHGQI.js} +7 -7
  81. package/dist/chunks/{rm-N7W3QYWZ.js → rm-L7OQPCIE.js} +10 -8
  82. package/dist/chunks/{rule-inspect-M3QUSPU2.js → rule-inspect-V5DRHOTZ.js} +10 -10
  83. package/dist/chunks/{rules-NSSWPJ2B.js → rules-5XEMLN5G.js} +8 -8
  84. package/dist/chunks/{schema-G2PAXPVA.js → schema-UEOZVBY5.js} +8 -8
  85. package/dist/chunks/{tags-JFMO63D4.js → tags-ZGANV4YD.js} +4 -4
  86. package/dist/chunks/{types-QKLIFDDP.js → types-IKWGLSDF.js} +4 -4
  87. package/dist/chunks/{update-VJCKD6YG.js → update-DHWSMSMS.js} +7 -7
  88. package/dist/commands/build/index.js +12 -16
  89. package/dist/commands/deploy/index.js +29 -24
  90. package/dist/commands/dev/index.js +12 -12
  91. package/dist/commands/env/index.js +28 -23
  92. package/dist/commands/link/index.js +21 -21
  93. package/dist/commands/list/index.js +13 -8
  94. package/dist/commands-bulk.js +3537 -2164
  95. package/dist/help.js +1 -1
  96. package/dist/index.js +24 -23
  97. package/dist/version.mjs +1 -1
  98. package/package.json +21 -79
  99. package/dist/chunks/chunk-6OMC3HOW.js +0 -73
@@ -9,31 +9,31 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-R54DAHCL.js";
13
- import "./chunk-FYR7WEUJ.js";
12
+ } from "./chunk-HXTQVMJZ.js";
13
+ import "./chunk-CXICXWXJ.js";
14
14
  import "./chunk-BUZRVER7.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
18
18
  import {
19
19
  rulesAddSubcommand
20
- } from "./chunk-KCF6S3XF.js";
21
- import "./chunk-TPX7RZBM.js";
20
+ } from "./chunk-75MDJ6TK.js";
21
+ import "./chunk-DKS4XDVC.js";
22
22
  import "./chunk-ECCWJHC6.js";
23
23
  import {
24
24
  AGENT_REASON,
25
25
  buildCommandWithGlobalFlags,
26
26
  outputAgentError
27
- } from "./chunk-UDWRZXIT.js";
27
+ } from "./chunk-S7LXRKLD.js";
28
28
  import {
29
29
  parseArguments,
30
30
  printError
31
- } from "./chunk-SZXT3PDQ.js";
31
+ } from "./chunk-RL7X7JGK.js";
32
32
  import {
33
33
  getFlagsSpecification,
34
34
  isAPIError,
35
35
  packageName
36
- } from "./chunk-KSSNLCL4.js";
36
+ } from "./chunk-U6PPDPR5.js";
37
37
  import "./chunk-P4QNYOFB.js";
38
38
  import "./chunk-52QYYTM5.js";
39
39
  import {
@@ -9,32 +9,34 @@ import {
9
9
  handleVcrApiError,
10
10
  resolveVcrScope,
11
11
  validateVcrJsonOutput
12
- } from "./chunk-VUESC3YO.js";
12
+ } from "./chunk-XTQADJ6S.js";
13
+ import "./chunk-G75NFPIT.js";
13
14
  import {
14
15
  outputError
15
16
  } from "./chunk-BUZRVER7.js";
16
17
  import "./chunk-XPKWKPWA.js";
17
18
  import {
18
19
  addSubcommand
19
- } from "./chunk-3VS4DTAU.js";
20
- import "./chunk-GIL3VAUR.js";
21
- import "./chunk-FYQPTH5C.js";
22
- import "./chunk-TPX7RZBM.js";
20
+ } from "./chunk-V6WHZAPP.js";
21
+ import "./chunk-TCBOCSWF.js";
22
+ import "./chunk-NGYOR3MN.js";
23
+ import "./chunk-R6IGDGX3.js";
24
+ import "./chunk-DKS4XDVC.js";
23
25
  import "./chunk-ECCWJHC6.js";
24
26
  import {
25
27
  AGENT_REASON,
26
28
  buildCommandWithGlobalFlags,
27
29
  outputAgentError
28
- } from "./chunk-UDWRZXIT.js";
30
+ } from "./chunk-S7LXRKLD.js";
29
31
  import {
30
32
  parseArguments,
31
33
  printError
32
- } from "./chunk-SZXT3PDQ.js";
34
+ } from "./chunk-RL7X7JGK.js";
33
35
  import {
34
36
  getFlagsSpecification,
35
37
  isAPIError,
36
38
  packageName
37
- } from "./chunk-KSSNLCL4.js";
39
+ } from "./chunk-U6PPDPR5.js";
38
40
  import "./chunk-P4QNYOFB.js";
39
41
  import "./chunk-52QYYTM5.js";
40
42
  import {
@@ -0,0 +1,240 @@
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
+ DEFAULT_TAG,
9
+ buildRepositoryReference,
10
+ parseNameArg,
11
+ validateImageParts
12
+ } from "./chunk-RBIFXFZX.js";
13
+ import {
14
+ VCR_ENGINES,
15
+ emitVcrArgParseError,
16
+ isBuildxAvailable,
17
+ isEngineInstalled,
18
+ pushCompressionArgs,
19
+ reportEngineCommandFailure,
20
+ reportEnginePushFailure,
21
+ resolveRegistry,
22
+ resolveVcrScope,
23
+ runEngine,
24
+ splitPassthrough,
25
+ validateVcrChoice
26
+ } from "./chunk-XTQADJ6S.js";
27
+ import "./chunk-G75NFPIT.js";
28
+ import {
29
+ outputError
30
+ } from "./chunk-BUZRVER7.js";
31
+ import "./chunk-XPKWKPWA.js";
32
+ import {
33
+ buildSubcommand
34
+ } from "./chunk-V6WHZAPP.js";
35
+ import "./chunk-TCBOCSWF.js";
36
+ import "./chunk-NGYOR3MN.js";
37
+ import "./chunk-R6IGDGX3.js";
38
+ import "./chunk-DKS4XDVC.js";
39
+ import "./chunk-ECCWJHC6.js";
40
+ import {
41
+ AGENT_REASON,
42
+ buildCommandWithGlobalFlags,
43
+ outputAgentError
44
+ } from "./chunk-S7LXRKLD.js";
45
+ import {
46
+ parseArguments,
47
+ printError
48
+ } from "./chunk-RL7X7JGK.js";
49
+ import {
50
+ getFlagsSpecification
51
+ } from "./chunk-U6PPDPR5.js";
52
+ import "./chunk-P4QNYOFB.js";
53
+ import "./chunk-52QYYTM5.js";
54
+ import {
55
+ output_manager_default
56
+ } from "./chunk-OX7KI3LF.js";
57
+ import "./chunk-GGP5R3FU.js";
58
+ import "./chunk-S7KYDPEM.js";
59
+ import "./chunk-TZ2YI2VH.js";
60
+
61
+ // src/commands/vcr/build.ts
62
+ var DEFAULT_PLATFORM = "linux/amd64";
63
+ async function build(client, telemetry) {
64
+ const { own, passthrough } = splitPassthrough(client.argv);
65
+ let parsedArgs;
66
+ try {
67
+ parsedArgs = parseArguments(
68
+ own,
69
+ getFlagsSpecification(buildSubcommand.options)
70
+ );
71
+ } catch (err) {
72
+ emitVcrArgParseError(client, err, "vcr build <engine> [path] [name[:tag]]");
73
+ printError(err);
74
+ return 1;
75
+ }
76
+ const [engineArg, pathArg, nameArg] = parsedArgs.args.slice(2);
77
+ const project = parsedArgs.flags["--project"];
78
+ const platform = parsedArgs.flags["--platform"];
79
+ const push = Boolean(parsedArgs.flags["--push"]);
80
+ telemetry.trackCliArgumentEngine(engineArg);
81
+ telemetry.trackCliArgumentPath(pathArg);
82
+ telemetry.trackCliArgumentName(nameArg);
83
+ telemetry.trackCliOptionProject(project);
84
+ telemetry.trackCliOptionPlatform(platform);
85
+ telemetry.trackCliFlagPush(push);
86
+ if (!engineArg) {
87
+ const message = `Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;
88
+ outputAgentError(
89
+ client,
90
+ {
91
+ status: "error",
92
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
93
+ message,
94
+ next: [
95
+ {
96
+ command: buildCommandWithGlobalFlags(
97
+ client.argv,
98
+ "vcr build docker"
99
+ ),
100
+ when: "Replace docker with the container tool you use"
101
+ }
102
+ ]
103
+ },
104
+ 1
105
+ );
106
+ return outputError(client, false, "MISSING_ARGUMENTS", message);
107
+ }
108
+ const choiceError = validateVcrChoice(
109
+ client,
110
+ "engine",
111
+ engineArg,
112
+ VCR_ENGINES,
113
+ false
114
+ );
115
+ if (typeof choiceError === "number") {
116
+ return choiceError;
117
+ }
118
+ const engine = engineArg;
119
+ if (!isEngineInstalled(engine)) {
120
+ const message = `\`${engine}\` is not installed or not on your PATH. Install it and try again.`;
121
+ outputAgentError(
122
+ client,
123
+ {
124
+ status: "error",
125
+ reason: "engine_not_found",
126
+ message
127
+ },
128
+ 1
129
+ );
130
+ return outputError(client, false, "ENGINE_NOT_FOUND", message);
131
+ }
132
+ const scope = await resolveVcrScope(client, { project, jsonOutput: false });
133
+ if (typeof scope === "number") {
134
+ return scope;
135
+ }
136
+ const parsed = parseNameArg(nameArg, scope.projectName);
137
+ if ("error" in parsed) {
138
+ outputAgentError(
139
+ client,
140
+ {
141
+ status: "error",
142
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
143
+ message: parsed.error
144
+ },
145
+ 1
146
+ );
147
+ return outputError(client, false, "INVALID_ARGUMENTS", parsed.error);
148
+ }
149
+ const validationError = validateImageParts(parsed);
150
+ if (validationError) {
151
+ outputAgentError(
152
+ client,
153
+ {
154
+ status: "error",
155
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
156
+ message: validationError
157
+ },
158
+ 1
159
+ );
160
+ return outputError(client, false, "INVALID_ARGUMENTS", validationError);
161
+ }
162
+ const base = buildRepositoryReference({
163
+ registry: resolveRegistry(),
164
+ teamSlug: scope.teamSlug,
165
+ projectName: scope.projectName,
166
+ repository: parsed.repository
167
+ });
168
+ const ref = `${base}:${parsed.tag ?? DEFAULT_TAG}`;
169
+ const contextPath = pathArg ?? ".";
170
+ const buildPlatform = platform ?? DEFAULT_PLATFORM;
171
+ if (push && engine === "docker" && await isBuildxAvailable()) {
172
+ const outputSpec = `type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`;
173
+ const engineArgs2 = [
174
+ "buildx",
175
+ "build",
176
+ "--platform",
177
+ buildPlatform,
178
+ "--output",
179
+ outputSpec,
180
+ ...passthrough,
181
+ contextPath
182
+ ];
183
+ output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);
184
+ const result2 = await runEngine(engine, engineArgs2, {
185
+ cwd: client.cwd,
186
+ captureStderr: true
187
+ });
188
+ if (result2.exitCode !== 0) {
189
+ return reportEnginePushFailure(client, engine, "buildx build", result2);
190
+ }
191
+ output_manager_default.success(`Built and pushed ${ref} (zstd compression)`);
192
+ return 0;
193
+ }
194
+ if (push && engine === "docker") {
195
+ output_manager_default.warn(
196
+ "Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes."
197
+ );
198
+ }
199
+ const engineArgs = [
200
+ "build",
201
+ "--platform",
202
+ buildPlatform,
203
+ "--tag",
204
+ ref,
205
+ ...passthrough,
206
+ contextPath
207
+ ];
208
+ output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);
209
+ const result = await runEngine(engine, engineArgs, { cwd: client.cwd });
210
+ if (result.exitCode !== 0) {
211
+ return reportEngineCommandFailure(client, engine, "build", result);
212
+ }
213
+ if (!push) {
214
+ output_manager_default.success(`Built ${ref}`);
215
+ output_manager_default.log(
216
+ `Push it with \`${buildCommandWithGlobalFlags(
217
+ client.argv,
218
+ `vcr push ${engine}${nameArg ? ` ${nameArg}` : ""}`
219
+ )}\`.`
220
+ );
221
+ return 0;
222
+ }
223
+ const pushArgs = ["push", ...pushCompressionArgs(engine), ref];
224
+ output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);
225
+ const pushResult = await runEngine(engine, pushArgs, {
226
+ cwd: client.cwd,
227
+ captureStderr: true
228
+ });
229
+ if (pushResult.exitCode !== 0) {
230
+ return reportEnginePushFailure(client, engine, "push", pushResult);
231
+ }
232
+ const compressed = engine !== "docker";
233
+ output_manager_default.success(
234
+ `Built and pushed ${ref}${compressed ? " (zstd compression)" : ""}`
235
+ );
236
+ return 0;
237
+ }
238
+ export {
239
+ build as default
240
+ };
@@ -31,14 +31,14 @@ import {
31
31
  usePrefix,
32
32
  useState,
33
33
  writeToConfigFile
34
- } from "./chunk-TPX7RZBM.js";
34
+ } from "./chunk-DKS4XDVC.js";
35
35
  import {
36
36
  parseArguments,
37
37
  require_strip_ansi
38
- } from "./chunk-SZXT3PDQ.js";
38
+ } from "./chunk-RL7X7JGK.js";
39
39
  import {
40
40
  APIError
41
- } from "./chunk-KSSNLCL4.js";
41
+ } from "./chunk-U6PPDPR5.js";
42
42
  import {
43
43
  pkg_default
44
44
  } from "./chunk-P4QNYOFB.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-NM43FFV6.js";
11
11
  import {
12
12
  isAPIError
13
- } from "./chunk-KSSNLCL4.js";
13
+ } from "./chunk-U6PPDPR5.js";
14
14
  import {
15
15
  output_manager_default
16
16
  } from "./chunk-OX7KI3LF.js";
@@ -6,22 +6,22 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  setupAndLink
9
- } from "./chunk-KGVT2RSG.js";
9
+ } from "./chunk-BAUVB2VF.js";
10
10
  import {
11
11
  detectExplicitScope,
12
12
  getLinkedProject,
13
13
  param,
14
14
  printProjectNotFoundError,
15
15
  resolveProjectCwd
16
- } from "./chunk-TPX7RZBM.js";
16
+ } from "./chunk-DKS4XDVC.js";
17
17
  import {
18
18
  buildCommandWithYes,
19
19
  outputActionRequired
20
- } from "./chunk-UDWRZXIT.js";
20
+ } from "./chunk-S7LXRKLD.js";
21
21
  import {
22
22
  getCommandName,
23
23
  getCommandNamePlain
24
- } from "./chunk-KSSNLCL4.js";
24
+ } from "./chunk-U6PPDPR5.js";
25
25
  import {
26
26
  output_manager_default
27
27
  } from "./chunk-OX7KI3LF.js";
@@ -16,13 +16,13 @@ import {
16
16
  } from "./chunk-A3NYPUKZ.js";
17
17
  import {
18
18
  ellipsizeMiddle
19
- } from "./chunk-OF2GNB42.js";
19
+ } from "./chunk-TF627KEI.js";
20
20
  import {
21
21
  elapsed
22
22
  } from "./chunk-VXYGCOKL.js";
23
23
  import {
24
24
  table
25
- } from "./chunk-NZRWTCRM.js";
25
+ } from "./chunk-LA3BQQQK.js";
26
26
  import {
27
27
  require_ms
28
28
  } from "./chunk-GGP5R3FU.js";
@@ -6,24 +6,24 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  resolveProjectContext
9
- } from "./chunk-TPX7RZBM.js";
9
+ } from "./chunk-DKS4XDVC.js";
10
10
  import {
11
11
  AGENT_REASON,
12
12
  AGENT_STATUS,
13
13
  buildCommandWithYes,
14
14
  outputAgentError,
15
15
  withGlobalFlags
16
- } from "./chunk-UDWRZXIT.js";
16
+ } from "./chunk-S7LXRKLD.js";
17
17
  import {
18
18
  parseArguments,
19
19
  printError
20
- } from "./chunk-SZXT3PDQ.js";
20
+ } from "./chunk-RL7X7JGK.js";
21
21
  import {
22
22
  getCommandName,
23
23
  getCommandNamePlain,
24
24
  getFlagsSpecification,
25
25
  getGlobalFlagsFromArgs
26
- } from "./chunk-KSSNLCL4.js";
26
+ } from "./chunk-U6PPDPR5.js";
27
27
  import {
28
28
  output_manager_default
29
29
  } from "./chunk-OX7KI3LF.js";
@@ -7,26 +7,29 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-BYQQLGCT.js";
10
+ } from "./chunk-YITWM37U.js";
11
11
  import {
12
12
  progress
13
- } from "./chunk-B2MTCHPO.js";
13
+ } from "./chunk-2D22CMQ7.js";
14
+ import {
15
+ validateJsonOutput
16
+ } from "./chunk-XPKWKPWA.js";
14
17
  import {
15
18
  apiCommand,
16
- listSubcommand3 as listSubcommand,
19
+ listSubcommand4 as listSubcommand,
17
20
  loginCommand
18
- } from "./chunk-WANVKOVB.js";
21
+ } from "./chunk-6QUKJKFX.js";
19
22
  import {
20
23
  require_semver
21
24
  } from "./chunk-IB5L4LKZ.js";
22
25
  import {
23
26
  help
24
- } from "./chunk-DMSLNAVH.js";
27
+ } from "./chunk-P7IO46BQ.js";
25
28
  import {
26
29
  getGlobalPathConfig,
27
30
  login,
28
31
  writeToConfigFile
29
- } from "./chunk-TPX7RZBM.js";
32
+ } from "./chunk-DKS4XDVC.js";
30
33
  import {
31
34
  TelemetryClient,
32
35
  isNativeBinaryInstall
@@ -35,11 +38,11 @@ import {
35
38
  parseArguments,
36
39
  printError,
37
40
  require_strip_ansi
38
- } from "./chunk-SZXT3PDQ.js";
41
+ } from "./chunk-RL7X7JGK.js";
39
42
  import {
40
43
  getFlagsSpecification,
41
44
  packageName
42
- } from "./chunk-KSSNLCL4.js";
45
+ } from "./chunk-U6PPDPR5.js";
43
46
  import {
44
47
  pkg_default
45
48
  } from "./chunk-P4QNYOFB.js";
@@ -1147,6 +1150,11 @@ var ApiTelemetryClient = class extends TelemetryClient {
1147
1150
  });
1148
1151
  }
1149
1152
  }
1153
+ trackCliFlagJson(json) {
1154
+ if (json) {
1155
+ this.trackCliFlag("json");
1156
+ }
1157
+ }
1150
1158
  /**
1151
1159
  * Normalize endpoint by replacing IDs with placeholders for privacy
1152
1160
  */
@@ -1360,7 +1368,7 @@ async function parseOperationKeyValuePairs(endpoint, bodyFields, flags, position
1360
1368
  return;
1361
1369
  }
1362
1370
  throw new Error(
1363
- `Unknown option "${key}" for operation ${endpoint.operationId}. Check the API docs or run \`vercel api ls --format json\`.`
1371
+ `Unknown option "${key}" for operation ${endpoint.operationId}. Check the API docs or run \`vercel api ls --json\`.`
1364
1372
  );
1365
1373
  }
1366
1374
  for (const field of flags["--field"] || []) {
@@ -1910,18 +1918,24 @@ async function api(client) {
1910
1918
  );
1911
1919
  return 2;
1912
1920
  }
1921
+ const formatResult = validateJsonOutput(lsFlags);
1922
+ if (!formatResult.valid) {
1923
+ output_manager_default.error(formatResult.error);
1924
+ return 1;
1925
+ }
1913
1926
  telemetryClient.trackCliSubcommandList();
1914
1927
  if (lsFlags["--refresh"])
1915
1928
  telemetryClient.trackCliFlagRefresh(true);
1916
1929
  if (lsFlags["--format"])
1917
1930
  telemetryClient.trackCliOptionFormat(lsFlags["--format"]);
1931
+ telemetryClient.trackCliFlagJson(lsFlags["--json"]);
1918
1932
  if (lsFlags["--spec-url"])
1919
1933
  telemetryClient.trackCliOptionSpecUrl(lsFlags["--spec-url"]);
1920
1934
  return listEndpoints(
1921
1935
  client,
1922
1936
  lsFlags["--refresh"] ?? false,
1923
1937
  lsFlags["--spec-url"],
1924
- lsFlags["--format"] ?? "table"
1938
+ formatResult.jsonOutput ? "json" : "table"
1925
1939
  );
1926
1940
  }
1927
1941
  if (needHelp) {
@@ -2276,7 +2290,7 @@ function printTagOperationResolveError(result, allEndpoints) {
2276
2290
  const tags = [...new Set(allEndpoints.flatMap((ep) => ep.tags || []))].sort();
2277
2291
  const preview = tags.slice(0, 25).join(", ");
2278
2292
  output_manager_default.error(
2279
- `No operations use tag "${result.tag}".${tags.length > 0 ? ` Example tags: ${preview}${tags.length > 25 ? ", \u2026" : ""}.` : ""} Run \`vercel api ls --format json\` to inspect tags.`
2293
+ `No operations use tag "${result.tag}".${tags.length > 0 ? ` Example tags: ${preview}${tags.length > 25 ? ", \u2026" : ""}.` : ""} Run \`vercel api ls --json\` to inspect tags.`
2280
2294
  );
2281
2295
  return;
2282
2296
  }
@@ -11,15 +11,15 @@ import {
11
11
  getLinkedProject,
12
12
  getProjectByNameOrId,
13
13
  getScope
14
- } from "./chunk-TPX7RZBM.js";
14
+ } from "./chunk-DKS4XDVC.js";
15
15
  import {
16
16
  printError
17
- } from "./chunk-SZXT3PDQ.js";
17
+ } from "./chunk-RL7X7JGK.js";
18
18
  import {
19
19
  ProjectNotFound,
20
20
  getCommandName,
21
21
  isAPIError
22
- } from "./chunk-KSSNLCL4.js";
22
+ } from "./chunk-U6PPDPR5.js";
23
23
  import {
24
24
  output_manager_default
25
25
  } from "./chunk-OX7KI3LF.js";