vercel 56.4.1 → 57.0.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 (94) hide show
  1. package/dist/chunks/{add-L3Z6PL54.js → add-7M577U56.js} +7 -6
  2. package/dist/chunks/{add-RFEJCIBM.js → add-YRZTDNXX.js} +3 -3
  3. package/dist/chunks/{chunk-V5P25P7F.js → chunk-2473DUBR.js} +4 -11
  4. package/dist/chunks/{chunk-5EXIJBLL.js → chunk-2EDWKVNP.js} +8 -8
  5. package/dist/chunks/{chunk-YS6EDZHB.js → chunk-2MJROFVC.js} +5 -1
  6. package/dist/chunks/{chunk-OOD67FAL.js → chunk-3242RXCN.js} +1 -1
  7. package/dist/chunks/chunk-3PGXYIKC.js +147 -0
  8. package/dist/chunks/{chunk-CHZBEMLF.js → chunk-4PGF367U.js} +47 -210
  9. package/dist/chunks/{chunk-GKVAAY2A.js → chunk-555WJSO5.js} +1 -1
  10. package/dist/chunks/chunk-5AJPMLDV.js +28 -0
  11. package/dist/chunks/{chunk-IHQ7DPQI.js → chunk-A2TYQBX2.js} +117 -3
  12. package/dist/chunks/chunk-A3NYPUKZ.js +17 -0
  13. package/dist/chunks/{chunk-W346YNDN.js → chunk-DWMH5M4Q.js} +4 -1
  14. package/dist/chunks/chunk-E336ZXPP.js +43 -0
  15. package/dist/chunks/chunk-F5PQWDOC.js +245 -0
  16. package/dist/chunks/{chunk-Y7TVKRRJ.js → chunk-F7X55TOY.js} +15 -839
  17. package/dist/chunks/chunk-FGDKMNEN.js +21 -0
  18. package/dist/chunks/chunk-FHEMFAHB.js +320 -0
  19. package/dist/chunks/{chunk-NLRIKNPX.js → chunk-GP5VCTEU.js} +1 -1
  20. package/dist/chunks/chunk-GZLPFESR.js +48 -0
  21. package/dist/chunks/{chunk-HZKJMZEQ.js → chunk-HD7B425F.js} +2 -2
  22. package/dist/chunks/{chunk-J6KTUJHV.js → chunk-IOAZNR6Z.js} +1 -1
  23. package/dist/chunks/{chunk-STJJ3DFO.js → chunk-KCF6S3XF.js} +16 -1
  24. package/dist/chunks/chunk-LMHT3QR3.js +247 -0
  25. package/dist/chunks/{chunk-A4XB42AB.js → chunk-MAHINYBW.js} +4 -3
  26. package/dist/chunks/{chunk-DXFSBJTA.js → chunk-MIFDRYTN.js} +1 -1
  27. package/dist/chunks/{chunk-VLTQJKP6.js → chunk-NH43BFJ3.js} +1 -1
  28. package/dist/chunks/{chunk-Z7NPYIZ6.js → chunk-NM43FFV6.js} +0 -8
  29. package/dist/chunks/{chunk-MQRHJEBS.js → chunk-NRNMT43R.js} +3 -3
  30. package/dist/chunks/chunk-OF2GNB42.js +53 -0
  31. package/dist/chunks/chunk-PRWJUY5U.js +848 -0
  32. package/dist/chunks/{chunk-F5OMERHI.js → chunk-QZD5DKUR.js} +10 -23
  33. package/dist/chunks/{chunk-4M3ZQCYN.js → chunk-RAFH25WW.js} +8 -1
  34. package/dist/chunks/{chunk-43B3LNUF.js → chunk-RYO6FJFB.js} +1 -1
  35. package/dist/chunks/{chunk-XFGY3JAX.js → chunk-T4NODP6Y.js} +11 -18
  36. package/dist/chunks/{chunk-GLAHGVBS.js → chunk-TBR2Q37Y.js} +2038 -1786
  37. package/dist/chunks/chunk-V4RMJKQP.js +36 -0
  38. package/dist/chunks/chunk-WR7JTCGL.js +104 -0
  39. package/dist/chunks/{chunk-6RTK6BWX.js → chunk-YA3WQFLY.js} +1 -1
  40. package/dist/chunks/{chunk-UHGAPG7O.js → chunk-YOZCJHLZ.js} +4 -4
  41. package/dist/chunks/{compile-vercel-config-J2X5OV6K.js → compile-vercel-config-3OHO3TJA.js} +2 -2
  42. package/dist/chunks/config-validator.mjs +1 -0
  43. package/dist/chunks/delete-3DZOCWCC.js +150 -0
  44. package/dist/chunks/{delete-57A44RN7.js → delete-VOSJLNEA.js} +3 -3
  45. package/dist/chunks/{disable-DNZ52MEO.js → disable-LQDEVRQF.js} +3 -3
  46. package/dist/chunks/{discard-HACSIZ74.js → discard-RGV4JKXQ.js} +3 -3
  47. package/dist/chunks/{edit-HJ47TQU3.js → edit-SFIEOQ24.js} +4 -4
  48. package/dist/chunks/edit-UPZPI54L.js +153 -0
  49. package/dist/chunks/{enable-BVLRVRYM.js → enable-6UVH35WC.js} +3 -3
  50. package/dist/chunks/{export-7MJFGMG7.js → export-6CEG3CK7.js} +3 -3
  51. package/dist/chunks/{image-4UMD7UZP.js → image-CQRCD2OE.js} +3 -3
  52. package/dist/chunks/inspect-4ZAH3RFT.js +205 -0
  53. package/dist/chunks/inspect-EXQBIAFF.js +587 -0
  54. package/dist/chunks/{inspect-WBHUZC3R.js → inspect-K5ZMQG7X.js} +3 -3
  55. package/dist/chunks/{inspect-4JD2QN67.js → inspect-UM3LDRPV.js} +3 -3
  56. package/dist/chunks/{inspect-XX3OXSHC.js → inspect-ZFRY3X3H.js} +3 -3
  57. package/dist/chunks/{list-AM6K2JCW.js → list-4DRVM7Q4.js} +42 -55
  58. package/dist/chunks/{list-5H57NTM4.js → list-FJCBOCCA.js} +2 -2
  59. package/dist/chunks/list-KCUHD4OA.js +360 -0
  60. package/dist/chunks/{login-YO34E4V5.js → login-DFGYNU3K.js} +3 -3
  61. package/dist/chunks/{ls-44NPIO2N.js → ls-34NCZKBE.js} +3 -3
  62. package/dist/chunks/{ls-P7ZLBWW2.js → ls-4QHHVXXD.js} +3 -3
  63. package/dist/chunks/{ls-YDUYTLXW.js → ls-CG6A7UXF.js} +3 -3
  64. package/dist/chunks/ls-RHEQ6YQB.js +188 -0
  65. package/dist/chunks/open-E3XADEMX.js +106 -0
  66. package/dist/chunks/{publish-RXFUYSW3.js → publish-Z3AQRUCS.js} +3 -3
  67. package/dist/chunks/{query-ILJJL3BZ.js → query-3EV66DO3.js} +9 -9
  68. package/dist/chunks/{reorder-GBCOPZT4.js → reorder-VA5E5ZJT.js} +3 -3
  69. package/dist/chunks/reply-SNSCNKAW.js +167 -0
  70. package/dist/chunks/resolve-6ZX4RTXX.js +228 -0
  71. package/dist/chunks/{restore-YK5DGGRX.js → restore-NEHI5B5P.js} +3 -3
  72. package/dist/chunks/{rm-O474MI5C.js → rm-22B22E47.js} +3 -3
  73. package/dist/chunks/{rm-LK6P7XTA.js → rm-E5ZVLAKO.js} +3 -3
  74. package/dist/chunks/{rm-FRZMXB2W.js → rm-FR6KE744.js} +7 -6
  75. package/dist/chunks/rule-inspect-DMP2CKJQ.js +283 -0
  76. package/dist/chunks/{rules-MZ2MP6KJ.js → rules-EYGXEI2Z.js} +7 -7
  77. package/dist/chunks/{schema-FR6CCQIZ.js → schema-2IIWOBSQ.js} +7 -5
  78. package/dist/chunks/{tags-AKRTKFRV.js → tags-ZDVYRHAY.js} +2 -2
  79. package/dist/chunks/{update-W3CWQB2F.js → update-QH4DQMZV.js} +7 -6
  80. package/dist/commands/build/index.js +45 -13
  81. package/dist/commands/deploy/index.js +38 -27
  82. package/dist/commands/dev/index.js +13 -16
  83. package/dist/commands/env/index.js +13 -11
  84. package/dist/commands/link/index.js +10 -9
  85. package/dist/commands/list/index.js +5 -5
  86. package/dist/commands-bulk.js +2981 -2179
  87. package/dist/index.js +31 -21
  88. package/dist/vc.js +54 -18
  89. package/dist/version.mjs +1 -1
  90. package/package.json +35 -35
  91. package/dist/chunks/chunk-F32B76CK.js +0 -86
  92. package/dist/chunks/inspect-5YZP7IWI.js +0 -351
  93. package/dist/chunks/ls-MB74DIQV.js +0 -113
  94. package/dist/chunks/rule-inspect-YEZGYINZ.js +0 -141
package/dist/index.js CHANGED
@@ -18,61 +18,61 @@ import {
18
18
  require_ci_info,
19
19
  setAutoUpdate,
20
20
  tryOpenApiFallback
21
- } from "./chunks/chunk-5EXIJBLL.js";
21
+ } from "./chunks/chunk-2EDWKVNP.js";
22
+ import "./chunks/chunk-FGDKMNEN.js";
22
23
  import {
23
24
  getUpdateCommand
24
- } from "./chunks/chunk-43B3LNUF.js";
25
+ } from "./chunks/chunk-RYO6FJFB.js";
25
26
  import {
26
- Client,
27
- getAuthConfigFilePath,
28
- getConfigFilePath,
29
- getGlobalPathConfig,
30
- readAuthConfigFile,
31
- readConfigFile,
32
- writeToConfigFile
33
- } from "./chunks/chunk-CHZBEMLF.js";
34
- import {
35
- highlight
36
- } from "./chunks/chunk-V5P25P7F.js";
27
+ Client
28
+ } from "./chunks/chunk-4PGF367U.js";
37
29
  import {
38
30
  commandNames,
39
31
  commands
40
- } from "./chunks/chunk-IHQ7DPQI.js";
32
+ } from "./chunks/chunk-A2TYQBX2.js";
41
33
  import "./chunks/chunk-3VS4DTAU.js";
42
34
  import "./chunks/chunk-GIL3VAUR.js";
43
35
  import "./chunks/chunk-FYQPTH5C.js";
44
36
  import "./chunks/chunk-4G6QZSBL.js";
45
37
  import "./chunks/chunk-VZSZBD4V.js";
38
+ import "./chunks/chunk-FHEMFAHB.js";
46
39
  import "./chunks/chunk-3PKFXNJZ.js";
47
- import "./chunks/chunk-YS6EDZHB.js";
48
- import "./chunks/chunk-STJJ3DFO.js";
40
+ import "./chunks/chunk-2MJROFVC.js";
41
+ import "./chunks/chunk-KCF6S3XF.js";
49
42
  import "./chunks/chunk-OGG6UBXK.js";
50
43
  import "./chunks/chunk-LHFNIZ2P.js";
51
44
  import {
52
45
  require_semver
53
46
  } from "./chunks/chunk-IB5L4LKZ.js";
54
- import "./chunks/chunk-F32B76CK.js";
55
- import "./chunks/chunk-VLTQJKP6.js";
47
+ import "./chunks/chunk-V4RMJKQP.js";
48
+ import "./chunks/chunk-NH43BFJ3.js";
56
49
  import "./chunks/chunk-DMSLNAVH.js";
57
50
  import "./chunks/chunk-NZRWTCRM.js";
58
51
  import {
52
+ getAuthConfigFilePath,
53
+ getConfigFilePath,
54
+ getGlobalPathConfig,
59
55
  getLinkFromDir,
60
56
  getScope,
61
57
  getTeams,
62
58
  getUser,
63
59
  getVercelDirectory,
60
+ highlight,
64
61
  humanizePath,
65
62
  param,
63
+ readAuthConfigFile,
64
+ readConfigFile,
66
65
  readJSONFile,
67
66
  require_dist as require_dist2,
68
- require_lib
69
- } from "./chunks/chunk-GLAHGVBS.js";
70
- import "./chunks/chunk-UDWRZXIT.js";
67
+ require_lib,
68
+ writeToConfigFile
69
+ } from "./chunks/chunk-TBR2Q37Y.js";
71
70
  import {
72
71
  TelemetryClient,
73
72
  TelemetryEventStore,
74
73
  isNativeBinaryInstall
75
74
  } from "./chunks/chunk-ECCWJHC6.js";
75
+ import "./chunks/chunk-UDWRZXIT.js";
76
76
  import {
77
77
  getArgs,
78
78
  parseArguments,
@@ -852,6 +852,12 @@ var RootTelemetryClient = class extends TelemetryClient {
852
852
  value: actual
853
853
  });
854
854
  }
855
+ trackCliCommandComments(actual) {
856
+ this.trackCliCommand({
857
+ command: "comments",
858
+ value: actual
859
+ });
860
+ }
855
861
  trackCliCommandConnex(actual) {
856
862
  this.trackCliCommand({
857
863
  command: "connex",
@@ -2088,6 +2094,10 @@ var main = async () => {
2088
2094
  telemetry.trackCliCommandCerts(userSuppliedSubCommand);
2089
2095
  func = (await import("./commands-bulk.js")).certs;
2090
2096
  break;
2097
+ case "comments":
2098
+ telemetry.trackCliCommandComments(userSuppliedSubCommand);
2099
+ func = (await import("./commands-bulk.js")).comments;
2100
+ break;
2091
2101
  case "crons":
2092
2102
  case "cron":
2093
2103
  telemetry.trackCliCommandCrons(userSuppliedSubCommand);
package/dist/vc.js CHANGED
@@ -10,40 +10,76 @@ try {
10
10
  }
11
11
  } catch {}
12
12
 
13
- // Native-first: spawn a @vercel/vc-native-{platform}-{arch} binary when
14
- // present and exit with its result, otherwise fall through to the JS CLI.
15
- // The native package is declared as an os/cpu-filtered optionalDependency
16
- // so at most one platform binary downloads per install.
13
+ // Spawn the @vercel/vc-native-{platform}-{arch} binary when it's present and
14
+ // the user has opted in (`useNativeBinary`); otherwise run the JS CLI.
17
15
  import { spawnSync } from 'node:child_process';
18
- import { createRequire } from 'node:module';
19
16
  import { existsSync } from 'node:fs';
20
- import { dirname, join } from 'node:path';
17
+ import { dirname, join, resolve } from 'node:path';
21
18
  import { fileURLToPath } from 'node:url';
22
19
 
23
20
  const __dirname = dirname(fileURLToPath(import.meta.url));
24
- const require = createRequire(import.meta.url);
25
21
 
26
22
  function resolveNative() {
27
23
  // Already running inside the native binary — never trampoline again.
28
24
  if (process.env.VERCEL_VC_NATIVE === '1') return null;
29
25
  const pkgName = `@vercel/vc-native-${process.platform}-${process.arch}`;
30
26
  const binName = process.platform === 'win32' ? 'vercel.exe' : 'vercel';
27
+ // Walk up from this install's own tree looking for a sibling native
28
+ // package. `require.resolve()` is not used because it falls back to
29
+ // NODE_PATH and the global folders even when `paths` is given.
30
+ let dir = __dirname;
31
+ while (true) {
32
+ const pkgDir = join(dir, 'node_modules', pkgName);
33
+ if (existsSync(join(pkgDir, 'package.json'))) {
34
+ const a = join(pkgDir, 'bin', binName);
35
+ if (existsSync(a)) return a;
36
+ const b = join(pkgDir, binName);
37
+ if (existsSync(b)) return b;
38
+ }
39
+ const parent = dirname(dir);
40
+ if (parent === dir) return null;
41
+ dir = parent;
42
+ }
43
+ }
44
+
45
+ // Read `--global-config`/`-Q` without loading the full CLI arg parser.
46
+ function globalConfigDirFromArgv() {
47
+ const argv = process.argv.slice(2);
48
+ for (let i = 0; i < argv.length; i++) {
49
+ const arg = argv[i];
50
+ if (arg === '--global-config' || arg === '-Q') {
51
+ return argv[i + 1];
52
+ }
53
+ if (arg.startsWith('--global-config=')) {
54
+ return arg.slice('--global-config='.length);
55
+ }
56
+ }
57
+ return undefined;
58
+ }
59
+
60
+ // Any failure to read config counts as "not opted in".
61
+ async function isNativeBinaryOptedIn() {
62
+ const envOverride = process.env.VERCEL_CLI_USE_NATIVE_BINARY;
63
+ if (envOverride === '1' || envOverride === 'true') return true;
64
+ if (envOverride === '0' || envOverride === 'false') return false;
65
+
31
66
  try {
32
- // Resolve only from this install's own tree, never from NODE_PATH.
33
- const dir = dirname(
34
- require.resolve(`${pkgName}/package.json`, { paths: [__dirname] })
35
- );
36
- const a = join(dir, 'bin', binName);
37
- if (existsSync(a)) return a;
38
- const b = join(dir, binName);
39
- if (existsSync(b)) return b;
40
- } catch {}
41
- return null;
67
+ // Zod-free subpath to avoid loading zod + schemas on this hot path.
68
+ const config = await import('@vercel/cli-config/paths');
69
+ const argDir = globalConfigDirFromArgv();
70
+ const configDir = argDir
71
+ ? resolve(process.cwd(), argDir)
72
+ : config.getGlobalPathConfig();
73
+ const configPath = config.getConfigFilePath(configDir);
74
+ return config.readGlobalConfigFlag(configPath, 'useNativeBinary') === true;
75
+ } catch {
76
+ return false;
77
+ }
42
78
  }
43
79
 
44
80
  const bin = resolveNative();
45
81
 
46
- if (bin) {
82
+ if (bin && (await isNativeBinaryOptedIn())) {
47
83
  process.env.VERCEL_VC_NATIVE = '1';
48
84
  const r = spawnSync(bin, process.argv.slice(2), {
49
85
  stdio: 'inherit',
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "56.4.1";
1
+ export const version = "57.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "56.4.1",
3
+ "version": "57.0.0",
4
4
  "type": "module",
5
5
  "preferGlobal": true,
6
6
  "license": "Apache-2.0",
@@ -34,50 +34,50 @@
34
34
  "smol-toml": "1.5.2",
35
35
  "undici": "5.29.0",
36
36
  "zod": "4.1.11",
37
- "@vercel/backends": "0.8.25",
38
- "@vercel/build-utils": "13.34.0",
39
- "@vercel/cli-auth": "0.3.0",
40
- "@vercel/container": "0.0.5",
41
- "@vercel/cli-config": "0.2.0",
37
+ "@vercel/backends": "0.8.26",
38
+ "@vercel/cli-auth": "0.3.1",
39
+ "@vercel/build-utils": "13.35.0",
40
+ "@vercel/cli-config": "0.2.1",
41
+ "@vercel/container": "0.1.0",
42
42
  "@vercel/detect-agent": "1.2.3",
43
- "@vercel/elysia": "0.1.102",
44
- "@vercel/express": "0.1.116",
45
- "@vercel/fastify": "0.1.105",
43
+ "@vercel/fastify": "0.1.106",
44
+ "@vercel/elysia": "0.1.103",
46
45
  "@vercel/go": "3.10.2",
47
- "@vercel/hono": "0.2.105",
48
- "@vercel/hydrogen": "1.4.0",
49
- "@vercel/koa": "0.1.85",
50
- "@vercel/h3": "0.1.111",
51
- "@vercel/nestjs": "0.2.106",
46
+ "@vercel/h3": "0.1.112",
47
+ "@vercel/hono": "0.2.106",
48
+ "@vercel/express": "0.1.117",
49
+ "@vercel/nestjs": "0.2.107",
52
50
  "@vercel/next": "4.20.4",
53
- "@vercel/node": "5.8.26",
54
- "@vercel/python": "6.51.0",
51
+ "@vercel/python": "6.52.0",
52
+ "@vercel/node": "5.8.27",
53
+ "@vercel/koa": "0.1.86",
55
54
  "@vercel/remix-builder": "5.9.1",
56
- "@vercel/redwood": "2.5.0",
57
55
  "@vercel/ruby": "2.5.1",
56
+ "@vercel/static-build": "2.11.9",
58
57
  "@vercel/rust": "1.4.0",
59
- "@vercel/static-build": "2.11.8"
58
+ "@vercel/redwood": "2.5.0",
59
+ "@vercel/hydrogen": "1.4.0"
60
60
  },
61
61
  "peerDependencies": {
62
- "@vercel/backends": "0.8.25",
63
- "@vercel/elysia": "0.1.102",
64
- "@vercel/container": "0.0.5",
65
- "@vercel/express": "0.1.116",
66
- "@vercel/fastify": "0.1.105",
67
- "@vercel/hono": "0.2.105",
68
- "@vercel/koa": "0.1.85",
62
+ "@vercel/backends": "0.8.26",
63
+ "@vercel/container": "0.1.0",
64
+ "@vercel/fastify": "0.1.106",
65
+ "@vercel/express": "0.1.117",
66
+ "@vercel/elysia": "0.1.103",
69
67
  "@vercel/hydrogen": "1.4.0",
70
- "@vercel/nestjs": "0.2.106",
68
+ "@vercel/nestjs": "0.2.107",
71
69
  "@vercel/next": "4.20.4",
72
- "@vercel/node": "5.8.26",
73
- "@vercel/h3": "0.1.111",
70
+ "@vercel/hono": "0.2.106",
71
+ "@vercel/koa": "0.1.86",
72
+ "@vercel/h3": "0.1.112",
74
73
  "@vercel/go": "3.10.2",
75
- "@vercel/python": "6.51.0",
74
+ "@vercel/node": "5.8.27",
76
75
  "@vercel/redwood": "2.5.0",
77
76
  "@vercel/remix-builder": "5.9.1",
78
- "@vercel/static-build": "2.11.8",
77
+ "@vercel/ruby": "2.5.1",
78
+ "@vercel/python": "6.52.0",
79
79
  "@vercel/rust": "1.4.0",
80
- "@vercel/ruby": "2.5.1"
80
+ "@vercel/static-build": "2.11.9"
81
81
  },
82
82
  "peerDependenciesMeta": {
83
83
  "@vercel/backends": {
@@ -262,11 +262,11 @@
262
262
  "@vercel-internals/constants": "1.0.4",
263
263
  "@vercel-internals/get-package-json": "1.0.0",
264
264
  "@vercel-internals/types": "3.0.6",
265
- "@vercel/client": "18.1.0",
266
- "@vercel/routing-utils": "6.4.0",
265
+ "@vercel/client": "18.1.1",
266
+ "@vercel/error-utils": "2.2.0",
267
267
  "@vercel/frameworks": "3.30.7",
268
- "@vercel/fs-detectors": "6.13.2",
269
- "@vercel/error-utils": "2.2.0"
268
+ "@vercel/fs-detectors": "6.13.3",
269
+ "@vercel/routing-utils": "6.4.0"
270
270
  },
271
271
  "scripts": {
272
272
  "test": "vitest run --config ./vitest.config.mts",
@@ -1,86 +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
- VERCEL_DIR,
9
- isVercelTomlEnabled
10
- } from "./chunk-GLAHGVBS.js";
11
- import {
12
- parseArguments
13
- } from "./chunk-SZXT3PDQ.js";
14
- import {
15
- ConflictingConfigFiles,
16
- DeprecatedNowJson,
17
- InvalidLocalConfig
18
- } from "./chunk-KSSNLCL4.js";
19
-
20
- // src/util/input/prompt-cancellation.ts
21
- var PromptCanceledError = class extends Error {
22
- constructor() {
23
- super("Prompt canceled");
24
- this.name = "PromptCanceledError";
25
- }
26
- };
27
- var PromptBackError = class extends Error {
28
- constructor() {
29
- super("Prompt back");
30
- this.name = "PromptBackError";
31
- }
32
- };
33
- function isPromptBackError(error) {
34
- return error instanceof PromptBackError;
35
- }
36
- function isPromptCanceledError(error) {
37
- if (error instanceof PromptCanceledError) {
38
- return true;
39
- }
40
- return error instanceof Error && error.message.includes("User force closed the prompt");
41
- }
42
-
43
- // src/util/config/local-path.ts
44
- import path from "path";
45
- import { existsSync } from "fs";
46
- function getLocalPathConfig(prefix) {
47
- const argv = parseArguments(process.argv.slice(2), {}, { permissive: true });
48
- const customPath = argv.flags["--local-config"];
49
- if (customPath) {
50
- if (typeof customPath !== "string") {
51
- throw new InvalidLocalConfig(customPath);
52
- }
53
- return path.resolve(process.cwd(), customPath);
54
- }
55
- const vercelConfigPath = path.join(prefix, "vercel.json");
56
- const vercelTomlPath = path.join(prefix, "vercel.toml");
57
- const nowConfigPath = path.join(prefix, "now.json");
58
- const vercelConfigExists = existsSync(vercelConfigPath);
59
- const vercelTomlExists = isVercelTomlEnabled() && existsSync(vercelTomlPath);
60
- const nowConfigExists = existsSync(nowConfigPath);
61
- const foundConfigs = [];
62
- if (vercelConfigExists)
63
- foundConfigs.push(vercelConfigPath);
64
- if (vercelTomlExists)
65
- foundConfigs.push(vercelTomlPath);
66
- if (nowConfigExists) {
67
- throw new DeprecatedNowJson(nowConfigPath);
68
- }
69
- if (foundConfigs.length > 1) {
70
- throw new ConflictingConfigFiles(foundConfigs);
71
- }
72
- const compiledConfigPath = path.join(prefix, VERCEL_DIR, "vercel.json");
73
- const compiledConfigExists = existsSync(compiledConfigPath);
74
- if (compiledConfigExists) {
75
- return compiledConfigPath;
76
- }
77
- return vercelConfigPath;
78
- }
79
-
80
- export {
81
- getLocalPathConfig,
82
- PromptCanceledError,
83
- PromptBackError,
84
- isPromptBackError,
85
- isPromptCanceledError
86
- };