Skip to content

Commit db71c48

Browse files
committed
chore: add pre-commit and pre-push hooks with husky
- Pre-commit: run lint + build CDN and verify no changes - Pre-push: run tests
1 parent 04a0aa4 commit db71c48

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
npm run lint
2+
npm run build:cdn
3+
git diff --exit-code dist/cdn/ || (echo "CDN bundle is out of sync. Please commit the updated dist/cdn/ files." && exit 1)

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

package-lock.json

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"packages/test-performance"
3737
],
3838
"scripts": {
39+
"prepare": "husky",
3940
"docs:preview": "docsify serve docs",
4041
"lint": "biome check .",
4142
"lint:fix": "biome check --write .",
@@ -55,6 +56,7 @@
5556
"conventional-changelog-cli": "^5.0.0",
5657
"docsify-cli": "^4.4.4",
5758
"esbuild": "^0.27.0",
59+
"husky": "^9.1.7",
5860
"tiny-glob": "^0.2.9",
5961
"typescript": "~5.9.3",
6062
"vitest": "^4.0.17"

0 commit comments

Comments
 (0)