vercel 59.11.2 → 59.11.7

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 (154) hide show
  1. package/dist/chunks/{add-BKSHWTPX.js → add-KSJQYR5C.js} +23 -18
  2. package/dist/chunks/{add-RBW7QITR.js → add-PERLOALD.js} +37 -23
  3. package/dist/chunks/{add-HPLJZFM2.js → add-WU2QYHYL.js} +23 -18
  4. package/dist/chunks/{build-V4ZLAJWB.js → build-F3J6FLPD.js} +23 -18
  5. package/dist/chunks/{chunk-NGGLYKNU.js → chunk-26CU4Q3C.js} +3 -115
  6. package/dist/chunks/{chunk-QFAS4OVW.js → chunk-2JIX6UMI.js} +3 -84
  7. package/dist/chunks/chunk-2TSBB22D.js +14059 -0
  8. package/dist/chunks/chunk-332LMJLZ.js +16014 -0
  9. package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
  10. package/dist/chunks/chunk-4IALDGB7.js +22 -0
  11. package/dist/chunks/chunk-4IVSM24H.js +522 -0
  12. package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
  13. package/dist/chunks/chunk-6E6KPBXY.js +43 -0
  14. package/dist/chunks/chunk-7KROIXQM.js +59 -0
  15. package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
  16. package/dist/chunks/chunk-A5JZS6ZN.js +92 -0
  17. package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
  18. package/dist/chunks/{chunk-26XDDLXM.js → chunk-ARU7VBKR.js} +2 -2
  19. package/dist/chunks/chunk-B5XLQKHI.js +849 -0
  20. package/dist/chunks/chunk-C762AAVU.js +137 -0
  21. package/dist/chunks/{chunk-WA2SJE5S.js → chunk-CEDN47PH.js} +4 -4
  22. package/dist/chunks/{chunk-ONRLTUP2.js → chunk-CNDPIHY5.js} +24 -22
  23. package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
  24. package/dist/chunks/chunk-DBYHS3CK.js +257 -0
  25. package/dist/chunks/{chunk-HDBQPBL6.js → chunk-DSTNNQVV.js} +12 -8
  26. package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
  27. package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-EPOLDWRA.js} +2 -2
  28. package/dist/chunks/{chunk-B4TXCKXE.js → chunk-EZQDYIVB.js} +10 -8
  29. package/dist/chunks/{chunk-2EAIC3SH.js → chunk-FL4JLNT2.js} +8 -8
  30. package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
  31. package/dist/chunks/{chunk-FKDO3CM4.js → chunk-FVNJTRCE.js} +17 -13
  32. package/dist/chunks/chunk-FVT74RZ5.js +1536 -0
  33. package/dist/chunks/chunk-G3PXSXIB.js +18188 -0
  34. package/dist/chunks/chunk-G5FBSUL4.js +822 -0
  35. package/dist/chunks/{chunk-FRAXI2WT.js → chunk-GCVXKRR5.js} +3 -3
  36. package/dist/chunks/chunk-GHKJAK5V.js +1288 -0
  37. package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-GUU4Z2AQ.js} +42 -28
  38. package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
  39. package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
  40. package/dist/chunks/chunk-HRXRELD3.js +338 -0
  41. package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
  42. package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
  43. package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
  44. package/dist/chunks/{chunk-RSEAADCE.js → chunk-KEKR7OCB.js} +6 -4
  45. package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
  46. package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
  47. package/dist/chunks/{chunk-RO44KX6Y.js → chunk-N4QHMXOO.js} +11 -7
  48. package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
  49. package/dist/chunks/{chunk-RSJBU3ON.js → chunk-NSOYO6JQ.js} +35 -27
  50. package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
  51. package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
  52. package/dist/chunks/{chunk-MTWHQEXI.js → chunk-OIH6FP5Y.js} +5 -3
  53. package/dist/chunks/chunk-P7VSBDR4.js +827 -0
  54. package/dist/chunks/chunk-PEC3CQSK.js +90 -0
  55. package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-PFM75KY3.js} +12 -8
  56. package/dist/chunks/chunk-PJXMXMCO.js +81 -0
  57. package/dist/chunks/chunk-PNGVSHR3.js +40 -0
  58. package/dist/chunks/{chunk-TPATD2MM.js → chunk-QHS645AZ.js} +14 -6
  59. package/dist/chunks/{chunk-OTXE7MHI.js → chunk-QKX7WKIN.js} +8 -6
  60. package/dist/chunks/chunk-QOPTXV4G.js +417 -0
  61. package/dist/chunks/chunk-RN6V5ODW.js +114 -0
  62. package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
  63. package/dist/chunks/chunk-SHFNEZVI.js +49 -0
  64. package/dist/chunks/{chunk-OO3OF6MK.js → chunk-TGNEG57M.js} +44 -15
  65. package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
  66. package/dist/chunks/chunk-UARGTFCT.js +875 -0
  67. package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
  68. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  69. package/dist/chunks/chunk-VT3Z7HF6.js +233 -0
  70. package/dist/chunks/chunk-VUS2JQB2.js +121 -0
  71. package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-VYC45Q4Z.js} +2 -2
  72. package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WL6QYSGD.js} +78 -17
  73. package/dist/chunks/{chunk-FZRBF25Y.js → chunk-X7DBBZQD.js} +4 -4
  74. package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-XD4DCYMX.js} +6 -6
  75. package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
  76. package/dist/chunks/{chunk-6TBDHUXK.js → chunk-XIFATBH5.js} +21 -15
  77. package/dist/chunks/chunk-XNIZGCN5.js +58 -0
  78. package/dist/chunks/chunk-XPJLPUKO.js +117 -0
  79. package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
  80. package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
  81. package/dist/chunks/chunk-Z7JWYFOY.js +58 -0
  82. package/dist/chunks/{chunk-6JPVTPTU.js → chunk-ZBEECGFD.js} +3 -3
  83. package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
  84. package/dist/chunks/chunk-ZW6HETRE.js +97 -0
  85. package/dist/chunks/{clear-IYGWCNXT.js → clear-XUQO4ZTK.js} +23 -18
  86. package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-D3ARNHTN.js} +8 -11
  87. package/dist/chunks/{config-6DS6BBR2.js → config-37OAE7QJ.js} +22 -17
  88. package/dist/chunks/{config-NTB5EMV4.js → config-MEDLXUVM.js} +23 -18
  89. package/dist/chunks/{delete-LLC2OGHA.js → delete-3N3YZZOF.js} +16 -12
  90. package/dist/chunks/{delete-LSGID5FV.js → delete-VSWDZ2SW.js} +19 -14
  91. package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
  92. package/dist/chunks/detect-services-TESZCQWG.js +40 -0
  93. package/dist/chunks/{disable-H4EXEQK7.js → disable-A4FLFMC7.js} +17 -13
  94. package/dist/chunks/{discard-FG6VKHWN.js → discard-CHGFULBZ.js} +17 -13
  95. package/dist/chunks/{edit-YE7D3CPJ.js → edit-JZ63AJYQ.js} +17 -13
  96. package/dist/chunks/{edit-BZJSGUHT.js → edit-MHSYAPDR.js} +19 -15
  97. package/dist/chunks/{enable-6ESD4QTE.js → enable-KD46SEC5.js} +17 -13
  98. package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
  99. package/dist/chunks/{export-QWSJROLG.js → export-42QZLBSN.js} +16 -13
  100. package/dist/chunks/{image-LTHQMKFG.js → image-GP4H73A2.js} +11 -8
  101. package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-6TBLMPL2.js} +18 -13
  102. package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-5FMWMY3C.js} +22 -18
  103. package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-MUVK6MMT.js} +18 -14
  104. package/dist/chunks/{inspect-F7KCTHIL.js → inspect-Q3DWW7MC.js} +22 -18
  105. package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-QFXAOUL4.js} +18 -14
  106. package/dist/chunks/{inspect-ICKNCDMT.js → inspect-RNTSYM6O.js} +18 -14
  107. package/dist/chunks/{list-NWTIJF3L.js → list-IHHIPXEC.js} +20 -16
  108. package/dist/chunks/{list-IPGQVBJO.js → list-JRNWLSO5.js} +16 -14
  109. package/dist/chunks/{list-DS7ZOUXA.js → list-XHD5DLEX.js} +23 -19
  110. package/dist/chunks/{login-F7A7ONKC.js → login-PCT6KFWY.js} +23 -18
  111. package/dist/chunks/{ls-NBDX3MKN.js → ls-GPEHEFCF.js} +24 -18
  112. package/dist/chunks/{ls-RNGO257R.js → ls-PF7F4PP4.js} +27 -23
  113. package/dist/chunks/{ls-XINES6PL.js → ls-PQZ2RIDX.js} +24 -18
  114. package/dist/chunks/{ls-D4TUDBIH.js → ls-SVOHC3XW.js} +24 -18
  115. package/dist/chunks/{ls-2QW3ZSM6.js → ls-TGHCCARZ.js} +24 -18
  116. package/dist/chunks/{ls-LSJEUPFX.js → ls-VRIH5WA3.js} +22 -15
  117. package/dist/chunks/{open-VRQDWZAW.js → open-E7DEKYDU.js} +18 -13
  118. package/dist/chunks/{permissions-6C5C7TEV.js → permissions-JKOONWVL.js} +14 -11
  119. package/dist/chunks/{publish-GVIZPNLN.js → publish-EDDELDE5.js} +17 -13
  120. package/dist/chunks/pull-646WEVDE.js +45 -0
  121. package/dist/chunks/{push-EFZ5P5Z6.js → push-LTNW5OVD.js} +23 -18
  122. package/dist/chunks/{query-GBS2PIT4.js → query-LU4N6KPO.js} +22 -19
  123. package/dist/chunks/{reorder-TN65IFRL.js → reorder-22PKJMZP.js} +17 -13
  124. package/dist/chunks/{reply-DYVEV3PY.js → reply-SF2EZMVZ.js} +17 -13
  125. package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZCZGXTOT.js} +16 -12
  126. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
  127. package/dist/chunks/{restore-TJVMHUBQ.js → restore-VJAWZXB4.js} +17 -13
  128. package/dist/chunks/{rm-7XACNZ2U.js → rm-KN2QFCKO.js} +23 -18
  129. package/dist/chunks/{rm-REJVXALW.js → rm-KVEAJPRE.js} +23 -18
  130. package/dist/chunks/{rm-CBPNMSRP.js → rm-OSZ5FZUM.js} +23 -16
  131. package/dist/chunks/{rm-5B5VHWWN.js → rm-W722Q2AO.js} +21 -18
  132. package/dist/chunks/{rm-HQ5CYNJA.js → rm-WNPGTUBH.js} +23 -18
  133. package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
  134. package/dist/chunks/{rule-inspect-ZSTDDFID.js → rule-inspect-25Z6SNX3.js} +28 -24
  135. package/dist/chunks/{rules-VGV4M4KY.js → rules-65LKAQ35.js} +15 -12
  136. package/dist/chunks/{schema-45SJNY5L.js → schema-7D6IGJEJ.js} +9 -7
  137. package/dist/chunks/{schema-GMTQOQCV.js → schema-NXCW4M75.js} +19 -17
  138. package/dist/chunks/{set-Z5FO2FCC.js → set-FYJVKMPV.js} +20 -13
  139. package/dist/chunks/setup-and-link-KXPZE32P.js +65 -0
  140. package/dist/chunks/{tags-SDRXWJ63.js → tags-ANIRP5E3.js} +10 -7
  141. package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
  142. package/dist/chunks/{update-JBQBC3IV.js → update-UT6CTKVG.js} +32 -19
  143. package/dist/commands/build/index.js +86 -49
  144. package/dist/commands/deploy/index.js +75 -66
  145. package/dist/commands/dev/index.js +98 -52
  146. package/dist/commands/env/index.js +67 -43
  147. package/dist/commands/link/index.js +48 -27
  148. package/dist/commands/list/index.js +33 -22
  149. package/dist/commands-bulk.js +1659 -1287
  150. package/dist/index.js +62 -40
  151. package/dist/version.mjs +1 -1
  152. package/package.json +46 -46
  153. package/dist/chunks/chunk-WYU64FLP.js +0 -62123
  154. package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getEnvTargetPlaceholder
9
- } from "./chunk-FXD67VN5.js";
9
+ } from "./chunk-XUAWTW4W.js";
10
10
  import {
11
11
  packageName,
12
12
  projectOption,
@@ -0,0 +1,36 @@
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
+
8
+ // src/util/input/prompt-cancellation.ts
9
+ var PromptCanceledError = class extends Error {
10
+ constructor() {
11
+ super("Prompt canceled");
12
+ this.name = "PromptCanceledError";
13
+ }
14
+ };
15
+ var PromptBackError = class extends Error {
16
+ constructor() {
17
+ super("Prompt back");
18
+ this.name = "PromptBackError";
19
+ }
20
+ };
21
+ function isPromptBackError(error) {
22
+ return error instanceof PromptBackError;
23
+ }
24
+ function isPromptCanceledError(error) {
25
+ if (error instanceof PromptCanceledError) {
26
+ return true;
27
+ }
28
+ return error instanceof Error && error.message.includes("User force closed the prompt");
29
+ }
30
+
31
+ export {
32
+ PromptCanceledError,
33
+ PromptBackError,
34
+ isPromptBackError,
35
+ isPromptCanceledError
36
+ };
@@ -0,0 +1,233 @@
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
+ require_dist as require_dist2,
9
+ validateConfig
10
+ } from "./chunk-UARGTFCT.js";
11
+ import {
12
+ require_dist2 as require_dist
13
+ } from "./chunk-332LMJLZ.js";
14
+ import {
15
+ readJSONFile
16
+ } from "./chunk-SHFNEZVI.js";
17
+ import {
18
+ compileVercelConfig
19
+ } from "./chunk-QOPTXV4G.js";
20
+ import {
21
+ CantParseJSONFile
22
+ } from "./chunk-CV5YC2EN.js";
23
+ import {
24
+ __toESM
25
+ } from "./chunk-TZ2YI2VH.js";
26
+
27
+ // src/util/projects/detect-services.ts
28
+ var import_fs_detectors = __toESM(require_dist(), 1);
29
+ var import_service_topology = __toESM(require_dist2(), 1);
30
+ import { readFile, writeFile } from "fs/promises";
31
+ import { basename, join as join2 } from "path";
32
+ import { parse as tomlParse, stringify as tomlStringify } from "smol-toml";
33
+
34
+ // src/util/projects/detect-entrypoint.ts
35
+ import { join } from "path";
36
+ import {
37
+ isPythonFramework,
38
+ isNodeBackendFramework,
39
+ normalizePath
40
+ } from "@vercel/build-utils";
41
+ function createDetectEntrypoint(projectRoot) {
42
+ return async ({ workPath, framework }) => {
43
+ const absWorkPath = normalizePath(join(projectRoot, workPath));
44
+ let builderName;
45
+ if (isPythonFramework(framework)) {
46
+ builderName = "@vercel/python";
47
+ } else if (isNodeBackendFramework(framework)) {
48
+ builderName = "@vercel/backends";
49
+ } else if (framework === "go") {
50
+ builderName = "@vercel/go";
51
+ } else if (framework === "rust") {
52
+ builderName = "@vercel/rust";
53
+ } else {
54
+ return null;
55
+ }
56
+ const detectEntrypoint = await loadBuilderDetectEntrypoint(
57
+ builderName,
58
+ projectRoot
59
+ );
60
+ if (!detectEntrypoint) {
61
+ return null;
62
+ }
63
+ if (builderName === "@vercel/python") {
64
+ return detectEntrypoint({
65
+ workPath: absWorkPath,
66
+ framework
67
+ });
68
+ }
69
+ return detectEntrypoint({ workPath: absWorkPath });
70
+ };
71
+ }
72
+ async function loadBuilderDetectEntrypoint(name, projectRoot) {
73
+ const { importBuilders } = await import("./import-builders-6TBLMPL2.js");
74
+ const builders = await importBuilders(/* @__PURE__ */ new Set([name]), projectRoot);
75
+ const loaded = builders.get(name);
76
+ if (!loaded) {
77
+ return void 0;
78
+ }
79
+ const detect = loaded.builder.detectEntrypoint;
80
+ return typeof detect === "function" ? detect : void 0;
81
+ }
82
+
83
+ // src/util/projects/detect-services.ts
84
+ async function isExperimentalServicesEnabled(cwd) {
85
+ return process.env.VERCEL_USE_EXPERIMENTAL_SERVICES === "1" || process.env.VERCEL_USE_EXPERIMENTAL_SERVICES?.toLowerCase() === "true" || await hasExperimentalServicesConfig(cwd);
86
+ }
87
+ async function hasExperimentalServicesConfig(cwd) {
88
+ try {
89
+ const compileResult = await compileVercelConfig(cwd);
90
+ if (!compileResult.configPath)
91
+ return false;
92
+ const config = await readJSONFile(
93
+ compileResult.configPath
94
+ );
95
+ if (!config || config instanceof Error)
96
+ return false;
97
+ return config.experimentalServices != null && typeof config.experimentalServices === "object" || config.services != null && typeof config.services === "object" || config.experimentalServicesV2 != null && typeof config.experimentalServicesV2 === "object";
98
+ } catch {
99
+ return false;
100
+ }
101
+ }
102
+ async function tryDetectServices(cwd) {
103
+ const isServicesEnabled = await isExperimentalServicesEnabled(cwd);
104
+ if (!isServicesEnabled) {
105
+ return null;
106
+ }
107
+ const fs = new import_fs_detectors.LocalFileSystemDetector(cwd);
108
+ const result = await (0, import_service_topology.detectServices)({
109
+ fs,
110
+ detectEntrypoint: createDetectEntrypoint(cwd)
111
+ });
112
+ const hasNoServicesError = result.errors.some(
113
+ (e) => e.code === "NO_SERVICES_CONFIGURED"
114
+ );
115
+ if (hasNoServicesError) {
116
+ return null;
117
+ }
118
+ return result;
119
+ }
120
+ async function writeServicesConfig(cwd, config) {
121
+ const prepared = await prepareServicesConfigWrite(cwd, config);
122
+ await writeFile(prepared.configPath, prepared.content, "utf8");
123
+ return { configFileName: basename(prepared.configPath) };
124
+ }
125
+ async function getServicesConfigWriteBlocker(cwd, config) {
126
+ try {
127
+ await prepareServicesConfigWrite(cwd, config);
128
+ return null;
129
+ } catch (error) {
130
+ return getServicesConfigWriteBlockerFromError(error);
131
+ }
132
+ }
133
+ function toProjectServicesConfigPatch(config) {
134
+ const services = {};
135
+ for (const [name, svc] of Object.entries(config)) {
136
+ const buildCommand = svc.preDeployCommand && svc.buildCommand ? `${svc.buildCommand} && ${svc.preDeployCommand}` : svc.preDeployCommand || svc.buildCommand;
137
+ services[name] = {
138
+ root: svc.root,
139
+ ...svc.framework ? { framework: svc.framework } : {},
140
+ ...svc.entrypoint ? { entrypoint: svc.entrypoint } : {},
141
+ ...buildCommand ? { buildCommand } : {}
142
+ };
143
+ }
144
+ const rewrites = (0, import_service_topology.generateServiceRewrites)(config);
145
+ return {
146
+ services,
147
+ ...rewrites.length > 0 ? { rewrites } : {}
148
+ };
149
+ }
150
+ async function prepareServicesConfigWrite(cwd, config) {
151
+ const compileResult = await compileVercelConfig(cwd);
152
+ const configPath = join2(cwd, "vercel.json");
153
+ if (compileResult.sourceFile === "vercel.toml") {
154
+ return prepareTomlServicesConfigWrite(join2(cwd, "vercel.toml"), config);
155
+ }
156
+ if (compileResult.wasCompiled) {
157
+ throw new Error(
158
+ `Cannot automatically update ${compileResult.sourceFile ?? "the current Vercel config"}.`
159
+ );
160
+ }
161
+ let existingConfig = {};
162
+ if (compileResult.configPath && basename(compileResult.configPath) === "vercel.json") {
163
+ const result = await readJSONFile(configPath);
164
+ if (result instanceof CantParseJSONFile) {
165
+ throw result;
166
+ }
167
+ existingConfig = result ?? {};
168
+ }
169
+ const patch = toProjectServicesConfigPatch(config);
170
+ const nextConfig = {
171
+ ...existingConfig,
172
+ ...patch,
173
+ // Preserve existing user rewrites; append auto-detected service rewrites.
174
+ ...patch.rewrites ? {
175
+ rewrites: [
176
+ ...existingConfig.rewrites ?? [],
177
+ ...patch.rewrites
178
+ ]
179
+ } : {}
180
+ };
181
+ const validationError = validateConfig(nextConfig);
182
+ if (validationError) {
183
+ throw validationError;
184
+ }
185
+ return {
186
+ configPath,
187
+ content: JSON.stringify(nextConfig, null, 2) + "\n"
188
+ };
189
+ }
190
+ async function prepareTomlServicesConfigWrite(configPath, config) {
191
+ const patch = toProjectServicesConfigPatch(config);
192
+ const patchKeys = Object.keys(patch);
193
+ let existingContent;
194
+ try {
195
+ existingContent = await readFile(configPath, "utf8");
196
+ } catch {
197
+ existingContent = "";
198
+ }
199
+ if (existingContent.trim()) {
200
+ const existingParsed = tomlParse(existingContent);
201
+ const overlapping = patchKeys.filter((key) => key in existingParsed);
202
+ if (overlapping.length > 0) {
203
+ const plural = overlapping.length > 1;
204
+ const keyList = overlapping.map((k) => `"${k}"`).join(", ");
205
+ throw new Error(
206
+ `Cannot automatically update vercel.toml: key${plural ? "s" : ""} ${keyList} already exist${plural ? "" : "s"}.`
207
+ );
208
+ }
209
+ }
210
+ const patchToml = tomlStringify(patch);
211
+ const content = existingContent.trim() ? existingContent.trimEnd() + "\n\n" + patchToml + "\n" : patchToml + "\n";
212
+ return { configPath, content };
213
+ }
214
+ function getServicesConfigWriteBlockerFromError(error) {
215
+ switch (error?.code) {
216
+ case "EXPERIMENTAL_SERVICES_AND_BUILDS":
217
+ case "SERVICES_AND_BUILDS":
218
+ return "builds";
219
+ case "EXPERIMENTAL_SERVICES_AND_FUNCTIONS":
220
+ case "SERVICES_AND_FUNCTIONS":
221
+ return "functions";
222
+ default:
223
+ return null;
224
+ }
225
+ }
226
+
227
+ export {
228
+ createDetectEntrypoint,
229
+ isExperimentalServicesEnabled,
230
+ tryDetectServices,
231
+ writeServicesConfig,
232
+ getServicesConfigWriteBlocker
233
+ };
@@ -0,0 +1,121 @@
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
+
8
+ // src/util/agent-output-constants.ts
9
+ var AGENT_STATUS = {
10
+ ERROR: "error",
11
+ ACTION_REQUIRED: "action_required",
12
+ OK: "ok"
13
+ };
14
+ var AGENT_REASON = {
15
+ // Common (use across dns, flags, routes, env, domains, link)
16
+ MISSING_ARGUMENTS: "missing_arguments",
17
+ INVALID_ARGUMENTS: "invalid_arguments",
18
+ CONFIRMATION_REQUIRED: "confirmation_required",
19
+ INTERACTIVE_CONFIRMATION_REQUIRED: "interactive_confirmation_required",
20
+ LOGIN_REQUIRED: "login_required",
21
+ PROJECT_SETTINGS_REQUIRED: "project_settings_required",
22
+ NOT_LINKED: "not_linked",
23
+ NOT_FOUND: "not_found",
24
+ PROJECT_NOT_FOUND: "project_not_found",
25
+ MISSING_SCOPE: "missing_scope",
26
+ SCOPE_NOT_ACCESSIBLE: "scope_not_accessible",
27
+ API_ERROR: "api_error",
28
+ // Flags
29
+ SEGMENT_IN_USE: "segment_in_use",
30
+ // Env
31
+ MISSING_REQUIREMENTS: "missing_requirements",
32
+ MISSING_NAME: "missing_name",
33
+ MISSING_VALUE: "missing_value",
34
+ MISSING_ENVIRONMENT: "missing_environment",
35
+ ENV_NOT_FOUND: "env_not_found",
36
+ MULTIPLE_ENVS: "multiple_envs",
37
+ ENV_FILE_EXISTS: "env_file_exists",
38
+ GIT_BRANCH_REQUIRED: "git_branch_required",
39
+ ENV_KEY_SENSITIVE: "env_key_sensitive",
40
+ // Routes
41
+ AMBIGUOUS_ROUTE: "ambiguous_route",
42
+ ROUTE_CREATE_FAILED: "route_create_failed",
43
+ ROUTE_GENERATION_FAILED: "route_generation_failed",
44
+ // DNS
45
+ DOMAIN_NOT_FOUND: "domain_not_found",
46
+ DNS_RECORD_NOT_FOUND: "dns_record_not_found",
47
+ INCOMPLETE_RECORD: "incomplete_record",
48
+ PERMISSION_DENIED: "permission_denied",
49
+ INVALID_PORT: "invalid_port",
50
+ INVALID_DNS_TYPE: "invalid_dns_type",
51
+ DNS_ADD_FAILED: "dns_add_failed",
52
+ INVALID_DOMAIN: "invalid_domain",
53
+ CONFIGURED_CORRECTLY: "configured_correctly",
54
+ VERIFICATION_NEEDED: "verification_needed",
55
+ INVALID_CONFIGURATION: "invalid_configuration",
56
+ DNS_CHANGE_REQUIRED: "dns_change_required",
57
+ DNS_CHANGE_RECOMMENDED: "dns_change_recommended",
58
+ DNSSEC_NEEDS_TO_BE_DISABLED: "dnssec_needs_to_be_disabled",
59
+ PROJECT_ATTACHMENT_RECOMMENDED: "project_attachment_recommended",
60
+ PROJECT_DOMAIN_MISSING: "project_domain_missing",
61
+ /** User must accept marketplace integration terms in the browser before install can continue. */
62
+ INTEGRATION_TERMS_ACCEPTANCE_REQUIRED: "integration_terms_acceptance_required",
63
+ /** Integration uninstall blocked because team-scoped resources still exist. */
64
+ HAS_RESOURCES: "has_resources",
65
+ /** User must claim a sandbox marketplace resource (e.g. Stripe, Shopify) in the browser. */
66
+ INTEGRATION_SANDBOX_CLAIM_REQUIRED: "integration_sandbox_claim_required",
67
+ // Tokens
68
+ CLASSIC_TOKEN_REQUIRED: "classic_token_required",
69
+ /** Classic token lacks full user/account scope (e.g. team- or product-scoped token). */
70
+ TOKEN_USER_SCOPE_REQUIRED: "token_user_scope_required",
71
+ // Webhooks
72
+ MISSING_URL: "missing_url",
73
+ MISSING_EVENTS: "missing_events",
74
+ INVALID_URL: "invalid_url",
75
+ INVALID_EVENT: "invalid_event",
76
+ // AI Gateway
77
+ INVALID_BUDGET: "invalid_budget",
78
+ INVALID_REFRESH_PERIOD: "invalid_refresh_period",
79
+ INVALID_EXPIRATION: "invalid_expiration",
80
+ INVALID_ALERT_THRESHOLDS: "invalid_alert_thresholds",
81
+ /**
82
+ * Every selected agent needs explicit `--agent`/`--all` consent (see the
83
+ * payload's skipped[]). `--yes` does not grant it, so this is deliberately
84
+ * not `confirmation_required` — re-running with --yes would loop forever.
85
+ */
86
+ REQUIRES_CONSENT: "requires_consent",
87
+ // KMS
88
+ MISSING_ISSUER_ID: "missing_issuer_id",
89
+ MISSING_KEY: "missing_key",
90
+ MISSING_KEY_ID: "missing_key_id",
91
+ MISSING_PROJECT: "missing_project",
92
+ ISSUER_NOT_FOUND: "issuer_not_found",
93
+ /** The issuer is provisioned by another Vercel service and is read-only here. */
94
+ ISSUER_MANAGED: "issuer_managed",
95
+ /** Keys for an imported issuer must be imported too, so `add-key` cannot serve it. */
96
+ ISSUER_REQUIRES_IMPORTED_KEY: "issuer_requires_imported_key",
97
+ /** Vercel generates the keys for this issuer, so `import-key` cannot serve it. */
98
+ ISSUER_REQUIRES_GENERATED_KEY: "issuer_requires_generated_key",
99
+ /** Immediate revocation only applies to a key already scheduled for revocation. */
100
+ KEY_NOT_REVOKING: "key_not_revoking",
101
+ NO_CHANGES_REQUESTED: "no_changes_requested",
102
+ // Redirects
103
+ REDIRECT_NOT_FOUND: "redirect_not_found",
104
+ VERSION_NOT_FOUND: "version_not_found",
105
+ VERSION_ALREADY_LIVE: "version_already_live",
106
+ VERSION_IS_STAGING: "version_is_staging",
107
+ PLAN_UPGRADE_REQUIRED: "plan_upgrade_required",
108
+ NOT_TEAM_MEMBER: "not_team_member",
109
+ INVALID_ROLE_COMBINATION: "invalid_role_combination"
110
+ };
111
+ var AGENT_ACTION = {
112
+ MISSING_ARGUMENTS: "missing_arguments",
113
+ CONFIRMATION_REQUIRED: "confirmation_required",
114
+ LOGIN_REQUIRED: "login_required"
115
+ };
116
+
117
+ export {
118
+ AGENT_STATUS,
119
+ AGENT_REASON,
120
+ AGENT_ACTION
121
+ };
@@ -8,10 +8,10 @@ import {
8
8
  formatCondition,
9
9
  formatTransform,
10
10
  isTargetTransform
11
- } from "./chunk-B4TXCKXE.js";
11
+ } from "./chunk-EZQDYIVB.js";
12
12
  import {
13
13
  output_manager_default
14
- } from "./chunk-QFAS4OVW.js";
14
+ } from "./chunk-2JIX6UMI.js";
15
15
  import {
16
16
  require_source
17
17
  } from "./chunk-S7KYDPEM.js";
@@ -4,27 +4,27 @@ import { dirname as __dirname_ } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
- import {
8
- tracesCommand
9
- } from "./chunk-7Q45OKWR.js";
10
7
  import {
11
8
  vcrCommand
12
9
  } from "./chunk-CJV7J7B5.js";
10
+ import {
11
+ tracesCommand
12
+ } from "./chunk-7Q45OKWR.js";
13
13
  import {
14
14
  metricsCommand
15
- } from "./chunk-MTWHQEXI.js";
15
+ } from "./chunk-OIH6FP5Y.js";
16
16
  import {
17
17
  routesCommand
18
18
  } from "./chunk-POOO7W47.js";
19
19
  import {
20
20
  commentsCommand
21
21
  } from "./chunk-SLPSPYVR.js";
22
- import {
23
- activityCommand
24
- } from "./chunk-4KD5BYHB.js";
25
22
  import {
26
23
  alertsCommand
27
24
  } from "./chunk-DWIC7MRV.js";
25
+ import {
26
+ activityCommand
27
+ } from "./chunk-4KD5BYHB.js";
28
28
  import {
29
29
  devCommand
30
30
  } from "./chunk-XDGOOW3K.js";
@@ -34,10 +34,10 @@ import {
34
34
  import {
35
35
  buildCommand,
36
36
  pullCommand
37
- } from "./chunk-FWKSJYDV.js";
37
+ } from "./chunk-UG2WOB5L.js";
38
38
  import {
39
39
  envCommand
40
- } from "./chunk-FXD67VN5.js";
40
+ } from "./chunk-XUAWTW4W.js";
41
41
  import {
42
42
  confirmOption,
43
43
  deploymentOption,
@@ -53,7 +53,7 @@ import {
53
53
  } from "./chunk-Q2DGFCO7.js";
54
54
  import {
55
55
  output_manager_default
56
- } from "./chunk-QFAS4OVW.js";
56
+ } from "./chunk-2JIX6UMI.js";
57
57
 
58
58
  // src/commands/deploy/command.ts
59
59
  var deprecatedArchiveSplitTgz = "split-tgz";
@@ -2465,7 +2465,7 @@ var createSubcommand2 = {
2465
2465
  type: String,
2466
2466
  argument: "BRANCH",
2467
2467
  deprecated: false,
2468
- description: "Target a specific git branch for the trigger destination. Requires --triggers."
2468
+ description: "Target a preview deployment by git branch name. Omit the flag to target production. Cannot be combined with --trigger-environment. Requires --triggers."
2469
2469
  },
2470
2470
  {
2471
2471
  name: "trigger-environment",
@@ -2473,7 +2473,7 @@ var createSubcommand2 = {
2473
2473
  type: String,
2474
2474
  argument: "ENV",
2475
2475
  deprecated: false,
2476
- description: "Target a custom environment by slug or stable ID. Mutually exclusive with --trigger-branch and requires --triggers."
2476
+ description: "Target a custom environment by slug or stable ID. Cannot be combined with --trigger-branch. Requires --triggers."
2477
2477
  },
2478
2478
  {
2479
2479
  name: "connection-method",
@@ -2569,7 +2569,7 @@ var createSubcommand2 = {
2569
2569
  },
2570
2570
  {
2571
2571
  name: "Create with branch-specific trigger routing",
2572
- value: `${packageName} connect create github --name github --triggers --trigger-path /api/webhooks --trigger-branch main`
2572
+ value: `${packageName} connect create github --name github --triggers --trigger-path /api/webhooks --trigger-branch staging`
2573
2573
  },
2574
2574
  {
2575
2575
  name: "Create with trigger routing on another project",
@@ -3000,7 +3000,7 @@ var attachSubcommand = {
3000
3000
  type: String,
3001
3001
  argument: "BRANCH",
3002
3002
  deprecated: false,
3003
- description: "Target a specific git branch for the trigger destination (default: production). Only valid with --triggers."
3003
+ description: "Target a preview deployment by git branch name. Omit the flag to target production. Cannot be combined with --trigger-environment. Only valid with --triggers."
3004
3004
  },
3005
3005
  {
3006
3006
  name: "trigger-environment",
@@ -3008,7 +3008,7 @@ var attachSubcommand = {
3008
3008
  type: String,
3009
3009
  argument: "ENV",
3010
3010
  deprecated: false,
3011
- description: "Target a custom environment by slug or stable ID. Mutually exclusive with --trigger-branch and only valid with --triggers."
3011
+ description: "Target a custom environment by slug or stable ID. Cannot be combined with --trigger-branch. Only valid with --triggers."
3012
3012
  },
3013
3013
  {
3014
3014
  name: "trigger-path",
@@ -5229,6 +5229,65 @@ var listSubcommand11 = {
5229
5229
  }
5230
5230
  ]
5231
5231
  };
5232
+ var staleSubcommand = {
5233
+ name: "stale",
5234
+ aliases: [],
5235
+ description: "List stale feature flags for the current project",
5236
+ hidden: true,
5237
+ arguments: [],
5238
+ options: [
5239
+ projectOption,
5240
+ {
5241
+ name: "stale-after",
5242
+ shorthand: null,
5243
+ type: String,
5244
+ deprecated: false,
5245
+ description: "Consider flags stale after this relative day duration (default: 30d, max: 90d)",
5246
+ argument: "DURATION"
5247
+ },
5248
+ {
5249
+ name: "limit",
5250
+ shorthand: null,
5251
+ type: Number,
5252
+ deprecated: false,
5253
+ description: "Return one page of at most NUMBER stale flags (default: 50, max: 100)",
5254
+ argument: "NUMBER"
5255
+ },
5256
+ {
5257
+ name: "next",
5258
+ shorthand: null,
5259
+ type: String,
5260
+ deprecated: false,
5261
+ description: "Pagination cursor from a previous stale response",
5262
+ argument: "CURSOR"
5263
+ },
5264
+ {
5265
+ name: "json",
5266
+ shorthand: null,
5267
+ type: Boolean,
5268
+ deprecated: false,
5269
+ description: "Output in JSON format"
5270
+ }
5271
+ ],
5272
+ examples: [
5273
+ {
5274
+ name: "List stale flags",
5275
+ value: `${packageName} flags stale`
5276
+ },
5277
+ {
5278
+ name: "List flags that have been stale for 14 days",
5279
+ value: `${packageName} flags stale --stale-after 14d`
5280
+ },
5281
+ {
5282
+ name: "List the next page using the cursor from the previous page",
5283
+ value: `${packageName} flags stale --limit 10 --next <cursor>`
5284
+ },
5285
+ {
5286
+ name: "List stale flags as JSON",
5287
+ value: `${packageName} flags stale --json`
5288
+ }
5289
+ ]
5290
+ };
5232
5291
  var inspectSubcommand5 = {
5233
5292
  name: "inspect",
5234
5293
  aliases: [],
@@ -5761,7 +5820,7 @@ var splitSubcommand = {
5761
5820
  examples: [
5762
5821
  {
5763
5822
  name: "Split a boolean flag in production",
5764
- value: `${packageName} flags split redesigned-checkout --environment production --by user.userId --weight off=95 --weight on=5`
5823
+ value: `${packageName} flags split redesigned-checkout --environment production --by user.userId --weight false=95 --weight true=5`
5765
5824
  },
5766
5825
  {
5767
5826
  name: "Split a string flag with a fallback variant",
@@ -6033,7 +6092,7 @@ var rulesAddSubcommand3 = {
6033
6092
  },
6034
6093
  {
6035
6094
  name: "Add a split rule at the top",
6036
- value: `${packageName} flags rules add my-feature -e production --condition user.plan:eq:pro --by user.userId --weight off=90 --weight on=10 --position 1`
6095
+ value: `${packageName} flags rules add my-feature -e production --condition user.plan:eq:pro --by user.userId --weight false=90 --weight true=10 --position 1`
6037
6096
  }
6038
6097
  ]
6039
6098
  };
@@ -6779,6 +6838,7 @@ var flagsCommand = {
6779
6838
  arguments: [],
6780
6839
  subcommands: [
6781
6840
  listSubcommand11,
6841
+ staleSubcommand,
6782
6842
  inspectSubcommand5,
6783
6843
  versionsSubcommand,
6784
6844
  evaluationsSubcommand,
@@ -12597,6 +12657,7 @@ export {
12597
12657
  FLAG_EVALUATIONS_GRANULARITIES,
12598
12658
  isFlagEvaluationsGranularity,
12599
12659
  listSubcommand11,
12660
+ staleSubcommand,
12600
12661
  inspectSubcommand5,
12601
12662
  versionsListSubcommand,
12602
12663
  versionsDiffSubcommand,
@@ -6,13 +6,13 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  ellipsis
9
- } from "./chunk-C5HKWXRR.js";
10
- import {
11
- ALIGNED_LABEL_WIDTH
12
- } from "./chunk-WYU64FLP.js";
9
+ } from "./chunk-OAMU5QO6.js";
13
10
  import {
14
11
  require_ms
15
12
  } from "./chunk-GGP5R3FU.js";
13
+ import {
14
+ ALIGNED_LABEL_WIDTH
15
+ } from "./chunk-2TSBB22D.js";
16
16
  import {
17
17
  require_source
18
18
  } from "./chunk-S7KYDPEM.js";
@@ -7,23 +7,23 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  login,
9
9
  require_ci_info
10
- } from "./chunk-2EAIC3SH.js";
10
+ } from "./chunk-FL4JLNT2.js";
11
11
  import {
12
12
  getGlobalPathConfig
13
13
  } from "./chunk-AINIBIP4.js";
14
+ import {
15
+ printError
16
+ } from "./chunk-3VM7HWF6.js";
14
17
  import {
15
18
  humanizePath,
16
19
  param
17
- } from "./chunk-WYU64FLP.js";
18
- import {
19
- printError
20
- } from "./chunk-AYLY3ZVL.js";
20
+ } from "./chunk-2TSBB22D.js";
21
21
  import {
22
22
  getCommandName
23
23
  } from "./chunk-Q2DGFCO7.js";
24
24
  import {
25
25
  output_manager_default
26
- } from "./chunk-QFAS4OVW.js";
26
+ } from "./chunk-2JIX6UMI.js";
27
27
  import {
28
28
  __toESM
29
29
  } from "./chunk-TZ2YI2VH.js";
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_dist
9
- } from "./chunk-QFAS4OVW.js";
9
+ } from "./chunk-ZW6HETRE.js";
10
10
  import {
11
11
  require_source
12
12
  } from "./chunk-S7KYDPEM.js";