From a5f6ad1edfa0deea75af2940e24e83b63b0cb6a8 Mon Sep 17 00:00:00 2001 From: sebastianjnuwu Date: Sun, 22 Dec 2024 09:14:00 -0300 Subject: [PATCH] feat(repo): add husky, commitlint, cz --- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ android/build.gradle | 6 +----- commitlint.config.js | 1 + package.json | 6 +++++- 5 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .husky/commit-msg create mode 100644 .husky/pre-commit create mode 100644 commitlint.config.js diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..9dcdbc2 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname -- "$0")/_/husky.sh" + +npx --no -- commitlint --edit ${1} diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..5d95df1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +npm run lint +npm run format + +echo "Done!" \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index e6d4bd3..c538ce6 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,3 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { @@ -8,10 +7,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:8.7.3' - classpath 'com.google.gms:google-services:4.4.2' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.google.gms:google-services:4.4.2'ssssss } } diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..fa584fb --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +export default { extends: ["@commitlint/config-conventional"] }; diff --git a/package.json b/package.json index b70f847..7a98696 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "preview": "vite preview", "copy": "npx cap copy", "update": "npx cap update", - "sync": "npx cap sync" + "sync": "npx cap sync", + "prepare": "husky" }, "dependencies": { "@capacitor-community/admob": "^6.1.0", @@ -28,8 +29,11 @@ "@babel/preset-env": "^7.26.0", "@biomejs/biome": "1.9.4", "@capacitor/cli": "^6.2.0", + "@commitlint/cli": "^19.6.1", + "@commitlint/config-conventional": "^19.6.0", "babel-plugin-transform-remove-console": "^6.9.4", "core-js": "^3.39.0", + "husky": "^9.1.7", "typescript": "^5.7.2", "vite": "^5.4.2", "vite-plugin-babel": "^1.3.0"