Skip to content

chore(deps): update commitlint to v21 and husky to v9 - #1525

Merged
Anber merged 2 commits into
callstack:masterfrom
Anber:chore/commitlint-21-husky-9
Oct 23, 2026
Merged

Anber merged 2 commits into
callstack:masterfrom
Anber:chore/commitlint-21-husky-9

Conversation

@Anber

@Anber Anber commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

commitlint and @commitlint/config-conventional go from 8.3.6 to 21.2.3, husky from 1.3.1 to 9.1.7, one commit per tool. husky 9 reads no package.json key and sets no HUSKY_GIT_PARAMS, so the hooks move into files; raising the version alone would silently turn both off.

 package.json
-  "husky": { "hooks": {
-    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
-    "pre-commit": "pnpm check:all" } },
-  "prepare": "turbo run build --output-logs=new-only",
+  "prepare": "husky && turbo run build --output-logs=new-only",
 .husky/pre-commit
+pnpm check:all
 .husky/commit-msg
+pnpm exec commitlint --edit "$1"
 .github/workflows/release.yml   (release job)
+    env:
+      HUSKY: 0
  • commitlint.config.js becomes commitlint.config.mjs with export default and the same single preset. The git-raw-commits devDependency and resolutions entry go; only @commitlint/read 8 used it.
  • prepare keeps the build that release and the CI install use.
  • HUSKY: 0 is the only CI change. husky 1.3.1 skipped CI; 9.1.7 installs wherever .git exists, and the release job's install runs prepare. The commit-msg hook would then reject the Version Packages commit of changesets/action ([subject-empty], [type-empty]), which uses a plain git commit -m. The other workflows make no commit that the hook could reject: check.yml makes none, and the deploy action in site-deploy.yml commits with --no-verify.
  • 21.2.3 rather than 21.2.4, published on 2026-10-18, five days before this change. The newest package added to the lockfile is from 2026-10-05.

Lockfile

99 keys leave (the commitlint 8 and husky 1 closures) and 44 arrive; no retained package changes version. Two side effects of pnpm 9.15.9:

  • jiti 2.6.1 enters through @commitlint/load and satisfies the optional jiti peer of vite, so pnpm adds (jiti@2.6.1) to 11 snapshot keys and importer lines of examples/astro-solid and examples/vite. Their versions do not move; the suffix stripped by hand is written back the next time pnpm resolves.
  • semver@7.8.5 loses optional: true, since @commitlint/is-ignored 21.2.3 depends on it directly.

Evidence

pnpm 9.15.9, Node 24.4.1:

pnpm install --frozen-lockfile --strict-peer-dependencies   # clean clone, as CI runs it
pnpm install --frozen-lockfile --ignore-scripts             # at each commit
pnpm lint && pnpm sp:check && pnpm check:all
pnpm exec commitlint --from 9fc8b2de --to HEAD
printf 'foo: bar\n' | pnpm exec commitlint
printf 'chore(deps): update commitlint\n' | pnpm exec commitlint
  • The CI install exits 0: prepare ran husky and the build, core.hooksPath is .husky/_, git status --short is empty.
  • foo: bar exits 1 with [type-enum]; the good message exits 0 silently.
  • In a clone with the hooks installed and .husky/pre-commit set to exit 0 there (so the slow checks cannot mask the result), git commit -m 'foo: bar' is rejected with [type-enum] and the commit count is unchanged; git commit -m 'chore: try hooks' succeeds.
  • With the real pre-commit hook, a commit ran sh -e .husky/pre-commit and pnpm check:all passed.
  • git commit -m 'Version Packages' exits 1 with the hooks installed; HUSKY=0 pnpm exec husky prints HUSKY=0 skip install and leaves core.hooksPath unset.

Left out

  • No changeset: the root manifest is private and nothing under packages/, examples/ or website/ changes.
  • No new commitlint rules; the defaults of config-conventional 21 apply.
  • The .git/hooks files husky 1 left in existing clones are not removed.

Not verified

  • No CI result yet; the release and Windows jobs did not run.
  • HUSKY: 0 was checked only locally, not in a release run.

Anber added 2 commits October 23, 2026 17:53
Move commitlint and @commitlint/config-conventional from 8.3 to 21.2.3
and turn the configuration into an ES module, commitlint.config.mjs,
with the same single preset.

Drop the git-raw-commits devDependency and resolution: only commitlint 8
used that package, and commitlint 21 reads the history through
@conventional-changelog/git-client instead.
Move husky from 1.3 to 9.1.7. husky 9 no longer reads hooks from
package.json and no longer sets HUSKY_GIT_PARAMS, so the two hooks move
from the `husky` key of the manifest to .husky/pre-commit and
.husky/commit-msg with the same commands; commit-msg now passes the
message file git gives it to `commitlint --edit`.

`prepare` runs `husky` before the build to install the hooks.

husky 1.3 did not install hooks on CI, husky 9 does, so the release job
sets HUSKY=0: otherwise commit-msg would reject the "Version Packages"
commit that changesets/action creates.
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c448246

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Anber
Anber merged commit 0094f37 into callstack:master Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant