vercel 54.15.1 → 54.16.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 (54) hide show
  1. package/dist/chunks/{add-BHCMFK52.js → add-ODBKI7EV.js} +5 -5
  2. package/dist/chunks/{chunk-AWD3IGXU.js → chunk-3NR6OYDV.js} +1 -1
  3. package/dist/chunks/{chunk-5X6ILMYI.js → chunk-76QQSALN.js} +3 -3
  4. package/dist/chunks/{chunk-CQ24PL4F.js → chunk-7CTLNKAS.js} +48 -9
  5. package/dist/chunks/{chunk-B5DP7FOH.js → chunk-BGQPLZFA.js} +6 -6
  6. package/dist/chunks/{chunk-4GQBO7KU.js → chunk-BIHRICRM.js} +2 -2
  7. package/dist/chunks/{chunk-4TL5EF3A.js → chunk-FBYYZKN3.js} +4 -1
  8. package/dist/chunks/{chunk-OOGTHUXU.js → chunk-HL5ZRVF2.js} +6 -6
  9. package/dist/chunks/{chunk-OEFNWW5M.js → chunk-HXAMK45D.js} +2 -2
  10. package/dist/chunks/{chunk-MABHXDYV.js → chunk-INFYZRHS.js} +286 -76
  11. package/dist/chunks/{chunk-PMUUPCDL.js → chunk-JFA4NUXP.js} +1 -1
  12. package/dist/chunks/{chunk-UEPXHHDN.js → chunk-KJMSI2CT.js} +1 -1
  13. package/dist/chunks/{chunk-CBMMVXLH.js → chunk-LJXYGWOY.js} +11 -3
  14. package/dist/chunks/{chunk-4OEXX4CB.js → chunk-MSWXRAHA.js} +1 -1
  15. package/dist/chunks/{chunk-D7U6YBVT.js → chunk-NVITPK2U.js} +1 -1
  16. package/dist/chunks/{chunk-RWRYDAUG.js → chunk-O6YJBWWC.js} +1 -1
  17. package/dist/chunks/{chunk-JNVCGTF2.js → chunk-Q4ZRBN2A.js} +1 -1
  18. package/dist/chunks/{chunk-HIYWSGI7.js → chunk-Q77ALSXR.js} +3 -0
  19. package/dist/chunks/{chunk-TDFUNPL7.js → chunk-RCUMYP4L.js} +4 -4
  20. package/dist/chunks/{chunk-UYC2Q5YZ.js → chunk-U2NYO6GP.js} +1 -1
  21. package/dist/chunks/{chunk-TAUAS27Y.js → chunk-UI2T3GI4.js} +2 -2
  22. package/dist/chunks/{chunk-UJZ4RUU6.js → chunk-ULNWA6GY.js} +1 -1
  23. package/dist/chunks/{chunk-AQWK7XXE.js → chunk-VLQBXXOQ.js} +2 -2
  24. package/dist/chunks/{compile-vercel-config-LUMMHFTD.js → compile-vercel-config-7THB6MTJ.js} +2 -2
  25. package/dist/chunks/{delete-X6VOLLCP.js → delete-USWDARFF.js} +3 -3
  26. package/dist/chunks/{disable-LFH5IOCZ.js → disable-K6B26MC2.js} +3 -3
  27. package/dist/chunks/{discard-EVD33PAE.js → discard-2T7HZCGR.js} +3 -3
  28. package/dist/chunks/{edit-FL3SRS2I.js → edit-2CC2WAO4.js} +5 -5
  29. package/dist/chunks/{enable-HTU7LQK5.js → enable-KEZA6F4T.js} +3 -3
  30. package/dist/chunks/{export-R222C6IH.js → export-PE2T4HYP.js} +3 -3
  31. package/dist/chunks/{inspect-YYTAQP3A.js → inspect-TQSHD4MH.js} +4 -4
  32. package/dist/chunks/{list-AOJMWKA7.js → list-AU6URG3E.js} +4 -4
  33. package/dist/chunks/{list-SWJFJSEE.js → list-IDTF5TWY.js} +3 -3
  34. package/dist/chunks/{ls-H7KDHFK6.js → ls-XOAWRTNQ.js} +5 -5
  35. package/dist/chunks/{publish-O5VKBFJ6.js → publish-G42C77TP.js} +3 -3
  36. package/dist/chunks/{query-7UDJEOOR.js → query-YTBD7YLX.js} +3 -3
  37. package/dist/chunks/{reorder-ZPI6Q7DQ.js → reorder-BDOOUURL.js} +3 -3
  38. package/dist/chunks/{restore-7FNMEG4A.js → restore-ENUHC25O.js} +3 -3
  39. package/dist/chunks/{rm-U37YHRNF.js → rm-ALWF3NBL.js} +5 -5
  40. package/dist/chunks/{routes-YEU33SON.js → routes-KUTLDFIF.js} +2 -2
  41. package/dist/chunks/{rule-inspect-CVI3TQHN.js → rule-inspect-BV6MC7PG.js} +5 -5
  42. package/dist/chunks/{rules-ZTL4JCZO.js → rules-IGG7M2AC.js} +6 -6
  43. package/dist/chunks/{schema-LZ6VDRGM.js → schema-ZYJOJIGL.js} +3 -3
  44. package/dist/chunks/{update-O6FSP627.js → update-I3WE3IQJ.js} +5 -5
  45. package/dist/commands/build/index.js +18 -18
  46. package/dist/commands/deploy/index.js +12 -12
  47. package/dist/commands/dev/index.js +623 -95
  48. package/dist/commands/env/index.js +6 -6
  49. package/dist/commands/link/index.js +47 -13
  50. package/dist/commands/list/index.js +5 -5
  51. package/dist/commands-bulk.js +44 -40
  52. package/dist/index.js +46 -42
  53. package/dist/version.mjs +1 -1
  54. package/package.json +20 -19
@@ -9,8 +9,8 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-JNVCGTF2.js";
13
- import "./chunk-TAUAS27Y.js";
12
+ } from "./chunk-Q4ZRBN2A.js";
13
+ import "./chunk-UI2T3GI4.js";
14
14
  import "./chunk-D7MGZH35.js";
15
15
  import {
16
16
  validateJsonOutput
@@ -21,9 +21,9 @@ import {
21
21
  import {
22
22
  AGENT_REASON
23
23
  } from "./chunk-QH7WYDEP.js";
24
- import "./chunk-4TL5EF3A.js";
25
- import "./chunk-MABHXDYV.js";
26
- import "./chunk-HIYWSGI7.js";
24
+ import "./chunk-FBYYZKN3.js";
25
+ import "./chunk-INFYZRHS.js";
26
+ import "./chunk-Q77ALSXR.js";
27
27
  import {
28
28
  buildCommandWithGlobalFlags,
29
29
  outputAgentError
@@ -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-HIYWSGI7.js";
9
+ } from "./chunk-Q77ALSXR.js";
10
10
  import {
11
11
  noBorderChars,
12
12
  require_cli_table3
@@ -10,10 +10,10 @@ import {
10
10
  } from "./chunk-QH7WYDEP.js";
11
11
  import {
12
12
  getLocalPathConfig
13
- } from "./chunk-UJZ4RUU6.js";
13
+ } from "./chunk-ULNWA6GY.js";
14
14
  import {
15
15
  getScope
16
- } from "./chunk-4TL5EF3A.js";
16
+ } from "./chunk-FBYYZKN3.js";
17
17
  import {
18
18
  VERCEL_DIR_PROJECT,
19
19
  VERCEL_DIR_README,
@@ -48,7 +48,7 @@ import {
48
48
  selectAndParseRemoteUrl,
49
49
  selectOrg,
50
50
  writeServicesConfig
51
- } from "./chunk-MABHXDYV.js";
51
+ } from "./chunk-INFYZRHS.js";
52
52
  import {
53
53
  buildCommandWithGlobalFlags,
54
54
  outputAgentError,
@@ -18,7 +18,7 @@ import {
18
18
  require_lib,
19
19
  require_minimatch,
20
20
  require_pluralize
21
- } from "./chunk-MABHXDYV.js";
21
+ } from "./chunk-INFYZRHS.js";
22
22
  import {
23
23
  CantParseJSONFile,
24
24
  cmd,
@@ -11422,6 +11422,9 @@ async function writeBuildResult(args) {
11422
11422
  function isEdgeFunction(v) {
11423
11423
  return v?.type === "EdgeFunction";
11424
11424
  }
11425
+ function isContainerImage(v) {
11426
+ return v?.runtime === "container";
11427
+ }
11425
11428
  function isLambda(v) {
11426
11429
  return v?.type === "Lambda";
11427
11430
  }
@@ -11432,21 +11435,23 @@ function isFile(v) {
11432
11435
  const type = v?.type;
11433
11436
  return type === "FileRef" || type === "FileFsRef" || type === "FileBlob";
11434
11437
  }
11435
- function injectServiceEnvVars(lambda, service, stripServiceRoutePrefix = false) {
11438
+ function injectServiceEnvVars(fn, service, stripServiceRoutePrefix = false) {
11439
+ const target = fn.config ?? fn;
11440
+ target.environment ??= {};
11436
11441
  if (service?.name) {
11437
- lambda.environment.VERCEL_SERVICE_NAME = service.name;
11442
+ target.environment.VERCEL_SERVICE_NAME = service.name;
11438
11443
  }
11439
11444
  if (service?.type) {
11440
- lambda.environment.VERCEL_SERVICE_TYPE = service.type;
11445
+ target.environment.VERCEL_SERVICE_TYPE = service.type;
11441
11446
  }
11442
11447
  if (service?.trigger) {
11443
- lambda.environment.VERCEL_SERVICE_TRIGGER = service.trigger;
11448
+ target.environment.VERCEL_SERVICE_TRIGGER = service.trigger;
11444
11449
  }
11445
11450
  if (service?.routePrefix && service.routePrefix !== "/") {
11446
- lambda.environment.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
11451
+ target.environment.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
11447
11452
  }
11448
11453
  if (stripServiceRoutePrefix) {
11449
- lambda.environment.VERCEL_SERVICE_ROUTE_PREFIX_STRIP = "1";
11454
+ target.environment.VERCEL_SERVICE_ROUTE_PREFIX_STRIP = "1";
11450
11455
  }
11451
11456
  }
11452
11457
  function stripDuplicateSlashes(path2) {
@@ -11483,7 +11488,14 @@ async function writeBuildResultV2(args) {
11483
11488
  const overrides = {};
11484
11489
  for (const [path2, output] of Object.entries(buildResult.output)) {
11485
11490
  const normalizedPath = stripDuplicateSlashes(path2);
11486
- if (isLambda(output)) {
11491
+ if (isContainerImage(output)) {
11492
+ injectServiceEnvVars(
11493
+ output,
11494
+ service && isExperimentalService(service) ? service : void 0,
11495
+ stripServiceRoutePrefix
11496
+ );
11497
+ await writeContainerImage(outputDir, output, normalizedPath);
11498
+ } else if (isLambda(output)) {
11487
11499
  injectServiceEnvVars(
11488
11500
  output,
11489
11501
  service && isExperimentalService(service) ? service : void 0,
@@ -11649,7 +11661,14 @@ async function writeBuildResultV3(args) {
11649
11661
  const path2 = service && typeof service.runtime === "string" ? stripDuplicateSlashes((0, import_fs_detectors2.getInternalServiceFunctionPath)(service.name)) : stripDuplicateSlashes(
11650
11662
  build2.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
11651
11663
  );
11652
- if (isLambda(output)) {
11664
+ if (isContainerImage(output)) {
11665
+ injectServiceEnvVars(
11666
+ output,
11667
+ service && isExperimentalService(service) ? service : void 0,
11668
+ stripServiceRoutePrefix
11669
+ );
11670
+ await writeContainerImage(outputDir, output, path2);
11671
+ } else if (isLambda(output)) {
11653
11672
  injectServiceEnvVars(
11654
11673
  output,
11655
11674
  service && isExperimentalService(service) ? service : void 0,
@@ -11726,6 +11745,26 @@ async function writeFunctionSymlink(outputDir, dest, fn, existingFunctions) {
11726
11745
  await import_fs_extra5.default.symlink(target, dest);
11727
11746
  return true;
11728
11747
  }
11748
+ async function writeContainerImage(outputDir, containerImage, path2) {
11749
+ const dest = join4(outputDir, "functions", `${path2}.func`);
11750
+ const handler = containerImage.handler;
11751
+ if (typeof handler !== "string" || handler.length === 0) {
11752
+ throw new Error(
11753
+ `Container image output for "${path2}" is missing "handler".`
11754
+ );
11755
+ }
11756
+ await import_fs_extra5.default.mkdirp(dest);
11757
+ await import_fs_extra5.default.writeJSON(
11758
+ join4(dest, ".vc-config.json"),
11759
+ {
11760
+ handler,
11761
+ runtime: "container",
11762
+ environment: containerImage.environment ?? {},
11763
+ ...containerImage.command ? { command: containerImage.command } : {}
11764
+ },
11765
+ { spaces: 2 }
11766
+ );
11767
+ }
11729
11768
  async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, existingFunctions, standalone = false) {
11730
11769
  const dest = join4(outputDir, "functions", `${path2}.func`);
11731
11770
  if (existingFunctions) {
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  writeProjectSettings
9
- } from "./chunk-4OEXX4CB.js";
9
+ } from "./chunk-MSWXRAHA.js";
10
10
  import {
11
11
  autoInstallVercelPlugin
12
12
  } from "./chunk-BRQ6PX3U.js";
@@ -15,23 +15,23 @@ import {
15
15
  } from "./chunk-64IF634X.js";
16
16
  import {
17
17
  ensureLink
18
- } from "./chunk-4GQBO7KU.js";
18
+ } from "./chunk-BIHRICRM.js";
19
19
  import {
20
20
  pullCommand
21
- } from "./chunk-UEPXHHDN.js";
21
+ } from "./chunk-KJMSI2CT.js";
22
22
  import {
23
23
  help
24
- } from "./chunk-AWD3IGXU.js";
24
+ } from "./chunk-3NR6OYDV.js";
25
25
  import {
26
26
  VERCEL_DIR,
27
27
  VERCEL_DIR_PROJECT,
28
28
  envPullCommandLogic,
29
29
  humanizePath,
30
30
  parseTarget
31
- } from "./chunk-MABHXDYV.js";
31
+ } from "./chunk-INFYZRHS.js";
32
32
  import {
33
33
  TelemetryClient
34
- } from "./chunk-HIYWSGI7.js";
34
+ } from "./chunk-Q77ALSXR.js";
35
35
  import {
36
36
  getFlagsSpecification,
37
37
  parseArguments,
@@ -7,12 +7,12 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  printProjectNotFoundError,
9
9
  setupAndLink
10
- } from "./chunk-5X6ILMYI.js";
10
+ } from "./chunk-76QQSALN.js";
11
11
  import {
12
12
  getLinkedProject,
13
13
  param,
14
14
  resolveProjectCwd
15
- } from "./chunk-MABHXDYV.js";
15
+ } from "./chunk-INFYZRHS.js";
16
16
  import {
17
17
  buildCommandWithYes,
18
18
  outputActionRequired
@@ -11,7 +11,7 @@ import {
11
11
  getTeamById,
12
12
  getUser,
13
13
  getVercelDirectory
14
- } from "./chunk-MABHXDYV.js";
14
+ } from "./chunk-INFYZRHS.js";
15
15
  import {
16
16
  TeamDeleted
17
17
  } from "./chunk-LN6B7ZI3.js";
@@ -27,6 +27,9 @@ async function getScope(client, opts = {}) {
27
27
  let team = null;
28
28
  const defaultTeamId = user.version === "northstar" ? user.defaultTeamId : void 0;
29
29
  const currentTeamOrDefaultTeamId = client.config.currentTeam || defaultTeamId;
30
+ if (!client.config.currentTeam && defaultTeamId) {
31
+ client.config.currentTeam = defaultTeamId;
32
+ }
30
33
  if (currentTeamOrDefaultTeamId && opts.getTeam !== false) {
31
34
  team = await getTeamById(client, currentTeamOrDefaultTeamId);
32
35
  if (!team) {
@@ -7,30 +7,30 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-OEFNWW5M.js";
10
+ } from "./chunk-HXAMK45D.js";
11
11
  import {
12
12
  getGlobalPathConfig,
13
13
  progress,
14
14
  writeToConfigFile
15
- } from "./chunk-CBMMVXLH.js";
15
+ } from "./chunk-LJXYGWOY.js";
16
16
  import {
17
17
  apiCommand,
18
18
  listSubcommand2 as listSubcommand,
19
19
  loginCommand
20
- } from "./chunk-AQWK7XXE.js";
20
+ } from "./chunk-VLQBXXOQ.js";
21
21
  import {
22
22
  require_semver
23
23
  } from "./chunk-IB5L4LKZ.js";
24
24
  import {
25
25
  help
26
- } from "./chunk-AWD3IGXU.js";
26
+ } from "./chunk-3NR6OYDV.js";
27
27
  import {
28
28
  login
29
- } from "./chunk-MABHXDYV.js";
29
+ } from "./chunk-INFYZRHS.js";
30
30
  import {
31
31
  TelemetryClient,
32
32
  isNativeBinaryInstall
33
- } from "./chunk-HIYWSGI7.js";
33
+ } from "./chunk-Q77ALSXR.js";
34
34
  import {
35
35
  require_ms
36
36
  } from "./chunk-GGP5R3FU.js";
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_lib
9
- } from "./chunk-MABHXDYV.js";
9
+ } from "./chunk-INFYZRHS.js";
10
10
  import {
11
11
  isNativeBinaryInstall
12
- } from "./chunk-HIYWSGI7.js";
12
+ } from "./chunk-Q77ALSXR.js";
13
13
  import {
14
14
  packageName
15
15
  } from "./chunk-LN6B7ZI3.js";