Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency husky to v9 #627

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 25, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
husky 8.0.3 -> 9.1.1 age adoption passing confidence

Release Notes

typicode/husky (husky)

v9.1.1

Compare Source

v9.1.0

Compare Source

Super saiyan god dog! It's over 9.0.0!

There's a bug with this release which prevents the deprecation notice to appear and requires to remove #!/usr/bin/env sh and . "$(dirname -- "$0")/_/husky.sh" (which are deprecated by the way). I'll publish a new version to fix that. Sorry about any inconvenience.

What's new

You can now run package commands directly, no need for npx or equivalents.
It makes writing hooks more intuitive and is also slightly faster 🐺⚡️

### .husky/pre-commit
- npx jest
+ jest # ~0.2s faster

A new recipe has been added to the docs. Lint staged files without external dependencies (inspired by Prettier docs). Feel free to modify it.

### .husky/pre-commit
prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown
git update-index --again

For more advanced use cases, see lint-staged.

Fixes

  • bunx husky init command
  • Workaround for some hooks implementation on Windows 🤷

Deprecations

  • Remove #!/usr/bin/env sh and . "$(dirname -- "$0")/_/husky.sh" from your hooks
  • Move your code from ~/.huskyrc to .config/husky/init.sh

Support for these will be removed in v10, notices have been added.

Friendly reminder

If Git hooks don't fit your workflow, you can disable Husky globally. Just add export HUSKY=0 to .config/husky/init.sh.

I've seen some confusion about this on X, so just a heads-up!

Sponsoring

Husky is downloaded over 45M times per month and used by ~1.5M projects. If your company wants to sponsor, you can do so here: GitHub Sponsors.

Have a nice summer ☀️ I'm open to new opportunities/consulting so feel free to drop me a message 😉

v9.0.11

Compare Source

v9.0.10

Compare Source

v9.0.9

Compare Source

v9.0.8

Compare Source

v9.0.7

Compare Source

v9.0.6

Compare Source

v9.0.5

Compare Source

v9.0.4

Compare Source

v9.0.3

Compare Source

v9.0.2

Compare Source

What's Changed

New Contributors

Full Changelog: typicode/husky@v9.0.1...v9.0.2

v9.0.1

Compare Source

Kicking off the year with an exciting update!

TLDR;

Improved user experience and a (even) smaller package size while packing in more features!

👋 By the Way

I'm available for remote work (Front-end/Back-end mainly JS/TS but open to other stacks Rails, Go, Elixir). You can contact me at my mail: typicode at gmail 🙂

Introducing husky init

Adding husky to a project is now easier than ever. Although the installation process was straightforward, it often required consulting the documentation.

v8
npm pkg set scripts.prepare="husky install"
npm run prepare
npx husky add .husky/pre-commit "npm test"
v9
npx husky init

Adding a New Hook

Adding a hook is now as simple as creating a file. This can be accomplished using your favorite editor, a script or a basic echo command.

v8
npx husky add  .husky/pre-commit "npm test"
git add --chmod=+x .husky/pre-commit # On Windows
v9
echo "npm test" > .husky/pre-commit

Further Size Reduction

v8 was already the most compact Git hooks manager at approximately 6kB.

v9 takes this a step further, reducing the size to just 3kB, likely making it the smallest devDependency in your toolkit.

To give you an idea of how small it is, the biggest file in the project is the MIT license 😄

More to Come

Additional features are in the pipeline for v9. Stay tuned 🙌

Other Changes

  • Enhanced security with CI and npm --provenance for safer publishing.
  • Added $XDG_CONFIG_HOME support. Move ~/.huskyrc to ~/.config/husky/init.sh for centralized configuration.
  • Fixed permission issue for Windows-created hooks; they no longer need to be executable.
  • Removed husky install. Use husky or husky some/dir for the same functionality (deprecation notice to be added).
  • Modified behavior when .git is missing; it now triggers a warning instead of failure.
  • Replaced HUSKY_DEBUG=1 with HUSKY=2 for debugging.
  • Updated the Husky API for module usage.
  • Transitioned to ESM for module usage.
  • Dropped support for Node 14 and 16.
  • Revamped docs.

How to Migrate

v9 is backward compatible with v8, allowing you to freely upgrade and migrate your hooks later.

package.json

{
  "scripts": {
-   "prepare": "husky install"
+   "prepare": "husky"
  }
}

.husky/pre-commit

- #!/usr/bin/env sh
- . "$(dirname -- "$0")/_/husky.sh"
npm test

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

changeset-bot bot commented Jan 25, 2024

⚠️ No Changeset found

Latest commit: f184ee6

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

Copy link

vercel bot commented Jan 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
use-wait-for-transaction-hash ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2024 6:01pm

Copy link

socket-security bot commented Jan 25, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@eslint-community/eslint-utils@4.4.0 Transitive: environment, filesystem, unsafe +19 4.8 MB eslint-community-bot
npm/@eslint-community/regexpp@4.11.0 None 0 446 kB eslint-community-bot
npm/@eslint/eslintrc@3.1.0 filesystem, unsafe Transitive: eval +4 1.75 MB eslintbot
npm/css-tree@1.1.3 None 0 989 kB lahmatiy
npm/domelementtype@2.3.0 None 0 11.4 kB feedic
npm/domhandler@4.3.1 None 0 44.6 kB feedic
npm/es-abstract@1.23.3 None +8 2.53 MB ljharb
npm/es-shim-unscopables@1.0.2 None 0 11 kB ljharb
npm/eslint-rule-docs@1.1.235 None 0 200 kB stefanbuck
npm/eslint-visitor-keys@3.4.3 None 0 32.3 kB eslintbot
npm/espree@10.1.0 None +2 133 kB eslintbot
npm/esquery@1.6.0 None 0 1.04 MB michaelficarra
npm/estraverse@5.3.0 None 0 37.1 kB michaelficarra

🚮 Removed packages: npm/husky@8.0.3, npm/import-fresh@3.3.0, npm/isomorphic-fetch@3.0.0, npm/lint-staged@15.2.7, npm/microbundle@0.15.1, npm/minimist@1.2.8, npm/msw@1.3.3, npm/node-fetch@2.7.0, npm/object-assign@4.1.1, npm/parse-json@5.2.0, npm/postcss-value-parser@4.2.0, npm/prettier@3.3.3, npm/quick-lru@7.0.0, npm/read-pkg-up@7.0.1, npm/readable-stream@3.6.2, npm/resolve-from@5.0.0, npm/resolve-global@1.0.0, npm/resolve@1.22.8, npm/rimraf@5.0.9, npm/semver@7.6.0, npm/sort-package-json@2.10.0, npm/string-width@7.2.0, npm/strip-ansi@7.1.0, npm/terser@5.31.2, npm/through@2.3.8, npm/ts-node@10.9.2, npm/tsd@0.31.1, npm/tslib@2.6.3, npm/xo@0.59.0

View full report↗︎

Copy link

vercel bot commented Jan 26, 2024

Deployment failed with the following error:

Resource is limited - try again in 34 seconds (more than 100, code: "api-deployments-free-per-day").

Copy link

vercel bot commented Feb 1, 2024

Deployment failed with the following error:

Resource is limited - try again in 34 minutes (more than 100, code: "api-deployments-free-per-day").

Copy link

coderabbitai bot commented Jul 17, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

socket-security bot commented Jul 18, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

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.

None yet

0 participants