refactor(model): extract dashboard model package #34

Merged
vince merged 2 commits from codex/turbo-package-boundaries into main 2026-06-20 06:36:32 +02:00
2 changed files with 33 additions and 0 deletions
Showing only changes of commit 9311b81102 - Show all commits

View file

@ -4,6 +4,7 @@ WORKDIR /repo
ENV PATH=/repo/apps/web/node_modules/.bin:/repo/packages/ui/node_modules/.bin:/repo/node_modules/.bin:$PATH
COPY package.json bun.lock turbo.json tsconfig.base.json ./
COPY apps/web/package.json apps/web/package.json
COPY packages/dashboard-model/package.json packages/dashboard-model/package.json
COPY packages/ui/package.json packages/ui/package.json
RUN bun install --frozen-lockfile

View file

@ -113,4 +113,36 @@ describe("workspace boundaries", () => {
false,
);
});
test("stages web workspace dependency manifests before container install", () => {
const webPackage = JSON.parse(
readFileSync(join(root, "apps/web/package.json"), "utf8"),
) as { dependencies?: Record<string, string> };
const workspacePackages = [
"packages/ui/package.json",
"packages/dashboard-model/package.json",
].map((manifestPath) => {
const packageJson = JSON.parse(
readFileSync(join(root, manifestPath), "utf8"),
) as { name?: string };
return [packageJson.name, manifestPath] as const;
});
const manifestsByPackageName = new Map(workspacePackages);
const containerfile = readFileSync(
join(root, "apps/web/Containerfile"),
"utf8",
);
const workspaceDependencyManifests = Object.entries(
webPackage.dependencies ?? {},
)
.filter(([, version]) => version.startsWith("workspace:"))
.map(([packageName]) => manifestsByPackageName.get(packageName));
expect(workspaceDependencyManifests).not.toContain(undefined);
for (const manifestPath of workspaceDependencyManifests) {
expect(containerfile).toContain(`COPY ${manifestPath} ${manifestPath}`);
}
});
});