From 6a563fa98033199b2736c343a91dd55ff6456866 Mon Sep 17 00:00:00 2001 From: Ajeet Singh Raina Date: Mon, 17 Aug 2026 23:33:35 +0530 Subject: [PATCH] Build workspace packages in the authoring image so validate-lab resolves them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Aug 14 "Publish compiled packages instead of source" change pointed the workspace packages' `exports` at compiled `./dist/*` (gitignored, produced by `npm run build:packages`). Vite still works because vite.config.js aliases the packages to their source, but `npm run validate-lab` runs through a standalone esbuild (scripts/run-ts.mjs) with no such alias — so it resolves the real `exports` entry and needs `dist/` to exist. The authoring stage never builds the packages, so `dist/` is absent and the published `dockersamples/simspace-authoring:latest` fails with: scripts/validate-lab.ts:35:7: ERROR: Could not resolve "@dockersamples/simspace-simulator" This breaks the `Validate labs` step of the reusable deploy-lab.yml for every downstream lab repo, so GitHub Pages deploys can't publish. Fix: run `npm run build:packages` after the source copy in the authoring stage. Verified: `docker build --target authoring` then `docker run ... npm run validate-lab -- /lab` now reports `0 error(s), 0 warning(s)` on a lab that fails against the current latest image. Co-Authored-By: Claude Opus 4.8 (1M context) --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 911d73b..fe4d06b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,5 +57,12 @@ COPY app/packages/simulator/package.json ./packages/simulator/ COPY app/packages/labspace/package.json ./packages/labspace/ RUN npm ci COPY app/ ./ +# The workspace packages' `exports` point at compiled dist/ (gitignored). Vite +# aliases them to source (see vite.config.js), but validate-lab runs through a +# standalone esbuild (scripts/run-ts.mjs) with no such alias, so it resolves the +# real exports and needs dist/ to exist. Build the packages before the image is +# used, or `npm run validate-lab` fails with "Could not resolve +# @dockersamples/simspace-simulator". +RUN npm run build:packages EXPOSE 5173 CMD ["npm", "run", "dev"]