@abelspithost/commitlint 0.0.2 → 0.1.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 +11 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +19 -16
package/README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @abelspithost/commitlint
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://sonarcloud.io/summary/new_code?id=aspithost_commitlint)
|
|
4
|
+
|
|
5
|
+
A shared [commitlint](https://commitlint.js.org/) preset that extends `@commitlint/config-conventional` with stricter defaults, plus a CLI to set everything up with one command.
|
|
4
6
|
|
|
5
7
|
## What's included
|
|
6
8
|
|
|
7
9
|
- Commitlint configuration that extends `@commitlint/config-conventional`
|
|
8
10
|
- Scope is optional by default
|
|
9
|
-
- A `createConfig` helper to customize allowed types and scopes (
|
|
11
|
+
- A `createConfig` helper to customize allowed types and scopes (when you provide scopes, they become mandatory)
|
|
10
12
|
- An `init` CLI that installs and configures commitlint + husky automatically
|
|
11
13
|
- Automatic package manager detection (npm, yarn, pnpm, bun)
|
|
12
14
|
|
|
@@ -18,17 +20,17 @@ Run the init command in your project root:
|
|
|
18
20
|
npx -p @abelspithost/commitlint init
|
|
19
21
|
```
|
|
20
22
|
|
|
21
|
-
The CLI
|
|
23
|
+
The CLI detects your package manager by looking for `bun.lockb`/`bun.lock`, `pnpm-lock.yaml`, `yarn.lock`, or falling back to npm. It will:
|
|
22
24
|
|
|
23
25
|
1. Install `husky`, `@commitlint/cli`, and `@abelspithost/commitlint` as dev dependencies
|
|
24
26
|
2. Initialize husky
|
|
25
|
-
3. Remove the default `pre-commit` hook
|
|
27
|
+
3. Remove the default `pre-commit` hook that husky creates
|
|
26
28
|
4. Create a `.husky/commit-msg` hook (using the correct runner for your package manager)
|
|
27
|
-
5. Generate a `commitlint.config.ts` that re-exports the preset (
|
|
29
|
+
5. Generate a `commitlint.config.ts` that re-exports the preset (skip if one already exists)
|
|
28
30
|
|
|
29
31
|
## Manual setup (npm)
|
|
30
32
|
|
|
31
|
-
Install the dependencies:
|
|
33
|
+
Install the required dependencies:
|
|
32
34
|
|
|
33
35
|
```sh
|
|
34
36
|
npm install --save-dev husky @commitlint/cli @abelspithost/commitlint
|
|
@@ -71,7 +73,7 @@ export default createConfig({
|
|
|
71
73
|
| `scopes` | `string[]` | — | Restrict commits to these scopes (makes scope mandatory) |
|
|
72
74
|
| `types` | `string[]` | `COMMIT_TYPES` | Override the allowed commit types |
|
|
73
75
|
|
|
74
|
-
When `scopes
|
|
76
|
+
When you omit `scopes`, scope is optional and you can use any value. When you provide `scopes`, scope becomes **required** and must match one of the listed values. When you omit `types`, it defaults to the built-in `COMMIT_TYPES`.
|
|
75
77
|
|
|
76
78
|
### Examples
|
|
77
79
|
|
|
@@ -113,11 +115,11 @@ const configuration: UserConfig = {
|
|
|
113
115
|
export default configuration;
|
|
114
116
|
```
|
|
115
117
|
|
|
116
|
-
`RuleConfigSeverity` and `UserConfig
|
|
118
|
+
This package re-exports `RuleConfigSeverity` and `UserConfig`, so you don't need to install `@commitlint/types` separately.
|
|
117
119
|
|
|
118
120
|
## Commit message format
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
Write your commits in the [Conventional Commits](https://www.conventionalcommits.org/) format:
|
|
121
123
|
|
|
122
124
|
```
|
|
123
125
|
type: description
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { RuleConfigSeverity, type UserConfig } from '@commitlint/types';
|
|
2
|
-
export { COMMIT_TYPES } from './constants/commitTypes.js';
|
|
3
2
|
export { configuration, configuration as default, createConfig } from './config/config.js';
|
|
3
|
+
export { COMMIT_TYPES } from './constants/commitTypes.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { RuleConfigSeverity } from '@commitlint/types';
|
|
2
|
-
export { COMMIT_TYPES } from './constants/commitTypes.js';
|
|
3
2
|
export { configuration, configuration as default, createConfig } from './config/config.js';
|
|
3
|
+
export { COMMIT_TYPES } from './constants/commitTypes.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abelspithost/commitlint",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Shared commitlint preset extending @commitlint/config-conventional with stricter defaults",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commitlint",
|
|
@@ -39,8 +39,11 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
42
|
+
"build": "npm run clean && npm run typecheck && tsc -p tsconfig.build.json && npm run deps:check",
|
|
43
43
|
"clean": "rimraf dist",
|
|
44
|
+
"deps:check": "npx -y npm-check-updates --cooldown 2",
|
|
45
|
+
"deps:update": "npx -y npm-check-updates -u --target minor --cooldown 2 && npm install",
|
|
46
|
+
"deps:update:major": "npx -y npm-check-updates -u --cooldown 2 && npm install",
|
|
44
47
|
"lint": "eslint .",
|
|
45
48
|
"test:unit": "vitest",
|
|
46
49
|
"test:cov": "vitest run --coverage --coverage.reporter=text",
|
|
@@ -48,22 +51,22 @@
|
|
|
48
51
|
"prepare": "husky || true"
|
|
49
52
|
},
|
|
50
53
|
"dependencies": {
|
|
51
|
-
"@commitlint/config-conventional": "^
|
|
52
|
-
"@commitlint/format": "^
|
|
53
|
-
"@commitlint/types": "^
|
|
54
|
+
"@commitlint/config-conventional": "^21.0.1",
|
|
55
|
+
"@commitlint/format": "^21.0.1",
|
|
56
|
+
"@commitlint/types": "^21.0.1"
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
|
-
"@abelspithost/eslint-config-ts": "^
|
|
57
|
-
"@abelspithost/tsconfig-node": "^0.0.
|
|
58
|
-
"@commitlint/cli": "^
|
|
59
|
-
"@types/node": "^24.
|
|
60
|
-
"@vitest/coverage-v8": "^4.
|
|
61
|
-
"commitlint": "^
|
|
62
|
-
"eslint": "^
|
|
59
|
+
"@abelspithost/eslint-config-ts": "^1.1.0",
|
|
60
|
+
"@abelspithost/tsconfig-node": "^0.0.5",
|
|
61
|
+
"@commitlint/cli": "^21.0.1",
|
|
62
|
+
"@types/node": "^24.12.4",
|
|
63
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
64
|
+
"commitlint": "^21.0.1",
|
|
65
|
+
"eslint": "^10.4.0",
|
|
63
66
|
"husky": "^9.1.7",
|
|
64
|
-
"jiti": "^2.
|
|
65
|
-
"rimraf": "^6.1.
|
|
66
|
-
"typescript": "^
|
|
67
|
-
"vitest": "^4.
|
|
67
|
+
"jiti": "^2.7.0",
|
|
68
|
+
"rimraf": "^6.1.3",
|
|
69
|
+
"typescript": "^6.0.3",
|
|
70
|
+
"vitest": "^4.1.6"
|
|
68
71
|
}
|
|
69
72
|
}
|