vercel 54.21.1 → 56.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 (74) hide show
  1. package/dist/chunks/{add-UMB55BRR.js → add-MD247HM7.js} +6 -6
  2. package/dist/chunks/{add-NKDLTZ3B.js → add-YN76XNHI.js} +6 -6
  3. package/dist/chunks/{chunk-MLY3KGVY.js → chunk-2BZVY6SF.js} +4 -4
  4. package/dist/chunks/{chunk-TLKTTWDA.js → chunk-36OUS2KE.js} +1 -1
  5. package/dist/chunks/{chunk-43I5EAPY.js → chunk-3JOLICSO.js} +1 -1
  6. package/dist/chunks/{chunk-3EMRC44D.js → chunk-5OT26JZN.js} +32 -0
  7. package/dist/chunks/{chunk-TRQJQXKD.js → chunk-75HDPY6N.js} +82 -19
  8. package/dist/chunks/chunk-7PZWVZN6.js +105 -0
  9. package/dist/chunks/{chunk-DKE73NGN.js → chunk-C6E2RJS7.js} +29 -2
  10. package/dist/chunks/{chunk-2QBF3ZL3.js → chunk-CB3I3QIT.js} +3 -4
  11. package/dist/chunks/{chunk-I3HGCZ4E.js → chunk-CMJMYVQM.js} +1 -0
  12. package/dist/chunks/{chunk-IMTOXXTF.js → chunk-DO3V6PZD.js} +6 -4
  13. package/dist/chunks/{chunk-QKR7GNAK.js → chunk-DREO3DFB.js} +6 -6
  14. package/dist/chunks/{chunk-GAJ2ESDD.js → chunk-FN36GZDS.js} +100 -36
  15. package/dist/chunks/{chunk-4UZF3U4N.js → chunk-HA7C7SDO.js} +2 -0
  16. package/dist/chunks/{chunk-QH7WYDEP.js → chunk-IC4YEIGW.js} +7 -0
  17. package/dist/chunks/{chunk-H3KWN2KA.js → chunk-JHZG2MPW.js} +4 -4
  18. package/dist/chunks/{chunk-QMZO4CEP.js → chunk-KODCUW77.js} +353 -403
  19. package/dist/chunks/{chunk-RO5JIUOI.js → chunk-KSJ4FNUG.js} +3 -3
  20. package/dist/chunks/{chunk-KNSDQCVQ.js → chunk-MBH4DFF7.js} +51 -9
  21. package/dist/chunks/{chunk-MV65GD4L.js → chunk-N4VWB5RV.js} +1 -1
  22. package/dist/chunks/{chunk-AUYY7RD3.js → chunk-NZ73KKYG.js} +550 -191
  23. package/dist/chunks/{chunk-ADTCIFMD.js → chunk-ORKY33ZK.js} +69 -16
  24. package/dist/chunks/{chunk-XMJAKLQQ.js → chunk-T7EIXPC5.js} +1 -1
  25. package/dist/chunks/{chunk-I4NRKN2Z.js → chunk-THMFJODG.js} +480 -277
  26. package/dist/chunks/{chunk-2ZXLLEEZ.js → chunk-TNDFVAZV.js} +4 -4
  27. package/dist/chunks/{chunk-OVE2GAHC.js → chunk-VPDJOK2C.js} +3 -3
  28. package/dist/chunks/{chunk-HMFUXSD7.js → chunk-VSD5BID5.js} +1 -1
  29. package/dist/chunks/{chunk-ZZIAWRCX.js → chunk-W346YNDN.js} +18 -0
  30. package/dist/chunks/chunk-WGGABYO5.js +31 -0
  31. package/dist/chunks/{chunk-XCL7I6W5.js → chunk-ZHDXN5V3.js} +3 -3
  32. package/dist/chunks/{compile-vercel-config-OKONVGZI.js → compile-vercel-config-65QWHKPO.js} +2 -2
  33. package/dist/chunks/{delete-L7TN5GNZ.js → delete-NPEJGNTV.js} +5 -5
  34. package/dist/chunks/{disable-7NVU4H2N.js → disable-RH3MH7PH.js} +5 -5
  35. package/dist/chunks/{discard-SJ2TDPS2.js → discard-IJBFO24S.js} +5 -5
  36. package/dist/chunks/{edit-SW4MF4Q3.js → edit-GMLOKGHO.js} +6 -6
  37. package/dist/chunks/{enable-FOKEO6J2.js → enable-QCTL7ISO.js} +5 -5
  38. package/dist/chunks/{exec-UKMIYIF6.js → exec-G4AUF3KG.js} +4 -90
  39. package/dist/chunks/{export-3DSHT2FD.js → export-6ERWU54A.js} +9 -8
  40. package/dist/chunks/{image-T6I7BZSC.js → image-XUMTOUQS.js} +5 -5
  41. package/dist/chunks/{inspect-RV444SBC.js → inspect-7UPFOAJO.js} +5 -5
  42. package/dist/chunks/{inspect-EP24WN4I.js → inspect-F6LEST4Y.js} +10 -10
  43. package/dist/chunks/{inspect-2MY25CMN.js → inspect-OKOUOOWW.js} +10 -10
  44. package/dist/chunks/{inspect-DJ7OGHBK.js → inspect-ZS4U24NA.js} +9 -9
  45. package/dist/chunks/{list-CCG2NVLL.js → list-BTMO3CXU.js} +5 -5
  46. package/dist/chunks/{list-OMJ7EDKA.js → list-ZK7Q3UHB.js} +3 -3
  47. package/dist/chunks/login-POFRYQZ6.js +247 -0
  48. package/dist/chunks/{ls-VXZGEJJD.js → ls-D5Z4IWMU.js} +6 -6
  49. package/dist/chunks/{ls-VCTHIVI7.js → ls-EXRMNZUT.js} +9 -9
  50. package/dist/chunks/{ls-33Z3R2KY.js → ls-JGNNPYUA.js} +9 -9
  51. package/dist/chunks/{ls-5KN5FKAQ.js → ls-Z2TCQW5W.js} +9 -9
  52. package/dist/chunks/{publish-RZ2DIYRU.js → publish-ED2XVYSE.js} +5 -5
  53. package/dist/chunks/{query-2MIBB7C5.js → query-6XMBJTPX.js} +3 -3
  54. package/dist/chunks/{reorder-FEZIPHNW.js → reorder-7B6HZCOZ.js} +5 -5
  55. package/dist/chunks/{restore-JHH6CW2S.js → restore-47ZDRYQT.js} +5 -5
  56. package/dist/chunks/{rm-EKPVQYGH.js → rm-4IY6QGHF.js} +6 -6
  57. package/dist/chunks/{rm-3KAXICHP.js → rm-AA7WYBZ5.js} +5 -5
  58. package/dist/chunks/{rm-ULQHII4K.js → rm-NGTPTPZK.js} +6 -6
  59. package/dist/chunks/{rule-inspect-FOZOCOUO.js → rule-inspect-FNX6P4LZ.js} +6 -6
  60. package/dist/chunks/{rules-RJD4S7JA.js → rules-MMCCBGQJ.js} +10 -10
  61. package/dist/chunks/{schema-CDXFJU72.js → schema-JSK7S7HL.js} +3 -3
  62. package/dist/chunks/{tags-BLBAPEWV.js → tags-KNCSBTIH.js} +4 -4
  63. package/dist/chunks/{update-2NW6NKG6.js → update-JEFLJ3TH.js} +6 -6
  64. package/dist/commands/build/index.js +47 -16
  65. package/dist/commands/deploy/index.js +24 -46
  66. package/dist/commands/dev/index.js +202 -59
  67. package/dist/commands/env/index.js +10 -20
  68. package/dist/commands/link/index.js +33 -16
  69. package/dist/commands/list/index.js +26 -11
  70. package/dist/commands-bulk.js +13722 -10599
  71. package/dist/index.js +14 -24
  72. package/dist/version.mjs +1 -1
  73. package/package.json +24 -23
  74. package/dist/chunks/chunk-Y4JJYHUG.js +0 -16
@@ -18,7 +18,7 @@ import {
18
18
  require_lib,
19
19
  require_minimatch,
20
20
  require_pluralize
21
- } from "./chunk-I4NRKN2Z.js";
21
+ } from "./chunk-THMFJODG.js";
22
22
  import {
23
23
  CantParseJSONFile,
24
24
  cmd,
@@ -11058,13 +11058,17 @@ async function untracedInstallBuilders(buildersDir, buildersToAdd) {
11058
11058
  }
11059
11059
  return resolvedSpecs;
11060
11060
  }
11061
- async function installBuilders(buildersDir, buildersToAdd, span) {
11061
+ async function installBuilders(buildersDir, buildersToAdd, span, installReasons) {
11062
11062
  if (!span) {
11063
11063
  return untracedInstallBuilders(buildersDir, buildersToAdd);
11064
11064
  }
11065
- const installSpan = span.child("vc.installBuilders", {
11065
+ const attributes = {
11066
11066
  packages: Array.from(buildersToAdd).join(",")
11067
- });
11067
+ };
11068
+ if (installReasons && installReasons.size > 0) {
11069
+ attributes.reasons = Array.from(installReasons).map(([spec, reason]) => `${spec}=${reason}`).join(",");
11070
+ }
11071
+ const installSpan = span.child("vc.installBuilders", attributes);
11068
11072
  return installSpan.trace(async (s) => {
11069
11073
  try {
11070
11074
  return await untracedInstallBuilders(buildersDir, buildersToAdd);
@@ -11083,11 +11087,12 @@ async function importBuilders(builderSpecs, cwd, span) {
11083
11087
  const buildersDir = join2(cwd, VERCEL_DIR, "builders");
11084
11088
  let importResult = await resolveBuilders(buildersDir, builderSpecs);
11085
11089
  if ("buildersToAdd" in importResult) {
11086
- const { buildersToAdd } = importResult;
11090
+ const { buildersToAdd, installReasons } = importResult;
11087
11091
  const installResult = await installBuilders(
11088
11092
  buildersDir,
11089
11093
  buildersToAdd,
11090
- span
11094
+ span,
11095
+ installReasons
11091
11096
  );
11092
11097
  importResult = await resolveBuilders(
11093
11098
  buildersDir,
@@ -11105,15 +11110,28 @@ async function importBuilders(builderSpecs, cwd, span) {
11105
11110
  output_manager_default.debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`);
11106
11111
  return importResult.builders;
11107
11112
  }
11113
+ function missingModuleId(err) {
11114
+ const match = /Cannot find module '([^']+)'/.exec(err.message);
11115
+ const id = match?.[1];
11116
+ if (!id) {
11117
+ return void 0;
11118
+ }
11119
+ if (id.startsWith("/") || id.startsWith(".") || /^[A-Za-z]:[\\/]/.test(id)) {
11120
+ return void 0;
11121
+ }
11122
+ return id.replace(/[,=]/g, "_").slice(0, 100);
11123
+ }
11108
11124
  async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11109
11125
  const builders = /* @__PURE__ */ new Map();
11110
11126
  const buildersToAdd = /* @__PURE__ */ new Set();
11127
+ const installReasons = /* @__PURE__ */ new Map();
11111
11128
  for (const spec of builderSpecs) {
11112
11129
  const resolvedSpec = resolvedSpecs?.get(spec) || spec;
11113
11130
  const parsed = (0, import_npm_package_arg.default)(resolvedSpec);
11114
11131
  const { name } = parsed;
11115
11132
  if (!name) {
11116
11133
  buildersToAdd.add(spec);
11134
+ installReasons.set(spec, "url-spec");
11117
11135
  continue;
11118
11136
  }
11119
11137
  if ((0, import_fs_detectors.isStaticRuntime)(name)) {
@@ -11126,6 +11144,7 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11126
11144
  });
11127
11145
  continue;
11128
11146
  }
11147
+ let entrypointLoadFailed = false;
11129
11148
  try {
11130
11149
  let pkgPath;
11131
11150
  let builderPkg;
@@ -11157,6 +11176,7 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11157
11176
  `Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`
11158
11177
  );
11159
11178
  buildersToAdd.add(spec);
11179
+ installReasons.set(spec, "version-mismatch");
11160
11180
  continue;
11161
11181
  }
11162
11182
  if (parsed.type === "range" && !(0, import_semver.satisfies)(builderPkg.version, parsed.rawSpec)) {
@@ -11164,10 +11184,17 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11164
11184
  `Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`
11165
11185
  );
11166
11186
  buildersToAdd.add(spec);
11187
+ installReasons.set(spec, "range-mismatch");
11167
11188
  continue;
11168
11189
  }
11169
11190
  const path2 = join2(dirname(pkgPath), builderPkg.main || "index.js");
11170
- const builder = require_(path2);
11191
+ let builder;
11192
+ try {
11193
+ builder = require_(path2);
11194
+ } catch (requireErr) {
11195
+ entrypointLoadFailed = true;
11196
+ throw requireErr;
11197
+ }
11171
11198
  const dynamicallyInstalled = pkgPath.startsWith(buildersDir);
11172
11199
  builders.set(spec, {
11173
11200
  builder,
@@ -11184,6 +11211,15 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11184
11211
  if (err.code === "MODULE_NOT_FOUND" && !resolvedSpecs) {
11185
11212
  output_manager_default.debug(`Failed to import "${name}": ${err}`);
11186
11213
  buildersToAdd.add(spec);
11214
+ if (entrypointLoadFailed) {
11215
+ const missing = missingModuleId(err);
11216
+ installReasons.set(
11217
+ spec,
11218
+ missing ? `entrypoint-load-failed:${missing}` : "entrypoint-load-failed"
11219
+ );
11220
+ } else {
11221
+ installReasons.set(spec, "not-installed");
11222
+ }
11187
11223
  } else {
11188
11224
  err.message = `Importing "${name}": ${err.message}`;
11189
11225
  throw err;
@@ -11191,7 +11227,7 @@ async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
11191
11227
  }
11192
11228
  }
11193
11229
  if (buildersToAdd.size > 0) {
11194
- return { buildersToAdd };
11230
+ return { buildersToAdd, installReasons };
11195
11231
  }
11196
11232
  return { builders };
11197
11233
  }
@@ -11458,6 +11494,33 @@ function injectServiceEnvVars(fn, service, stripServiceRoutePrefix = false) {
11458
11494
  function stripDuplicateSlashes(path2) {
11459
11495
  return normalize(path2).replace(/(^\/|\/$)/g, "");
11460
11496
  }
11497
+ async function resolveFunctionConfiguration(src, vercelConfig, service) {
11498
+ if (service && isExperimentalServiceV2(service) && service.functions) {
11499
+ let sourceFile = src;
11500
+ const serviceRoot = stripDuplicateSlashes(service.root);
11501
+ if (serviceRoot && serviceRoot !== ".") {
11502
+ const prefix = `${serviceRoot}/`;
11503
+ if (sourceFile.startsWith(prefix)) {
11504
+ sourceFile = sourceFile.slice(prefix.length);
11505
+ }
11506
+ }
11507
+ return getLambdaOptionsFromFunction({
11508
+ sourceFile,
11509
+ config: {
11510
+ ...vercelConfig,
11511
+ functions: service.functions,
11512
+ serviceName: service.name
11513
+ }
11514
+ });
11515
+ }
11516
+ if (vercelConfig) {
11517
+ return getLambdaOptionsFromFunction({
11518
+ sourceFile: src,
11519
+ config: vercelConfig
11520
+ });
11521
+ }
11522
+ return {};
11523
+ }
11461
11524
  function getServiceOutputDir(outputDir, service) {
11462
11525
  return join4(outputDir, "services", service.name);
11463
11526
  }
@@ -11487,6 +11550,7 @@ async function writeBuildResultV2(args) {
11487
11550
  }
11488
11551
  const existingFunctions = /* @__PURE__ */ new Map();
11489
11552
  const overrides = {};
11553
+ const functionConfiguration = build2.src ? await resolveFunctionConfiguration(build2.src, vercelConfig, service) : {};
11490
11554
  for (const [path2, output] of Object.entries(buildResult.output)) {
11491
11555
  const normalizedPath = stripDuplicateSlashes(path2);
11492
11556
  if (isContainerImage(output)) {
@@ -11495,7 +11559,12 @@ async function writeBuildResultV2(args) {
11495
11559
  service && isExperimentalService(service) ? service : void 0,
11496
11560
  stripServiceRoutePrefix
11497
11561
  );
11498
- await writeContainerImage(outputDir, output, normalizedPath);
11562
+ await writeContainerImage(
11563
+ outputDir,
11564
+ output,
11565
+ normalizedPath,
11566
+ functionConfiguration
11567
+ );
11499
11568
  } else if (isLambda(output)) {
11500
11569
  injectServiceEnvVars(
11501
11570
  output,
@@ -11654,30 +11723,11 @@ async function writeBuildResultV3(args) {
11654
11723
  if (typeof src !== "string") {
11655
11724
  throw new Error(`Expected "build.src" to be a string`);
11656
11725
  }
11657
- let functionConfiguration = {};
11658
- if (service && isExperimentalServiceV2(service) && service.functions) {
11659
- let sourceFile = src;
11660
- const serviceRoot = stripDuplicateSlashes(service.root);
11661
- if (serviceRoot && serviceRoot !== ".") {
11662
- const prefix = `${serviceRoot}/`;
11663
- if (sourceFile.startsWith(prefix)) {
11664
- sourceFile = sourceFile.slice(prefix.length);
11665
- }
11666
- }
11667
- functionConfiguration = await getLambdaOptionsFromFunction({
11668
- sourceFile,
11669
- config: {
11670
- ...vercelConfig,
11671
- functions: service.functions,
11672
- serviceName: service.name
11673
- }
11674
- });
11675
- } else if (vercelConfig) {
11676
- functionConfiguration = await getLambdaOptionsFromFunction({
11677
- sourceFile: src,
11678
- config: vercelConfig
11679
- });
11680
- }
11726
+ const functionConfiguration = await resolveFunctionConfiguration(
11727
+ src,
11728
+ vercelConfig,
11729
+ service
11730
+ );
11681
11731
  const ext = extname(src);
11682
11732
  const path2 = service && isExperimentalServiceV2(service) ? "index" : service && typeof service.runtime === "string" ? stripDuplicateSlashes((0, import_fs_detectors2.getInternalServiceFunctionPath)(service.name)) : stripDuplicateSlashes(
11683
11733
  build2.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
@@ -11688,7 +11738,7 @@ async function writeBuildResultV3(args) {
11688
11738
  service && isExperimentalService(service) ? service : void 0,
11689
11739
  stripServiceRoutePrefix
11690
11740
  );
11691
- await writeContainerImage(outputDir, output, path2);
11741
+ await writeContainerImage(outputDir, output, path2, functionConfiguration);
11692
11742
  } else if (isLambda(output)) {
11693
11743
  injectServiceEnvVars(
11694
11744
  output,
@@ -11766,7 +11816,7 @@ async function writeFunctionSymlink(outputDir, dest, fn, existingFunctions) {
11766
11816
  await import_fs_extra5.default.symlink(target, dest);
11767
11817
  return true;
11768
11818
  }
11769
- async function writeContainerImage(outputDir, containerImage, path2) {
11819
+ async function writeContainerImage(outputDir, containerImage, path2, functionConfiguration) {
11770
11820
  const dest = join4(outputDir, "functions", `${path2}.func`);
11771
11821
  const handler = containerImage.handler;
11772
11822
  if (typeof handler !== "string" || handler.length === 0) {
@@ -11774,6 +11824,13 @@ async function writeContainerImage(outputDir, containerImage, path2) {
11774
11824
  `Container image output for "${path2}" is missing "handler".`
11775
11825
  );
11776
11826
  }
11827
+ const architecture = functionConfiguration?.architecture ?? containerImage.architecture;
11828
+ const memory = functionConfiguration?.memory ?? containerImage.memory;
11829
+ const maxDuration = functionConfiguration?.maxDuration ?? containerImage.maxDuration;
11830
+ const regions = functionConfiguration?.regions ?? containerImage.regions;
11831
+ const functionFailoverRegions = functionConfiguration?.functionFailoverRegions ?? containerImage.functionFailoverRegions;
11832
+ const experimentalTriggers = functionConfiguration?.experimentalTriggers ?? containerImage.experimentalTriggers;
11833
+ const supportsCancellation = functionConfiguration?.supportsCancellation ?? containerImage.supportsCancellation;
11777
11834
  await import_fs_extra5.default.mkdirp(dest);
11778
11835
  await import_fs_extra5.default.writeJSON(
11779
11836
  join4(dest, ".vc-config.json"),
@@ -11781,7 +11838,14 @@ async function writeContainerImage(outputDir, containerImage, path2) {
11781
11838
  handler,
11782
11839
  runtime: "container",
11783
11840
  environment: containerImage.environment ?? {},
11784
- ...containerImage.command ? { command: containerImage.command } : {}
11841
+ ...containerImage.command ? { command: containerImage.command } : {},
11842
+ ...architecture !== void 0 ? { architecture } : {},
11843
+ ...memory !== void 0 ? { memory } : {},
11844
+ ...maxDuration !== void 0 ? { maxDuration } : {},
11845
+ ...regions !== void 0 ? { regions } : {},
11846
+ ...functionFailoverRegions !== void 0 ? { functionFailoverRegions } : {},
11847
+ ...experimentalTriggers !== void 0 ? { experimentalTriggers } : {},
11848
+ ...supportsCancellation !== void 0 ? { supportsCancellation } : {}
11785
11849
  },
11786
11850
  { spaces: 2 }
11787
11851
  );
@@ -8,6 +8,7 @@ import {
8
8
  allOption,
9
9
  confirmOption,
10
10
  formatOption,
11
+ limitOption,
11
12
  nextOption,
12
13
  yesOption
13
14
  } from "./chunk-EHTPDXTS.js";
@@ -61,6 +62,7 @@ var listCommand = {
61
62
  deprecated: false
62
63
  },
63
64
  nextOption,
65
+ limitOption,
64
66
  // this can be deprecated someday
65
67
  { name: "prod", shorthand: null, type: Boolean, deprecated: false },
66
68
  yesOption,
@@ -75,6 +75,13 @@ var AGENT_REASON = {
75
75
  // AI Gateway
76
76
  INVALID_BUDGET: "invalid_budget",
77
77
  INVALID_REFRESH_PERIOD: "invalid_refresh_period",
78
+ INVALID_EXPIRATION: "invalid_expiration",
79
+ /**
80
+ * Every selected agent needs explicit `--agent`/`--all` consent (see the
81
+ * payload's skipped[]). `--yes` does not grant it, so this is deliberately
82
+ * not `confirmation_required` — re-running with --yes would loop forever.
83
+ */
84
+ REQUIRES_CONSENT: "requires_consent",
78
85
  // Redirects
79
86
  REDIRECT_NOT_FOUND: "redirect_not_found",
80
87
  VERSION_NOT_FOUND: "version_not_found",
@@ -9,18 +9,18 @@ import {
9
9
  } from "./chunk-BUZRVER7.js";
10
10
  import {
11
11
  AGENT_REASON
12
- } from "./chunk-QH7WYDEP.js";
12
+ } from "./chunk-IC4YEIGW.js";
13
13
  import {
14
14
  getScope
15
- } from "./chunk-HMFUXSD7.js";
15
+ } from "./chunk-VSD5BID5.js";
16
16
  import {
17
17
  getLinkedProject,
18
18
  getProjectByNameOrId
19
- } from "./chunk-I4NRKN2Z.js";
19
+ } from "./chunk-THMFJODG.js";
20
20
  import {
21
21
  buildCommandWithGlobalFlags,
22
22
  outputAgentError
23
- } from "./chunk-2QBF3ZL3.js";
23
+ } from "./chunk-CB3I3QIT.js";
24
24
  import {
25
25
  ProjectNotFound,
26
26
  isAPIError