Skip to content

Commit 59e5f90

Browse files
committed
fix(FR-2719): build docs-toolkit before PDF run so docs-toolkit CLI is on PATH
backend.ai-docs-toolkit ships its CLI as a package bin pointing at dist/cli.js. On a fresh `pnpm install`, that file does not exist yet (tsc has not run), so pnpm silently fails to create the .bin/docs-toolkit symlink and emits a WARN. The downstream `pnpm run pdf:all` (which calls `docs-toolkit pdf --lang all`) then fails with `spawn ENOENT` because the bin is not on PATH. The fix is a one-time toolkit build + re-install after the initial install: tsc populates dist/cli.js, then the second install picks up the now-existing bin and creates the symlink. The original `pnpm run pdf:all` script's own `build:toolkit` step still rebuilds the toolkit, but it cannot fix the missing symlink on its own. Caught by a workflow_dispatch dry run before merging.
1 parent 774a538 commit 59e5f90

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/package.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,17 @@ jobs:
246246
- name: Install Dependencies
247247
run: pnpm install --no-frozen-lockfile
248248

249+
# backend.ai-docs-toolkit ships its `docs-toolkit` CLI as the package
250+
# bin, but it lives at dist/cli.js which only exists after `tsc` runs.
251+
# On a fresh `pnpm install` the dist directory is empty, so pnpm
252+
# cannot create the .bin/docs-toolkit symlink and later `pdf:all`
253+
# fails with `spawn ENOENT`. Building the toolkit and re-running
254+
# install populates dist/ and lets pnpm wire the bin link.
255+
- name: Build docs-toolkit and link CLI
256+
run: |
257+
pnpm --filter backend.ai-docs-toolkit run build
258+
pnpm install --no-frozen-lockfile
259+
249260
# Cache the Playwright browser binaries (~150 MB Chromium download).
250261
# The lockfile hash keys the cache so a Playwright version bump
251262
# naturally invalidates the cache without manual intervention.

0 commit comments

Comments
 (0)