fix(container): stage model package manifest
This commit is contained in:
parent
7a6ad8ab0e
commit
9311b81102
2 changed files with 33 additions and 0 deletions
|
|
@ -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
|
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 package.json bun.lock turbo.json tsconfig.base.json ./
|
||||||
COPY apps/web/package.json apps/web/package.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
|
COPY packages/ui/package.json packages/ui/package.json
|
||||||
RUN bun install --frozen-lockfile
|
RUN bun install --frozen-lockfile
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,4 +113,36 @@ describe("workspace boundaries", () => {
|
||||||
false,
|
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}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue