@mutmutco/cli 3.107.2 → 3.107.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/main.cjs +19 -7
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -22495,7 +22495,7 @@ async function runHotfixStart(deps, options) {
22495
22495
  if (!sources.some((s) => s.sha === resolved.sha)) sources.push(resolved);
22496
22496
  }
22497
22497
  const label = sources.map((s) => s.label).join(", ");
22498
- const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
22498
+ const foldPaths = await resolveFoldPaths(deps, deployModel);
22499
22499
  const pickTolerated = deployModel === "hub-serverless" || deployModel === "registry-publish" ? [...foldPaths, ...HOTFIX_SKILL_TOLERATED_ROOTS] : foldPaths;
22500
22500
  if (deployModel === "hub-serverless") {
22501
22501
  await deps.run("node", ["scripts/release-distribution.mjs", "verify-deps"]);
@@ -22539,15 +22539,15 @@ async function runHotfixStart(deps, options) {
22539
22539
  } else {
22540
22540
  notes.push("distribution prepare produced no changes \u2014 nothing extra committed");
22541
22541
  }
22542
- } else if (deployModel === "registry-publish" && foldPaths.length > 0) {
22542
+ } else if (foldPaths.length > 0) {
22543
22543
  const foldNote = await foldReleaseVersion(deps, deployModel, tag, foldPaths);
22544
22544
  notes.push(foldNote);
22545
22545
  } else {
22546
- notes.push(`distribution bump skipped (deployModel=${deployModel})`);
22546
+ notes.push(`version fold skipped (deployModel=${deployModel} carries no version manifest \u2014 the tag is the version)`);
22547
22547
  }
22548
22548
  await deps.run("git", ["push", "-u", "origin", branch]);
22549
22549
  }
22550
- const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : deployModel === "registry-publish" ? " with the package version bump" : "";
22550
+ const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : foldPaths.length > 0 ? " with the package version bump" : "";
22551
22551
  const prUrl = clean3(await deps.run("gh", [
22552
22552
  "pr",
22553
22553
  "create",
@@ -22610,6 +22610,15 @@ async function watchReleaseRun(deps, ctx, workflow, sha) {
22610
22610
  function devFoldBranch(tag) {
22611
22611
  return `hotfix-fold/${tag}`;
22612
22612
  }
22613
+ function devFoldScratchBranch(tag, deps) {
22614
+ return `${devFoldBranch(tag)}--port-${(deps.now ?? Date.now)().toString(36)}`;
22615
+ }
22616
+ async function reapFoldScratchBranches(deps) {
22617
+ const listed = await deps.run("git", ["branch", "--list", "hotfix-fold/*--port-*", "--format=%(refname:short)"]).catch(() => "");
22618
+ for (const name of listed.split("\n").map((s) => s.trim()).filter(Boolean)) {
22619
+ await deps.run("git", ["branch", "-D", name]).catch(() => void 0);
22620
+ }
22621
+ }
22613
22622
  async function portFoldToDevelopment(deps, ctx, deployModel, tag) {
22614
22623
  const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
22615
22624
  if (foldPaths.length === 0) return `fold port skipped (deployModel=${deployModel} folds no version manifest)`;
@@ -22633,14 +22642,16 @@ async function portFoldToDevelopment(deps, ctx, deployModel, tag) {
22633
22642
  const existing = JSON.parse(listed || "[]").filter((r) => r.state === "OPEN" || r.state === "MERGED").sort((a, b) => (b.number ?? 0) - (a.number ?? 0))[0];
22634
22643
  if (existing) return `development fold PR #${existing.number} for ${tag} is ${existing.state} \u2014 reused`;
22635
22644
  const previousRef = clean3(await deps.run("git", ["rev-parse", "--abbrev-ref", "HEAD"]));
22645
+ await reapFoldScratchBranches(deps);
22646
+ const scratch = devFoldScratchBranch(tag, deps);
22636
22647
  try {
22637
22648
  await deps.run("git", ["fetch", "origin", "development"]);
22638
- await deps.run("git", ["checkout", "-B", branch, "origin/development"]);
22649
+ await deps.run("git", ["checkout", "-B", scratch, "origin/development"]);
22639
22650
  const durableSource = clean3(await deps.run("git", ["merge-base", "HEAD", "origin/development"]));
22640
22651
  const foldNote = await foldReleaseVersion(deps, deployModel, tag, foldPaths, durableSource, false);
22641
22652
  const committed = clean3(await deps.run("git", ["rev-list", "--count", "origin/development..HEAD"]));
22642
22653
  if (committed === "0") return `development already carries ${tag} \u2014 no fold PR needed (${foldNote})`;
22643
- await deps.run("git", ["push", "-u", "origin", branch]);
22654
+ await deps.run("git", ["push", "origin", `${scratch}:refs/heads/${branch}`]);
22644
22655
  const prUrl = clean3(await deps.run("gh", [
22645
22656
  "pr",
22646
22657
  "create",
@@ -22660,6 +22671,7 @@ Generated by \`mmi-cli hotfix release\` \u2014 no main-parented commit is merged
22660
22671
  return `opened development fold PR ${prUrl} (${foldNote})`;
22661
22672
  } finally {
22662
22673
  if (previousRef && previousRef !== "HEAD") await deps.run("git", ["checkout", previousRef]).catch(() => void 0);
22674
+ await deps.run("git", ["branch", "-D", scratch]).catch(() => void 0);
22663
22675
  }
22664
22676
  }
22665
22677
  async function runHotfixRelease(deps, versionInput, options = {}) {
@@ -22791,7 +22803,7 @@ async function runHotfixRelease(deps, versionInput, options = {}) {
22791
22803
  try {
22792
22804
  foldNote = await portFoldToDevelopment(deps, ctx, deployModel, tag);
22793
22805
  } catch (e) {
22794
- foldNote = `development fold port FAILED: ${e.message ?? e} \u2014 the release stands; port it by hand: git checkout -B ${devFoldBranch(tag)} origin/development && node scripts/release-distribution.mjs prepare ${version}, then open a development-base PR`;
22806
+ foldNote = `development fold port FAILED: ${e.message ?? e} \u2014 the release stands; port it by hand on a fresh branch: git checkout -B ${devFoldBranch(tag)}-manual origin/development && node scripts/release-distribution.mjs prepare ${version}, then push it as the canonical head (git push origin ${devFoldBranch(tag)}-manual:refs/heads/${devFoldBranch(tag)}) and open a development-base PR`;
22795
22807
  }
22796
22808
  return {
22797
22809
  ...ctx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "3.107.2",
3
+ "version": "3.107.3",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",