Skip to content

ci: fix the docs deploy under the pnpm workspace layout - #12917

Merged
naorpeled merged 1 commit into
masterfrom
fix/docs-deploy-pnpm-workspace
Sep 30, 2026
Merged

naorpeled merged 1 commit into
masterfrom
fix/docs-deploy-pnpm-workspace

Conversation

@naorpeled

Copy link
Copy Markdown
Member

Description of change

Both docs deployments for master have been failing since the repository root became a pnpm workspace (#12854). That workspace excludes docs, but pnpm still walks up from docs to the root pnpm-workspace.yaml:

  • Cloudflare Pages build: it runs pnpm install in docs, which installs the root workspace ("Scope: all 5 workspace projects") and skips the docs dependencies. The build then fails with sh: 1: docusaurus: not found.
  • Deploy Docs to Cloudflare Pages workflow: wrangler-action runs from the repository root, can't find wrangler, and falls back to pnpm add wrangler@4 there. pnpm rejects that with ERR_PNPM_ADDING_TO_ROOT.

Changes:

  • Add docs/pnpm-workspace.yaml so docs is a workspace root of its own. pnpm commands run from docs then use docs/pnpm-lock.yaml. The root workspace is unchanged.
  • Run wrangler-action with workingDirectory: docs, so it installs and runs wrangler inside the docs project.

Verified locally with pnpm 10.34.5 on a clean copy of the repository:

  • Without the change, CI=true pnpm install in docs installs the root workspace and npm run build fails with docusaurus: command not found, matching the Cloudflare log.
  • With the change, the same commands on Node 22 install from docs/pnpm-lock.yaml without changing it and the site builds.
  • The workflow sequence on Node 24 works: pnpm install --frozen-lockfile --ignore-workspace, then pnpm exec wrangler --version (not found), then pnpm add wrangler@4 (succeeds), then pnpm exec wrangler --version (4.145.0).
  • At the repository root, pnpm install --frozen-lockfile still covers the same 5 workspace projects and the lockfile is up to date.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links a relevant issue using a closing keyword: N/A
  • There are new or updated tests validating the change: N/A (CI configuration)
  • Documentation has been updated to reflect this change: N/A

Since the repository root became a pnpm workspace that excludes `docs`,
pnpm commands run from `docs` resolve to the root workspace:

- the Cloudflare Pages build runs `pnpm install` in `docs`, which installs
  the root workspace instead of the docs dependencies, so `docusaurus` is
  missing when the build runs
- `wrangler-action` runs from the repository root and falls back to
  `pnpm add wrangler@4` there, which pnpm rejects with
  `ERR_PNPM_ADDING_TO_ROOT`

Give `docs` its own `pnpm-workspace.yaml` so it is a workspace root of its
own, and run `wrangler-action` from `docs`.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review
  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9ffba7c
Status: ✅  Deploy successful!
Preview URL: https://b3a9e3bf.typeorm.pages.dev
Branch Preview URL: https://fix-docs-deploy-pnpm-workspa.typeorm.pages.dev

View logs

@naorpeled
naorpeled merged commit 17e858d into master Sep 30, 2026
16 checks passed
@naorpeled
naorpeled deleted the fix/docs-deploy-pnpm-workspace branch September 30, 2026 20:19
@github-actions github-actions Bot added this to the 2.0.next milestone Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants