@itcase/config 1.6.46 → 1.6.47

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.
Files changed (2) hide show
  1. package/README.md +52 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,8 +13,9 @@ npm install --save-dev @itcase/config
13
13
  Пакет предоставляет следующие конфигурации:
14
14
 
15
15
  - **Commitlint** — проверка формата сообщений коммитов
16
- - `commitlint/indexProject.js` — для разработки
17
- - `commitlint/indexRelease.js` — для релизных веток
16
+ - `createCommitlintProjectConfig(SCOPES)` — для разработки
17
+ - `createCommitlintReleaseConfig(SCOPES)` — для релизных веток
18
+ - `commitlint/commitizenAdapter.js` — адаптер Commitizen (type → scope → subScope → subject)
18
19
 
19
20
  - **Husky** — husky-hooks
20
21
 
@@ -35,3 +36,52 @@ npm install --save-dev @itcase/config
35
36
  - **SVGR** — преобразование SVG в React компоненты
36
37
  - `svgr/index.js` — базовая конфигурация
37
38
  - `svgr/webpack.js` — интеграция с Webpack
39
+
40
+ ## Подключение Commitlint
41
+
42
+ 1. Установите зависимости в проекте:
43
+
44
+ ```bash
45
+ npm install --save-dev @itcase/config @commitlint/cli @commitlint/config-conventional conventional-changelog-conventionalcommits
46
+ ```
47
+
48
+ 2. Создайте в корне проекта файл `commitlint.config.mjs`:
49
+
50
+ ```js
51
+ import {
52
+ createCommitlintProjectConfig,
53
+ createCommitlintReleaseConfig,
54
+ } from '@itcase/config/commitlint/index.js'
55
+
56
+ const SCOPES = {
57
+ auth: [],
58
+ common: [],
59
+ dashboard: [],
60
+ logbook: ['events', 'filters'],
61
+ map: ['layers', 'controls', 'markers'],
62
+ report: ['monitoring', 'analytics', 'export', 'filters'],
63
+ other: [],
64
+ }
65
+
66
+ export default process.env.RELEASE_BRANCH === 'true'
67
+ ? createCommitlintReleaseConfig(SCOPES)
68
+ : createCommitlintProjectConfig(SCOPES)
69
+ ```
70
+
71
+ 3. Подключите проверку в husky (например, в `.husky/commit-msg`):
72
+
73
+ ```bash
74
+ npx commitlint --edit "$1"
75
+ ```
76
+
77
+ 4. **(Опционально)** Интерактивное оформление коммитов через Commitizen. Установите:
78
+
79
+ ```bash
80
+ npm install --save-dev commitizen @commitlint/cz-commitlint
81
+ ```
82
+
83
+ Добавьте файл `.cz.json`
84
+
85
+ ```json
86
+ { "path": "@itcase/config/commitlint/commitizenAdapter.js" }
87
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.6.46",
3
+ "version": "1.6.47",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {