Pin sort-package-json instead of running it with pnpm dlx #62

Stängd
öppnade 2026-10-08 21:12:36 +00:00 av supernaut · 1 kommentar
Ägare

What

lefthook.json runs pnpm dlx sort-package-json on each commit that stages package.json.

Why

dlx downloads and runs the latest release, outside the lockfile and the release-age quarantine.

Failing case

Staging package.json executes whatever version is newest on the registry at that moment.

Fix

Add sort-package-json as a pinned devDependency. Run pnpm exec sort-package-json.

Done when

  • Hook works offline after install
  • No dlx in lefthook.json
## What `lefthook.json` runs `pnpm dlx sort-package-json` on each commit that stages package.json. ## Why dlx downloads and runs the latest release, outside the lockfile and the release-age quarantine. ## Failing case Staging package.json executes whatever version is newest on the registry at that moment. ## Fix Add `sort-package-json` as a pinned devDependency. Run `pnpm exec sort-package-json`. ## Done when - [ ] Hook works offline after install - [ ] No `dlx` in lefthook.json
Upphovsperson
Ägare

Fixed in #63 by removing the hook rather than pinning the tool. The pnpm dlx sort-package-json job is gone from lefthook.json, so nothing downloads or runs an unpinned package on commit, and the remaining hooks run from the lockfile and work offline after install. lefthook.json on main contains no dlx or sort-package-json. Closing.

Fixed in #63 by removing the hook rather than pinning the tool. The `pnpm dlx sort-package-json` job is gone from `lefthook.json`, so nothing downloads or runs an unpinned package on commit, and the remaining hooks run from the lockfile and work offline after install. `lefthook.json` on main contains no `dlx` or `sort-package-json`. Closing.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-reconcile-trigger#62
Ingen beskrivning angiven.