potiuk opened a new pull request, #56:
URL: https://github.com/apache/comdev/pull/56

   npm copies name, version, dependencies, `engines`, etc. from `package.json` 
into the lock file's root entry (`packages[""]`). If `package.json` is edited 
without regenerating the lock, the two silently disagree and the next `npm 
install` produces an unrelated diff — as currently in #55, where `engines` is 
bumped to `>=22.21` but both lock files still record the old state.
   
   This adds:
   - `scripts/check-package-lock.mjs` — zero-dependency check comparing those 
mirrored fields; prints the mismatching field and the fix (`npm install 
--package-lock-only`).
   - a `package-lock-sync` prek hook that runs only when a `package.json` / 
`package-lock.json` changes. To allow that, `package-lock.json` is dropped from 
the global exclude (lock files pass all other hooks unchanged).
   - in `static-checks.yml`, PRs skip the hook in the `--all-files` run and 
instead run it with `--from-ref <base> --to-ref HEAD`, so it only fires when 
the PR touches package files. Pushes to `main` still run everything.
   - a note in `AGENTS.md`.
   
   Verified locally: skipped when no package files change; passes on current 
lock files; fails with a clear message when `engines` is bumped in 
`package.json` only.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to