{"_id":"@aggreggator-labs/git-hooks","name":"@aggreggator-labs/git-hooks","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@aggreggator-labs/git-hooks","version":"0.0.1","description":"Shared Husky pre-push hook for aggreggator-labs repositories - runs the consumer's own format and lint scripts before every push","type":"module","bin":{"aggreggator-pre-push":"bin/pre-push.mjs"},"repository":{"type":"git","url":"git+https://github.com/aggreggator-labs/dotfiles.git","directory":"npm/git-hooks"},"keywords":["husky","git-hooks","pre-push","format","lint"],"license":"MIT","peerDependencies":{"husky":"^9.0.0"},"publishConfig":{"access":"public"},"gitHead":"2f07eda4bddff90329ceda5d367fe9a8751428ea","_id":"@aggreggator-labs/git-hooks@0.0.1","bugs":{"url":"https://github.com/aggreggator-labs/dotfiles/issues"},"homepage":"https://github.com/aggreggator-labs/dotfiles#readme","_nodeVersion":"26.8.1","_npmVersion":"11.19.0","dist":{"integrity":"sha512-LBvvA1XVT6U5lzpey94ojyTh3w+aKu4uwITZaVzdquRLDOVjppuGUaL3kAvNCyNhPPe/v+MiFO79Jr7RtP3Gcg==","shasum":"4b4c57532f0748321a70ae4533e505281f0819cd","tarball":"https://registry.npmjs.org/@aggreggator-labs/git-hooks/-/git-hooks-0.0.1.tgz","fileCount":3,"unpackedSize":5736,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFVEBcOvI4Tfy0wOvICx4dIWSxAD107Ue6HMr771E2U1AiEAui6fVs1daE4/jTD8KkFPvK7Gb2igzsn5K6M2zBoZmdg="}]},"_npmUser":{"name":"aggreggator-labs","email":"labs-npmjs@aggreggator.de"},"directories":{},"maintainers":[{"name":"aggreggator-labs","email":"labs-npmjs@aggreggator.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/git-hooks_0.0.1_1788808138918_0.9571559585865876"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-07T19:08:58.756Z","0.0.1":"2026-09-07T19:08:59.071Z","modified":"2026-09-07T19:08:59.275Z"},"maintainers":[{"name":"aggreggator-labs","email":"labs-npmjs@aggreggator.de"}],"description":"Shared Husky pre-push hook for aggreggator-labs repositories - runs the consumer's own format and lint scripts before every push","homepage":"https://github.com/aggreggator-labs/dotfiles#readme","keywords":["husky","git-hooks","pre-push","format","lint"],"repository":{"type":"git","url":"git+https://github.com/aggreggator-labs/dotfiles.git","directory":"npm/git-hooks"},"bugs":{"url":"https://github.com/aggreggator-labs/dotfiles/issues"},"license":"MIT","readme":"# @aggreggator-labs/git-hooks\n\nA shared pre-push hook for aggreggator-labs repositories. It runs\na repo's own `format` and `lint` scripts before every `git push`,\nso a formatting slip is caught on the machine that made it, not\nby CI on the pull request.\n\n## Usage\n\n```bash\nbun add -d husky @aggreggator-labs/git-hooks\n```\n\nAdd a `prepare` script so the hook activates on every `install`,\nno manual `git config core.hooksPath` step for anyone to forget:\n\n```bash\nnpm pkg set scripts.prepare=\"husky\"\n```\n\nThen initialize Husky's hooks directory and add the pre-push\nhook:\n\n```bash\nnpx husky init\necho \"node ./node_modules/@aggreggator-labs/git-hooks/bin/pre-push.mjs\" > .husky/pre-push\n```\n\n`husky init` creates `.husky/`, adds `.husky/pre-commit` (delete\nit if unused), and sets the `prepare` script above for you - the\nexplicit `npm pkg set` step is only needed if `init` is skipped.\nCommit `.husky/pre-push`; it is a plain POSIX shell file, no\n`husky.sh` sourcing or shebang needed as of Husky v9.\n\nThe hook calls the bin's `node_modules` path directly rather than\n`npx aggreggator-pre-push`: on at least one tested setup\n(Windows + Bun), `npx` fell back to the npm registry instead of\nresolving the locally-linked, unpublished workspace bin, because\nBun's Windows bin shims (`.exe`/`.bunx`) aren't the files npm's\nown `npx` looks for. Calling the script by its `node_modules`\npath sidesteps package-manager bin-shim differences entirely and\nworks the same under npm, pnpm, yarn, and bun.\n\n## What it runs\n\n`aggreggator-pre-push` reads the current repo's own\n`package.json`:\n\n- runs `format` if the script exists, then `lint` if it exists\n- skips either one gracefully (prints a note, exits 0) if the\n  repo doesn't define it\n- aborts the push (non-zero exit) if a check that did run fails\n\nIt detects the repo's package manager from its lockfile\n(`bun.lock`/`bun.lockb` → bun, `pnpm-lock.yaml` → pnpm,\n`yarn.lock` → yarn, otherwise npm) and shells out to that\nmanager's `run` command - never hardcoded to `bun run`.\n\nOnly `format` and `lint` run here, never the test suite. Tests\nstay CI's job; this hook is meant to stay fast enough that nobody\nis tempted to disable it.\n\n## Publishing\n\nReleases are staged, never pushed live by a machine. A push to\n`main` with a new version in `package.json` runs\n`.github/workflows/publish-npm.yml` in the dotfiles repository,\nwhich stages the version on npmjs through trusted publishing\n(GitHub OIDC, no token; no provenance, which npm attaches only\nfor public source repositories). A maintainer then approves it\nwith two-factor authentication - `npm stage approve` or the\npackage page - and only then is it on the registry. An unchanged\nversion stages nothing and says so. Bump the version here to\nrelease; patch bumps (`0.0.x`) by default.\n","readmeFilename":"README.md","_rev":"1-08700c114f1020b346abf93f6eb83028"}