fix smoke test

This commit is contained in:
gsxdsm
2026-06-10 18:06:51 -07:00
parent 9f38b0d090
commit e62847bd06
3 changed files with 23 additions and 0 deletions

View File

@@ -18,12 +18,19 @@ export function applyPrepackTransform(pkg) {
devDependencies,
// Inject exports only for the packed manifest so workspace/dev resolution
// remains unchanged (postpack restore reverts this file to original state).
//
// Declaring any `exports` field flips Node into strict subpath mode, which
// would otherwise hide every other `./dist/*` file. The runfusion.ai alias
// imports `@runfusion/fusion/dist/bin.js` and the pi loader reads
// `./dist/extension.js`, so a `./dist/*` passthrough is required to keep
// those subpaths resolvable post-pack.
exports: {
...(pkg.exports || {}),
"./plugin-sdk": {
types: "./dist/plugin-sdk/index.d.ts",
import: "./dist/plugin-sdk/index.js",
},
"./dist/*": "./dist/*",
"./package.json": "./package.json",
},
};

View File

@@ -25,6 +25,10 @@ describe("plugin-sdk export surface", () => {
import: "./dist/plugin-sdk/index.js",
});
expect(transformed.exports["./package.json"]).toBe("./package.json");
// The runfusion.ai alias imports `@runfusion/fusion/dist/bin.js`; the
// injected exports field must keep `./dist/*` subpaths resolvable or the
// pre-publish smoke test fails with ERR_PACKAGE_PATH_NOT_EXPORTED.
expect(transformed.exports["./dist/*"]).toBe("./dist/*");
expect(transformed.bin).toEqual(pkg.bin);
expect(transformed.pi).toEqual(pkg.pi);
});