fix(webapp): make SDK bundle-docs build step work in pruned Docker image#3947
Conversation
The webapp Docker build runs the SDK build as a dependency. The SDK's new bundle-docs step was not runnable in the pruned image: the script was not copied into the builder, and the repo docs/ tree it reads is pruned away. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
The webapp Docker image build runs
pnpm run build --filter=webapp..., which builds@trigger.dev/sdkas a dependency. The SDK'sbuildscript recently gained abundle-docsstep (tsx ../../scripts/bundleSdkDocs.ts), but the build couldn't run it in the pruned image, breaking the image build.Two things were missing:
docker/Dockerfilecopiedscripts/updateVersion.tsinto the builder stage but notscripts/bundleSdkDocs.ts, so the step failed withERR_MODULE_NOT_FOUND.docs/tree it reads is a separate workspace package that isn't in webapp's dependency graph, soturbo prune --scope=webappexcludes it — the script's missing-docs guard would then fail the build.Design
The Dockerfile now copies
bundleSdkDocs.tsalongsideupdateVersion.ts.bundleSdkDocs.tsskips gracefully when the repodocs/tree is absent, which is exactly the pruned-dependency-build case (the SDK is compiled there but never published). Publishing always runs from the full monorepo wheredocs/exists, so the missing-docs guard still protects releases — it only fires whendocs/is present but a cited doc is genuinely missing, rather than when the whole tree was pruned away. This avoids dragging 27M of docs into a throwaway builder stage.Test plan
bundle-docsfrom the full monorepo still bundles all cited docs (exit 0)docs/skips cleanly instead of failing