Skip to content

Commit 8065465

Browse files
committed
feat: add husky and conventional commits setup
- Install husky, commitlint, and commitizen dependencies - Configure pre-commit hook to run 'bun run check' - Configure commit-msg hook for conventional commit validation - Add commitlint.config.js with conventional commit rules - Add interactive commit script with commitizen - Enable proper Git hooks for consistent development workflow
1 parent e579ff1 commit 8065465

6 files changed

Lines changed: 479 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: bun run check
2727

2828
- name: Run tests with coverage
29-
run: bun test --coverage
29+
run: bun test --coverage --coverage-reporter=lcov
3030

3131
- name: Upload coverage to Coveralls
3232
uses: coverallsapp/github-action@v2

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bunx commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bun run check

bun.lock

Lines changed: 423 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commitlint.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
// Allow all conventional commit types (as per CLAUDE.md requirements)
5+
'type-enum': [
6+
2,
7+
'always',
8+
[
9+
'feat',
10+
'fix',
11+
'docs',
12+
'style',
13+
'refactor',
14+
'perf',
15+
'test',
16+
'build',
17+
'ci',
18+
'chore',
19+
'revert'
20+
]
21+
],
22+
'header-max-length': [2, 'always', 100],
23+
'subject-case': [2, 'always', 'lower-case'],
24+
'subject-empty': [2, 'never'],
25+
'subject-full-stop': [2, 'never', '.']
26+
}
27+
}

package.json

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
"name": "zip-json",
33
"version": "1.0.0",
44
"description": "Zip files and folders into a JSON format for bundling and runtime extraction",
5-
"keywords": ["zip", "json", "bundle", "compress", "archive", "bun"],
5+
"keywords": [
6+
"zip",
7+
"json",
8+
"bundle",
9+
"compress",
10+
"archive",
11+
"bun"
12+
],
613
"author": "Your Name",
714
"license": "MIT",
815
"repository": {
@@ -33,27 +40,39 @@
3340
"build": "bun run scripts/build.ts",
3441
"build:watch": "bun run scripts/build.ts --watch",
3542
"test": "bun test",
36-
"test:coverage": "bun test --coverage",
43+
"test:coverage": "bun test --coverage --coverage-reporter=lcov",
3744
"test:watch": "bun test --watch",
3845
"lint": "biome check --apply ./src",
3946
"format": "biome format --write ./src ./tests",
4047
"check": "biome check ./src ./tests",
4148
"prepublishOnly": "bun run build && bun run test:coverage",
42-
"postbuild": "chmod +x bin/zip-json.js"
49+
"postbuild": "chmod +x bin/zip-json.js",
50+
"prepare": "husky",
51+
"commit": "cz"
4352
},
4453
"dependencies": {
4554
"commander": "^12.0.0",
4655
"glob": "^10.3.10",
4756
"chalk": "^5.3.0"
4857
},
4958
"devDependencies": {
59+
"@biomejs/biome": "^1.5.0",
60+
"@commitlint/cli": "^19.8.1",
61+
"@commitlint/config-conventional": "^19.8.1",
5062
"@types/bun": "latest",
5163
"@types/node": "^22.0.0",
52-
"typescript": "^5.3.0",
53-
"@biomejs/biome": "^1.5.0"
64+
"commitizen": "^4.3.1",
65+
"cz-conventional-changelog": "^3.3.0",
66+
"husky": "^9.1.7",
67+
"typescript": "^5.3.0"
5468
},
5569
"engines": {
5670
"node": ">=22.0.0"
5771
},
58-
"engineStrict": true
59-
}
72+
"engineStrict": true,
73+
"config": {
74+
"commitizen": {
75+
"path": "cz-conventional-changelog"
76+
}
77+
}
78+
}

0 commit comments

Comments
 (0)