fix(cli): ship registry manifest and pi-llama-cpp extension in npm package

Tarball-completeness audit found two more assets stripped from the
published package: dist/pi-llama-cpp (staged by tsup, matched no files
glob — useLlamaCpp silently reported not-installed) and the dashboard's
registry-manifest.json (resolved beside the bundled bin.js by
plugin-routes but never staged into cli dist — published installs served
an empty plugin registry). Stage the manifest in tsup onSuccess and add
both to files; npm pack --dry-run now lists them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-07-17 18:30:00 -07:00
parent 4970465364
commit c831ccb366
3 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
---
"@runfusion/fusion": patch
---
summary: Ship the plugin registry manifest and llama.cpp extension in the published npm package.
category: fix
dev: "Tarball-completeness audit follow-ups to the migrations fix: (1) dist/pi-llama-cpp was staged by tsup but matched no files glob, so useLlamaCpp silently reported not-installed in every published build — added dist/pi-llama-cpp/** to files. (2) dashboard plugin-routes resolves ./registry-manifest.json beside the bundled bin.js but it was never staged into the CLI dist, so published installs served an empty plugin registry — tsup now stages it from packages/dashboard/src and files includes dist/registry-manifest.json."

View File

@@ -34,9 +34,11 @@
"dist/**/*.d.ts.map",
"dist/**/*.js.map",
"dist/migrations/**",
"dist/registry-manifest.json",
"dist/client/**",
"dist/desktop/**",
"dist/pi-claude-cli/**",
"dist/pi-llama-cpp/**",
"dist/droid-cli/**",
"dist/plugins/**",
"skill/**",

View File

@@ -424,6 +424,22 @@ const cliBuildConfig = {
);
}
/*
FNXC:CliPackaging 2026-07-17-19:55:
The dashboard's plugin-registry route resolves ./registry-manifest.json next to the
bundled server (new URL relative to import.meta.url in plugin-routes.ts), i.e.
dist/registry-manifest.json beside bin.js after bundling. It was never staged into
the CLI dist, so every published install served an empty plugin registry with a
warning. Stage it from the dashboard source of truth in both fast and full modes.
*/
const registryManifestSrc = join(__dirname, "..", "dashboard", "src", "registry-manifest.json");
if (existsSync(registryManifestSrc)) {
cpSync(registryManifestSrc, join(__dirname, "dist", "registry-manifest.json"));
console.log("Copied registry-manifest.json to dist/");
} else {
console.warn(`WARNING: registry manifest not found at ${registryManifestSrc}; plugin registry will be empty.`);
}
/*
FNXC:CliPackaging 2026-07-15-03:25:
Fast local packaging: migrations + optional dashboard client copy only. Skip desktop ensure-build, multi-plugin esbuild staging, and assertAllStagedBundledPluginsLoadable — those dominate CPU/wall time and are only needed for published artifacts. Prior staged dist/plugins/desktop is left in place if present so a previous full build remains usable.