Skip to content

chore(docs): move to PNPM - #11884

Merged
alumni merged 7 commits into
masterfrom
fix/resolve-docs-crash-after-pnpm-move
Dec 30, 2025
Merged

alumni merged 7 commits into
masterfrom
fix/resolve-docs-crash-after-pnpm-move

Conversation

@naorpeled

@naorpeled naorpeled commented Dec 30, 2025 •

Copy link
Copy Markdown
Member

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 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
  • Root pnpm install installs docs dependencies automatically

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated tests validating the change (tests/**.test.ts) - N/A (build configuration change)
  • Documentation has been updated to reflect this change (docs/docs/**.md) - N/A (no user-facing documentation changes)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 30, 2025 •

Copy link
Copy Markdown

Deploying typeorm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1c57720
Status: ✅  Deploy successful!
Preview URL: https://52f46c1d.typeorm.pages.dev
Branch Preview URL: https://fix-resolve-docs-crash-after.typeorm.pages.dev

View logs

@naorpeled
naorpeled requested review from alumni and removed request for alumni December 30, 2025 21:22
@alumni

alumni commented Dec 30, 2025 •

Copy link
Copy Markdown
Collaborator

Okay, got it.

Worst case, we can remove the workspace yaml file and move those settings to package.json (and keep npm)

@naorpeled naorpeled changed the title fix: resolve docs crash after pnpm move chore(docs): move to PNPM Dec 30, 2025
@pkg-pr-new

pkg-pr-new Bot commented Dec 30, 2025 •

Copy link
Copy Markdown
  • typeorm-sql-js-example

    npm i https://pkg.pr.new/typeorm/typeorm@11884
    

commit: 1c57720

@naorpeled
naorpeled marked this pull request as ready for review December 30, 2025 21:37
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing working-directory

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.

- run: pnpm install
- run: pnpm run build
Unclear Configuration

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.

  "minimumReleaseAge": 1440
},

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 30, 2025 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to 1c57720

CategorySuggestion                                                                                                                                    Impact
General
Pin PNPM version in workflow

Pin the pnpm version in the .github/workflows/tests.yml file to 10.26.2 to match
the version specified in package.json and ensure consistent builds.

.github/workflows/tests.yml [72-76]

 - uses: pnpm/action-setup@v4
+    with:
+      version: 10.26.2
   - uses: actions/setup-node@v6
     with:
       node-version: 20
       cache: "pnpm"

[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.

package.json [247-260]

 "pnpm": {
   "onlyBuiltDependencies": [
     "better-sqlite3",
     "sqlite3"
   ],
   "ignoredBuiltDependencies": [
     "@sap/hana-client",
     "es5-ext",
     "libpq",
     "oracledb",
     "protobufjs"
-  ],
-  "minimumReleaseAge": 1440
+  ]
 }

[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.

docs/package.json [51-57]

 "pnpm": {
-  "ignoredBuiltDependencies": [
-    "typesense-instantsearch-adapter",
-    "core-js-pure",
-    "core-js"
-  ]
+  "ignoredBuiltDependencies": []
 }
  • Apply / Chat
Suggestion importance[1-10]: 5

__

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.

Low
  • More

Previous suggestions

Suggestions up to commit 7ca5681
CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix invalid PNPM version

The pnpm version specified in packageManager is invalid; correct it to a valid,
existing version to prevent installation failures.

docs/package.json [47]

-"packageManager": "[email protected]",
+"packageManager": "[email protected]",
Suggestion importance[1-10]: 9

__

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.

package.json [259]

-"minimumReleaseAge": 1440
+"minimumReleaseAge": 360
Suggestion importance[1-10]: 4

__

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.

Low
Suggestions up to commit 6d09d47
CategorySuggestion                                                                                                                                    Impact
General
Specify PNPM version explicitly

Explicitly specify the pnpm version in the pnpm/action-setup GitHub action to
ensure reproducible builds and improve workflow clarity.

.github/workflows/tests.yml [72-76]

 - uses: pnpm/action-setup@v4
+    with:
+      version: 10.26.2
   - uses: actions/setup-node@v6
     with:
       node-version: 20
       cache: "pnpm"
Suggestion importance[1-10]: 4

__

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.

Low
✅ Suggestions up to commit 28e8285
CategorySuggestion                                                                                                                                    Impact
High-level
Re-evaluate using a separate lockfile

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.

Examples:

docs/pnpm-lock.yaml [1-11879]
lockfileVersion: '9.0'

settings:
  autoInstallPeers: true
  excludeLinksFromLockfile: false

importers:

  .:
    dependencies:

 ... (clipped 11869 lines)

Solution Walkthrough:

Before:

# pnpm-workspace.yaml (as implemented in PR)
packages:
  - 'packages/*'
  - 'docs'
sharedWorkspaceLockfile: false

# docs/pnpm-lock.yaml
lockfileVersion: '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 caching
Suggestion 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.

.github/workflows/tests.yml [70-78]

 steps:
   - uses: actions/checkout@v6
-  - uses: pnpm/action-setup@v4
   - uses: actions/setup-node@v6
     with:
       node-version: 20
+      cache: 'pnpm'
+      cache-dependency-path: 'docs/pnpm-lock.yaml'
 
   - run: pnpm install
   - run: pnpm run build
Suggestion importance[1-10]: 7

__

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.

Medium

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread .github/workflows/tests.yml Resolved

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏

Comment thread docs/package.json Resolved
@coveralls

coveralls commented Dec 30, 2025 •

Copy link
Copy Markdown

Coverage Status

coverage: 80.909%. remained the same
when pulling 1c57720 on fix/resolve-docs-crash-after-pnpm-move
into 56c449e on master.

@alumni
alumni merged commit f283304 into master Dec 30, 2025
@alumni
alumni deleted the fix/resolve-docs-crash-after-pnpm-move branch December 30, 2025 23:20
Cprakhar pushed a commit to Cprakhar/typeorm that referenced this pull request Jan 7, 2026
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
kranners pushed a commit to kranners/typeorm that referenced this pull request Mar 1, 2026
@pkuczynski pkuczynski added this to the 1.0 milestone Mar 8, 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.

6 participants