@mutmutco/cli 3.105.4 → 3.105.5
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/main.cjs +56 -4
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -20341,6 +20341,51 @@ async function deriveHotfixVersion(deps) {
|
|
|
20341
20341
|
function hotfixBranch(tag) {
|
|
20342
20342
|
return `hotfix/${tag}`;
|
|
20343
20343
|
}
|
|
20344
|
+
function pathIsTolerated(path2, tolerated) {
|
|
20345
|
+
return tolerated.some((entry) => {
|
|
20346
|
+
if (!entry) return false;
|
|
20347
|
+
if (path2 === entry) return true;
|
|
20348
|
+
const root = entry.endsWith("/") ? entry : `${entry}/`;
|
|
20349
|
+
return path2.startsWith(root);
|
|
20350
|
+
});
|
|
20351
|
+
}
|
|
20352
|
+
var HOTFIX_SKILL_TOLERATED_ROOTS = ["skills", ".kilo-plugin/skills"];
|
|
20353
|
+
async function cherryPickWithToleratedPaths(deps, sha, tolerated) {
|
|
20354
|
+
try {
|
|
20355
|
+
await deps.run("git", ["cherry-pick", "-x", sha]);
|
|
20356
|
+
return [];
|
|
20357
|
+
} catch (original) {
|
|
20358
|
+
const unmerged = (await deps.run("git", ["diff", "--name-only", "--diff-filter=U"])).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
20359
|
+
const blocking = unmerged.filter((f) => !pathIsTolerated(f, tolerated));
|
|
20360
|
+
if (unmerged.length === 0 || blocking.length > 0) {
|
|
20361
|
+
try {
|
|
20362
|
+
await deps.run("git", ["cherry-pick", "--abort"]);
|
|
20363
|
+
} catch {
|
|
20364
|
+
}
|
|
20365
|
+
const detail = original.message ?? String(original);
|
|
20366
|
+
if (unmerged.length === 0) {
|
|
20367
|
+
throw new Error(`cherry-pick of ${sha.slice(0, 7)} failed without conflicted paths \u2014 ${detail}`);
|
|
20368
|
+
}
|
|
20369
|
+
throw new Error(
|
|
20370
|
+
`cherry-pick of ${sha.slice(0, 7)} conflicted on untolerated path(s): ${blocking.join(", ")}` + (tolerated.length > 0 ? ` (regenerable paths are auto-resolved: ${tolerated.join(", ")})` : "") + ` \u2014 ${detail}`
|
|
20371
|
+
);
|
|
20372
|
+
}
|
|
20373
|
+
await deps.run("git", ["checkout", "--theirs", "--", ...unmerged]);
|
|
20374
|
+
await deps.run("git", ["add", "--", ...unmerged]);
|
|
20375
|
+
try {
|
|
20376
|
+
await deps.run("git", ["-c", "core.editor=true", "cherry-pick", "--continue"]);
|
|
20377
|
+
} catch (contErr) {
|
|
20378
|
+
try {
|
|
20379
|
+
await deps.run("git", ["cherry-pick", "--abort"]);
|
|
20380
|
+
} catch {
|
|
20381
|
+
}
|
|
20382
|
+
throw new Error(
|
|
20383
|
+
`cherry-pick continue after regenerable-path resolve failed for ${unmerged.join(", ")} \u2014 ${contErr.message ?? contErr}`
|
|
20384
|
+
);
|
|
20385
|
+
}
|
|
20386
|
+
return unmerged;
|
|
20387
|
+
}
|
|
20388
|
+
}
|
|
20344
20389
|
async function restoreAfterFailedPort(deps, opts) {
|
|
20345
20390
|
const { startBranch, branch, created } = opts;
|
|
20346
20391
|
if (!startBranch || startBranch === "HEAD" || startBranch === branch) {
|
|
@@ -20472,6 +20517,8 @@ async function runHotfixStart(deps, options) {
|
|
|
20472
20517
|
}
|
|
20473
20518
|
}
|
|
20474
20519
|
const { sha, label } = await resolveHotfixSource(deps, ctx, options.from);
|
|
20520
|
+
const foldPaths = deployModel === "hub-serverless" || deployModel === "registry-publish" ? await resolveFoldPaths(deps, deployModel) : [];
|
|
20521
|
+
const pickTolerated = deployModel === "hub-serverless" ? [...foldPaths, ...HOTFIX_SKILL_TOLERATED_ROOTS] : foldPaths;
|
|
20475
20522
|
if (deployModel === "hub-serverless") {
|
|
20476
20523
|
await deps.run("node", ["scripts/release-distribution.mjs", "verify-deps"]);
|
|
20477
20524
|
}
|
|
@@ -20485,9 +20532,11 @@ async function runHotfixStart(deps, options) {
|
|
|
20485
20532
|
const preexistingLocal = clean3(await deps.run("git", ["branch", "--list", branch]));
|
|
20486
20533
|
await deps.run("git", ["checkout", "-B", branch, "origin/main"]);
|
|
20487
20534
|
try {
|
|
20488
|
-
await deps
|
|
20535
|
+
const autoResolved = await cherryPickWithToleratedPaths(deps, sha, pickTolerated);
|
|
20536
|
+
if (autoResolved.length > 0) {
|
|
20537
|
+
notes.push(`auto-resolved regenerable cherry-pick conflict(s): ${autoResolved.join(", ")} (regenerated in bump step)`);
|
|
20538
|
+
}
|
|
20489
20539
|
} catch (e) {
|
|
20490
|
-
await deps.run("git", ["cherry-pick", "--abort"]);
|
|
20491
20540
|
const recovery = await restoreAfterFailedPort(deps, { startBranch, branch, created: !preexistingLocal });
|
|
20492
20541
|
throw new Error(
|
|
20493
20542
|
`cherry-pick of ${label} onto ${branch} conflicted \u2014 aborted; nothing was pushed. Land the conflict resolution on development through a normal PR, then rerun \`mmi-cli hotfix start --from <that PR's merge sha>\` \u2014 never hand-resolve the port onto main. ${recovery} (${e.message ?? e})`
|
|
@@ -20506,12 +20555,15 @@ async function runHotfixStart(deps, options) {
|
|
|
20506
20555
|
} else {
|
|
20507
20556
|
notes.push("distribution prepare produced no changes \u2014 nothing extra committed");
|
|
20508
20557
|
}
|
|
20558
|
+
} else if (deployModel === "registry-publish" && foldPaths.length > 0) {
|
|
20559
|
+
const foldNote = await foldReleaseVersion(deps, deployModel, tag, foldPaths);
|
|
20560
|
+
notes.push(foldNote);
|
|
20509
20561
|
} else {
|
|
20510
|
-
notes.push(`distribution bump skipped (deployModel=${deployModel}
|
|
20562
|
+
notes.push(`distribution bump skipped (deployModel=${deployModel})`);
|
|
20511
20563
|
}
|
|
20512
20564
|
await deps.run("git", ["push", "-u", "origin", branch]);
|
|
20513
20565
|
}
|
|
20514
|
-
const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : "";
|
|
20566
|
+
const bumpNote = deployModel === "hub-serverless" ? " with the locked distribution bump" : deployModel === "registry-publish" ? " with the package version bump" : "";
|
|
20515
20567
|
const prUrl = clean3(await deps.run("gh", [
|
|
20516
20568
|
"pr",
|
|
20517
20569
|
"create",
|
package/package.json
CHANGED