fix(FN-2897): harden npm bundle packaging and merge recovery flows
- Strip private @fusion/* workspace devDependencies from the published CLI manifest via prepare-publish-manifest and package metadata updates - Replace cross-spawn usage and add staged bundle layout assertions to verify resolver output in dist packaging - Add per-task/project model override resolution across core, dashboard settings/task modals, and route coverage with new regression tests - Strengthen engine merge/recovery handling for paused/interrupted/squash paths and surface merger timeline activity with additional self-healing and merger tests - Add changesets for npm bundle dependency fixes, project model override stabilization, and FTS5 corruption recovery Fusion-Task-Id: FN-2897
This commit is contained in:
42
packages/cli/scripts/prepare-publish-manifest.mjs
Normal file
42
packages/cli/scripts/prepare-publish-manifest.mjs
Normal file
@@ -0,0 +1,42 @@
|
||||
/* global process, URL, console */
|
||||
|
||||
import { existsSync, readFileSync, writeFileSync, unlinkSync } from "node:fs";
|
||||
|
||||
const mode = process.argv[2];
|
||||
const packageJsonPath = new URL("../package.json", import.meta.url);
|
||||
const backupPath = new URL("../package.json.pack-backup", import.meta.url);
|
||||
|
||||
if (mode === "prepack") {
|
||||
if (existsSync(backupPath)) {
|
||||
// Clean up stale backup from interrupted runs.
|
||||
unlinkSync(backupPath);
|
||||
}
|
||||
|
||||
const original = readFileSync(packageJsonPath, "utf8");
|
||||
writeFileSync(backupPath, original, "utf8");
|
||||
|
||||
const pkg = JSON.parse(original);
|
||||
const devDependencies = { ...(pkg.devDependencies || {}) };
|
||||
delete devDependencies["@fusion/core"];
|
||||
delete devDependencies["@fusion/dashboard"];
|
||||
delete devDependencies["@fusion/engine"];
|
||||
delete devDependencies["@fusion/pi-claude-cli"];
|
||||
|
||||
pkg.devDependencies = devDependencies;
|
||||
writeFileSync(packageJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (mode === "postpack") {
|
||||
if (!existsSync(backupPath)) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const backup = readFileSync(backupPath, "utf8");
|
||||
writeFileSync(packageJsonPath, backup, "utf8");
|
||||
unlinkSync(backupPath);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
console.error("Usage: node ./scripts/prepare-publish-manifest.mjs <prepack|postpack>");
|
||||
process.exit(1);
|
||||
Reference in New Issue
Block a user