Skip to content

ci: setup pnpm#11881

Merged
alumni merged 1 commit intotypeorm:masterfrom
alumni:ci/setup-pnpm
Dec 30, 2025
Merged

ci: setup pnpm#11881
alumni merged 1 commit intotypeorm:masterfrom
alumni:ci/setup-pnpm

Conversation

@alumni
Copy link
Copy Markdown
Collaborator

@alumni alumni commented Dec 28, 2025

Description of change

Sets up pnpm to replace npm for the main project. Docs are left unchanged for the moment, they will soon be a separate package/workspace in the monorepo.

I used pnpm import to convert the lockfile without altering the dependency versions.

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)
  • Documentation has been updated to reflect this change (docs/docs/**.md)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Dec 28, 2025

commit: 653fafa

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 28, 2025

Coverage Status

coverage: 80.909%. remained the same
when pulling 653fafa on alumni:ci/setup-pnpm
into c52a5fd on typeorm:master.

@alumni alumni marked this pull request as ready for review December 29, 2025 15:01
@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 pnpm version

The pnpm/action-setup@v4 action is used without specifying a pnpm version. While package.json defines packageManager: "pnpm@10.26.2", it's best practice to explicitly set the version in the workflow to ensure consistency and avoid potential issues if the action's default version changes.

- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
Reduced sleep time

The Oracle test sleep time was reduced from 10 seconds to 3 seconds (line 341). This might be insufficient for Oracle to be fully ready, potentially causing flaky tests. This change should be validated to ensure Oracle initialization completes reliably within 3 seconds across different CI environments.

- run: sleep 3 # wait for oracle to be fully ready
- run: pnpm exec c8 pnpm run test:ci
Removed pre-commit script

The pre-commit script was removed from package.json, but the functionality is now handled by .husky/pre-commit. Verify that the Husky setup is working correctly and that lint-staged runs as expected on pre-commit hooks, especially for new contributors who might not have Husky installed initially.

"prepare": "is-ci || husky",
"publish:preview": "pkg-pr-new publish './build/package' --template='./sample/playground'",
"test": "pnpm run compile && pnpm run test:fast --",
"test:ci": "mocha --bail",
"test:fast": "mocha",
"typecheck": "tsc --noEmit",

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects bot commented Dec 29, 2025

PR Code Suggestions ✨

Latest suggestions up to 653fafa

CategorySuggestion                                                                                                                                    Impact
General
Add missing pnpm setup for docs

Update the docs job in the workflow to use pnpm for dependency installation,
consistent with the rest of the project, by adding pnpm/action-setup and using
pnpm install.

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

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

__

Why: This suggestion correctly points out a critical inconsistency in the docs job, which still uses npm while the rest of the project has migrated to pnpm, likely causing the job to fail.

Medium
Possible issue
Restore adequate Oracle initialization wait time

Increase the sleep duration for Oracle database initialization from 3 to 10
seconds to prevent potential race conditions and test failures.

.github/workflows/tests-linux.yml [341]

-- run: sleep 3 # wait for oracle to be fully ready
+- run: sleep 10 # wait for oracle to be fully ready
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a potential source of test flakiness by reducing the Oracle DB startup wait time, which could impact CI stability.

Medium
Verify pnpm availability before publishing

Add a check to verify pnpm is installed before attempting to use it for
publishing the package.

gulpfile.ts [91]

-"cd ./build/package && pnpm publish --tag next"
+"pnpm --version && cd ./build/package && pnpm publish --tag next"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that switching to pnpm requires it to be installed in the execution environment and provides a good way to verify its existence, making the script more robust.

Low
Specify pnpm version explicitly

Pin the pnpm version in the pnpm/action-setup@v4 action to match the version
specified in package.json for consistency.

.github/workflows/tests-linux.yml [25-29]

 - uses: pnpm/action-setup@v4
+  with:
+    version: 10.26.2
 - uses: actions/setup-node@v6
   with:
     node-version: ${{ inputs.node-version }}
     cache: "pnpm"
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: While pnpm/action-setup respects the packageManager field in package.json, explicitly pinning the version in the workflow improves robustness and clarity.

Low
  • More

Previous suggestions

Suggestions up to commit c6b8b3b
CategorySuggestion                                                                                                                                    Impact
Possible issue
Restore adequate Oracle initialization wait time

Revert the Oracle database wait time from 3 seconds back to 10 seconds to
prevent potential test failures due to the database not being fully initialized.

.github/workflows/tests-linux.yml [341]

-- run: sleep 3 # wait for oracle to be fully ready
+- run: sleep 10 # wait for oracle to be fully ready
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that reducing the Oracle DB wait time from 10s to 3s could introduce flakiness in the tests, as Oracle may not be fully initialized, and recommends reverting to the safer, longer wait time.

Medium
Validate pnpm availability before publishing

Add a shell command to verify that pnpm is installed before attempting to
execute the pnpm publish command.

gulpfile.ts [91]

-"cd ./build/package && pnpm publish --tag next"
+"command -v pnpm >/dev/null 2>&1 || { echo 'pnpm is not installed'; exit 1; } && cd ./build/package && pnpm publish --tag next"
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly points out a potential runtime failure if pnpm is not installed in the execution environment, and adding a check improves the script's robustness and error reporting.

Low
Specify pnpm version in action

Explicitly set the pnpm version in the pnpm/action-setup action to match the
version specified in package.json.

.github/workflows/tests-linux.yml [25-29]

 - uses: pnpm/action-setup@v4
+  with:
+    version: 10.26.2
 - uses: actions/setup-node@v6
   with:
     node-version: ${{ inputs.node-version }}
     cache: "pnpm"
Suggestion importance[1-10]: 5

__

Why: While pnpm/action-setup is designed to use the version from package.json, explicitly setting the version in the workflow improves robustness and clarity, preventing potential issues if the automatic detection fails.

Low
Suggestions up to commit 653fafa
CategorySuggestion                                                                                                                                    Impact
Possible issue
Use pnpm for dependency installation

Update the docs job in the workflow to use pnpm for dependency installation
instead of npm ci to maintain consistency with the rest of the PR's migration
and prevent potential build failures.

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

+- uses: pnpm/action-setup@v4
 - uses: actions/setup-node@v6
   with:
     node-version: 20
+    cache: "pnpm"
 
-- run: npm ci
-- run: npm run build
+- run: pnpm install
+- run: pnpm run build
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that the docs job was missed in the pnpm migration, which would likely cause the CI to fail due to the removal of package-lock.json.

Medium
Disable auto-installing peer dependencies

Set autoInstallPeers to false in pnpm-lock.yaml to prevent potential build
instability. This encourages explicitly declaring peer dependencies in
package.json for more reproducible builds.

pnpm-lock.yaml [3-5]

 settings:
-  autoInstallPeers: true
+  autoInstallPeers: false
   excludeLinksFromLockfile: false
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that autoInstallPeers: true can lead to non-deterministic builds and recommends a best practice for improved dependency stability.

Low
Increase sleep time for database readiness

Reconsider reducing the sleep duration for the Oracle database from 10 to 3
seconds, as it may cause flaky tests; suggest reverting to the longer duration
or implementing a more robust readiness check.

.github/workflows/tests-linux.yml [341]

-- run: sleep 3 # wait for oracle to be fully ready
+- run: sleep 10 # wait for oracle to be fully ready
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies that reducing the sleep duration from 10s to 3s for the Oracle DB readiness could introduce flakiness into the CI pipeline, which is a valid concern for test stability.

Low

Copy link
Copy Markdown
Member

@naorpeled naorpeled left a comment

Choose a reason for hiding this comment

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

🔥

Copy link
Copy Markdown
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

@alumni This is a massive PR 👌😅
💪 let's do it

@alumni
Copy link
Copy Markdown
Collaborator Author

alumni commented Dec 30, 2025

This is a massive PR

I'm actually thinking to make the lockfile binary so the updates don't count as changed lines :)

@alumni
Copy link
Copy Markdown
Collaborator Author

alumni commented Dec 30, 2025

Okay, so GitHub Linguist automatically detects pnpm-lock.yaml as a generated file and collapses the diff in the UI: https://github.com/github-linguist/linguist/blob/main/docs/overrides.md#summary

I reverted the binary git attribute since it had no effect on how GitHub calculates the stats. Seems the generated attribute should trigger it being excluded from the stats, according to those docs. 🤷🏻‍♂️

@alumni alumni mentioned this pull request Dec 30, 2025
19 tasks
@alumni alumni merged commit 56c449e into typeorm:master Dec 30, 2025
99 checks passed
@alumni
Copy link
Copy Markdown
Collaborator Author

alumni commented Dec 30, 2025

@naorpeled Could you please check the Cloudfare logs?

I didn't change the docs on purpose since I have no control on Cloudfare config :)

@naorpeled
Copy link
Copy Markdown
Member

@naorpeled Could you please check the Cloudfare logs?

I didn't change the docs on purpose since I have no control on Cloudfare config :)

Sure thing, if you'd like we can do a short Discord session about the docs config sometime 🙏

@naorpeled naorpeled mentioned this pull request Dec 30, 2025
4 tasks
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.

5 participants