kvalita 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,18 +13,15 @@ Kvalita provides reusable, opinionated configurations for maintaining consistent
13
13
  bun add -d kvalita
14
14
  ```
15
15
 
16
- Each configuration can be used independently - import only what your project needs.
16
+ This will automatically install all required dependencies.
17
+
18
+ > [!NOTE]
19
+ > All tools are installed together for simplicity, even if you only use some of the configurations. This ensures all CLIs and configs work correctly and avoids resolution issues.
17
20
 
18
21
  ## Usage
19
22
 
20
23
  ### [Biome](https://github.com/biomejs/biome) Configuration
21
24
 
22
- Install the required dependencies:
23
-
24
- ```bash
25
- bun add -d @biomejs/biome
26
- ```
27
-
28
25
  Create a `biome.json` file in your project root:
29
26
 
30
27
  ```json
@@ -35,12 +32,6 @@ Create a `biome.json` file in your project root:
35
32
 
36
33
  ### [Commitlint](https://github.com/conventional-changelog/commitlint) Configuration
37
34
 
38
- Install the required dependencies:
39
-
40
- ```bash
41
- bun add -d @commitlint/cli @commitlint/config-conventional
42
- ```
43
-
44
35
  Create a `commitlint.json` file in your project root:
45
36
 
46
37
  ```json
@@ -51,12 +42,6 @@ Create a `commitlint.json` file in your project root:
51
42
 
52
43
  ### [Semantic Release](https://github.com/semantic-release/semantic-release) Configuration
53
44
 
54
- Install the required dependencies:
55
-
56
- ```bash
57
- bun add -d semantic-release conventional-changelog-conventionalcommits
58
- ```
59
-
60
45
  Create a `release.json` file in your project root:
61
46
 
62
47
  ```json
@@ -66,3 +51,22 @@ Create a `release.json` file in your project root:
66
51
  ```
67
52
 
68
53
  This configuration uses the `conventionalcommits` preset, which supports the `feat!:` syntax for breaking changes.
54
+
55
+ ### [Lefthook](https://github.com/evilmartians/lefthook) Configuration
56
+
57
+ Create a `lefthook.json` file in your project root and extend the hooks you need:
58
+
59
+ ```json
60
+ {
61
+ "extends": [
62
+ "node_modules/kvalita/configs/lefthook-biome.json",
63
+ "node_modules/kvalita/configs/lefthook-typescript.json",
64
+ "node_modules/kvalita/configs/lefthook-commitlint.json"
65
+ ]
66
+ }
67
+ ```
68
+
69
+ **Available hooks:**
70
+ - `lefthook-biome.json` - Lints and formats staged files with Biome (pre-commit)
71
+ - `lefthook-typescript.json` - Type checks TypeScript files (pre-commit)
72
+ - `lefthook-commitlint.json` - Validates commit messages (commit-msg)
@@ -1,6 +1,7 @@
1
1
  {
2
- "extends": ["@commitlint/config-conventional"],
3
- "rules": {
4
- "subject-case": [2, "always", "sentence-case"]
5
- }
6
- }
2
+ "$schema": "https://json.schemastore.org/commitlintrc.json",
3
+ "extends": ["@commitlint/config-conventional"],
4
+ "rules": {
5
+ "subject-case": [2, "always", "sentence-case"]
6
+ }
7
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/lefthook.json",
3
+ "pre-commit": {
4
+ "parallel": true,
5
+ "commands": {
6
+ "lint:biome": {
7
+ "glob": "*.{ts,tsx,js,jsx,json,jsonc,css,graphql,gql}",
8
+ "run": "bunx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}",
9
+ "stage_fixed": true
10
+ }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/lefthook.json",
3
+ "commit-msg": {
4
+ "commands": {
5
+ "lint:commitlint": {
6
+ "run": "bunx commitlint --config ./commitlint.json --edit {1}"
7
+ }
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/lefthook.json",
3
+ "pre-commit": {
4
+ "commands": {
5
+ "typescript": {
6
+ "glob": "*.{ts,tsx}",
7
+ "run": "bunx tsc --noEmit"
8
+ }
9
+ }
10
+ }
11
+ }
package/package.json CHANGED
@@ -23,6 +23,15 @@
23
23
  "scripts": {
24
24
  "prepare": "lefthook install"
25
25
  },
26
+ "peerDependencies": {
27
+ "@biomejs/biome": ">=2.0.0",
28
+ "@commitlint/cli": ">=19.0.0",
29
+ "@commitlint/config-conventional": ">=19.0.0",
30
+ "conventional-changelog-conventionalcommits": ">=8.0.0",
31
+ "lefthook": ">=1.0.0",
32
+ "semantic-release": ">=23.0.0",
33
+ "typescript": ">=5.0.0"
34
+ },
26
35
  "devDependencies": {
27
36
  "@biomejs/biome": "^2.2.4",
28
37
  "@commitlint/cli": "^20.1.0",
@@ -30,7 +39,7 @@
30
39
  "conventional-changelog-conventionalcommits": "^9.1.0",
31
40
  "lefthook": "^1.13.6",
32
41
  "semantic-release": "^24.2.9",
33
- "typescript": "^5.9.2"
42
+ "typescript": "^5.9.3"
34
43
  },
35
- "version": "1.1.0"
44
+ "version": "1.3.0"
36
45
  }