You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes the Cloudflare Pages docs build failure that occurred after migrating to pnpm. The build was failing with docusaurus: not found because the docs package wasn't being installed as part of the workspace.
What the change does:
Adds docs to the pnpm workspace packages list in pnpm-workspace.yaml
Enables per-package lockfiles by setting sharedWorkspaceLockfile: false, allowing the docs site to have its own docs/pnpm-lock.yaml
Generates docs/pnpm-lock.yaml with the docs dependencies
Removes the old docs/package-lock.json (npm lockfile)
Why this change is needed:
After migrating to pnpm (#11881), Cloudflare Pages was running pnpm install from the repo root, but the docs package wasn't included in the workspace configuration. This meant:
Docs dependencies weren't being installed during the root pnpm install
The docusaurus binary wasn't available when running pnpm run build in the docs directory
The build failed with sh: 1: docusaurus: not found
How it's verified:
Ran pnpm install from the repo root and confirmed docs/pnpm-lock.yaml was generated
Verified docs/node_modules/.bin/docusaurus exists and is executable
Confirmed the docs build command can find and execute docusaurus
Current behavior:
Cloudflare Pages build fails because docs dependencies aren't installed
Docs uses a shared root lockfile (or no lockfile if not in workspace)
New behavior:
Cloudflare Pages build succeeds because docs is now a workspace package
Docs has its own docs/pnpm-lock.yaml for independent dependency management
The new pnpm install and pnpm run build commands are added at the job level without specifying working-directory. This may cause them to run from the repository root instead of the docs directory, which could lead to build failures. Verify that these commands should run from the root or add working-directory: ./docs to each step.
The minimumReleaseAge value of 1440 (minutes, approximately 1 day) is added without context. This pnpm configuration affects when packages can be installed after publication. Verify this is the intended behavior and consider if this delay is appropriate for the project's needs, as it may prevent installing recently published packages.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly points out that pinning the pnpm version in the CI workflow ensures reproducible builds by matching the version specified in package.json, which is a best practice.
Medium
Review build dependencies configuration conflicts
Review the pnpm configuration for potential build conflicts and consider reducing or removing the minimumReleaseAge setting to avoid delays in receiving critical patches.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 6
__
Why: The suggestion correctly identifies that setting minimumReleaseAge to 24 hours might delay important updates, which is a valid concern for project stability and security.
Low
Verify ignored build dependencies necessity
Verify that ignoring build steps for typesense-instantsearch-adapter, core-js-pure, and core-js is intentional and does not cause issues with native dependencies.
Why: The suggestion correctly points out a potential issue with ignoredBuiltDependencies and encourages verification, which is good practice, but the author likely added this configuration to solve an existing problem.
Why: The suggestion correctly identifies that the specified pnpm version 10.26.2 is invalid and does not exist, which would cause installation failures in CI and local development environments.
High
General
Reduce package release delay time
Reduce the minimumReleaseAge from 1440 minutes (24 hours) to a lower value to enable faster adoption of dependency updates, including security patches.
Why: The suggestion raises a valid point about the trade-off for minimumReleaseAge, but the chosen value of 24 hours is a reasonable and deliberate choice for stability, making this a low-impact suggestion.
Why: This is a good practice for CI reproducibility, but the current configuration would work as pnpm/action-setup reads the version from package.json.
The suggestion questions the necessity of a separate lockfile for the docs package. It proposes using a single, shared workspace lockfile to align with pnpm's standard practice and ensure dependency consistency.
# pnpm-workspace.yaml (as implemented in PR)packages:
- 'packages/*'
- 'docs'sharedWorkspaceLockfile: false# docs/pnpm-lock.yamllockfileVersion: '9.0'# ... (new, separate lockfile for docs)# pnpm-lock.yaml (root)# ... (root lockfile does not include docs dependencies)
After:
# pnpm-workspace.yaml (suggested change)packages:
- 'packages/*'
- 'docs'# sharedWorkspaceLockfile is true by default# docs/pnpm-lock.yaml# This file would be deleted.# pnpm-lock.yaml (root)lockfileVersion: '9.0'# ... (single root lockfile includes all workspace dependencies, including docs)
Suggestion importance[1-10]: 7
__
Why: The suggestion raises a valid architectural point about dependency management strategy, questioning a deviation from the standard pnpm workspace setup which has long-term maintenance implications.
Medium
General
✅ Simplify CI by using integrated cachingSuggestion Impact:The commit partially implemented the suggestion by adding 'cache: "pnpm"' to the actions/setup-node configuration. However, it did not include the 'cache-dependency-path: docs/pnpm-lock.yaml' parameter and did not remove the pnpm/action-setup step as suggested.
code diff:
+ cache: "pnpm"
Simplify the CI workflow by removing the pnpm/action-setup step and using the integrated caching feature of actions/setup-node for pnpm dependencies. This improves performance and aligns with best practices.
Why: The suggestion correctly proposes using the built-in caching of actions/setup-node for pnpm, which improves CI performance and simplifies the workflow file by removing the redundant pnpm/action-setup action.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR completes the migration to pnpm for the documentation build system. The change consolidates pnpm configuration by moving settings from a standalone pnpm-workspace.yaml file into the root package.json, updates the GitHub Actions workflow to use pnpm instead of npm for building docs, and adds explicit packageManager declarations.
Key Changes
Consolidates pnpm configuration by deleting pnpm-workspace.yaml and moving its settings to package.json's pnpm field
Updates GitHub Actions docs workflow to use pnpm commands and adds the pnpm/action-setup step
Adds packageManager: "[email protected]" field to docs/package.json for explicit version pinning
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
File
Description
pnpm-workspace.yaml
Removes the standalone pnpm workspace configuration file
package.json
Migrates pnpm configuration (onlyBuiltDependencies, ignoredBuiltDependencies, minimumReleaseAge) from workspace file to pnpm field
docs/package.json
Adds packageManager field to explicitly specify pnpm version 10.26.2
.github/workflows/tests.yml
Updates docs job to use pnpm/action-setup and changes npm commands to pnpm equivalents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
This PR fixes the Cloudflare Pages docs build failure that occurred after migrating to pnpm. The build was failing with
docusaurus: not foundbecause the docs package wasn't being installed as part of the workspace.What the change does:
docsto the pnpm workspace packages list inpnpm-workspace.yamlsharedWorkspaceLockfile: false, allowing the docs site to have its owndocs/pnpm-lock.yamldocs/pnpm-lock.yamlwith the docs dependenciesdocs/package-lock.json(npm lockfile)Why this change is needed:
After migrating to pnpm (#11881), Cloudflare Pages was running
pnpm installfrom the repo root, but the docs package wasn't included in the workspace configuration. This meant:pnpm installdocusaurusbinary wasn't available when runningpnpm run buildin the docs directorysh: 1: docusaurus: not foundHow it's verified:
pnpm installfrom the repo root and confirmeddocs/pnpm-lock.yamlwas generateddocs/node_modules/.bin/docusaurusexists and is executabledocusaurusCurrent behavior:
New behavior:
docs/pnpm-lock.yamlfor independent dependency managementpnpm installinstalls docs dependencies automaticallyPull-Request Checklist
masterbranchFixes #00000tests/**.test.ts) - N/A (build configuration change)docs/docs/**.md) - N/A (no user-facing documentation changes)