diff --git a/.changeset/fn-8978-typescript-dedup.md b/.changeset/fn-8978-typescript-dedup.md new file mode 100644 index 0000000000..521b887c44 --- /dev/null +++ b/.changeset/fn-8978-typescript-dedup.md @@ -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. diff --git a/packages/cli/package.json b/packages/cli/package.json index 3547258e54..7992bfe2d5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -115,7 +115,6 @@ "tsup": "^8.5.1", "tsx": "^4.19.0", "typebox": "^1.0.0", - "typescript": "^5.7.0", "vitest": "^4.1.10", "yaml": "^2.8.3" }, diff --git a/packages/cli/src/__tests__/package-config.test.ts b/packages/cli/src/__tests__/package-config.test.ts index 0023908c2e..05a305b757 100644 --- a/packages/cli/src/__tests__/package-config.test.ts +++ b/packages/cli/src/__tests__/package-config.test.ts @@ -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)", () => { for (const name of Object.keys(TRANSITIVE_EXTERNALS)) { expect( diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts index 913e4875b8..8a316e925d 100644 --- a/packages/cli/tsup.config.ts +++ b/packages/cli/tsup.config.ts @@ -441,6 +441,12 @@ const cliBuildConfig = { */ "playwright-core", // 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", ], splitting: false,