diff --git a/.gitignore b/.gitignore index 54bbe61..32e1696 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,10 @@ # Dependency directories vendor/ +node_modules/ + +# Node lockfiles (root dev tooling only — dashboard uses its own) +package-lock.json # Go workspace file go.work diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..0a4b97d --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..2312dc5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d13bf0..17e051b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,21 @@ Versions map to GitHub pull requests; the project does not use semver tags yet. --- +## [0.10.0] - 2026-03-24 - PR #11: Husky local DX hooks + +### Added + +- Root `package.json` with Husky 9, commitlint, lint-staged, and + markdownlint-cli as dev dependencies. +- `.husky/commit-msg` — runs `commitlint` on every local commit, enforcing + the same conventional commit rules already checked in CI. Bad commit + messages are rejected instantly, before any push. +- `.husky/pre-commit` — runs `lint-staged` on staged files. Currently lints + any staged `*.md` files with markdownlint. +- `node_modules/` and root `package-lock.json` added to `.gitignore`. + +--- + ## [0.9.0] - 2026-03-24 - PR #10: Docker build validation on every PR ### Fixed diff --git a/PROGRESS.md b/PROGRESS.md index 46cf1de..96eab5a 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -91,6 +91,7 @@ Items not yet started, ordered roughly by priority. - [x] Build (no push) Docker images on PRs so broken Dockerfiles are caught before merge. +- [x] Husky local DX hooks (commit-msg + pre-commit with lint-staged) - [ ] Replace the `go get` workaround in Dockerfiles with properly committed `go.mod` / `go.sum` files (requires Go installed in the dev environment or a CI step that commits updated module files). diff --git a/package.json b/package.json new file mode 100644 index 0000000..f4c2a96 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "onchain-health-monitor", + "private": true, + "scripts": { + "prepare": "husky" + }, + "devDependencies": { + "@commitlint/cli": "^19.3.0", + "@commitlint/config-conventional": "^19.2.2", + "husky": "^9.1.6", + "lint-staged": "^15.2.10", + "markdownlint-cli": "^0.44.0" + }, + "lint-staged": { + "*.md": "markdownlint --ignore node_modules --ignore vendor" + } +}