ci: deploy docs via Workers Builds with pnpm workspace - #263
ci: deploy docs via Workers Builds with pnpm workspace#263dimitropoulos wants to merge 7 commits into
Conversation
Production docs deploys through Cloudflare Workers Builds (pnpm --filter capnweb-docs build / wrangler deploy from repo root), so drop the redundant GitHub deploy-docs workflow. Move the monorepo onto pnpm so that filter command works: include packages/docs and the React example client in the workspace, replace npm lockfiles with pnpm-lock.yaml, and point CI (test, preview, release, pkg.pr.new) at pnpm. Docs prebuild builds the library first so playgrounds resolve monorepo outputs under a single install.
|
|
@dimitropoulos Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
commit: |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-docs-workers-builds.pr.capnweb.com (commit 7e8a919)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
🟡 Changes recommended
There are a few concrete doc/script issues to resolve (incorrect pnpx --filter usage, .npmrc guidance inconsistencies, and redundant double-build in dev:docs) before this can be safely approved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates the repo’s tooling and CI from npm workspaces to a pnpm workspace so docs builds/deploys can run via Cloudflare Workers Builds using pnpm --filter commands.
Changes:
- Introduces a
pnpm-workspace.yaml+packageManagerpin and updates root scripts to use pnpm filters/exec. - Updates CI workflows (test/preview/release/pkg.pr.new) to install/build with pnpm and removes the docs deploy GitHub Action.
- Updates docs/readme guidance and docs package lifecycle scripts to build workspace outputs before bundling playgrounds.
File summaries
| File | Description |
|---|---|
| README.md | Updates local docs dev instructions to pnpm-based commands. |
| pnpm-workspace.yaml | Defines workspace packages for pnpm filtering across the monorepo. |
| packages/docs/README.md | Updates docs site run/deploy instructions for pnpm + Workers Builds. |
| packages/docs/package.json | Makes docs lifecycle hooks build workspace outputs before bundling playgrounds; adds wrangler/esbuild deps. |
| packages/docs/AGENTS.md | Updates contributor guidance for pnpm workspace + Workers Builds/preview flow. |
| package.json | Pins pnpm and rewires scripts to pnpm filters/exec; adds pnpm-only-built dependency config. |
| examples/worker-react/client/package-lock.json | Removes npm lockfile as part of pnpm migration. |
| .npmrc | Forces @cloudflare registry resolution to npmjs to avoid internal-registry overrides. |
| .github/workflows/test.yml | Switches CI jobs to pnpm install/cache and pnpm-based build/test commands. |
| .github/workflows/release.yml | Switches release pipeline to pnpm install/build/publish commands. |
| .github/workflows/preview-docs.yml | Switches preview docs build/deploy steps to pnpm and workspace-scoped wrangler exec. |
| .github/workflows/pkg-pr-new.yml | Switches pkg.pr.new publishing workflow to pnpm exec. |
| .github/workflows/deploy-docs.yml | Removes GitHub Action-based production docs deploy in favor of Workers Builds. |
Review details
Files not reviewed (1)
- examples/worker-react/client/package-lock.json: Generated file
Suppressed comments (2)
packages/docs/AGENTS.md:33
- This section says “Don’t commit an
.npmrc” but the PR introduces a root.npmrcfor exactly this use case, and it also usespnpx --filter ...(which doesn’t work with pnpm workspace filtering / bypasses the pinned wrangler). Align the text and commands with the repo’s approach: root.npmrc+pnpm --filter capnweb-docs exec wrangler ....
Don't commit an `.npmrc` to work around it. Production deploys via Workers Builds
(`pnpm --filter capnweb-docs build` / `pnpx --filter capnweb-docs wrangler deploy`); PR previews
use `.github/workflows/preview-docs.yml`. `README.md`, "Deployment" and "Previews", is the detail.
packages/docs/README.md:944
- The deployment command uses
pnpx --filter ..., butpnpxdoesn’t support pnpm workspace filtering and it also bypasses the pinnedwranglerdevDependency in this package. Use the same workspace-scopedpnpm --filter capnweb-docs exec wrangler ...form used elsewhere in this PR.
`pnpx --filter capnweb-docs wrangler deploy`. The same build runs as a `build-docs` job on every
- Files reviewed: 12/16 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace single-letter flags (-w, -r, -er, -X, -f, -g, -p) with their long forms across docs scripts and CI workflows.
The repo already pins the scope to the public registry; drop the manual override instructions that conflict with that.
- Drop redundant library build from root dev:docs (predev already builds). - Replace invalid pnpx --filter with pnpm --filter … exec wrangler. - Remove preview-docs.yml; Workers Builds owns PR previews. - Rewrite Previews docs for Workers Builds instead of the GH workflow.
Including packages/docs in the workspace pulled typescript@6 into capnweb-validate (range allowed <7), which broke type-only asset import detection. Pin validate to typescript@5.9.3. Playwright resolved to 1.63 while the test job image is still v1.56.1; pin playwright@1.56.1 to match.
Summary
/,pnpm --filter capnweb-docs build,pnpx --filter capnweb-docs wrangler deploy). Remove.github/workflows/deploy-docs.yml.pnpm-workspace.yamlincludes the library,capnweb-validate,capnweb-docs, and the React example client.prebuildrunspnpm -w run buildfirst so playgrounds get library/capnweb-validatedist under one install.Test plan
pnpm installpnpm --filter capnweb-docs buildpnpm run build+ node serialization testsbuild-docsandpreviewjobs