import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { describe, expect, it } from "vitest"; import * as datasources from "../index"; describe("@upstart.gg/sdk/datasources barrel", () => { it("does not expose the server-only manifest-fs helpers", () => { // manifest-fs imports `node:child_process`: re-exporting it here pulled it into the browser // bundle of every site and raised a `node:child_process externalized` page error. expect(datasources).not.toHaveProperty("getManifest"); expect(datasources).not.toHaveProperty("getManifestFromGit"); expect(datasources).not.toHaveProperty("getMigrationFilePath"); }); it("does not re-export manifest-fs", () => { const source = readFileSync(resolve(__dirname, "../index.ts"), "utf8"); expect(source).not.toMatch(/^\s*export\s+.*from\s+["']\.\/manifest-fs["']/m); }); });