refactor(model): extract dashboard model package
This commit is contained in:
parent
22f50d64f9
commit
7a6ad8ab0e
35 changed files with 164 additions and 57 deletions
|
|
@ -88,4 +88,29 @@ describe("workspace boundaries", () => {
|
|||
expect(uiPackage.exports).toHaveProperty(".");
|
||||
expect(uiPackage.exports).toHaveProperty("./styles.css");
|
||||
});
|
||||
|
||||
test("keeps the dashboard model in a reusable internal package", () => {
|
||||
const webPackage = JSON.parse(
|
||||
readFileSync(join(root, "apps/web/package.json"), "utf8"),
|
||||
) as { dependencies?: Record<string, string> };
|
||||
const modelPackage = JSON.parse(
|
||||
readFileSync(join(root, "packages/dashboard-model/package.json"), "utf8"),
|
||||
) as { exports?: Record<string, unknown>; name?: string };
|
||||
const tsconfig = JSON.parse(
|
||||
readFileSync(join(root, "tsconfig.json"), "utf8"),
|
||||
) as { references?: Array<{ path: string }> };
|
||||
|
||||
expect(webPackage.dependencies?.["@dimensionlab/dashboard-model"]).toBe(
|
||||
"workspace:*",
|
||||
);
|
||||
expect(modelPackage.name).toBe("@dimensionlab/dashboard-model");
|
||||
expect(modelPackage.exports).toHaveProperty(".");
|
||||
expect(modelPackage.exports).toHaveProperty("./fixtures");
|
||||
expect(tsconfig.references).toEqual(
|
||||
expect.arrayContaining([{ path: "./packages/dashboard-model" }]),
|
||||
);
|
||||
expect(existsSync(join(root, "apps/web/src/lib/model/index.ts"))).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue