Use a committed launcher for published CLI bin links to avoid fresh-install warnings. - point the published fn and fusion bin entries at a committed bin.mjs launcher - add a launcher that checks for dist/bin.js and forwards execution to the built CLI - cover bin target invariants across workspace packages and update CLI package config tests - add a patch changeset for the published @runfusion/fusion package Files changed: .changeset/fn-5916-cli-bin-launcher.md | 5 ++ packages/cli/bin.mjs | 20 ++++++ packages/cli/package.json | 5 +- packages/cli/src/__tests__/bin-targets.test.ts | 85 +++++++++++++++++++++++ packages/cli/src/__tests__/package-config.test.ts | 8 ++- 5 files changed, 118 insertions(+), 5 deletions(-) Fusion-Task-Id: FN-5916 Fusion-Task-Lineage: 59d40654-ff77-4655-b9ce-3f3421521b2c
21 lines
609 B
JavaScript
Executable File
21 lines
609 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import { constants } from "node:fs";
|
|
import { access } from "node:fs/promises";
|
|
import { dirname, resolve } from "node:path";
|
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
|
const packageDir = dirname(fileURLToPath(import.meta.url));
|
|
const distEntry = resolve(packageDir, "dist", "bin.js");
|
|
|
|
try {
|
|
await access(distEntry, constants.F_OK);
|
|
} catch {
|
|
globalThis.console.error(
|
|
`Fusion CLI build output is missing at ${distEntry}. Run \`pnpm build\` before invoking this source checkout.`,
|
|
);
|
|
globalThis.process.exit(1);
|
|
}
|
|
|
|
await import(pathToFileURL(distEntry).href);
|