Skip to content

fix: wire up husky commit-msg hook and update site branding - #584

Merged
Michael (mschilling) merged 1 commit into
mainfrom
fix/husky-hook-and-branding
Jul 5, 2026
Merged

fix: wire up husky commit-msg hook and update site branding#584
Michael (mschilling) merged 1 commit into
mainfrom
fix/husky-hook-and-branding

Conversation

@mschilling

Copy link
Copy Markdown
Contributor

What

Wires up the husky commit-msg hook so conventional-commit linting actually runs, and refreshes outdated site branding.

Why

package.json declared husky ^9 and a commitlint config, but the only hook wiring was a legacy husky v4-style "husky": { "hooks": { ... } } block that husky v9 ignores. There was no prepare script and no .husky/ directory, so fresh clones got no git hook and bad commit messages were never rejected locally.

Separately, the site description still read Move4Mobile developers blog; the blog is Framna's now.

Changes

  • Added "prepare": "husky" to scripts so .husky/ is registered on install.
  • Removed the ignored legacy "husky": { ... } config block from package.json.
  • Added .husky/commit-msg (husky v9 idiom, executable) running npx --no -- commitlint --edit "$1".
  • Updated src/_data/site.js description to Framna developer blog. URL fields left unchanged (geekbites.move4mobile.io is still the live production domain).

Test plan

  • Hook rejects a non-conventional message (git commit -m "bad message" fails with commitlint subject-empty / type-empty errors)
  • Hook accepts a valid message (git commit -m "test: hook check" passes; the real PR commit also passed the hook)
  • git config core.hooksPath resolves to .husky/_ after npm install ran the prepare script
  • npm run build succeeds (eleventy wrote 27 files)

- husky v9 needs a `prepare` script and a .husky/ hook dir; the legacy
  v4-style config block in package.json was silently ignored, so
  commitlint never ran on fresh clones
- site description still said 'Move4Mobile developers blog'; the blog
  is Framna's now
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 606e62e):

https://m4m-geekbites-dev--pr584-fix-husky-hook-and-b-o2jmi2tk.web.app

(expires Sun, 12 Jul 2026 15:02:40 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 995f16c8ca726a359e48b7c460e5b3e3ea21476d

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates local developer workflow and branding by enabling Husky v9 commit-msg hooks for conventional commit linting and refreshing the site description to reflect current ownership.

Changes:

  • Added a prepare script (husky) and removed the legacy (ignored) Husky v4-style config from package.json.
  • Added a Husky commit-msg hook to run commitlint on commit messages.
  • Updated the site description in src/_data/site.js to “Framna developer blog”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/_data/site.js Updates the site description text to the new branding.
package.json Ensures Husky installs hooks via prepare and removes legacy Husky config.
.husky/commit-msg Adds the commit-msg hook intended to enforce conventional commits.

Comment thread .husky/commit-msg
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
@mschilling Michael (mschilling) self-assigned this Jul 5, 2026
@mschilling

Copy link
Copy Markdown
Contributor Author

Re: the shebang comment — this is the official husky v9 hook format. Husky sets core.hooksPath to .husky/_ (verified: git config core.hooksPath.husky/_), where its own shim executes and sources .husky/commit-msg via sh — the file is never executed as a standalone hook, so no shebang is needed. The shebang + husky.sh sourcing style is the deprecated pre-v9 format that husky v9 warns about.

The hook was verified empirically on this branch: git commit -m "bad message" → blocked by commitlint (subject-empty, type-empty, exit 1); git commit -m "test: hook check" → passes.

@mschilling
Michael (mschilling) merged commit 2d5c891 into main Jul 5, 2026
8 checks passed
@mschilling
Michael (mschilling) deleted the fix/husky-hook-and-branding branch July 5, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants