naro-cli 0.5.2 → 0.5.3

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 (2) hide show
  1. package/dist/index.js +7 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -603,6 +603,9 @@ async function resolveTeam(context, teams, deps = {}) {
603
603
  }
604
604
  if (teams.length === 0)
605
605
  throw new NaroError("NOT_FOUND", "Your account has no teams yet.");
606
+ const only = teams.length === 1 ? teams[0] : null;
607
+ const deploying = (deps.intent ?? "deploy") === "deploy";
608
+ if (only && !deploying) return only;
606
609
  const canPrompt = deps.canPrompt?.() ?? (!context.flags.json && !context.flags.yes && isInteractive());
607
610
  if (!canPrompt)
608
611
  throw new NaroError(
@@ -611,8 +614,7 @@ async function resolveTeam(context, teams, deps = {}) {
611
614
  Your teams: ${teams.map((team) => team.slug).join(", ")}`
612
615
  );
613
616
  const account = deps.accountLabel ? await deps.accountLabel() : "this account";
614
- if (teams.length === 1) {
615
- const only = teams[0];
617
+ if (only) {
616
618
  const label = only.isPersonal ? `${only.name} (personal)` : only.name;
617
619
  context.output.log(`
618
620
  ${account} \u2192 ${label}`);
@@ -629,7 +631,7 @@ async function resolveTeam(context, teams, deps = {}) {
629
631
  SWITCH_ACCOUNT
630
632
  ];
631
633
  const index = await context.prompter.select(
632
- `Deploying as ${account} \u2014 which team owns this project?`,
634
+ deploying ? `Deploying as ${account} \u2014 which team owns this project?` : `Signed in as ${account}. Which team?`,
633
635
  options
634
636
  );
635
637
  const picked = teams[index];
@@ -658,7 +660,7 @@ function saveLink(context, project, teamSlug) {
658
660
  async function runLink(context) {
659
661
  const client = await context.client();
660
662
  const teams = await client.teams.list();
661
- const team = await resolveTeam(context, teams);
663
+ const team = await resolveTeam(context, teams, { intent: "read" });
662
664
  const projects = await client.projects.list(team.slug);
663
665
  let project;
664
666
  if (context.flags.project) {
@@ -1232,7 +1234,7 @@ function productionUrl(subdomain) {
1232
1234
  async function runProjects(context) {
1233
1235
  const client = await context.client();
1234
1236
  const teams = await client.teams.list();
1235
- const team = await resolveTeam(context, teams);
1237
+ const team = await resolveTeam(context, teams, { intent: "read" });
1236
1238
  const projects = await client.projects.list(team.slug);
1237
1239
  context.output.result(
1238
1240
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naro-cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "naro": "./dist/index.js"
@@ -28,8 +28,8 @@
28
28
  "tsx": "4.23.12",
29
29
  "typescript": "7.0.2",
30
30
  "vitest": "3.2.7",
31
- "@next-deploy/build": "0.1.0",
32
31
  "@next-deploy/core": "0.1.0",
32
+ "@next-deploy/build": "0.1.0",
33
33
  "@next-deploy/config": "0.1.0",
34
34
  "@next-deploy/sdk": "0.1.0"
35
35
  },