@biffo/cli 0.211.2 → 0.211.4

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 +26 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3389,8 +3389,9 @@ async function buildCommitAndOpenPr(options, deps, plan, migrations, fromVersion
3389
3389
  `Applied ${applied.written.length} change(s), ${applied.deleted.length + (cleanedCoreVersion ? 1 : 0)} deletion(s), ${carried.length} new migration(s)`
3390
3390
  );
3391
3391
  const lockfiles = await refreshInstanceLockfiles(options.cwd, applied, deps);
3392
+ const carriedPrs = readCarriedPrs(options.templateRepo, fromVersion, toVersion);
3392
3393
  await git.add(options.cwd, ["-A"]);
3393
- await git.commit(options.cwd, `chore(core): upgrade template core ${fromVersion} -> ${toVersion}`);
3394
+ await git.commit(options.cwd, buildCommitMessage(fromVersion, toVersion, carriedPrs));
3394
3395
  log.step(3, 4, `Pushing ${branch}`);
3395
3396
  const pushOpts = { token };
3396
3397
  if (options.remote) pushOpts.remote = options.remote;
@@ -3415,7 +3416,7 @@ async function buildCommitAndOpenPr(options, deps, plan, migrations, fromVersion
3415
3416
  lockfiles,
3416
3417
  breaking,
3417
3418
  cleanedCoreVersion ? coreVersionCleanup : null,
3418
- readCarriedPrs(options.templateRepo, fromVersion, toVersion)
3419
+ carriedPrs
3419
3420
  )
3420
3421
  });
3421
3422
  if (plan.conflicts.length > 0) {
@@ -3443,6 +3444,11 @@ function carriedPrsSection(carriedPrs) {
3443
3444
  const unique = [...new Set(carriedPrs)].sort((a, b) => a - b);
3444
3445
  return ["", `<!-- ${CARRIED_PRS_MARKER}${unique.join(",")} -->`];
3445
3446
  }
3447
+ function buildCommitMessage(from, to, carriedPrs) {
3448
+ const subject = `chore(core): upgrade template core ${from} -> ${to}`;
3449
+ const marker = carriedPrsSection(carriedPrs);
3450
+ return marker.length === 0 ? subject : [subject, ...marker].join("\n");
3451
+ }
3446
3452
  function carriedPrNumbers(subjects) {
3447
3453
  const numbers = [];
3448
3454
  for (const subject of subjects) {
@@ -4978,6 +4984,7 @@ function formatWiringResult(environment, result) {
4978
4984
  // src/commands/deploy.ts
4979
4985
  var deployCommand = new Command9("deploy").description("Deploy infrastructure and application to an environment").argument("<environment>", "Target environment: dev | staging | prod").option("--infra-only", "Deploy infrastructure only, skip application build").option("--app-only", "Deploy application only, skip Terraform").option("-p, --project <name>", "Project name (overrides biffo.config.json in current directory)").option("-c, --config <path>", "Path to biffo.config.json").option("-y, --yes", "Skip deployment target confirmation").action(
4980
4986
  async (environment, options) => {
4987
+ process.exitCode = 1;
4981
4988
  const validEnvs = ["dev", "staging", "prod"];
4982
4989
  if (!validEnvs.includes(environment)) {
4983
4990
  log.error(`Unknown environment: ${environment}. Must be one of: ${validEnvs.join(", ")}`);
@@ -4989,12 +4996,14 @@ var deployCommand = new Command9("deploy").description("Deploy infrastructure an
4989
4996
  `));
4990
4997
  if (!options.yes && !await confirmDeployTarget(config, environment)) {
4991
4998
  log.warn("Deploy cancelled");
4999
+ process.exitCode = 0;
4992
5000
  return;
4993
5001
  }
4994
5002
  const token = resolveGithubToken();
4995
5003
  const github = new GitHubAdapter(token);
4996
5004
  const aws = new AwsAdapter(config);
4997
5005
  await runDeploy(github, aws, config, environment, { ...options, token });
5006
+ process.exitCode = 0;
4998
5007
  }
4999
5008
  );
5000
5009
  async function resolveConfig2(options) {
@@ -5056,17 +5065,28 @@ function describeProject(config) {
5056
5065
  const { org, repo } = config.source_control.config;
5057
5066
  return `${config.project.name} (${org}/${repo})`;
5058
5067
  }
5059
- async function chooseProject(projects) {
5068
+ async function chooseProject(projects, isTTY = Boolean(process.stdin.isTTY)) {
5069
+ const question = "Which project do you want to deploy?";
5070
+ const remedy = "Pass --project <name> to choose one. Available:\n" + projects.map((p) => ` ${describeProject(p)}`).join("\n");
5071
+ if (isNonInteractive()) {
5072
+ throw new NonInteractiveError(nonInteractiveMessage(question, remedy));
5073
+ }
5074
+ if (!isTTY) {
5075
+ throw new NonInteractiveError(
5076
+ `Refusing to prompt for "${question}" \u2014 no interactive terminal is attached.
5077
+ ${remedy}`
5078
+ );
5079
+ }
5060
5080
  const { chosen } = await promptOr(
5061
5081
  {
5062
- question: "Which project do you want to deploy?",
5063
- remedy: "Pass --project <name> to choose one. Available:\n" + projects.map((p) => ` ${describeProject(p)}`).join("\n")
5082
+ question,
5083
+ remedy
5064
5084
  },
5065
5085
  [
5066
5086
  {
5067
5087
  type: "list",
5068
5088
  name: "chosen",
5069
- message: "Which project do you want to deploy?",
5089
+ message: question,
5070
5090
  choices: projects.map((p) => ({ name: describeProject(p), value: p.project.name }))
5071
5091
  }
5072
5092
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biffo/cli",
3
- "version": "0.211.2",
3
+ "version": "0.211.4",
4
4
  "description": "Biffo project scaffolding CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",