Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: typicode/husky
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.0.7
Choose a base ref
...
head repository: typicode/husky
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.0.8
Choose a head ref
  • 7 commits
  • 5 files changed
  • 3 contributors

Commits on Jan 29, 2024

  1. docs: fix link (#1369)

    wrong url routing to wrong md file, changed that
    khaledYS authored Jan 29, 2024
    Copy the full SHA
    5eb3553 View commit details
  2. docs: fix links

    typicode authored Jan 29, 2024
    Copy the full SHA
    3e13656 View commit details
  3. Copy the full SHA
    b98985d View commit details

Commits on Jan 30, 2024

  1. docs: update list

    typicode authored Jan 30, 2024
    Copy the full SHA
    798f1ad View commit details

Commits on Feb 1, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d091328 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a5a45fc View commit details
  3. 9.0.8

    typicode committed Feb 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    211b80a View commit details
Showing with 24 additions and 19 deletions.
  1. +16 −12 bin.js
  2. +4 −3 docs/index.md
  3. +2 −2 package-lock.json
  4. +1 −1 package.json
  5. +1 −1 test/7_init.sh
28 changes: 16 additions & 12 deletions bin.js
Original file line number Diff line number Diff line change
@@ -2,21 +2,25 @@
import f, { writeFileSync as w } from 'fs'
import i from './index.js'

let a = process.argv[2]
let p, a, n, s, o, d

p = process
a = p.argv[2]

if (a == 'init') {
let p = 'package.json'
let d = JSON.parse(f.readFileSync(p))
; (d.scripts ||= {}).prepare = 'husky'
w('package.json', JSON.stringify(d, null, /\t/.test() ? '\t' : 2) + '\n')
process.stdout.write(i())
try { f.mkdirSync('.husky') } catch { }
w('.husky/pre-commit', process.env.npm_config_user_agent.split('/')[0] + ' test\n')
process.exit()
n = 'package.json'
s = f.readFileSync(n)
o = JSON.parse(s)
;(o.scripts ||= {}).prepare = 'husky'
w(n, JSON.stringify(o, 0, /\t/.test(s) ? '\t' : 2) + '\n')
p.stdout.write(i())
try { f.mkdirSync('.husky') } catch {}
w('.husky/pre-commit', p.env.npm_config_user_agent.split('/')[0] + ' test\n')
p.exit()
}

let d = c => console.error(`${c} command is deprecated`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); process.exit(1) }
d = c => console.error(`${c} command is deprecated`)
if (['add', 'set', 'uninstall'].includes(a)) { d(a); p.exit(1) }
if (a == 'install') d(a)

process.stdout.write(i(a == 'install' ? undefined : a))
p.stdout.write(i(a == 'install' ? undefined : a))
7 changes: 4 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ Husky enhances your commits and more 🐶 _woof!_

Automatically **lint your commit messages**, **code**, and **run tests** upon committing or pushing.

Get started [here](/get-started).
Get started [here](/get-started.md).

[Check out the v9 changelog](https://github.com/typicode/husky/releases/tag/v9.0.1) to discover all the new and improved features! 🚀

@@ -59,9 +59,10 @@ Husky is used in [**over 1.3M projects**](https://github.com/typicode/husky/netw
- [stylelint/stylelint](https://github.com/stylelint/stylelint)
- [colinhacks/zod](https://github.com/colinhacks/zod)
- [rollup/rollup](https://github.com/rollup/rollup)
- [tinyhttp/tinyhttp](https://github.com/tinyhttp/tinyhttp)
- ...

## Articles

- [Why husky has dropped conventional JS config](https://blog.typicode.com/husky-git-hooks-javascript-config/)
- [Why husky doesn't autoinstall anymore](https://blog.typicode.com/husky-git-hooks-autoinstall/)
- [Why husky has dropped conventional JS config](https://blog.typicode.com/posts/husky-git-hooks-javascript-config/)
- [Why husky doesn't autoinstall anymore](https://blog.typicode.com/posts/husky-git-hooks-autoinstall/)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "husky",
"version": "9.0.7",
"version": "9.0.8",
"description": "Modern native Git hooks",
"keywords": [
"git",
2 changes: 1 addition & 1 deletion test/7_init.sh
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@
setup
install

npx --no-install husky init
expect 0 "npx --no-install husky init"