Skip to content

Commit 45c8c15

Browse files
d-csclaude
andcommitted
fix(webapp): make SDK bundle-docs build step work in pruned Docker image
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>
1 parent a7312b1 commit 45c8c15

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: fix
4+
---
5+
6+
Fix webapp Docker build failing because the SDK's bundle-docs build step was not runnable in the pruned image

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ RUN chmod +x ./scripts/wait-for-it.sh
6868
RUN chmod +x ./scripts/entrypoint.sh
6969
COPY --chown=node:node .configs/tsconfig.base.json .configs/tsconfig.base.json
7070
COPY --chown=node:node scripts/updateVersion.ts scripts/updateVersion.ts
71+
COPY --chown=node:node scripts/bundleSdkDocs.ts scripts/bundleSdkDocs.ts
7172
RUN pnpm run generate
7273
RUN --mount=type=secret,id=sentry_auth_token \
7374
SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry_auth_token) \

scripts/bundleSdkDocs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,19 @@ async function collectManifest(): Promise<string[]> {
6565
}
6666

6767
async function bundleSdkDocs() {
68+
// When the SDK is built as a dependency inside a pruned workspace (e.g. the webapp Docker
69+
// image), the repo-level docs/ tree is a separate workspace package that isn't part of that
70+
// build's dependency graph, so it isn't present. The SDK isn't being published there, so
71+
// there's nothing to bundle: skip rather than fail. Publishing always runs from the full
72+
// monorepo where docs/ exists, so the missing-docs guard below still protects releases.
73+
const docsRoot = path.join(repoRoot, "docs");
74+
try {
75+
await fs.access(docsRoot);
76+
} catch {
77+
console.log(`[bundleSdkDocs] docs/ not present at ${docsRoot}; skipping (pruned build)`);
78+
return;
79+
}
80+
6881
const manifest = await collectManifest();
6982

7083
if (manifest.length === 0) {

0 commit comments

Comments
 (0)