Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
25 lines
798 B
TypeScript
25 lines
798 B
TypeScript
import { readFileSync } from "node:fs";
|
|
import { describe, expect, test } from "vitest";
|
|
|
|
interface CodingAgentPackageJson {
|
|
bin: { pi: string };
|
|
main: string;
|
|
exports: {
|
|
".": { import: string; types: string };
|
|
"./rpc-entry": { import: string };
|
|
};
|
|
}
|
|
|
|
const packageJson = JSON.parse(
|
|
readFileSync(new URL("../package.json", import.meta.url), "utf8"),
|
|
) as CodingAgentPackageJson;
|
|
|
|
describe("package distribution entrypoints", () => {
|
|
test("uses the bundle for executables and modular output for libraries", () => {
|
|
expect(packageJson.bin.pi).toBe("dist/bundle/cli.js");
|
|
expect(packageJson.main).toBe("./dist/index.js");
|
|
expect(packageJson.exports["."].import).toBe("./dist/index.js");
|
|
expect(packageJson.exports["./rpc-entry"].import).toBe("./dist/bundle/rpc-entry.js");
|
|
});
|
|
});
|