From 972cf686e1a480ea6813ed03f02ca446db9e509e Mon Sep 17 00:00:00 2001 From: "Ricardo Q. Bazan" Date: Sun, 18 Oct 2026 10:57:25 -0500 Subject: [PATCH] chore: let pnpm run lefthook's install script pnpm 10 blocks dependency build scripts by default, so a fresh clone got no git hooks from `pnpm install`. Allow lefthook's with `allowBuilds`, the setting pnpm 10.26+ prefers and the one pnpm 11 keeps, and turn off the side-effects cache so a lefthook already built for another project still runs its postinstall. The development guide drops the manual `lefthook install` step. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VFY4xrjKujVz6rsni1MJPm --- docs/development.md | 3 +-- pnpm-workspace.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/development.md b/docs/development.md index 08d4d93..a51b7dc 100644 --- a/docs/development.md +++ b/docs/development.md @@ -10,10 +10,9 @@ How to work on theme-toggle in a clone. The [contributing guide](contributing.md mise install pnpm install playwright install chromium # the browser the tests run in -lefthook install # the git hooks in lefthook.yml ``` -pnpm doesn't run lefthook's own install script, so the hooks need `lefthook install` once. After changing a version in `mise.toml`, run `mise lock` and commit both files. +`pnpm install` also installs the git hooks in `lefthook.yml`, because `pnpm-workspace.yaml` allows lefthook's install script. After changing a version in `mise.toml`, run `mise lock` and commit both files. ## Tasks diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8e6e557..882cd32 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,10 @@ +allowBuilds: + lefthook: true + +# lefthook's postinstall installs the git hooks, so it has to run on every install: +# with the side-effects cache on, a lefthook already built for another project skips it. +sideEffectsCache: false + # Supply-chain cooldown: malicious releases are usually pulled within 24h; pattern excludes need pnpm >= 10.17. minimumReleaseAge: 1440 minimumReleaseAgeExclude: