vercel 59.11.2 → 59.12.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 (173) hide show
  1. package/dist/chunks/{add-BKSHWTPX.js → add-OO3JGLZW.js} +23 -18
  2. package/dist/chunks/{add-HPLJZFM2.js → add-RTXDASSS.js} +23 -18
  3. package/dist/chunks/add-XGO6LHMD.js +221 -0
  4. package/dist/chunks/{build-V4ZLAJWB.js → build-JINV2UD4.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-2NIDTSQJ.js +305 -0
  8. package/dist/chunks/chunk-32XSMM3W.js +49 -0
  9. package/dist/chunks/chunk-332LMJLZ.js +16014 -0
  10. package/dist/chunks/{chunk-RO44KX6Y.js → chunk-3BB2HOO2.js} +12 -7
  11. package/dist/chunks/{chunk-HDBQPBL6.js → chunk-3F25W3GA.js} +13 -9
  12. package/dist/chunks/{chunk-AYLY3ZVL.js → chunk-3VM7HWF6.js} +2 -2
  13. package/dist/chunks/chunk-4IALDGB7.js +22 -0
  14. package/dist/chunks/{chunk-MTWHQEXI.js → chunk-4TUMNBEE.js} +7 -5
  15. package/dist/chunks/{chunk-5XECIWME.js → chunk-5NF5HOBJ.js} +5 -3
  16. package/dist/chunks/chunk-6E6KPBXY.js +43 -0
  17. package/dist/chunks/{chunk-ASBP32T6.js → chunk-7MRDIPJY.js} +1 -1
  18. package/dist/chunks/chunk-ABSZNJQO.js +522 -0
  19. package/dist/chunks/{chunk-7ST552E3.js → chunk-AKLTIZCU.js} +1 -1
  20. package/dist/chunks/{chunk-ONRLTUP2.js → chunk-AV747POV.js} +43 -36
  21. package/dist/chunks/chunk-B5XLQKHI.js +849 -0
  22. package/dist/chunks/{chunk-BMKU5KEL.js → chunk-CV5YC2EN.js} +1 -1
  23. package/dist/chunks/{chunk-TPATD2MM.js → chunk-CZ5QQRXD.js} +14 -6
  24. package/dist/chunks/{chunk-2EAIC3SH.js → chunk-E47NARDE.js} +8 -8
  25. package/dist/chunks/{chunk-XM3LOQIX.js → chunk-EDMW7SBH.js} +76 -92
  26. package/dist/chunks/{chunk-QAT3CW4G.js → chunk-EFYMIIER.js} +2 -2
  27. package/dist/chunks/chunk-ELZ6WQQA.js +81 -0
  28. package/dist/chunks/{chunk-FKDO3CM4.js → chunk-EOLGLGXJ.js} +17 -13
  29. package/dist/chunks/chunk-FRVG4OW3.js +7438 -0
  30. package/dist/chunks/chunk-G5FBSUL4.js +822 -0
  31. package/dist/chunks/chunk-GDOUDU6O.js +74 -0
  32. package/dist/chunks/{chunk-OQ3C5VXZ.js → chunk-GVNCVKCI.js} +4 -2
  33. package/dist/chunks/chunk-HB4UKFDO.js +1295 -0
  34. package/dist/chunks/{chunk-FRAXI2WT.js → chunk-HD4DR3DA.js} +4 -3
  35. package/dist/chunks/{chunk-DWIC7MRV.js → chunk-HKHXKSXQ.js} +1 -1
  36. package/dist/chunks/{chunk-6JPVTPTU.js → chunk-HM24ZWQL.js} +4 -4
  37. package/dist/chunks/chunk-HR2MP4XF.js +324 -0
  38. package/dist/chunks/chunk-HRXRELD3.js +338 -0
  39. package/dist/chunks/{chunk-IJ4X426J.js → chunk-IIMSID24.js} +1 -1
  40. package/dist/chunks/{chunk-B4TXCKXE.js → chunk-JOXNBQ7W.js} +10 -8
  41. package/dist/chunks/{chunk-O75LSD3C.js → chunk-JSD4EZL3.js} +1 -1
  42. package/dist/chunks/{chunk-7AEEQOD4.js → chunk-K3RED3VO.js} +1 -1
  43. package/dist/chunks/chunk-KAF4WFF3.js +257 -0
  44. package/dist/chunks/{chunk-3T7WSWZH.js → chunk-KFWQ3EFH.js} +1 -1
  45. package/dist/chunks/{chunk-6CZZ3SH3.js → chunk-KNO327AW.js} +2 -2
  46. package/dist/chunks/{chunk-L3UXB2CW.js → chunk-KW7BS25T.js} +1 -1
  47. package/dist/chunks/{chunk-2NJJ2K5S.js → chunk-L6B6BRHH.js} +6 -6
  48. package/dist/chunks/{chunk-FZRBF25Y.js → chunk-LDV2R4P4.js} +4 -4
  49. package/dist/chunks/chunk-MADFAH3O.js +14059 -0
  50. package/dist/chunks/{chunk-OO3OF6MK.js → chunk-MDGPZHSM.js} +151 -26
  51. package/dist/chunks/{chunk-XRWOTCDO.js → chunk-ND5CF2H3.js} +1 -1
  52. package/dist/chunks/{chunk-6TBDHUXK.js → chunk-NDY3JDOU.js} +21 -15
  53. package/dist/chunks/{chunk-RKDCNQ4S.js → chunk-NW34PW6V.js} +3 -105
  54. package/dist/chunks/{chunk-C5HKWXRR.js → chunk-OAMU5QO6.js} +1 -1
  55. package/dist/chunks/{chunk-RSJBU3ON.js → chunk-OJHDGHOB.js} +35 -27
  56. package/dist/chunks/chunk-P7VSBDR4.js +827 -0
  57. package/dist/chunks/chunk-PEC3CQSK.js +90 -0
  58. package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-PIMIVJYK.js} +1 -0
  59. package/dist/chunks/chunk-PNGVSHR3.js +40 -0
  60. package/dist/chunks/chunk-PP5GKSIX.js +137 -0
  61. package/dist/chunks/chunk-QB2UHSUB.js +58 -0
  62. package/dist/chunks/chunk-QIUK4Z7Q.js +79 -0
  63. package/dist/chunks/chunk-RN6V5ODW.js +114 -0
  64. package/dist/chunks/chunk-RNK3LXLR.js +1288 -0
  65. package/dist/chunks/chunk-RVBZ64EQ.js +52 -0
  66. package/dist/chunks/{chunk-WA2SJE5S.js → chunk-SWO66HE2.js} +4 -4
  67. package/dist/chunks/{chunk-NBW3BWOJ.js → chunk-TDGK45FB.js} +2 -2
  68. package/dist/chunks/{chunk-WNAKOXGK.js → chunk-TO7QZGYK.js} +1 -1
  69. package/dist/chunks/{chunk-QDV5LZ4Q.js → chunk-UA55I7M6.js} +12 -8
  70. package/dist/chunks/{chunk-FWKSJYDV.js → chunk-UG2WOB5L.js} +1 -1
  71. package/dist/chunks/chunk-UJPVHLL5.js +233 -0
  72. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  73. package/dist/chunks/chunk-VJSREJVM.js +875 -0
  74. package/dist/chunks/chunk-VUS2JQB2.js +121 -0
  75. package/dist/chunks/{chunk-4KVJ2M4J.js → chunk-WPBCUXMZ.js} +582 -37
  76. package/dist/chunks/chunk-WSZ5E4WH.js +92 -0
  77. package/dist/chunks/{chunk-Q5K5DEOK.js → chunk-WT2Y7FRD.js} +42 -28
  78. package/dist/chunks/chunk-WT6C2ALC.js +18188 -0
  79. package/dist/chunks/chunk-X6TGUHFD.js +59 -0
  80. package/dist/chunks/{chunk-ZSFEACZU.js → chunk-XFF5TGRA.js} +1 -1
  81. package/dist/chunks/chunk-XNIZGCN5.js +58 -0
  82. package/dist/chunks/chunk-XPJLPUKO.js +117 -0
  83. package/dist/chunks/{chunk-FXD67VN5.js → chunk-XUAWTW4W.js} +1 -1
  84. package/dist/chunks/chunk-YPMFZRTN.js +417 -0
  85. package/dist/chunks/chunk-YRESLJCW.js +1536 -0
  86. package/dist/chunks/{chunk-I526H4AS.js → chunk-YS76T533.js} +2 -2
  87. package/dist/chunks/{chunk-52QYYTM5.js → chunk-ZDU2NODC.js} +3 -127
  88. package/dist/chunks/chunk-ZW6HETRE.js +97 -0
  89. package/dist/chunks/{clear-IYGWCNXT.js → clear-GQTDYSKJ.js} +23 -18
  90. package/dist/chunks/{compile-vercel-config-NEEBZRUJ.js → compile-vercel-config-URVMKDVW.js} +8 -11
  91. package/dist/chunks/{config-6DS6BBR2.js → config-MSVQR5T6.js} +23 -18
  92. package/dist/chunks/{config-NTB5EMV4.js → config-OAXY4J6P.js} +23 -18
  93. package/dist/chunks/config-validator.mjs +1 -1
  94. package/dist/chunks/{delete-LSGID5FV.js → delete-57QO64HD.js} +19 -14
  95. package/dist/chunks/{delete-LLC2OGHA.js → delete-XN6ESD7C.js} +16 -12
  96. package/dist/chunks/detect-projects-ODNU4PK2.js +18 -0
  97. package/dist/chunks/detect-services-UPY4LTBZ.js +40 -0
  98. package/dist/chunks/{disable-H4EXEQK7.js → disable-BYI46V7B.js} +17 -13
  99. package/dist/chunks/{discard-FG6VKHWN.js → discard-IIQL44ZZ.js} +17 -13
  100. package/dist/chunks/{edit-BZJSGUHT.js → edit-BRNS3OR4.js} +19 -15
  101. package/dist/chunks/{edit-YE7D3CPJ.js → edit-JTW7XZH7.js} +17 -13
  102. package/dist/chunks/{enable-6ESD4QTE.js → enable-CH5FSQMR.js} +17 -13
  103. package/dist/chunks/{exec-XH4K34JM.js → exec-4IPHZ55G.js} +9 -5
  104. package/dist/chunks/{export-QWSJROLG.js → export-6WHQOWKM.js} +16 -13
  105. package/dist/chunks/{image-LTHQMKFG.js → image-ZSLYATWG.js} +11 -8
  106. package/dist/chunks/{import-builders-6O7ILGQJ.js → import-builders-FNMYJZGG.js} +18 -13
  107. package/dist/chunks/{inspect-2C4ZSNYC.js → inspect-4RDZSYWU.js} +27 -23
  108. package/dist/chunks/{inspect-N6SMHV3Z.js → inspect-7WQXZWET.js} +18 -14
  109. package/dist/chunks/{inspect-F7KCTHIL.js → inspect-CGXTNMMO.js} +19 -15
  110. package/dist/chunks/{inspect-ICKNCDMT.js → inspect-XJ7BYLZ5.js} +18 -14
  111. package/dist/chunks/{inspect-TWDPMXZ5.js → inspect-Z2MBTTB7.js} +18 -14
  112. package/dist/chunks/{list-NWTIJF3L.js → list-65LW6OTM.js} +20 -16
  113. package/dist/chunks/{list-DS7ZOUXA.js → list-7W3PHRB6.js} +25 -21
  114. package/dist/chunks/{list-IPGQVBJO.js → list-KS22Y57L.js} +16 -14
  115. package/dist/chunks/{login-F7A7ONKC.js → login-NXULVQZ2.js} +23 -18
  116. package/dist/chunks/{ls-2QW3ZSM6.js → ls-35EOVEIQ.js} +24 -18
  117. package/dist/chunks/{ls-XINES6PL.js → ls-5GKS5QRW.js} +24 -18
  118. package/dist/chunks/ls-ADYFYYIW.js +204 -0
  119. package/dist/chunks/{ls-D4TUDBIH.js → ls-DZYN3SNS.js} +24 -18
  120. package/dist/chunks/{ls-LSJEUPFX.js → ls-HVQOGBGV.js} +23 -16
  121. package/dist/chunks/{ls-NBDX3MKN.js → ls-I2PWG7YN.js} +24 -18
  122. package/dist/chunks/{open-VRQDWZAW.js → open-H34HXJHP.js} +18 -13
  123. package/dist/chunks/{permissions-6C5C7TEV.js → permissions-ZPPEPKVE.js} +14 -11
  124. package/dist/chunks/{publish-GVIZPNLN.js → publish-NRMKXHAU.js} +17 -13
  125. package/dist/chunks/pull-WUT3XTZX.js +45 -0
  126. package/dist/chunks/{push-EFZ5P5Z6.js → push-WFNCEA5J.js} +23 -18
  127. package/dist/chunks/{query-GBS2PIT4.js → query-2FQM3F7N.js} +23 -20
  128. package/dist/chunks/{reorder-TN65IFRL.js → reorder-GYCT7L3C.js} +17 -13
  129. package/dist/chunks/{reply-DYVEV3PY.js → reply-RFEXNYZ7.js} +17 -13
  130. package/dist/chunks/{resolve-JAWFBPUM.js → resolve-ZFGT7W6Z.js} +16 -12
  131. package/dist/chunks/resolve-deployment-framework-preset-NPE6RLV3.js +36 -0
  132. package/dist/chunks/{restore-TJVMHUBQ.js → restore-JAXPMYL5.js} +17 -13
  133. package/dist/chunks/rm-CLKQN5E4.js +162 -0
  134. package/dist/chunks/{rm-HQ5CYNJA.js → rm-JPV5V2SH.js} +23 -18
  135. package/dist/chunks/{rm-7XACNZ2U.js → rm-N7SGFQOA.js} +23 -18
  136. package/dist/chunks/{rm-REJVXALW.js → rm-UQJ4CZJH.js} +23 -18
  137. package/dist/chunks/{rm-CBPNMSRP.js → rm-ZUQ4U454.js} +24 -17
  138. package/dist/chunks/{routes-2OLIBRYX.js → routes-QVMBXOSX.js} +7 -3
  139. package/dist/chunks/rule-inspect-HI3YY7OY.js +123 -0
  140. package/dist/chunks/{rules-VGV4M4KY.js → rules-DA3Q64M4.js} +15 -12
  141. package/dist/chunks/{schema-GMTQOQCV.js → schema-R3C4CXJ6.js} +20 -18
  142. package/dist/chunks/schema-UYYFV3JB.js +381 -0
  143. package/dist/chunks/{set-Z5FO2FCC.js → set-TOJPGW4J.js} +21 -14
  144. package/dist/chunks/setup-and-link-DRYXQOH4.js +65 -0
  145. package/dist/chunks/{tags-SDRXWJ63.js → tags-TNLVFNVI.js} +10 -7
  146. package/dist/chunks/{types-JGANJ5EQ.js → types-4GAJ7XQQ.js} +9 -7
  147. package/dist/chunks/update-X6JB3NPI.js +224 -0
  148. package/dist/chunks/vlt-builder-importer-USCFHWPL.js +322 -0
  149. package/dist/commands/build/index.js +86 -49
  150. package/dist/commands/deploy/index.js +76 -67
  151. package/dist/commands/dev/index.js +98 -52
  152. package/dist/commands/env/index.js +68 -44
  153. package/dist/commands/link/index.js +49 -28
  154. package/dist/commands/list/index.js +33 -22
  155. package/dist/commands-bulk.js +8715 -3581
  156. package/dist/help.js +1 -1
  157. package/dist/index.js +74 -42
  158. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +6 -0
  159. package/dist/version.mjs +1 -1
  160. package/package.json +52 -48
  161. package/dist/chunks/add-RBW7QITR.js +0 -219
  162. package/dist/chunks/chunk-26XDDLXM.js +0 -144
  163. package/dist/chunks/chunk-5GGUB4EO.js +0 -31
  164. package/dist/chunks/chunk-MXLA3VQS.js +0 -20
  165. package/dist/chunks/chunk-OTXE7MHI.js +0 -96
  166. package/dist/chunks/chunk-RSEAADCE.js +0 -138
  167. package/dist/chunks/chunk-WYU64FLP.js +0 -62123
  168. package/dist/chunks/chunk-XNFHNTS2.js +0 -2939
  169. package/dist/chunks/ls-RNGO257R.js +0 -193
  170. package/dist/chunks/rm-5B5VHWWN.js +0 -170
  171. package/dist/chunks/rule-inspect-ZSTDDFID.js +0 -281
  172. package/dist/chunks/schema-45SJNY5L.js +0 -427
  173. package/dist/chunks/update-JBQBC3IV.js +0 -233
@@ -0,0 +1,52 @@
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_dist2 as require_dist
9
+ } from "./chunk-332LMJLZ.js";
10
+ import {
11
+ require_frameworks
12
+ } from "./chunk-FRVG4OW3.js";
13
+ import {
14
+ __toESM
15
+ } from "./chunk-TZ2YI2VH.js";
16
+
17
+ // src/util/projects/detect-projects.ts
18
+ var import_frameworks = __toESM(require_frameworks(), 1);
19
+ var import_fs_detectors = __toESM(require_dist(), 1);
20
+ import { join } from "path";
21
+ async function detectProjects(cwd) {
22
+ const fs = new import_fs_detectors.LocalFileSystemDetector(cwd);
23
+ const workspaces = await (0, import_fs_detectors.getWorkspaces)({ fs });
24
+ const detectedProjects = /* @__PURE__ */ new Map();
25
+ const packagePaths = (await Promise.all(
26
+ workspaces.map(
27
+ (workspace) => (0, import_fs_detectors.getWorkspacePackagePaths)({
28
+ fs,
29
+ workspace
30
+ })
31
+ )
32
+ )).flat();
33
+ if (packagePaths.length === 0) {
34
+ packagePaths.push("/");
35
+ }
36
+ await Promise.all(
37
+ packagePaths.map(async (p) => {
38
+ const frameworks = await (0, import_fs_detectors.detectFrameworks)({
39
+ fs: fs.chdir(join(".", p)),
40
+ frameworkList: import_frameworks.frameworkList
41
+ });
42
+ if (frameworks.length === 0)
43
+ return;
44
+ detectedProjects.set(p.slice(1), frameworks);
45
+ })
46
+ );
47
+ return detectedProjects;
48
+ }
49
+
50
+ export {
51
+ detectProjects
52
+ };
@@ -4,12 +4,12 @@ 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
- require_lib
9
- } from "./chunk-WYU64FLP.js";
10
7
  import {
11
8
  isNativeBinaryInstall
12
- } from "./chunk-XNFHNTS2.js";
9
+ } from "./chunk-4IALDGB7.js";
10
+ import {
11
+ require_lib
12
+ } from "./chunk-MADFAH3O.js";
13
13
  import {
14
14
  packageName
15
15
  } from "./chunk-Q2DGFCO7.js";
@@ -8,10 +8,10 @@ import {
8
8
  VERCEL_DIR,
9
9
  VERCEL_DIR_PROJECT,
10
10
  require_lib
11
- } from "./chunk-WYU64FLP.js";
11
+ } from "./chunk-MADFAH3O.js";
12
12
  import {
13
13
  require_dist
14
- } from "./chunk-QFAS4OVW.js";
14
+ } from "./chunk-ZW6HETRE.js";
15
15
  import {
16
16
  __toESM
17
17
  } 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_isexe
9
- } from "./chunk-5XECIWME.js";
9
+ } from "./chunk-5NF5HOBJ.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __require
@@ -7,25 +7,29 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  outputError,
9
9
  writeJsonError
10
- } from "./chunk-3T7WSWZH.js";
10
+ } from "./chunk-KFWQ3EFH.js";
11
11
  import {
12
- detectExplicitScope,
13
- getLinkedProject,
14
- getScope,
15
12
  resolveProjectContext
16
- } from "./chunk-WYU64FLP.js";
13
+ } from "./chunk-X6TGUHFD.js";
14
+ import {
15
+ detectExplicitScope,
16
+ getScope
17
+ } from "./chunk-ABSZNJQO.js";
17
18
  import {
18
19
  printError
19
- } from "./chunk-AYLY3ZVL.js";
20
+ } from "./chunk-3VM7HWF6.js";
21
+ import {
22
+ getLinkedProject
23
+ } from "./chunk-MADFAH3O.js";
20
24
  import {
21
25
  isAPIError
22
- } from "./chunk-BMKU5KEL.js";
26
+ } from "./chunk-CV5YC2EN.js";
23
27
  import {
24
28
  getCommandName
25
29
  } from "./chunk-Q2DGFCO7.js";
26
30
  import {
27
31
  output_manager_default
28
- } from "./chunk-QFAS4OVW.js";
32
+ } from "./chunk-2JIX6UMI.js";
29
33
 
30
34
  // src/commands/comments/errors.ts
31
35
  function handleCommentsParseError(err, subcommandName) {
@@ -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,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-VJSREJVM.js";
11
+ import {
12
+ require_dist2 as require_dist
13
+ } from "./chunk-332LMJLZ.js";
14
+ import {
15
+ readJSONFile
16
+ } from "./chunk-32XSMM3W.js";
17
+ import {
18
+ compileVercelConfig
19
+ } from "./chunk-YPMFZRTN.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-FNMYJZGG.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,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
+ };