Files
dev/third_party/pi/packages/coding-agent/test/package-distribution.test.ts
alexion 6081e3e325 chore(vendor): import pi 1.3.0
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
2026-10-15 17:58:48 -04:00

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");
});
});