Skip to content

chore: use pnpm exec in precommit#1671

Merged
alexdln merged 2 commits intonpmx-dev:mainfrom
alexdln:chore/update-precommit
Feb 26, 2026
Merged

chore: use pnpm exec in precommit#1671
alexdln merged 2 commits intonpmx-dev:mainfrom
alexdln:chore/update-precommit

Conversation

@alexdln
Copy link
Member

@alexdln alexdln commented Feb 26, 2026

🧭 Context

Bin files need to be called differently depending on the system, and to avoid solving this problem for others, I implemented it through pnpm exec, which only works with local bin files and therefore should work fast

@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 26, 2026 2:10pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 26, 2026 2:10pm
npmx-lunaria Ignored Ignored Feb 26, 2026 2:10pm

Request Review

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@alexdln alexdln marked this pull request as draft February 26, 2026 13:49
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

The pull request updates package.json to replace direct ./node_modules/.bin/... binary invocations with pnpm exec ... calls in pre-commit and lint-staged configurations. Commands for formatting and linting (including oxfmt and oxlint) are routed through pnpm so pnpm resolves and runs the tools instead of calling binaries by path. No public API or exported entities are changed.

Possibly related PRs

  • chore: speed up pre-commit hooks #1661: Modifies the same pre-commit and lint-staged command configurations but in the opposite direction, switching from pnpm exec ... back to direct ./node_modules/.bin/... paths.

Suggested reviewers

  • wojtekmaj
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description directly relates to the changeset, explaining the rationale for switching from direct node_modules bin references to pnpm exec invocations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
package.json (1)

151-151: Use pnpm exec for binary calls in hooks.

According to pnpm v10 documentation, pnpm exec <binary> is the recommended form for running local dependency binaries in hook contexts. Whilst pnpm <binary> works in many setups, using pnpm exec explicitly prevents potential future conflicts if pnpm adds a built-in command matching a binary name.

Suggested diff
   "simple-git-hooks": {
-    "pre-commit": "pnpm lint-staged"
+    "pre-commit": "pnpm exec lint-staged"
   },
   "lint-staged": {
     "i18n/locales/*": [
       "node ./lunaria/lunaria.ts",
-      "pnpm oxfmt lunaria/files/",
+      "pnpm exec oxfmt lunaria/files/",
       "git add lunaria/files/",
       "node scripts/generate-i18n-schema.ts",
-      "pnpm oxfmt i18n/schema.json",
+      "pnpm exec oxfmt i18n/schema.json",
       "git add i18n/schema.json"
     ],
     "*.{js,ts,mjs,cjs,vue}": [
-      "pnpm oxlint --fix"
+      "pnpm exec oxlint --fix"
     ],
     "*.{js,ts,mjs,cjs,vue,json,yml,md,html,css}": [
-      "pnpm oxfmt"
+      "pnpm exec oxfmt"
     ]
   },

Also applies to: 156-157, 159-160, 163-164, 169-170


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e1fe41 and 9d9714d.

📒 Files selected for processing (1)
  • package.json

@alexdln alexdln force-pushed the chore/update-precommit branch from 41b94f8 to 0817598 Compare February 26, 2026 14:08
@alexdln alexdln changed the title chore: use pnpm lint-staged in precommit chore: use pnpm exec in precommit Feb 26, 2026
@alexdln alexdln enabled auto-merge February 26, 2026 14:14
@alexdln alexdln added this pull request to the merge queue Feb 26, 2026
Merged via the queue into npmx-dev:main with commit bf4b537 Feb 26, 2026
19 checks passed
@alexdln alexdln deleted the chore/update-precommit branch February 26, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants