@biffo/cli 0.396.0 → 0.396.2

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.
package/dist/index.js CHANGED
@@ -5019,7 +5019,6 @@ import { existsSync as existsSync17, readFileSync as readFileSync12 } from "fs";
5019
5019
  import { resolve as resolve5 } from "path";
5020
5020
  import chalk5 from "chalk";
5021
5021
  import { Command as Command5 } from "commander";
5022
- import inquirer from "inquirer";
5023
5022
 
5024
5023
  // src/adapters/cloud/aws/index.ts
5025
5024
  import {
@@ -5456,6 +5455,57 @@ function resolveDnsConfig(config) {
5456
5455
  };
5457
5456
  }
5458
5457
 
5458
+ // src/lib/interactive.ts
5459
+ import inquirer from "inquirer";
5460
+ var NON_INTERACTIVE_FLAG = "--non-interactive";
5461
+ var NON_INTERACTIVE_ENV = "BIFFO_NON_INTERACTIVE";
5462
+ var NonInteractiveError = class extends Error {
5463
+ constructor(message) {
5464
+ super(message);
5465
+ this.name = "NonInteractiveError";
5466
+ }
5467
+ };
5468
+ function isNonInteractive(argv = process.argv, env = process.env) {
5469
+ const fromEnv = env[NON_INTERACTIVE_ENV];
5470
+ if (fromEnv !== void 0 && fromEnv !== "" && fromEnv !== "0" && fromEnv !== "false") {
5471
+ return true;
5472
+ }
5473
+ return argv.includes(NON_INTERACTIVE_FLAG);
5474
+ }
5475
+ function nonInteractiveMessage(question, remedy) {
5476
+ return `Refusing to prompt for "${question}" \u2014 ${NON_INTERACTIVE_FLAG} is set.
5477
+ ${remedy}`;
5478
+ }
5479
+ function noTerminalMessage(question, remedy) {
5480
+ return `Refusing to prompt for "${question}" \u2014 no interactive terminal is attached.
5481
+ ${remedy}`;
5482
+ }
5483
+ function assertInteractive(question, remedy, isTTY = Boolean(process.stdin.isTTY)) {
5484
+ if (isNonInteractive()) {
5485
+ throw new NonInteractiveError(nonInteractiveMessage(question, remedy));
5486
+ }
5487
+ if (!isTTY) {
5488
+ throw new NonInteractiveError(noTerminalMessage(question, remedy));
5489
+ }
5490
+ }
5491
+ async function promptOr(guard, questions) {
5492
+ assertInteractive(guard.question, guard.remedy, guard.isTTY);
5493
+ return await inquirer.prompt(questions);
5494
+ }
5495
+ function registerNonInteractive(command) {
5496
+ const already = command.options.some((o) => o.long === NON_INTERACTIVE_FLAG);
5497
+ if (!already) {
5498
+ command.option(
5499
+ NON_INTERACTIVE_FLAG,
5500
+ "Never prompt; fail with an error naming the flag that supplies the answer"
5501
+ );
5502
+ }
5503
+ for (const sub of command.commands) {
5504
+ registerNonInteractive(sub);
5505
+ }
5506
+ return command;
5507
+ }
5508
+
5459
5509
  // src/lib/local-config.ts
5460
5510
  var PLACEHOLDER = /^\{\{[A-Z0-9_]+\}\}$/;
5461
5511
  function isPlaceholder(value) {
@@ -5697,17 +5747,23 @@ async function resolveConfig(options) {
5697
5747
  log.info(`Using project: ${projects[0].project.name}`);
5698
5748
  return projects[0];
5699
5749
  }
5700
- const { chosen } = await inquirer.prompt([
5750
+ const { chosen } = await promptOr(
5701
5751
  {
5702
- type: "list",
5703
- name: "chosen",
5704
- message: "Which project do you want to apply this DDL import to?",
5705
- choices: projects.map((p) => ({
5706
- name: `${p.project.name} (${p.source_control.config.org}/${p.source_control.config.repo})`,
5707
- value: p.project.name
5708
- }))
5709
- }
5710
- ]);
5752
+ question: "Which project do you want to apply this DDL import to?",
5753
+ remedy: "Pass --project <name> or --config <path> to choose one."
5754
+ },
5755
+ [
5756
+ {
5757
+ type: "list",
5758
+ name: "chosen",
5759
+ message: "Which project do you want to apply this DDL import to?",
5760
+ choices: projects.map((p) => ({
5761
+ name: `${p.project.name} (${p.source_control.config.org}/${p.source_control.config.repo})`,
5762
+ value: p.project.name
5763
+ }))
5764
+ }
5765
+ ]
5766
+ );
5711
5767
  return projects.find((p) => p.project.name === chosen);
5712
5768
  }
5713
5769
 
@@ -5717,7 +5773,6 @@ import { cpSync, existsSync as existsSync18, mkdirSync as mkdirSync5, readdirSyn
5717
5773
  import { join as join18, resolve as resolve6 } from "path";
5718
5774
  import chalk6 from "chalk";
5719
5775
  import { Command as Command6 } from "commander";
5720
- import inquirer2 from "inquirer";
5721
5776
  var NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
5722
5777
  var dataImportCommand = new Command6("import").description(
5723
5778
  "Import a directory of DDL .sql files: biffo data import <name> --source <local-dir-or-github-url>"
@@ -5833,14 +5888,20 @@ async function resolveDdlImportToken() {
5833
5888
  if (token2) return token2;
5834
5889
  } catch {
5835
5890
  }
5836
- const { token } = await inquirer2.prompt([
5891
+ const { token } = await promptOr(
5837
5892
  {
5838
- type: "password",
5839
- name: "token",
5840
- message: 'GitHub Personal Access Token for the source repo (read-only "repo" scope; leave blank if public):',
5841
- mask: "*"
5842
- }
5843
- ]);
5893
+ question: "GitHub Personal Access Token for the source repo",
5894
+ remedy: "Set BIFFO_DATA_IMPORT_TOKEN, or run `gh auth login`."
5895
+ },
5896
+ [
5897
+ {
5898
+ type: "password",
5899
+ name: "token",
5900
+ message: 'GitHub Personal Access Token for the source repo (read-only "repo" scope; leave blank if public):',
5901
+ mask: "*"
5902
+ }
5903
+ ]
5904
+ );
5844
5905
  return token.trim() || void 0;
5845
5906
  }
5846
5907
  function printDryRun(name, sqlFiles) {
@@ -5915,50 +5976,6 @@ import { resolve as resolve8 } from "path";
5915
5976
  import chalk8 from "chalk";
5916
5977
  import { Command as Command9 } from "commander";
5917
5978
 
5918
- // src/lib/interactive.ts
5919
- import inquirer3 from "inquirer";
5920
- var NON_INTERACTIVE_FLAG = "--non-interactive";
5921
- var NON_INTERACTIVE_ENV = "BIFFO_NON_INTERACTIVE";
5922
- var NonInteractiveError = class extends Error {
5923
- constructor(message) {
5924
- super(message);
5925
- this.name = "NonInteractiveError";
5926
- }
5927
- };
5928
- function isNonInteractive(argv = process.argv, env = process.env) {
5929
- const fromEnv = env[NON_INTERACTIVE_ENV];
5930
- if (fromEnv !== void 0 && fromEnv !== "" && fromEnv !== "0" && fromEnv !== "false") {
5931
- return true;
5932
- }
5933
- return argv.includes(NON_INTERACTIVE_FLAG);
5934
- }
5935
- function nonInteractiveMessage(question, remedy) {
5936
- return `Refusing to prompt for "${question}" \u2014 ${NON_INTERACTIVE_FLAG} is set.
5937
- ${remedy}`;
5938
- }
5939
- function assertInteractive(question, remedy) {
5940
- if (isNonInteractive()) {
5941
- throw new NonInteractiveError(nonInteractiveMessage(question, remedy));
5942
- }
5943
- }
5944
- async function promptOr(guard, questions) {
5945
- assertInteractive(guard.question, guard.remedy);
5946
- return await inquirer3.prompt(questions);
5947
- }
5948
- function registerNonInteractive(command) {
5949
- const already = command.options.some((o) => o.long === NON_INTERACTIVE_FLAG);
5950
- if (!already) {
5951
- command.option(
5952
- NON_INTERACTIVE_FLAG,
5953
- "Never prompt; fail with an error naming the flag that supplies the answer"
5954
- );
5955
- }
5956
- for (const sub of command.commands) {
5957
- registerNonInteractive(sub);
5958
- }
5959
- return command;
5960
- }
5961
-
5962
5979
  // src/lib/root-sibling.ts
5963
5980
  var ROOT_SIBLING_NAME = "app";
5964
5981
  var RESERVED_SIBLING_NAMES = ["admin", "login", ROOT_SIBLING_NAME];
@@ -6327,19 +6344,11 @@ function describeProject(config) {
6327
6344
  async function chooseProject(projects, isTTY = Boolean(process.stdin.isTTY)) {
6328
6345
  const question = "Which project do you want to deploy?";
6329
6346
  const remedy = "Pass --project <name> to choose one. Available:\n" + projects.map((p) => ` ${describeProject(p)}`).join("\n");
6330
- if (isNonInteractive()) {
6331
- throw new NonInteractiveError(nonInteractiveMessage(question, remedy));
6332
- }
6333
- if (!isTTY) {
6334
- throw new NonInteractiveError(
6335
- `Refusing to prompt for "${question}" \u2014 no interactive terminal is attached.
6336
- ${remedy}`
6337
- );
6338
- }
6339
6347
  const { chosen } = await promptOr(
6340
6348
  {
6341
6349
  question,
6342
- remedy
6350
+ remedy,
6351
+ isTTY
6343
6352
  },
6344
6353
  [
6345
6354
  {
@@ -8176,7 +8185,6 @@ import { readFileSync as readFileSync20 } from "fs";
8176
8185
  import { resolve as resolve13 } from "path";
8177
8186
  import chalk12 from "chalk";
8178
8187
  import { Command as Command13 } from "commander";
8179
- import inquirer5 from "inquirer";
8180
8188
 
8181
8189
  // src/lib/build-freshness.ts
8182
8190
  import { existsSync as existsSync25, readdirSync as readdirSync7, statSync as statSync5 } from "fs";
@@ -8293,7 +8301,6 @@ import { homedir as homedir4 } from "os";
8293
8301
  import { join as join25 } from "path";
8294
8302
  import { GetCallerIdentityCommand as GetCallerIdentityCommand2, STSClient as STSClient2 } from "@aws-sdk/client-sts";
8295
8303
  import chalk10 from "chalk";
8296
- import inquirer4 from "inquirer";
8297
8304
  async function resolveGithubToken3(nonInteractive = false) {
8298
8305
  if (process.env["GITHUB_TOKEN"]) return process.env["GITHUB_TOKEN"];
8299
8306
  const ghCreds = tryGhCliToken();
@@ -8302,14 +8309,20 @@ async function resolveGithubToken3(nonInteractive = false) {
8302
8309
  chalk10.green(" \u2714") + ` GitHub account ${chalk10.bold(ghCreds.login)} detected (via gh CLI)
8303
8310
  `
8304
8311
  );
8305
- const confirmed = nonInteractive || (await inquirer4.prompt([
8312
+ const confirmed = nonInteractive || (await promptOr(
8306
8313
  {
8307
- type: "confirm",
8308
- name: "confirmed",
8309
- message: "Use these GitHub credentials?",
8310
- default: true
8311
- }
8312
- ])).confirmed;
8314
+ question: "Use these GitHub credentials?",
8315
+ remedy: "Pass -y to use the detected gh credentials, or set GITHUB_TOKEN."
8316
+ },
8317
+ [
8318
+ {
8319
+ type: "confirm",
8320
+ name: "confirmed",
8321
+ message: "Use these GitHub credentials?",
8322
+ default: true
8323
+ }
8324
+ ]
8325
+ )).confirmed;
8313
8326
  if (confirmed) {
8314
8327
  console.log();
8315
8328
  process.env["GITHUB_TOKEN"] = ghCreds.token;
@@ -8325,14 +8338,20 @@ async function resolveGithubToken3(nonInteractive = false) {
8325
8338
  console.log(
8326
8339
  chalk10.yellow(" \u2139 No GitHub credentials found.\n") + " Option A: run `gh auth login` to authenticate via the gh CLI\n Option B: create a classic PAT at https://github.com/settings/tokens\n with scopes: repo, workflow, admin:org (if using an org)\n"
8327
8340
  );
8328
- const { token } = await inquirer4.prompt([
8341
+ const { token } = await promptOr(
8329
8342
  {
8330
- type: "password",
8331
- name: "token",
8332
- message: "GitHub Personal Access Token:",
8333
- validate: (v) => v.trim().length > 0 || "Token is required"
8334
- }
8335
- ]);
8343
+ question: "GitHub Personal Access Token",
8344
+ remedy: "Set GITHUB_TOKEN or run `gh auth login`."
8345
+ },
8346
+ [
8347
+ {
8348
+ type: "password",
8349
+ name: "token",
8350
+ message: "GitHub Personal Access Token:",
8351
+ validate: (v) => v.trim().length > 0 || "Token is required"
8352
+ }
8353
+ ]
8354
+ );
8336
8355
  process.env["GITHUB_TOKEN"] = token;
8337
8356
  return token;
8338
8357
  }
@@ -8361,14 +8380,20 @@ async function resolveAwsCredentials(nonInteractive = false) {
8361
8380
  chalk10.green(` \u2714`) + ` AWS account ${chalk10.bold(detectedAccountId)} detected (${detectedRegion}, profile: ${profile})
8362
8381
  `
8363
8382
  );
8364
- const confirmed = nonInteractive || (await inquirer4.prompt([
8383
+ const confirmed = nonInteractive || (await promptOr(
8365
8384
  {
8366
- type: "confirm",
8367
- name: "confirmed",
8368
- message: "Use these AWS credentials?",
8369
- default: true
8370
- }
8371
- ])).confirmed;
8385
+ question: "Use these AWS credentials?",
8386
+ remedy: "Pass -y to use the detected AWS credentials, or set AWS_PROFILE."
8387
+ },
8388
+ [
8389
+ {
8390
+ type: "confirm",
8391
+ name: "confirmed",
8392
+ message: "Use these AWS credentials?",
8393
+ default: true
8394
+ }
8395
+ ]
8396
+ )).confirmed;
8372
8397
  if (confirmed) {
8373
8398
  console.log();
8374
8399
  return { accountId: detectedAccountId, region: detectedRegion, profile };
@@ -8388,32 +8413,38 @@ async function resolveAwsCredentials(nonInteractive = false) {
8388
8413
  async function promptForAwsProfile(detectedRegion) {
8389
8414
  const profiles = discoverAwsProfiles();
8390
8415
  if (profiles.length > 0) {
8391
- const answers2 = await inquirer4.prompt([
8416
+ const answers2 = await promptOr(
8392
8417
  {
8393
- type: "list",
8394
- name: "selected_profile",
8395
- message: "AWS profile for the target account:",
8396
- choices: [
8397
- ...profiles.map((p) => ({ name: p, value: p })),
8398
- { name: "Enter another profile name", value: "__manual__" },
8399
- { name: "Use current environment credentials", value: "" }
8400
- ],
8401
- default: profiles.includes("default") ? "default" : profiles[0]
8418
+ question: "AWS profile for the target account",
8419
+ remedy: "Set AWS_PROFILE and AWS_REGION for the target account, or run `aws configure`."
8402
8420
  },
8403
- {
8404
- type: "input",
8405
- name: "profile",
8406
- message: "AWS profile name:",
8407
- when: (a) => a.selected_profile === "__manual__",
8408
- validate: (v) => v.trim().length > 0 || "Profile is required"
8409
- },
8410
- {
8411
- type: "input",
8412
- name: "region",
8413
- message: "AWS region:",
8414
- default: detectedRegion
8415
- }
8416
- ]);
8421
+ [
8422
+ {
8423
+ type: "list",
8424
+ name: "selected_profile",
8425
+ message: "AWS profile for the target account:",
8426
+ choices: [
8427
+ ...profiles.map((p) => ({ name: p, value: p })),
8428
+ { name: "Enter another profile name", value: "__manual__" },
8429
+ { name: "Use current environment credentials", value: "" }
8430
+ ],
8431
+ default: profiles.includes("default") ? "default" : profiles[0]
8432
+ },
8433
+ {
8434
+ type: "input",
8435
+ name: "profile",
8436
+ message: "AWS profile name:",
8437
+ when: (a) => a.selected_profile === "__manual__",
8438
+ validate: (v) => v.trim().length > 0 || "Profile is required"
8439
+ },
8440
+ {
8441
+ type: "input",
8442
+ name: "region",
8443
+ message: "AWS region:",
8444
+ default: detectedRegion
8445
+ }
8446
+ ]
8447
+ );
8417
8448
  const selectedProfile = answers2.selected_profile === "__manual__" ? answers2.profile.trim() : answers2.selected_profile;
8418
8449
  const identity2 = await verifySelectedAwsCredentials(selectedProfile, answers2.region);
8419
8450
  if (!identity2.Account) {
@@ -8431,20 +8462,26 @@ async function promptForAwsProfile(detectedRegion) {
8431
8462
  ...selectedProfile ? { profile: selectedProfile } : {}
8432
8463
  };
8433
8464
  }
8434
- const answers = await inquirer4.prompt([
8465
+ const answers = await promptOr(
8435
8466
  {
8436
- type: "input",
8437
- name: "account_id",
8438
- message: "AWS account ID (12 digits):",
8439
- validate: (v) => /^\d{12}$/.test(v) || "Must be 12 digits"
8467
+ question: "AWS account ID and region",
8468
+ remedy: "Set AWS_PROFILE and AWS_REGION for the target account, or run `aws configure`."
8440
8469
  },
8441
- {
8442
- type: "input",
8443
- name: "region",
8444
- message: "AWS region:",
8445
- default: detectedRegion
8446
- }
8447
- ]);
8470
+ [
8471
+ {
8472
+ type: "input",
8473
+ name: "account_id",
8474
+ message: "AWS account ID (12 digits):",
8475
+ validate: (v) => /^\d{12}$/.test(v) || "Must be 12 digits"
8476
+ },
8477
+ {
8478
+ type: "input",
8479
+ name: "region",
8480
+ message: "AWS region:",
8481
+ default: detectedRegion
8482
+ }
8483
+ ]
8484
+ );
8448
8485
  process.env["AWS_REGION"] = answers.region;
8449
8486
  process.env["AWS_DEFAULT_REGION"] = answers.region;
8450
8487
  const identity = await verifySelectedAwsCredentials("", answers.region);
@@ -9662,57 +9699,59 @@ function applyResolvedAwsCredentials(config, credentials) {
9662
9699
  };
9663
9700
  }
9664
9701
  async function promptForConfig(awsAccountId, awsRegion, awsProfile) {
9665
- assertInteractive(
9666
- "Project configuration",
9667
- "Pass --config <path> with a pre-filled biffo.config.json (it implies -y)."
9668
- );
9669
- const answers = await inquirer5.prompt([
9702
+ const answers = await promptOr(
9670
9703
  {
9671
- type: "input",
9672
- name: "project_name",
9673
- message: "Project name (lowercase kebab-case):",
9674
- validate: (v) => /^[a-z0-9-]+$/.test(v) || "Must be lowercase kebab-case"
9704
+ question: "Project configuration",
9705
+ remedy: "Pass --config <path> with a pre-filled biffo.config.json (it implies -y)."
9675
9706
  },
9676
- { type: "input", name: "project_description", message: "Project description:" },
9677
- {
9678
- type: "list",
9679
- name: "dns_mode",
9680
- message: "DNS / custom domain mode:",
9681
- choices: [
9682
- {
9683
- name: "Managed Route53 \u2014 create DNS zone, certificate, and records automatically",
9684
- value: "managed-route53"
9685
- },
9686
- {
9687
- name: "External DNS \u2014 request SSL certificate and print records for manual DNS changes",
9688
- value: "external"
9689
- },
9690
- {
9691
- name: "None \u2014 use the default CloudFront domain only",
9692
- value: "none"
9693
- }
9694
- ],
9695
- default: "managed-route53"
9696
- },
9697
- {
9698
- type: "input",
9699
- name: "domain",
9700
- message: "Primary domain (e.g. myapp.com):",
9701
- when: (a) => a.dns_mode !== "none",
9702
- validate: (v) => v.trim().length > 0 || "Domain is required for this DNS mode"
9703
- },
9704
- { type: "input", name: "github_org", message: "GitHub org or username:" },
9705
- { type: "input", name: "github_repo", message: "Repository name (will be created):" },
9706
- { type: "input", name: "admin_email", message: "Admin email address:" },
9707
- { type: "input", name: "admin_username", message: "Admin username:" },
9708
- {
9709
- type: "checkbox",
9710
- name: "environments",
9711
- message: "Environments to provision:",
9712
- choices: ["dev", "staging", "prod"],
9713
- default: ["dev"]
9714
- }
9715
- ]);
9707
+ [
9708
+ {
9709
+ type: "input",
9710
+ name: "project_name",
9711
+ message: "Project name (lowercase kebab-case):",
9712
+ validate: (v) => /^[a-z0-9-]+$/.test(v) || "Must be lowercase kebab-case"
9713
+ },
9714
+ { type: "input", name: "project_description", message: "Project description:" },
9715
+ {
9716
+ type: "list",
9717
+ name: "dns_mode",
9718
+ message: "DNS / custom domain mode:",
9719
+ choices: [
9720
+ {
9721
+ name: "Managed Route53 \u2014 create DNS zone, certificate, and records automatically",
9722
+ value: "managed-route53"
9723
+ },
9724
+ {
9725
+ name: "External DNS \u2014 request SSL certificate and print records for manual DNS changes",
9726
+ value: "external"
9727
+ },
9728
+ {
9729
+ name: "None \u2014 use the default CloudFront domain only",
9730
+ value: "none"
9731
+ }
9732
+ ],
9733
+ default: "managed-route53"
9734
+ },
9735
+ {
9736
+ type: "input",
9737
+ name: "domain",
9738
+ message: "Primary domain (e.g. myapp.com):",
9739
+ when: (a) => a.dns_mode !== "none",
9740
+ validate: (v) => v.trim().length > 0 || "Domain is required for this DNS mode"
9741
+ },
9742
+ { type: "input", name: "github_org", message: "GitHub org or username:" },
9743
+ { type: "input", name: "github_repo", message: "Repository name (will be created):" },
9744
+ { type: "input", name: "admin_email", message: "Admin email address:" },
9745
+ { type: "input", name: "admin_username", message: "Admin username:" },
9746
+ {
9747
+ type: "checkbox",
9748
+ name: "environments",
9749
+ message: "Environments to provision:",
9750
+ choices: ["dev", "staging", "prod"],
9751
+ default: ["dev"]
9752
+ }
9753
+ ]
9754
+ );
9716
9755
  return {
9717
9756
  project: {
9718
9757
  name: answers.project_name,
@@ -12004,7 +12043,6 @@ import { existsSync as existsSync41, readFileSync as readFileSync29, rmSync as r
12004
12043
  import { join as join43, resolve as resolve19 } from "path";
12005
12044
  import chalk18 from "chalk";
12006
12045
  import { Command as Command20 } from "commander";
12007
- import inquirer6 from "inquirer";
12008
12046
  var NAME_PATTERN2 = /^[a-z][a-z0-9-]*$/;
12009
12047
  var pluginUninstallCommand = new Command20("uninstall").description("Remove an installed plugin: biffo plugin uninstall <name>").argument("<name>", "Plugin name").option("--dry-run", "Print planned changes without modifying the repo").option("--force", "Skip the confirmation prompt").option(
12010
12048
  "--keep-data",
@@ -12197,14 +12235,11 @@ function readInstalledManifest(targetDir) {
12197
12235
  }
12198
12236
  async function confirmUninstall(name, version) {
12199
12237
  const label = version ? `${name}@${version}` : name;
12200
- const { confirmed } = await inquirer6.prompt([
12201
- {
12202
- type: "confirm",
12203
- name: "confirmed",
12204
- message: `Remove ${chalk18.bold(label)} from services/${name}/? This cannot be undone from the CLI.`,
12205
- default: false
12206
- }
12207
- ]);
12238
+ const message = `Remove ${chalk18.bold(label)} from services/${name}/? This cannot be undone from the CLI.`;
12239
+ const { confirmed } = await promptOr(
12240
+ { question: message, remedy: "Re-run with --force to confirm the uninstall." },
12241
+ [{ type: "confirm", name: "confirmed", message, default: false }]
12242
+ );
12208
12243
  return confirmed;
12209
12244
  }
12210
12245
  function printDryRun5(name, version, stagePaths, keepData, frontendCwd) {
@@ -12232,7 +12267,6 @@ import { cpSync as cpSync6, existsSync as existsSync42, mkdirSync as mkdirSync13
12232
12267
  import { join as join44, relative as relative7, resolve as resolve20 } from "path";
12233
12268
  import chalk19 from "chalk";
12234
12269
  import { Command as Command21 } from "commander";
12235
- import inquirer7 from "inquirer";
12236
12270
  import { parse as parseToml2 } from "smol-toml";
12237
12271
  var pluginUpgradeCommand = new Command21("upgrade").description(
12238
12272
  "Upgrade an installed plugin to a new minor version (biffo plugin upgrade <name>@<new-minor>) or refresh it in place from a local, unpublished checkout (biffo plugin upgrade --local <path>)"
@@ -12629,20 +12663,18 @@ function readInstalledVersion(targetDir) {
12629
12663
  }
12630
12664
  async function confirmUpgrade(name, currentVersion, newVersion) {
12631
12665
  const message = currentVersion ? `Upgrade ${chalk19.bold(name)} from ${currentVersion} to ${chalk19.bold(newVersion)}?` : `Upgrade ${chalk19.bold(name)} to ${chalk19.bold(newVersion)}?`;
12632
- const { confirmed } = await inquirer7.prompt([
12633
- { type: "confirm", name: "confirmed", message, default: false }
12634
- ]);
12666
+ const { confirmed } = await promptOr(
12667
+ { question: message, remedy: "Re-run with --force to confirm the upgrade." },
12668
+ [{ type: "confirm", name: "confirmed", message, default: false }]
12669
+ );
12635
12670
  return confirmed;
12636
12671
  }
12637
12672
  async function confirmRefresh(name, origin) {
12638
- const { confirmed } = await inquirer7.prompt([
12639
- {
12640
- type: "confirm",
12641
- name: "confirmed",
12642
- message: `Refresh ${chalk19.bold(name)} from ${origin}, replacing services/${name}/?`,
12643
- default: false
12644
- }
12645
- ]);
12673
+ const message = `Refresh ${chalk19.bold(name)} from ${origin}, replacing services/${name}/?`;
12674
+ const { confirmed } = await promptOr(
12675
+ { question: message, remedy: "Re-run with --force to confirm the refresh." },
12676
+ [{ type: "confirm", name: "confirmed", message, default: false }]
12677
+ );
12646
12678
  return confirmed;
12647
12679
  }
12648
12680
  function printDryRun6(entry, currentVersion) {
@@ -19028,7 +19060,6 @@ import { execSync as execSync7 } from "child_process";
19028
19060
  import { GetCallerIdentityCommand as GetCallerIdentityCommand3, STSClient as STSClient3 } from "@aws-sdk/client-sts";
19029
19061
  import chalk22 from "chalk";
19030
19062
  import { Command as Command28 } from "commander";
19031
- import inquirer8 from "inquirer";
19032
19063
  var teardownCommand = new Command28("teardown").description(
19033
19064
  "Destroy all infrastructure then remove the repo, IAM role, and state bucket \u2014 single command"
19034
19065
  ).option("--project <name>", "Project name to tear down (reads session if omitted)").option("--skip-destroy", "Skip terraform destroy (only use if infrastructure is already gone)").option(
@@ -19409,19 +19440,19 @@ async function confirmTeardown(projectName, options) {
19409
19440
  log.warn(`Skipping typed confirmation for ${projectName} \u2014 --yes was passed`);
19410
19441
  return true;
19411
19442
  }
19412
- if (isNonInteractive()) {
19413
- throw new NonInteractiveError(
19414
- `Refusing to prompt for the teardown confirmation of "${projectName}" \u2014 --non-interactive is set.
19415
- Pass --confirm ${projectName} to confirm, or --yes to skip the check.`
19416
- );
19417
- }
19418
- const { confirm } = await inquirer8.prompt([
19443
+ const { confirm } = await promptOr(
19419
19444
  {
19420
- type: "input",
19421
- name: "confirm",
19422
- message: `Type ${chalk22.bold(projectName)} to confirm:`
19423
- }
19424
- ]);
19445
+ question: `the teardown confirmation of ${projectName}`,
19446
+ remedy: `Pass --confirm ${projectName} to confirm, or --yes to skip the check.`
19447
+ },
19448
+ [
19449
+ {
19450
+ type: "input",
19451
+ name: "confirm",
19452
+ message: `Type ${chalk22.bold(projectName)} to confirm:`
19453
+ }
19454
+ ]
19455
+ );
19425
19456
  return confirm === projectName;
19426
19457
  }
19427
19458
  function resolveGithubToken4() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.396.0",
3
+ "version": "0.396.2",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",