fix(container): stage model package manifest
This commit is contained in:
parent
7a6ad8ab0e
commit
9311b81102
2 changed files with 33 additions and 0 deletions
|
|
@ -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}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue