Build workspace packages in the authoring image so validate-lab resolves them - #3
Open
ajeetraina wants to merge 1 commit into
Open
Build workspace packages in the authoring image so validate-lab resolves them#3ajeetraina wants to merge 1 commit into
ajeetraina wants to merge 1 commit into
Conversation
…ves them 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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm run validate-labindockersamples/simspace-authoring:latest(built 2026-08-14) crashes before it reads any lab:This breaks the
Validate labsstep of the reusabledeploy-lab.ymlfor every downstream lab repo, so their GitHub Pages deploys can no longer publish.latestis the only published authoring tag, so there's no consumer-side workaround. (Reported in #2.)Root cause
The Aug 14 "Publish compiled packages instead of source" change pointed the workspace packages'
exportsat compiled./dist/*:app/vite.config.jsaliases the packages to their source (resolve: { alias: workspaceSource }).validate-labbreaks — it runs throughscripts/run-ts.mjs, a standalone esbuild with no such alias. It resolves the realexports→./dist/index.js, which doesn't exist because the authoring stage never builds the packages.Fix
Run
npm run build:packagesafter the source copy in the authoring stage of theDockerfile, sodist/exists before anything consumes the publishedexports.Verification
latest:ERROR: Could not resolve "@dockersamples/simspace-simulator"0 error(s), 0 warning(s) across 2 lab(s)✅(Verified against a real downstream lab; the same lab validates clean pre-Aug-14 and fails on current
latest, so this is purely the image, not lab content.)Note
Once merged,
dockersamples/simspace-authoring:latestneeds to be rebuilt and republished — the fix only reaches downstream repos when the image is pushed.🤖 Generated with Claude Code