Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ai/test/package-exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
interface PackageManifest {
name: string;
exports: Record<string, unknown>;
dependencies: Record<string, string>;
}

const packageRoot = fileURLToPath(new URL("..", import.meta.url));
Expand All @@ -25,6 +26,20 @@ async function run(command: string[]): Promise<{
}

describe("built package exports", () => {
test("root workspace install provisions every runtime dependency", async () => {
const rootManifest = await Bun.file(
new URL("../../package.json", import.meta.url),
).json() as { workspaces?: string[] };
const manifest = await Bun.file(
new URL("../package.json", import.meta.url),
).json() as PackageManifest;

expect(rootManifest.workspaces).toContain("ai");
for (const dependency of Object.keys(manifest.dependencies)) {
expect(Bun.resolveSync(dependency, packageRoot)).toBeString();
}
});

test("imports every declared export with supported Node", async () => {
const build = await run(["bun", "run", "build"]);
expect(build.exitCode).toBe(0);
Expand Down
52 changes: 51 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
}
},
"workspaces": [
"dashboard"
"dashboard",
"ai"
],
"files": [
"dist",
Expand Down Expand Up @@ -120,6 +121,7 @@
"zod": "^3.24.2"
},
"overrides": {
"ajv": "8.20.0",
"fast-uri": "3.1.2"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/no-cloud-boundary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe("OSS no-cloud boundary", () => {
expect(packageJson.publishConfig).toMatchObject({ access: "public" });
expect(packageJson.repository.url).toBe("https://github.com/hasna/todos.git");
expect(packageJson.workspaces).toContain("dashboard");
expect(packageJson.workspaces).toContain("ai");
expect(packageJson.bin).not.toHaveProperty("todos-remote");
expect(packageJson.exports).not.toHaveProperty("./remote");
expect(sdkPackageJson.repository.url).toBe("https://github.com/hasna/todos.git");
Expand Down
Loading