FN-8978: fix CLI TypeScript external packaging
Keep TypeScript available as a runtime external in the published CLI package. - Remove the duplicate TypeScript devDependency declaration. - Assert tsup externals are published runtime dependencies. - Document the runtime external packaging invariant. Files changed: .changeset/fn-8978-typescript-dedup.md | 7 +++++ packages/cli/package.json | 1 - packages/cli/src/__tests__/package-config.test.ts | 31 +++++++++++++++++++++++ packages/cli/tsup.config.ts | 6 +++++ 4 files changed, 44 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-8978 Fusion-Task-Lineage: b9630c4a-73a9-414f-9a78-25c689359509 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
7
.changeset/fn-8978-typescript-dedup.md
Normal file
7
.changeset/fn-8978-typescript-dedup.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
summary: Clean up the published CLI manifest so TypeScript is declared once as a runtime dependency.
|
||||||
|
category: internal
|
||||||
|
dev: Removed the duplicate `typescript` devDependencies entry from packages/cli/package.json (the runtime `dependencies` entry required by the tsup `external` list is unchanged) and regenerated pnpm-lock.yaml.
|
||||||
@@ -115,7 +115,6 @@
|
|||||||
"tsup": "^8.5.1",
|
"tsup": "^8.5.1",
|
||||||
"tsx": "^4.19.0",
|
"tsx": "^4.19.0",
|
||||||
"typebox": "^1.0.0",
|
"typebox": "^1.0.0",
|
||||||
"typescript": "^5.7.0",
|
|
||||||
"vitest": "^4.1.10",
|
"vitest": "^4.1.10",
|
||||||
"yaml": "^2.8.3"
|
"yaml": "^2.8.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -338,6 +338,37 @@ describe("CLI package.json publishing config", () => {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
FNXC:Packaging 2026-08-11-05:52:
|
||||||
|
FN-8978 removed the duplicate TypeScript declaration from CLI devDependencies.
|
||||||
|
Prepack copies remaining devDependencies into the published manifest, so this
|
||||||
|
guard covers the packed output as well as the source manifest.
|
||||||
|
*/
|
||||||
|
it("published manifest keeps tsup externals as runtime-only dependencies", () => {
|
||||||
|
const publishedPkg = applyPrepackTransform(pkg);
|
||||||
|
const deps = Object.keys(publishedPkg.dependencies || {});
|
||||||
|
const devDeps = Object.keys(publishedPkg.devDependencies || {});
|
||||||
|
|
||||||
|
for (const external of externals) {
|
||||||
|
if (
|
||||||
|
builtinModules.includes(external) ||
|
||||||
|
external.startsWith("node:") ||
|
||||||
|
external in TRANSITIVE_EXTERNALS
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(
|
||||||
|
deps,
|
||||||
|
`published tsup external "${external}" must be in @runfusion/fusion dependencies — otherwise \`npx runfusion.ai\` fails with ERR_MODULE_NOT_FOUND on a clean install. If this is a transitive dep, add it to TRANSITIVE_EXTERNALS with a reason.`,
|
||||||
|
).toContain(external);
|
||||||
|
expect(
|
||||||
|
devDeps,
|
||||||
|
`published tsup external "${external}" must not be only a devDependency`,
|
||||||
|
).not.toContain(external);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
it("TRANSITIVE_EXTERNALS entries still appear in tsup external (otherwise stale)", () => {
|
it("TRANSITIVE_EXTERNALS entries still appear in tsup external (otherwise stale)", () => {
|
||||||
for (const name of Object.keys(TRANSITIVE_EXTERNALS)) {
|
for (const name of Object.keys(TRANSITIVE_EXTERNALS)) {
|
||||||
expect(
|
expect(
|
||||||
|
|||||||
@@ -441,6 +441,12 @@ const cliBuildConfig = {
|
|||||||
*/
|
*/
|
||||||
"playwright-core",
|
"playwright-core",
|
||||||
// FNXC:KnowledgeGraph 2026-08-10-10:00: TypeScript 5.9.3 (sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==) stays runtime external.
|
// FNXC:KnowledgeGraph 2026-08-10-10:00: TypeScript 5.9.3 (sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==) stays runtime external.
|
||||||
|
/*
|
||||||
|
FNXC:KnowledgeGraph 2026-08-11-05:52:
|
||||||
|
FN-8978 requires TypeScript to remain a runtime dependency only, never a
|
||||||
|
devDependency or TRANSITIVE_EXTERNALS entry: bundled @fusion/core knowledge-
|
||||||
|
graph extractors import it from dist/bin.js at runtime.
|
||||||
|
*/
|
||||||
"typescript",
|
"typescript",
|
||||||
],
|
],
|
||||||
splitting: false,
|
splitting: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user