Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Jan 30, 2024

This PR contains the following updates:

Package Change Age Confidence
husky 5.1.29.1.7 age confidence

Release Notes

typicode/husky (husky)

v9.1.7

Compare Source

What's Changed

New Contributors

Full Changelog: typicode/husky@v9.1.6...v9.1.7

v9.1.6

Compare Source

What's Changed

New Contributors

Full Changelog: typicode/husky@v9.1.5...v9.1.6

v9.1.5

Compare Source

What's Changed

New Contributors

Full Changelog: typicode/husky@v9.1.4...v9.1.5

v9.1.4

Compare Source

  • Improve deprecation notice

v9.1.3

Compare Source

  • fix: better handle space in PATH

v9.1.2

Compare Source

Show a message instead of automatically removing deprecated code.

This only concerns projects that still have the following code in their hooks:

- #!/usr/bin/env sh # <- This is deprecated, remove it
- . "$(dirname -- "$0")/_/husky.sh"  # <- This is deprecated, remove it

### Rest of your hook code

Hooks with these lines will fail in v10.0.0

v9.1.1

Compare Source

Super saiyan god dog! It's over 9.0.0!

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

  • #!/usr/bin/env sh and . "$(dirname -- "$0")/_/husky.sh" are deprecated. husky command will automatically remove them, no action required.
  • If you're having code in ~/.huskyrc please move it to .config/husky/init.sh

Support for these will be removed in v10.

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.1.0

Compare Source

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

  • fix: typo and source ~/.huskyrc correctly (compatibility with v8)
  • docs: fix example by @​typicode in #​1363

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

v9.0.1

Compare Source

Kicking off the year with an exciting update!

Note: install using husky@latest to get the bug fixes that were released after.

Introducing husky init

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

Adding husky to a project is now easier than ever. It's just a single line that does the same as above. No need to read the docs to get started anymore.

npx husky init

Adding a New Hook

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

Adding a hook is as simple as creating a file. This can be accomplished using your favorite editor, a script or a basic echo command. For example, on Linux/macOS:

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.

Here are the steps to migrate:

package.json

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

.husky/pre-commit

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

Note: sh will be used to run hooks, even if a shebang is set.

If you were using husky as a module:

- const husky = require('husky')
- // ...
+ import husky from 'husky'
+ console.log(husky())

v8.0.3

Compare Source

  • fix: add git not installed message #​1208

v8.0.2

Compare Source

  • docs: remove deprecated npm set-script

v8.0.1

Compare Source

  • fix: use POSIX equality operator

v8.0.0

Compare Source

What's Changed

Feats
  • feat: add husky - prefix to logged global error messages by @​joshbalfour in #​1092
  • feat: show PATH when command not found to improve debuggability
  • feat: drop Node 12 support
  • feat: skip install if $HUSKY=0
Fixes
Docs
Chore

v7.0.4

Compare Source

No changes. Husky v7.0.3 was reverted, this version is the same as v7.0.2.

v7.0.3

Compare Source

v7.0.2

Compare Source

Fix pre-commit hook in WebStorm (#​1023)

v7.0.1

Compare Source

  • Fix gracefully fail if Git command is not found #​1003 (same as in v6)

v7.0.0

Compare Source

  • Improve .husky/ directory structure. .husky/.gitignore is now unnecessary and can be removed.
  • Improve error output (shorter)
  • Update husky-init CLI
  • Update husky-4-to-7 CLI
  • Drop Node 10 support

Please help me develop and release OSS projects ❤️ on GitHub Sponsors or Open Collective. Thank you for your support!

v6.0.0

Compare Source

After being in early access for Open Source projects and Sponsors for a limited time, I'm happy to announce that husky 6 is MIT again and can be freely used in commercial projects! 🎉

Many thanks to the Open Source projects and Companies which have switched to/sponsored the new husky during this period!

OSS is my full-time job, please consider sponsoring the development of husky on GitHub sponsors or Open Collective. Thank you!

Breaking change

  • husky init has been moved to its own package (npx husky-init)

Added

  • Programmatically use husky: require('husky')
  • TypeScript definitions

Migrating from husky 4

Husky 6 contains breaking changes. If you're coming from v4, npm install husky@6 won't be enough.

Recommended: see husky-4-to-6 CLI to automatically migrate your config. There's also a dedicated section in the docs.

If you're curious why config has changed, you may be interested in reading:
https://blog.typicode.com/husky-git-hooks-javascript-config/

Also Husky 6 follows official npm and Yarn best practices regarding autoinstall. It's recommended to use prepare script instead (see usage in docs).

v5.2.0

Compare Source

  • Add set command to replace hooks (husky set .husky/pre-commit cmd)
  • Update add command to append command (husky add .husky/pre-commit cmd)
  • Improve error messages

v5.1.3

Compare Source

  • docs: add specific Yarn v2 install/uninstall instructions
  • cli: husky init will detect Yarn v2 and initialize accordingly

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.

@renovate
Copy link
Author

renovate bot commented Jan 30, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p0faa2), requested by @babel/plugin-proposal-class-properties
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p3f8ad), requested by @babel/plugin-proposal-decorators
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pa67bb), requested by @babel/plugin-proposal-do-expressions
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p52181), requested by @babel/plugin-proposal-export-default-from
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p99b25), requested by @babel/plugin-proposal-function-bind
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p572b2), requested by @babel/plugin-proposal-logical-assignment-operators
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p7489b), requested by @babel/plugin-proposal-nullish-coalescing-operator
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pf99e6), requested by @babel/plugin-proposal-optional-chaining
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p14bd5), requested by @babel/plugin-proposal-pipeline-operator
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p96292), requested by @babel/plugin-syntax-top-level-await
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p1c01c), requested by @babel/plugin-transform-destructuring
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p97938), requested by @babel/plugin-transform-runtime
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pca456), requested by @babel/preset-env
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pbdbc6), requested by @babel/preset-react
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pa766a), requested by @babel/preset-typescript
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pb5eea), requested by babel-plugin-named-asset-import
➤ YN0002: │ @birman/utils@npm:1.2.1 doesn't provide @babel/core (p3781d), requested by @babel/register
➤ YN0002: │ @walrus/cli-utils@npm:1.5.0 doesn't provide typescript (pfc9de), requested by @walrus/joycon-ts-loader
➤ YN0002: │ @walrus/joycon-ts-loader@npm:1.0.0 [af033] doesn't provide @types/node (p2573b), requested by ts-node
➤ YN0060: │ @walrus/plugin-eslint@npm:1.2.3 provides eslint (pa3e8a) with version 7.8.0, which doesn't satisfy what eslint-plugin-vue and some of its descendants request
➤ YN0002: │ father-build@npm:1.20.4 doesn't provide webpack (p5b954), requested by ts-loader
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 1s 251ms
➤ YN0000: ┌ Fetch step
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at PassThrough.onclose (node:internal/streams/end-of-stream:154:30)
    at PassThrough.emit (node:events:518:28)
    at emitCloseNT (node:internal/streams/destroy:147:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
➤ YN0013: │ No packages were cached - one package had to be fetched (husky@npm:9.0.11)
➤ YN0000: └ Completed in 0s 459ms
➤ YN0000: Failed with errors in 1s 717ms

@renovate renovate bot force-pushed the renovate/husky-9.x branch from 37930a8 to c5780c4 Compare February 2, 2024 21:03
@renovate renovate bot force-pushed the renovate/husky-9.x branch from c5780c4 to 36d6d07 Compare February 14, 2024 00:53
@renovate renovate bot force-pushed the renovate/husky-9.x branch from 36d6d07 to e93cd58 Compare July 17, 2024 17:51
@renovate
Copy link
Author

renovate bot commented Jul 17, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p0faa2), requested by @babel/plugin-proposal-class-properties
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p3f8ad), requested by @babel/plugin-proposal-decorators
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pa67bb), requested by @babel/plugin-proposal-do-expressions
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p52181), requested by @babel/plugin-proposal-export-default-from
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p99b25), requested by @babel/plugin-proposal-function-bind
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p572b2), requested by @babel/plugin-proposal-logical-assignment-operators
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p7489b), requested by @babel/plugin-proposal-nullish-coalescing-operator
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pf99e6), requested by @babel/plugin-proposal-optional-chaining
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p14bd5), requested by @babel/plugin-proposal-pipeline-operator
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p96292), requested by @babel/plugin-syntax-top-level-await
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p1c01c), requested by @babel/plugin-transform-destructuring
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (p97938), requested by @babel/plugin-transform-runtime
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pca456), requested by @babel/preset-env
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pbdbc6), requested by @babel/preset-react
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pa766a), requested by @babel/preset-typescript
➤ YN0002: │ @birman/babel-preset-birman@npm:1.2.1 doesn't provide @babel/core (pb5eea), requested by babel-plugin-named-asset-import
➤ YN0002: │ @birman/utils@npm:1.2.1 doesn't provide @babel/core (p3781d), requested by @babel/register
➤ YN0002: │ @walrus/cli-utils@npm:1.5.0 doesn't provide typescript (pfc9de), requested by @walrus/joycon-ts-loader
➤ YN0002: │ @walrus/joycon-ts-loader@npm:1.0.0 [af033] doesn't provide @types/node (p2573b), requested by ts-node
➤ YN0060: │ @walrus/plugin-eslint@npm:1.2.3 provides eslint (pa3e8a) with version 7.8.0, which doesn't satisfy what eslint-plugin-vue and some of its descendants request
➤ YN0002: │ father-build@npm:1.20.4 doesn't provide webpack (p5b954), requested by ts-loader
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 707ms
➤ YN0000: ┌ Fetch step
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at PassThrough.onclose (node:internal/streams/end-of-stream:166:30)
    at PassThrough.emit (node:events:508:28)
    at emitCloseNT (node:internal/streams/destroy:148:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:88:21)
➤ YN0013: │ No packages were cached - one package had to be fetched (husky@npm:9.1.7)
➤ YN0000: └ Completed in 0s 229ms
➤ YN0000: Failed with errors in 0s 941ms

@renovate renovate bot force-pushed the renovate/husky-9.x branch from e93cd58 to 770c0d1 Compare July 18, 2024 14:18
@renovate renovate bot force-pushed the renovate/husky-9.x branch 3 times, most recently from 5dc5101 to f18ab61 Compare July 29, 2024 16:15
@renovate renovate bot force-pushed the renovate/husky-9.x branch from f18ab61 to fc46f41 Compare August 20, 2024 14:23
@renovate renovate bot force-pushed the renovate/husky-9.x branch from fc46f41 to 220f408 Compare September 12, 2024 00:58
@renovate renovate bot force-pushed the renovate/husky-9.x branch from 220f408 to 5b2a47f Compare November 18, 2024 17:30
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