@theholocron/cli 4.7.0 → 4.9.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.
package/dist/cli.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
4
4
  import path, { basename, dirname, join, relative, resolve } from "node:path";
5
5
  import { checkbox, input, select } from "@inquirer/prompts";
6
- import { KNOWN_WORKFLOWS, WORKFLOW_CHECK_CONTEXTS, WORKFLOW_TEMPLATES, createAstromech, deriveDeployPaths, extractPreviewConfig, generateCombinedDeployContent, generateThinCallerContent, lintThinCallerWith, normalizeWorkflowWith } from "@theholocron/astromech";
6
+ import { KNOWN_WORKFLOWS, WORKFLOW_TEMPLATES, createAstromech, deriveDeployPaths, extractPreviewConfig, generateCombinedDeployContent, generateThinCallerContent, lintThinCallerWith, normalizeWorkflowWith } from "@theholocron/astromech";
7
7
  import { loadTasksConfig } from "@theholocron/astromech/config";
8
8
  import yargs from "yargs";
9
9
  import { hideBin } from "yargs/helpers";
@@ -4352,15 +4352,12 @@ async function runSetup(input) {
4352
4352
  await source.updateRepoSettings(BALANCED_REPO_SETTINGS);
4353
4353
  }));
4354
4354
  print(formatStep(steps[steps.length - 1]));
4355
- const configuredWorkflowNames = [...new Set((config.tasks ?? []).map((entry) => typeof entry === "string" ? entry : entry.name))];
4356
- const requiredChecks = effectivePreset === "strict" ? [
4357
- "DCO",
4358
- ...configuredWorkflowNames.flatMap((name) => {
4359
- const ctx = WORKFLOW_CHECK_CONTEXTS[name];
4360
- return ctx ? [ctx] : [];
4361
- }),
4362
- ...repo?.requiredChecks ?? []
4363
- ] : [];
4355
+ const tasksConfig = { tasks: config.tasks };
4356
+ if (config.extraRequiredChecks) tasksConfig.extraRequiredChecks = config.extraRequiredChecks;
4357
+ const requiredChecks = effectivePreset === "strict" ? ["DCO", ...createAstromech({
4358
+ cwd: input.context.repoRoot,
4359
+ config: tasksConfig
4360
+ }).requiredChecks()] : [];
4364
4361
  steps.push(await upsertBranchProtection(source, dryRun, requiredChecks));
4365
4362
  print(formatStep(steps[steps.length - 1]));
4366
4363
  }
@@ -7066,6 +7063,9 @@ try {
7066
7063
  type: "boolean",
7067
7064
  default: false,
7068
7065
  describe: "Fail (exit 1) if this repo has no such task, instead of skipping."
7066
+ }).option("filter", {
7067
+ type: "string",
7068
+ describe: "turbo --filter=<pkg> passthrough (monorepo)."
7069
7069
  }), async (argv) => {
7070
7070
  const { logger } = buildCliLogger(argv, { command: "run" });
7071
7071
  const config = await loadTasksConfig(argv.cwd).catch(() => void 0);
@@ -7076,9 +7076,29 @@ try {
7076
7076
  }).run(argv.task, {
7077
7077
  passthrough: argv.passthrough ?? [],
7078
7078
  dryRun: argv.dryRun,
7079
- required: argv.required
7079
+ required: argv.required,
7080
+ ...argv.filter ? { filter: argv.filter } : {}
7080
7081
  });
7081
7082
  if (report.status === "fail" || report.status === "unknown") process.exitCode = 1;
7083
+ }).command("ci", "Run the merge-gating checks locally, in CI order — 'will CI pass?'", (y) => y.option("all", {
7084
+ type: "boolean",
7085
+ default: false,
7086
+ describe: "Run every `ci: true` task, not just the required ones."
7087
+ }).option("filter", {
7088
+ type: "string",
7089
+ describe: "turbo --filter=<pkg> passthrough (monorepo)."
7090
+ }), async (argv) => {
7091
+ const { logger } = buildCliLogger(argv, { command: "ci" });
7092
+ const config = await loadTasksConfig(argv.cwd).catch(() => void 0);
7093
+ if (createAstromech({
7094
+ cwd: argv.cwd,
7095
+ logger,
7096
+ config
7097
+ }).ci({
7098
+ dryRun: argv.dryRun,
7099
+ scope: argv.all ? "all" : "required",
7100
+ ...argv.filter ? { filter: argv.filter } : {}
7101
+ }).status === "fail") process.exitCode = 1;
7082
7102
  }).command("sync-github", "Sync workflow templates and composite actions to theholocron/.github", (y) => y.option("repo", {
7083
7103
  type: "string",
7084
7104
  default: "theholocron/.github",