diff --git a/CLAUDE.md b/CLAUDE.md index d48d5056..c1f20313 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -46,5 +46,5 @@ The development workflow uses **jiti** to run `src/bin.ts` directly without a co - **ESLint** uses flat config (`eslint.config.ts`) with `typescript-eslint` strict + stylistic type-checked rules. - **Prettier** uses `prettier-plugin-organize-imports` — import order is auto-managed. -- **Lefthook** runs pre-commit hooks (type-check → format → lint) with `fail_on_changes: always`, so hooks can auto-fix files but will abort the commit if any file changed, requiring a re-stage. +- **Lefthook** is an external tool (not a dev dependency) that manages Git hooks. It must be installed independently and set up with `lefthook install`. Pre-commit hooks run type-check → format → lint with `fail_on_changes: always`, so hooks can auto-fix files but will abort the commit if any file changed, requiring a re-stage. - **Vitest** requires 100% code coverage (lines, functions, branches, statements) enforced via the `coverage` threshold in `vitest.config.ts`. diff --git a/README.md b/README.md index 8f17e3ec..012feb89 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ pnpm install For more information on pnpm, including adding dependencies or running tools, refer to [this documentation](https://pnpm.io/pnpm-cli). +This template also uses [Lefthook](https://lefthook.dev/) to manage Git hooks. Lefthook is an external tool that must be installed independently — refer to [this guide](https://lefthook.dev/installation/) for installation instructions. Once installed, set up the Git hooks with: + +```sh +lefthook install +``` + ### Developing the Library This template provides two components: the library itself ([`src/lib.ts`](./src/lib.ts)) and an executable entry point ([`src/bin.ts`](./src/bin.ts)). Write code according to your project requirements. If you're new to [TypeScript](https://www.typescriptlang.org/), refer to [this documentation](https://www.typescriptlang.org/docs/) for guidance. diff --git a/package.json b/package.json index 737fe415..a20aa56d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,6 @@ "@vitest/coverage-v8": "^4.0.15", "eslint": "^10.3.0", "jiti": "^2.7.0", - "lefthook": "^2.1.6", "prettier": "^3.8.3", "prettier-plugin-organize-imports": "^4.3.0", "typescript": "^6.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a658d69f..41682077 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,9 +30,6 @@ importers: jiti: specifier: ^2.7.0 version: 2.7.0 - lefthook: - specifier: ^2.1.6 - version: 2.1.6 prettier: specifier: ^3.8.3 version: 3.8.3 @@ -769,60 +766,6 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - lefthook-darwin-arm64@2.1.6: - resolution: {integrity: sha512-hyB7eeiX78BS66f70byTJacDLC/xV1vgMv9n+idFUsrM7J3Udd/ag9Ag5NP3t0eN0EqQqAtrNnt35EH01lxnRQ==} - cpu: [arm64] - os: [darwin] - - lefthook-darwin-x64@2.1.6: - resolution: {integrity: sha512-5Ka6cFxiH83krt+OMRQtmS6zqoZR5SLXSudLjTbZA1c3ZqF0+dqkeb4XcB6plx6WR0GFizabuc6Bi3iXPIe1eQ==} - cpu: [x64] - os: [darwin] - - lefthook-freebsd-arm64@2.1.6: - resolution: {integrity: sha512-VswyOg5CVN3rMaOJ2HtnkltiMKgFHW/wouWxXsV8RxSa4tgWOKxM0EmSXi8qc2jX+LRga6B0uOY6toXS01zWxA==} - cpu: [arm64] - os: [freebsd] - - lefthook-freebsd-x64@2.1.6: - resolution: {integrity: sha512-vXsCUFYuVwrVWwcypB7Zt2Hf+5pl1V1la7ZfvGYZaTRURu0zF/XUnMF/nOz/PebGv0f4x/iOWXWwP7E42xRWsg==} - cpu: [x64] - os: [freebsd] - - lefthook-linux-arm64@2.1.6: - resolution: {integrity: sha512-WDJiQhJdZOvKORZd+kF/ms2l6NSsXzdA9ahflyr65V90AC4jES223W8VtEMbGPUtHuGWMEZ/v/XvwlWv0Ioz9g==} - cpu: [arm64] - os: [linux] - - lefthook-linux-x64@2.1.6: - resolution: {integrity: sha512-C18nCd7nTX1AVL4TcvwMmLAO1VI1OuGluIOTjiPkBQ746Ls1HhL5rl//jMPACmT28YmxIQJ2ZcLPNmhvEVBZvw==} - cpu: [x64] - os: [linux] - - lefthook-openbsd-arm64@2.1.6: - resolution: {integrity: sha512-mZOMxM8HiPxVFXDO3PtCUbH4GB8rkveXhsgXF27oAZTYVzQ3gO9vT6r/pxit6msqRXz3fvcwimLVJgb8eRsa8A==} - cpu: [arm64] - os: [openbsd] - - lefthook-openbsd-x64@2.1.6: - resolution: {integrity: sha512-sG9ALLZSnnMOfXu+B7SmxFhJhuoAh4bqi5En5aaHJET48TqrLOcWWZuH+7ArFM6gr/U5KfSUvdmHFmY8WqCcIg==} - cpu: [x64] - os: [openbsd] - - lefthook-windows-arm64@2.1.6: - resolution: {integrity: sha512-lD8yFWY4Csuljd0Rqs7EQaySC0VvDf7V3rN1FhRMUISTRDHutebIom1Loc8ckQPvKYGC6mftT9k0GvipsS+Brw==} - cpu: [arm64] - os: [win32] - - lefthook-windows-x64@2.1.6: - resolution: {integrity: sha512-q4z2n3xucLscoWiyMwFViEj3N8MDSkPulMwcJYuCYFHoPhP1h+icqNu7QRLGYj6AnVrCQweiUJY3Tb2X+GbD/A==} - cpu: [x64] - os: [win32] - - lefthook@2.1.6: - resolution: {integrity: sha512-w9sBoR0mdN+kJc3SB85VzpiAAl451/rxdCRcZlwW71QLjkeH3EBQFgc4VMj5apePychYDHAlqEWTB8J8JK/j1Q==} - hasBin: true - levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -1732,49 +1675,6 @@ snapshots: dependencies: json-buffer: 3.0.1 - lefthook-darwin-arm64@2.1.6: - optional: true - - lefthook-darwin-x64@2.1.6: - optional: true - - lefthook-freebsd-arm64@2.1.6: - optional: true - - lefthook-freebsd-x64@2.1.6: - optional: true - - lefthook-linux-arm64@2.1.6: - optional: true - - lefthook-linux-x64@2.1.6: - optional: true - - lefthook-openbsd-arm64@2.1.6: - optional: true - - lefthook-openbsd-x64@2.1.6: - optional: true - - lefthook-windows-arm64@2.1.6: - optional: true - - lefthook-windows-x64@2.1.6: - optional: true - - lefthook@2.1.6: - optionalDependencies: - lefthook-darwin-arm64: 2.1.6 - lefthook-darwin-x64: 2.1.6 - lefthook-freebsd-arm64: 2.1.6 - lefthook-freebsd-x64: 2.1.6 - lefthook-linux-arm64: 2.1.6 - lefthook-linux-x64: 2.1.6 - lefthook-openbsd-arm64: 2.1.6 - lefthook-openbsd-x64: 2.1.6 - lefthook-windows-arm64: 2.1.6 - lefthook-windows-x64: 2.1.6 - levn@0.4.1: dependencies: prelude-ls: 1.2.1