diff --git a/.changeset/FN-6409-plugin-sdk-dts-inline.md b/.changeset/FN-6409-plugin-sdk-dts-inline.md new file mode 100644 index 0000000000..0b7cdd850c --- /dev/null +++ b/.changeset/FN-6409-plugin-sdk-dts-inline.md @@ -0,0 +1,5 @@ +--- +"@runfusion/fusion": patch +--- + +Inline the private `@fusion/core` types into the published `@runfusion/fusion/plugin-sdk` declaration entry so standalone external plugins created with `fn plugin new` can typecheck and `pnpm build` cleanly against released Fusion. Human spot-check: `npx @runfusion/fusion@0.42.0 plugin new proof-point-plugin && cd proof-point-plugin && pnpm install && pnpm build`. diff --git a/packages/cli/src/__tests__/plugin-sdk-export.test.ts b/packages/cli/src/__tests__/plugin-sdk-export.test.ts index a9ee5891a5..8899323235 100644 --- a/packages/cli/src/__tests__/plugin-sdk-export.test.ts +++ b/packages/cli/src/__tests__/plugin-sdk-export.test.ts @@ -51,4 +51,13 @@ describe("plugin-sdk export surface", () => { const built = readFileSync(distPath, "utf-8"); expect(built.includes("@fusion/")).toBe(false); }); + + it("has no @fusion specifiers in built plugin-sdk declaration artifact when present", () => { + const distPath = join(workspaceRoot, "packages", "cli", "dist", "plugin-sdk", "index.d.ts"); + if (!existsSync(distPath)) { + return; + } + const built = readFileSync(distPath, "utf-8"); + expect(built.includes("@fusion/")).toBe(false); + }); }); diff --git a/packages/cli/tsup.config.ts b/packages/cli/tsup.config.ts index 3c608fbcb1..e26827f681 100644 --- a/packages/cli/tsup.config.ts +++ b/packages/cli/tsup.config.ts @@ -316,9 +316,18 @@ const pluginSdkBuildConfig = { target: "node22", tsconfig: join(__dirname, "..", "plugin-sdk", "tsconfig.json"), dts: { - resolve: true, + /* + * FNXC:PluginSDK 2026-06-13-12:00: + * FN-6409 requires the published @runfusion/fusion/plugin-sdk declaration entry to be self-contained. External plugin authors cannot resolve private @fusion/core types from scaffolded projects, so leaving @fusion/* imports in dist/plugin-sdk/index.d.ts makes tsc fail with TS2307 before ctx parameters can typecheck. + */ + resolve: [/^@fusion\//], compilerOptions: { rootDir: join(__dirname, ".."), + baseUrl: ".", + paths: { + "@fusion/core": ["../core/src/index.ts"], + }, + removeComments: true, }, }, noExternal: [/^@fusion\//],