vercel 56.2.0 → 56.2.1

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 (69) hide show
  1. package/dist/chunks/{add-YQRDKWJH.js → add-YIAPBLSF.js} +4 -4
  2. package/dist/chunks/{add-T6ZTAEU2.js → add-ZAQLTF5W.js} +5 -5
  3. package/dist/chunks/{chunk-B6SCQUDV.js → chunk-2I34TRQZ.js} +1 -1
  4. package/dist/chunks/{chunk-2RVK3DDN.js → chunk-52QYYTM5.js} +4 -0
  5. package/dist/chunks/{chunk-PN2GJKM5.js → chunk-52V5NDUN.js} +1 -1
  6. package/dist/chunks/{chunk-PQK4YU22.js → chunk-5HNYJHOB.js} +1 -1
  7. package/dist/chunks/{chunk-AEENIITE.js → chunk-6ZVIC6FL.js} +4 -4
  8. package/dist/chunks/{chunk-LSPZHWWP.js → chunk-75PKWYOS.js} +1 -1
  9. package/dist/chunks/{chunk-HMMPJ3VD.js → chunk-7OJJKCSW.js} +2 -2
  10. package/dist/chunks/{chunk-RLXBXRU2.js → chunk-7TJLLZPN.js} +2 -2
  11. package/dist/chunks/{chunk-NQEAHRBI.js → chunk-DD6D5J7E.js} +7 -8
  12. package/dist/chunks/{chunk-YGSTSVXS.js → chunk-DDEPCAGE.js} +155 -3071
  13. package/dist/chunks/{chunk-LXF3AXHM.js → chunk-DWU7JOO6.js} +1 -1
  14. package/dist/chunks/{chunk-AVLGVZJ5.js → chunk-EPBUWIAO.js} +144 -7
  15. package/dist/chunks/{chunk-7PZWVZN6.js → chunk-G75NFPIT.js} +1 -1
  16. package/dist/chunks/{chunk-EKIKD7RS.js → chunk-GPVU6JRS.js} +4 -4
  17. package/dist/chunks/{chunk-WOA4Z45Z.js → chunk-HIO4M75R.js} +20 -10
  18. package/dist/chunks/chunk-IMUF5MGV.js +81 -0
  19. package/dist/chunks/{chunk-SRJTYE5U.js → chunk-JF7LPEBD.js} +1 -1
  20. package/dist/chunks/{chunk-E3Y4SDXF.js → chunk-KXVQEPTA.js} +1 -1
  21. package/dist/chunks/{chunk-SHT5IY3Q.js → chunk-MYD7N6MH.js} +2 -2
  22. package/dist/chunks/{chunk-HR6VI6UV.js → chunk-NULWLKT7.js} +3 -4
  23. package/dist/chunks/{chunk-XFMTSTYT.js → chunk-PASZMRTZ.js} +5 -65
  24. package/dist/chunks/{chunk-24FCBXI4.js → chunk-R6IGDGX3.js} +1 -1
  25. package/dist/chunks/{chunk-EI555LUJ.js → chunk-UESEGACQ.js} +1 -1
  26. package/dist/chunks/{chunk-W346YNDN.js → chunk-VOBBH2SB.js} +49 -0
  27. package/dist/chunks/{chunk-K2THP63Z.js → chunk-YKJA5TVC.js} +1 -1
  28. package/dist/chunks/{compile-vercel-config-3AG4VKHZ.js → compile-vercel-config-4NKPN3EG.js} +2 -2
  29. package/dist/chunks/{delete-JLJ753B4.js → delete-NCMDC3IU.js} +3 -3
  30. package/dist/chunks/{disable-AXFGDOYN.js → disable-Z7DXY4AY.js} +3 -3
  31. package/dist/chunks/{discard-557SDKVO.js → discard-4ILK3ULP.js} +3 -3
  32. package/dist/chunks/{edit-ITGNF7S5.js → edit-ROJQCTWR.js} +4 -4
  33. package/dist/chunks/{enable-6RMJPNW5.js → enable-TAVCLAEC.js} +3 -3
  34. package/dist/chunks/{exec-G4AUF3KG.js → exec-CNBOV577.js} +3 -3
  35. package/dist/chunks/{export-3NC3DPRR.js → export-YTSIGJFX.js} +3 -3
  36. package/dist/chunks/{image-FGP5UVA5.js → image-LORSHERP.js} +3 -3
  37. package/dist/chunks/{inspect-FDF5WZMM.js → inspect-5C4UHSCT.js} +4 -4
  38. package/dist/chunks/{inspect-56OMR6RC.js → inspect-A2X7RTP4.js} +4 -4
  39. package/dist/chunks/{inspect-AF5J3QDV.js → inspect-L4UIWOXO.js} +4 -4
  40. package/dist/chunks/{inspect-N5DHCKLZ.js → inspect-OHDU2SVS.js} +4 -4
  41. package/dist/chunks/{list-PLG2ZHBA.js → list-FGVDMSFN.js} +3 -3
  42. package/dist/chunks/{list-F2AW7L3D.js → list-P2B5MHON.js} +4 -4
  43. package/dist/chunks/{login-LQRR64K7.js → login-4BK3VGII.js} +6 -6
  44. package/dist/chunks/{ls-EKNQN3V4.js → ls-NU4D6TLG.js} +4 -4
  45. package/dist/chunks/{ls-E7FYH3DW.js → ls-RAC5LMTR.js} +5 -5
  46. package/dist/chunks/{ls-HZDBJLMG.js → ls-WDRFGE2J.js} +4 -4
  47. package/dist/chunks/{ls-FWPYY7GH.js → ls-YXKRRYTL.js} +4 -4
  48. package/dist/chunks/{publish-PDGTM3M7.js → publish-DGF2TQCQ.js} +3 -3
  49. package/dist/chunks/{query-MUQKKYXI.js → query-NWW6RDHK.js} +5 -5
  50. package/dist/chunks/{reorder-B76HXU6D.js → reorder-TTZBKCEB.js} +3 -3
  51. package/dist/chunks/{restore-2PYXS4NP.js → restore-DG3LZMHQ.js} +3 -3
  52. package/dist/chunks/{rm-SFC67P5U.js → rm-2VBE4C2V.js} +5 -5
  53. package/dist/chunks/{rm-GZW2IDWX.js → rm-7WXXLTXF.js} +4 -4
  54. package/dist/chunks/{rm-SD3EJRXY.js → rm-U2DFRDKE.js} +4 -4
  55. package/dist/chunks/{rule-inspect-MSPP3V4O.js → rule-inspect-4NL3GGDB.js} +5 -5
  56. package/dist/chunks/{rules-AN32QRP7.js → rules-DABNOUNG.js} +6 -6
  57. package/dist/chunks/{schema-2GYFHMCN.js → schema-4RRRUUOO.js} +4 -4
  58. package/dist/chunks/{tags-ULDC3YLP.js → tags-MLX3AHHK.js} +2 -2
  59. package/dist/chunks/{update-NE62WKTZ.js → update-YXH7WWTN.js} +5 -5
  60. package/dist/commands/build/index.js +29 -19
  61. package/dist/commands/deploy/index.js +12 -11
  62. package/dist/commands/dev/index.js +27 -18
  63. package/dist/commands/env/index.js +23 -13
  64. package/dist/commands/link/index.js +13 -12
  65. package/dist/commands/list/index.js +7 -7
  66. package/dist/commands-bulk.js +2754 -1540
  67. package/dist/index.js +17 -18
  68. package/dist/version.mjs +1 -1
  69. package/package.json +21 -22
@@ -11,7 +11,7 @@ import {
11
11
  getTeamById,
12
12
  getUser,
13
13
  getVercelDirectory
14
- } from "./chunk-YGSTSVXS.js";
14
+ } from "./chunk-DDEPCAGE.js";
15
15
  import {
16
16
  TeamDeleted
17
17
  } from "./chunk-P6AK7SVK.js";
@@ -28,10 +28,10 @@ import {
28
28
  import {
29
29
  buildCommand,
30
30
  pullCommand
31
- } from "./chunk-K2THP63Z.js";
31
+ } from "./chunk-YKJA5TVC.js";
32
32
  import {
33
33
  envCommand
34
- } from "./chunk-YGSTSVXS.js";
34
+ } from "./chunk-DDEPCAGE.js";
35
35
  import {
36
36
  confirmOption,
37
37
  deploymentOption,
@@ -4467,6 +4467,131 @@ var inspectSubcommand3 = {
4467
4467
  }
4468
4468
  ]
4469
4469
  };
4470
+ var versionsListSubcommand = {
4471
+ name: "list",
4472
+ aliases: ["ls"],
4473
+ default: true,
4474
+ description: "List version history for a feature flag",
4475
+ arguments: [
4476
+ {
4477
+ name: "flag",
4478
+ required: true
4479
+ }
4480
+ ],
4481
+ options: [
4482
+ projectOption,
4483
+ {
4484
+ name: "environment",
4485
+ shorthand: "e",
4486
+ type: String,
4487
+ deprecated: false,
4488
+ description: "Filter versions by changed environment",
4489
+ argument: "ENV"
4490
+ },
4491
+ {
4492
+ name: "limit",
4493
+ shorthand: null,
4494
+ type: Number,
4495
+ deprecated: false,
4496
+ description: "Return at most NUMBER versions (1-100)",
4497
+ argument: "NUMBER"
4498
+ },
4499
+ {
4500
+ name: "cursor",
4501
+ shorthand: null,
4502
+ type: String,
4503
+ deprecated: false,
4504
+ description: "Pagination cursor from a previous versions response",
4505
+ argument: "CURSOR"
4506
+ },
4507
+ {
4508
+ name: "json",
4509
+ shorthand: null,
4510
+ type: Boolean,
4511
+ deprecated: false,
4512
+ description: "Output in JSON format"
4513
+ }
4514
+ ],
4515
+ examples: [
4516
+ {
4517
+ name: "List version history for a feature flag",
4518
+ value: `${packageName} flags versions my-feature-flag`
4519
+ },
4520
+ {
4521
+ name: "List version history using the explicit list subcommand",
4522
+ value: `${packageName} flags versions list my-feature-flag`
4523
+ },
4524
+ {
4525
+ name: "List production version history",
4526
+ value: `${packageName} flags versions my-feature-flag --environment production`
4527
+ },
4528
+ {
4529
+ name: "List the next page of version history",
4530
+ value: `${packageName} flags versions my-feature-flag --limit 10 --cursor <cursor>`
4531
+ },
4532
+ {
4533
+ name: "List version history as JSON",
4534
+ value: `${packageName} flags versions my-feature-flag --json`
4535
+ }
4536
+ ]
4537
+ };
4538
+ var versionsDiffSubcommand = {
4539
+ name: "diff",
4540
+ aliases: [],
4541
+ description: "Show changes introduced by a feature flag version",
4542
+ arguments: [
4543
+ {
4544
+ name: "flag",
4545
+ required: true
4546
+ }
4547
+ ],
4548
+ options: [
4549
+ projectOption,
4550
+ {
4551
+ name: "revision",
4552
+ shorthand: null,
4553
+ type: Number,
4554
+ deprecated: false,
4555
+ description: "Revision number to compare with the previous revision",
4556
+ argument: "NUMBER"
4557
+ },
4558
+ {
4559
+ name: "json",
4560
+ shorthand: null,
4561
+ type: Boolean,
4562
+ deprecated: false,
4563
+ description: "Output the diff in JSON format"
4564
+ }
4565
+ ],
4566
+ examples: [
4567
+ {
4568
+ name: "Show what changed in a revision",
4569
+ value: `${packageName} flags versions diff my-feature-flag --revision 4`
4570
+ },
4571
+ {
4572
+ name: "Show the revision diff as JSON",
4573
+ value: `${packageName} flags versions diff my-feature-flag --revision 4 --json`
4574
+ }
4575
+ ]
4576
+ };
4577
+ var versionsSubcommand = {
4578
+ name: "versions",
4579
+ aliases: [],
4580
+ description: "List and compare version history for a feature flag",
4581
+ arguments: [],
4582
+ subcommands: [versionsListSubcommand, versionsDiffSubcommand],
4583
+ options: [],
4584
+ examples: [
4585
+ {
4586
+ name: "List version history for a feature flag",
4587
+ value: `${packageName} flags versions my-feature-flag`
4588
+ },
4589
+ {
4590
+ name: "Show what changed in a revision",
4591
+ value: `${packageName} flags versions diff my-feature-flag --revision 4`
4592
+ }
4593
+ ]
4594
+ };
4470
4595
  var createSubcommand4 = {
4471
4596
  name: "create",
4472
4597
  aliases: ["add"],
@@ -5691,6 +5816,7 @@ var flagsCommand = {
5691
5816
  subcommands: [
5692
5817
  listSubcommand11,
5693
5818
  inspectSubcommand3,
5819
+ versionsSubcommand,
5694
5820
  createSubcommand4,
5695
5821
  openSubcommand2,
5696
5822
  updateSubcommand3,
@@ -6981,7 +7107,7 @@ var CommandTimeout = "5 minutes";
6981
7107
  var logsCommand = {
6982
7108
  name: "logs",
6983
7109
  aliases: ["log"],
6984
- description: "Display request logs for a project.\n\nSource types: \u03BB = serverless, \u03B5 = edge/middleware, \u25C7 = static/external",
7110
+ description: "Display request logs for a project.\n\nWith --follow, stream live runtime logs from a deployment. When no deployment is specified, resolves in order: latest deployment on the current git branch, then your latest deployment, then the latest production deployment. Use --environment production to always stream the latest production deployment.\n\nSource types: \u03BB = serverless, \u03B5 = edge/middleware, \u25C7 = static/external",
6985
7111
  arguments: [
6986
7112
  {
6987
7113
  name: "url|deploymentId",
@@ -7002,7 +7128,7 @@ var logsCommand = {
7002
7128
  shorthand: null,
7003
7129
  type: String,
7004
7130
  deprecated: false,
7005
- description: "Filter by environment: production or preview"
7131
+ description: "Filter by environment: production or preview. With --follow, selects which environment to stream (production always streams the latest production deployment)"
7006
7132
  },
7007
7133
  {
7008
7134
  name: "level",
@@ -7058,7 +7184,7 @@ var logsCommand = {
7058
7184
  shorthand: "f",
7059
7185
  type: Boolean,
7060
7186
  deprecated: false,
7061
- description: "Stream live runtime logs for a deployment"
7187
+ description: "Stream live runtime logs. Without a deployment, follows the latest deployment on the current git branch, then your latest deployment, then the latest production deployment"
7062
7188
  },
7063
7189
  {
7064
7190
  name: "no-follow",
@@ -7093,7 +7219,7 @@ var logsCommand = {
7093
7219
  shorthand: "x",
7094
7220
  type: Boolean,
7095
7221
  deprecated: false,
7096
- description: "Show full log message below each request line"
7222
+ description: "Show full log message below each request line (default when output is not a TTY)"
7097
7223
  },
7098
7224
  {
7099
7225
  name: "branch",
@@ -7111,6 +7237,14 @@ var logsCommand = {
7111
7237
  }
7112
7238
  ],
7113
7239
  examples: [
7240
+ {
7241
+ name: "Stream live logs for your most recent deployment",
7242
+ value: `${packageName} logs --follow`
7243
+ },
7244
+ {
7245
+ name: "Stream live logs for the latest production deployment",
7246
+ value: `${packageName} logs --follow --environment production`
7247
+ },
7114
7248
  {
7115
7249
  name: "Stream live logs for a deployment URL",
7116
7250
  value: `${packageName} logs https://my-app-xxxxx.vercel.app --follow`
@@ -7120,7 +7254,7 @@ var logsCommand = {
7120
7254
  value: `${packageName} logs dpl_xxxxx --follow`
7121
7255
  },
7122
7256
  {
7123
- name: "Stream logs for the latest production deployment of a project",
7257
+ name: "Stream logs for a specific project",
7124
7258
  value: `${packageName} logs --project my-app --follow`
7125
7259
  },
7126
7260
  {
@@ -10316,6 +10450,9 @@ export {
10316
10450
  formatFlagConditionComparator,
10317
10451
  listSubcommand11,
10318
10452
  inspectSubcommand3,
10453
+ versionsListSubcommand,
10454
+ versionsDiffSubcommand,
10455
+ versionsSubcommand,
10319
10456
  createSubcommand4,
10320
10457
  openSubcommand2,
10321
10458
  updateSubcommand3,
@@ -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-24FCBXI4.js";
9
+ } from "./chunk-R6IGDGX3.js";
10
10
  import {
11
11
  __commonJS,
12
12
  __require
@@ -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-SRJTYE5U.js";
9
+ } from "./chunk-JF7LPEBD.js";
10
10
  import {
11
11
  autoInstallVercelPlugin
12
12
  } from "./chunk-NJUPUGOE.js";
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-64IF634X.js";
16
16
  import {
17
17
  ensureLink
18
- } from "./chunk-WOA4Z45Z.js";
18
+ } from "./chunk-HIO4M75R.js";
19
19
  import {
20
20
  pullCommand
21
- } from "./chunk-K2THP63Z.js";
21
+ } from "./chunk-YKJA5TVC.js";
22
22
  import {
23
23
  help
24
24
  } from "./chunk-QY63UKTP.js";
@@ -28,7 +28,7 @@ import {
28
28
  envPullCommandLogic,
29
29
  humanizePath,
30
30
  parseTarget
31
- } from "./chunk-YGSTSVXS.js";
31
+ } from "./chunk-DDEPCAGE.js";
32
32
  import {
33
33
  TelemetryClient
34
34
  } from "./chunk-ECCWJHC6.js";
@@ -5,14 +5,19 @@ const require = __createRequire(import.meta.url);
5
5
  const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
- printProjectNotFoundError,
9
8
  setupAndLink
10
- } from "./chunk-XFMTSTYT.js";
9
+ } from "./chunk-PASZMRTZ.js";
10
+ import {
11
+ printProjectNotFoundError
12
+ } from "./chunk-IMUF5MGV.js";
13
+ import {
14
+ detectExplicitScope
15
+ } from "./chunk-DWU7JOO6.js";
11
16
  import {
12
17
  getLinkedProject,
13
18
  param,
14
19
  resolveProjectCwd
15
- } from "./chunk-YGSTSVXS.js";
20
+ } from "./chunk-DDEPCAGE.js";
16
21
  import {
17
22
  buildCommandWithYes,
18
23
  outputActionRequired
@@ -28,25 +33,30 @@ import {
28
33
  // src/util/link/ensure-link.ts
29
34
  async function ensureLink(commandName, client, cwd, opts = {}) {
30
35
  cwd = await resolveProjectCwd(cwd);
31
- let { link } = opts;
36
+ let link = opts.link;
32
37
  const nonInteractive = opts.nonInteractive ?? client.nonInteractive ?? false;
33
38
  opts.nonInteractive = nonInteractive;
34
39
  if (!link) {
35
40
  if (opts.forceDelete) {
36
41
  link = { status: "not_linked", org: null, project: null };
37
42
  } else {
38
- link = await getLinkedProject(
39
- client,
43
+ link = await getLinkedProject(client, {
40
44
  cwd,
41
- opts.projectName,
42
- opts.failIfNotFound
43
- );
45
+ projectName: opts.projectName,
46
+ projectNameIsExplicit: Boolean(opts.projectName && opts.failIfNotFound),
47
+ scopeIsExplicit: detectExplicitScope(client)
48
+ });
44
49
  }
45
50
  opts.link = link;
46
51
  }
47
52
  if (link.status === "linked" && opts.forceDelete || link.status === "not_linked") {
48
53
  if (link.status === "not_linked" && opts.failIfNotFound && opts.projectName) {
49
- await printProjectNotFoundError(client, opts.projectName, commandName);
54
+ await printProjectNotFoundError(
55
+ client,
56
+ opts.projectName,
57
+ commandName,
58
+ link.orgId
59
+ );
50
60
  return 1;
51
61
  }
52
62
  if (link.status === "not_linked" && opts.requireExistingLink) {
@@ -0,0 +1,81 @@
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
+ AGENT_REASON,
9
+ AGENT_STATUS
10
+ } from "./chunk-IC4YEIGW.js";
11
+ import {
12
+ getScope
13
+ } from "./chunk-DWU7JOO6.js";
14
+ import {
15
+ getOrgById
16
+ } from "./chunk-DDEPCAGE.js";
17
+ import {
18
+ buildCommandWithGlobalFlags,
19
+ outputAgentError,
20
+ shouldEmitNonInteractiveCommandError
21
+ } from "./chunk-CB3I3QIT.js";
22
+ import {
23
+ output_manager_default
24
+ } from "./chunk-OX7KI3LF.js";
25
+
26
+ // src/util/projects/project-not-found-error.ts
27
+ async function printProjectNotFoundError(client, projectNameOrId, commandName, orgId) {
28
+ let contextName;
29
+ try {
30
+ if (orgId) {
31
+ const org = await getOrgById(client, orgId);
32
+ contextName = org?.slug ?? orgId;
33
+ } else {
34
+ const scope = await getScope(client);
35
+ contextName = scope.contextName;
36
+ }
37
+ } catch (err) {
38
+ contextName = orgId;
39
+ output_manager_default.debug(`Scope lookup failed during error reporting: ${err}`);
40
+ }
41
+ const scopeClause = contextName ? ` (${contextName})` : "";
42
+ const headline = `Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`;
43
+ output_manager_default.error(
44
+ `${headline}
45
+
46
+ If it lives in a different team or account:
47
+ \u2022 Retry with \`--scope <team-slug|your-username>\`, or
48
+ \u2022 Run \`vercel switch <team-slug|your-username>\` to change scope.
49
+
50
+ List accessible teams with \`vercel teams ls\`.`
51
+ );
52
+ if (!shouldEmitNonInteractiveCommandError(client)) {
53
+ return;
54
+ }
55
+ const retryWithScope = buildCommandWithGlobalFlags(
56
+ client.argv,
57
+ `${commandName} --project ${projectNameOrId} --scope <team-slug>`
58
+ );
59
+ outputAgentError(
60
+ client,
61
+ {
62
+ status: AGENT_STATUS.ERROR,
63
+ reason: AGENT_REASON.PROJECT_NOT_FOUND,
64
+ message: `${headline} If it lives in a different team or account, retry with --scope <team-slug|your-username> or run \`vercel switch <team-slug|your-username>\` to change scope.`,
65
+ ...contextName ? { scope: contextName } : {},
66
+ next: [
67
+ { command: "vercel teams ls", when: "list accessible teams" },
68
+ { command: retryWithScope, when: "retry with a specific team" },
69
+ {
70
+ command: "vercel switch <team-slug>",
71
+ when: "change the default scope"
72
+ }
73
+ ]
74
+ },
75
+ 1
76
+ );
77
+ }
78
+
79
+ export {
80
+ printProjectNotFoundError
81
+ };
@@ -8,7 +8,7 @@ import {
8
8
  VERCEL_DIR,
9
9
  VERCEL_DIR_PROJECT,
10
10
  require_lib
11
- } from "./chunk-YGSTSVXS.js";
11
+ } from "./chunk-DDEPCAGE.js";
12
12
  import {
13
13
  require_dist
14
14
  } from "./chunk-OX7KI3LF.js";
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  resolveAlertsScope
9
- } from "./chunk-HMMPJ3VD.js";
9
+ } from "./chunk-7OJJKCSW.js";
10
10
  import {
11
11
  handleValidationError,
12
12
  outputError,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-IB5L4LKZ.js";
10
10
  import {
11
11
  require_execa
12
- } from "./chunk-24FCBXI4.js";
12
+ } from "./chunk-R6IGDGX3.js";
13
13
  import {
14
14
  VERCEL_CONFIG_EXTENSIONS,
15
15
  VERCEL_DIR,
@@ -19,7 +19,7 @@ import {
19
19
  require_lib,
20
20
  require_minimatch,
21
21
  require_pluralize
22
- } from "./chunk-YGSTSVXS.js";
22
+ } from "./chunk-DDEPCAGE.js";
23
23
  import {
24
24
  CantParseJSONFile,
25
25
  cmd,
@@ -11,7 +11,7 @@ import {
11
11
  PromptBackError,
12
12
  PromptCanceledError,
13
13
  getLocalPathConfig
14
- } from "./chunk-EI555LUJ.js";
14
+ } from "./chunk-UESEGACQ.js";
15
15
  import {
16
16
  DEFAULT_VERCEL_CONFIG_FILENAME,
17
17
  VERCEL_CONFIG_EXTENSIONS,
@@ -38,7 +38,7 @@ import {
38
38
  useKeypress,
39
39
  usePrefix,
40
40
  useState
41
- } from "./chunk-YGSTSVXS.js";
41
+ } from "./chunk-DDEPCAGE.js";
42
42
  import {
43
43
  require_load_json_file
44
44
  } from "./chunk-ECCWJHC6.js";
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  Headers,
58
58
  fetch
59
- } from "./chunk-2RVK3DDN.js";
59
+ } from "./chunk-52QYYTM5.js";
60
60
  import {
61
61
  emoji,
62
62
  link_default,
@@ -1655,7 +1655,6 @@ var Client = class extends EventEmitter {
1655
1655
  output_manager_default.debug(`Retrying: ${error}
1656
1656
  ${error.stack}`);
1657
1657
  };
1658
- this.agent = opts.agent;
1659
1658
  this.setArgv(opts.argv);
1660
1659
  this.apiUrl = opts.apiUrl;
1661
1660
  this.authConfig = opts.authConfig;
@@ -4,18 +4,11 @@ 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
- AGENT_REASON,
9
- AGENT_STATUS
10
- } from "./chunk-IC4YEIGW.js";
11
7
  import {
12
8
  getLocalPathConfig,
13
9
  isPromptBackError,
14
10
  isPromptCanceledError
15
- } from "./chunk-EI555LUJ.js";
16
- import {
17
- getScope
18
- } from "./chunk-LXF3AXHM.js";
11
+ } from "./chunk-UESEGACQ.js";
19
12
  import {
20
13
  table
21
14
  } from "./chunk-QEEGXNFK.js";
@@ -53,12 +46,7 @@ import {
53
46
  selectAndParseRemoteUrl,
54
47
  selectOrg,
55
48
  writeServicesConfig
56
- } from "./chunk-YGSTSVXS.js";
57
- import {
58
- buildCommandWithGlobalFlags,
59
- outputAgentError,
60
- shouldEmitNonInteractiveCommandError
61
- } from "./chunk-CB3I3QIT.js";
49
+ } from "./chunk-DDEPCAGE.js";
62
50
  import {
63
51
  printError
64
52
  } from "./chunk-EHTPDXTS.js";
@@ -167,53 +155,6 @@ async function readConfig(dir) {
167
155
  return null;
168
156
  }
169
157
 
170
- // src/util/projects/project-not-found-error.ts
171
- async function printProjectNotFoundError(client, projectNameOrId, commandName) {
172
- let contextName;
173
- try {
174
- const scope = await getScope(client);
175
- contextName = scope.contextName;
176
- } catch (err) {
177
- output_manager_default.debug(`getScope failed during error reporting: ${err}`);
178
- }
179
- const scopeClause = contextName ? ` (${contextName})` : "";
180
- const headline = `Project "${projectNameOrId}" was not found in the current scope${scopeClause}.`;
181
- output_manager_default.error(
182
- `${headline}
183
-
184
- If it lives in a different team or account:
185
- \u2022 Retry with \`--scope <team-slug|your-username>\`, or
186
- \u2022 Run \`vercel switch <team-slug|your-username>\` to change scope.
187
-
188
- List accessible teams with \`vercel teams ls\`.`
189
- );
190
- if (!shouldEmitNonInteractiveCommandError(client)) {
191
- return;
192
- }
193
- const retryWithScope = buildCommandWithGlobalFlags(
194
- client.argv,
195
- `${commandName} --project ${projectNameOrId} --scope <team-slug>`
196
- );
197
- outputAgentError(
198
- client,
199
- {
200
- status: AGENT_STATUS.ERROR,
201
- reason: AGENT_REASON.PROJECT_NOT_FOUND,
202
- message: `${headline} If it lives in a different team or account, retry with --scope <team-slug|your-username> or run \`vercel switch <team-slug|your-username>\` to change scope.`,
203
- ...contextName ? { scope: contextName } : {},
204
- next: [
205
- { command: "vercel teams ls", when: "list accessible teams" },
206
- { command: retryWithScope, when: "retry with a specific team" },
207
- {
208
- command: "vercel switch <team-slug>",
209
- when: "change the default scope"
210
- }
211
- ]
212
- },
213
- 1
214
- );
215
- }
216
-
217
158
  // src/util/input/display-services.ts
218
159
  var import_frameworks = __toESM(require_frameworks(), 1);
219
160
  import {
@@ -1190,7 +1131,7 @@ async function setupAndLink(client, path2, {
1190
1131
  return { status: "error", exitCode: 1, reason: "PATH_IS_FILE" };
1191
1132
  }
1192
1133
  if (!link) {
1193
- link = await getLinkedProject(client, path2);
1134
+ link = await getLinkedProject(client, { cwd: path2 });
1194
1135
  }
1195
1136
  const isTTY = client.stdin.isTTY;
1196
1137
  let rootDirectory = null;
@@ -1200,7 +1141,7 @@ async function setupAndLink(client, path2, {
1200
1141
  return link;
1201
1142
  }
1202
1143
  if (getPlatformEnv("ORG_ID") && getPlatformEnv("PROJECT_ID")) {
1203
- const envLink = await getLinkedProject(client, path2);
1144
+ const envLink = await getLinkedProject(client, { cwd: path2 });
1204
1145
  if (envLink.status === "error") {
1205
1146
  return envLink;
1206
1147
  }
@@ -1535,6 +1476,5 @@ export {
1535
1476
  validatePaths,
1536
1477
  readConfig,
1537
1478
  displayDetectedServices,
1538
- setupAndLink,
1539
- printProjectNotFoundError
1479
+ setupAndLink
1540
1480
  };
@@ -7,7 +7,7 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_end_of_stream,
9
9
  require_once
10
- } from "./chunk-2RVK3DDN.js";
10
+ } from "./chunk-52QYYTM5.js";
11
11
  import {
12
12
  require_signal_exit
13
13
  } from "./chunk-OX7KI3LF.js";
@@ -7,7 +7,7 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  VERCEL_DIR,
9
9
  isVercelTomlEnabled
10
- } from "./chunk-YGSTSVXS.js";
10
+ } from "./chunk-DDEPCAGE.js";
11
11
  import {
12
12
  parseArguments
13
13
  } from "./chunk-EHTPDXTS.js";
@@ -4,6 +4,18 @@ 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
+ printProjectNotFoundError
9
+ } from "./chunk-IMUF5MGV.js";
10
+ import {
11
+ detectExplicitScope
12
+ } from "./chunk-DWU7JOO6.js";
13
+ import {
14
+ getLinkedProject
15
+ } from "./chunk-DDEPCAGE.js";
16
+ import {
17
+ omitGlobalFlagsFromArgs
18
+ } from "./chunk-CB3I3QIT.js";
7
19
  import {
8
20
  require_dist
9
21
  } from "./chunk-OX7KI3LF.js";
@@ -299,11 +311,48 @@ function ellipsis(str, length) {
299
311
  return str.length > length ? `${str.slice(0, length - 1)}\u2026` : str;
300
312
  }
301
313
 
314
+ // src/util/projects/resolve-project-context.ts
315
+ function getInvokingCommandFromArgv(argv) {
316
+ const args = omitGlobalFlagsFromArgs(argv.slice(2));
317
+ const positionals = [];
318
+ for (const arg of args) {
319
+ if (arg.startsWith("-")) {
320
+ break;
321
+ }
322
+ positionals.push(arg);
323
+ }
324
+ return positionals.join(" ");
325
+ }
326
+ async function resolveProjectContext({
327
+ client,
328
+ cwd = client.cwd,
329
+ projectNameOrId,
330
+ commandName = ""
331
+ }) {
332
+ const context = await getLinkedProject(client, {
333
+ cwd,
334
+ projectName: projectNameOrId,
335
+ projectNameIsExplicit: Boolean(projectNameOrId),
336
+ scopeIsExplicit: detectExplicitScope(client)
337
+ });
338
+ if (context.status === "not_linked" && projectNameOrId) {
339
+ await printProjectNotFoundError(
340
+ client,
341
+ projectNameOrId,
342
+ commandName || getInvokingCommandFromArgv(client.argv),
343
+ context.orgId
344
+ );
345
+ return { status: "error", exitCode: 1, orgId: context.orgId };
346
+ }
347
+ return context;
348
+ }
349
+
302
350
  export {
303
351
  readStandardInput,
304
352
  CHECKBOX_INSTRUCTIONS,
305
353
  getCustomEnvironments,
306
354
  pickCustomEnvironment,
307
355
  ellipsis,
356
+ resolveProjectContext,
308
357
  require_dist2 as require_dist
309
358
  };