build: generate compatibility types after production build

This commit is contained in:
vorotamoroz
2026-07-30 12:18:01 +00:00
parent 725b5eb9a0
commit 31445a35bb
2 changed files with 12 additions and 0 deletions
@@ -122,6 +122,17 @@ function validSyntheticExports(): Record<string, unknown> {
};
}
Deno.test("root postbuild generates the type-resolution compatibility mirror", async () => {
const repositoryRoot = await Deno.realPath(new URL("../../", import.meta.url));
const packageJson = JSON.parse(await Deno.readTextFile(`${repositoryRoot}/package.json`)) as {
scripts?: Record<string, string>;
};
assert(
packageJson.scripts?.postbuild === "npm run generate:type-resolution-compat",
"root postbuild does not invoke the compatibility generator"
);
});
Deno.test("generator covers the installed package export maps deterministically", async () => {
const repositoryRoot = await Deno.realPath(new URL("../../", import.meta.url));
const temporaryDirectory = await Deno.makeTempDir({ prefix: "livesync-type-generator-" });