@theholocron/cli 4.16.1 → 4.16.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.
package/dist/cli.mjs CHANGED
@@ -6350,7 +6350,7 @@ async function bumpCatalogs(content, fetchLatest) {
6350
6350
  }
6351
6351
  /** True if the file still uses the 7.x preset shape. */
6352
6352
  function isLegacyConfig(content) {
6353
- return /const\s*\{[^}]*\b(repo|workflows|providers)\b[^}]*\}\s*=\s*(compose\(|[a-zA-Z]+\(\))/.test(content) || /\.\.\.repo\.requiredChecks/.test(content) || /^\s*workflows\s*:/m.test(content);
6353
+ return /\.\.\.repo\.requiredChecks/.test(content) || /^\s*workflows\s*:/m.test(content) || /const\s*\{[^}]*\bworkflows\b[^}]*\}\s*=\s*(compose\(|[a-zA-Z]+\()/.test(content);
6354
6354
  }
6355
6355
  /**
6356
6356
  * Apply the mechanical 7.x → 8.x transforms to a `holocron.config.ts`. Best
@@ -6366,10 +6366,20 @@ function migrateConfig(content) {
6366
6366
  transforms,
6367
6367
  warnings
6368
6368
  };
6369
- s = s.replace(/const\s*\{[^}]*\}\s*=\s*((?:compose\([\s\S]*?\)|[a-zA-Z]+\([\s\S]*?\)))\s*;/, (_m, expr) => {
6369
+ let destructured = [];
6370
+ s = s.replace(/const\s*\{([^}]*)\}\s*=\s*((?:compose\([\s\S]*?\)|[a-zA-Z]+\([\s\S]*?\)))\s*;/, (_m, names, expr) => {
6371
+ destructured = names.split(",").map((n) => n.trim().split(":")[0].trim()).filter(Boolean);
6370
6372
  transforms.push("destructured preset → `const preset = …`");
6371
6373
  return `const preset = ${expr.trim()};`;
6372
6374
  });
6375
+ for (const name of destructured) {
6376
+ if (name === "repo" || name === "providers" || name === "workflows") continue;
6377
+ const bare = new RegExp(`\\.\\.\\.${name}\\b(?!\\.)`, "g");
6378
+ if (bare.test(s)) {
6379
+ s = s.replace(bare, `...preset.${name}`);
6380
+ transforms.push(`\`...${name}\` → \`...preset.${name}\``);
6381
+ }
6382
+ }
6373
6383
  if (/const preset =/.test(s) && !/\.\.\.preset\b/.test(s)) {
6374
6384
  s = s.replace(/(defineConfig\(\{\s*\n)/, `$1\t...preset,\n`);
6375
6385
  transforms.push("spread `...preset` into defineConfig()");
@@ -6925,7 +6935,7 @@ init(CLI_VERSION);
6925
6935
  const updateCheckPromise = checkForUpdates(CLI_VERSION);
6926
6936
  let finishCommand = () => {};
6927
6937
  try {
6928
- await yargs(hideBin(process.argv)).scriptName("").usage("holocron <command> [options]").option("dry-run", {
6938
+ await yargs(hideBin(process.argv)).scriptName("").usage("holocron <command> [options]").parserConfiguration({ "populate--": true }).option("dry-run", {
6929
6939
  type: "boolean",
6930
6940
  default: false,
6931
6941
  describe: "Print what would be mutated without calling capability mutators. Commands branch on this; read-only commands ignore it."
@@ -7255,7 +7265,7 @@ try {
7255
7265
  config
7256
7266
  }).run(argv.task, {
7257
7267
  ...argv.job !== void 0 ? { job: argv.job } : {},
7258
- passthrough: argv.passthrough ?? [],
7268
+ passthrough: [...argv.passthrough ?? [], ...argv["--"] ?? []],
7259
7269
  dryRun: argv.dryRun,
7260
7270
  required: argv.required,
7261
7271
  ...argv.filter ? { filter: argv.filter } : {}