fix(docker): stage plugin manifests before native web type checking

This commit is contained in:
mrcfps
2026-10-22 02:17:13 +08:00
parent 9409bca088
commit 994cf76055
2 changed files with 11 additions and 1 deletions
+2 -1
View File
@@ -33,6 +33,8 @@ RUN corepack enable && \
pnpm install --frozen-lockfile
COPY apps ./apps
# The web type check includes tests that import bundled plugin manifests.
COPY plugins/_official ./plugins/_official
RUN pnpm --filter @open-design/daemon build && \
pnpm --filter @open-design/web build && \
pnpm --filter @open-design/daemon deploy --legacy --prod /app/deploy/daemon && \
@@ -81,7 +83,6 @@ COPY assets ./assets
# image, `loadManifest()` returns `{}` and every plugin silently falls back to
# the live-iframe preview path — the exact cost the bakes exist to avoid.
COPY data ./data
COPY plugins/_official ./plugins/_official
FROM ${RUNTIME_IMAGE}
@@ -46,6 +46,15 @@ describe("deploy/Dockerfile content directories", () => {
}
});
it("makes bundled plugin manifests available before the web type check", async () => {
const { build } = stageSections(await readFile(dockerfile, "utf8"));
const webBuild = build.indexOf("pnpm --filter @open-design/web build");
expect(webBuild).toBeGreaterThan(0);
const pluginCopy = build.indexOf("COPY plugins/_official ./plugins/_official");
expect(pluginCopy).toBeGreaterThanOrEqual(0);
expect(pluginCopy).toBeLessThan(webBuild);
});
it("ships the checked-in plugin preview manifest", async () => {
// Narrower than the directory check above and stated separately: this is the
// file whose absence is silent, so it is worth failing on its own terms