@itcase/config 1.0.80 → 1.2.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 +31 -0
- package/commitlint/indexRelease.js +70 -0
- package/package.json +11 -11
- package/semantic-release/index.js +1 -22
- package/semantic-release/indexLerna.js +0 -21
- package/semantic-release/indexVSMarketplace.js +1 -22
- package/commitlint/index.js +0 -30
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
1
|
# ITCase Config
|
|
2
2
|
|
|
3
|
+
Набор готовых конфигураций для инструментов разработки, используемых в проектах ITCase. Этот пакет содержит стандартизированные настройки для commitlint, lint-staged, PostCSS, semantic-release и SVGR.
|
|
3
4
|
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev @itcase/config
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Доступные конфигурации
|
|
12
|
+
|
|
13
|
+
Пакет предоставляет следующие конфигурации:
|
|
14
|
+
|
|
15
|
+
- **Commitlint** — проверка формата сообщений коммитов
|
|
16
|
+
- `commitlint/indexProject.js` — для разработки
|
|
17
|
+
- `commitlint/indexRelease.js` — для релизных веток
|
|
18
|
+
|
|
19
|
+
- **Lint-staged** — запуск линтеров для измененных файлов
|
|
20
|
+
- `lint-staged/index.js` — базовая конфигурация
|
|
21
|
+
- `lint-staged-ts/index.js` — с проверкой типов TypeScript
|
|
22
|
+
|
|
23
|
+
- **PostCSS** — обработка CSS
|
|
24
|
+
- `postcss/index.js` — стандартная конфигурация
|
|
25
|
+
- `postcss/nextVite.js` — для Next.js/Vite проектов
|
|
26
|
+
|
|
27
|
+
- **Semantic Release** — автоматическое управление версиями
|
|
28
|
+
- `semantic-release/index.js` — стандартная конфигурация
|
|
29
|
+
- `semantic-release/indexLerna.js` — для Lerna монорепозиториев
|
|
30
|
+
- `semantic-release/indexVSMarketplace.js` — для VS Code расширений
|
|
31
|
+
|
|
32
|
+
- **SVGR** — преобразование SVG в React компоненты
|
|
33
|
+
- `svgr/index.js` — базовая конфигурация
|
|
34
|
+
- `svgr/webpack.js` — интеграция с Webpack
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
2
|
+
|
|
3
|
+
import { releaseRules } from '../semantic-release/index.js'
|
|
4
|
+
|
|
5
|
+
const commitTypes = new Set(releaseRules.map((releaseRule) => releaseRule.type))
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
parserPreset: 'conventional-changelog-conventionalcommits',
|
|
9
|
+
extends: ['@commitlint/config-conventional'],
|
|
10
|
+
rules: {
|
|
11
|
+
'type-case': [0],
|
|
12
|
+
'body-empty': [1, 'always'],
|
|
13
|
+
'header-match-type-pattern': [2, 'always'],
|
|
14
|
+
'subject-empty': [2, 'never'],
|
|
15
|
+
'subject-case': [
|
|
16
|
+
2,
|
|
17
|
+
'always',
|
|
18
|
+
['lower-case', 'sentence-case', 'start-case'],
|
|
19
|
+
],
|
|
20
|
+
'type-empty': [2, 'never'],
|
|
21
|
+
'scope-empty': [2, 'always'],
|
|
22
|
+
'footer-empty': [1, 'always'],
|
|
23
|
+
'type-enum': [2, 'always', Array.from(commitTypes)],
|
|
24
|
+
},
|
|
25
|
+
defaultIgnores: true,
|
|
26
|
+
plugins: [
|
|
27
|
+
{
|
|
28
|
+
rules: {
|
|
29
|
+
'header-match-type-pattern': (parsed) => {
|
|
30
|
+
const { type } = parsed
|
|
31
|
+
if (!commitTypes.has(type)) {
|
|
32
|
+
const errorMessage = `type must be in ['major','minor','patch']`
|
|
33
|
+
return [false, errorMessage]
|
|
34
|
+
}
|
|
35
|
+
return [true, '']
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
prompt: {
|
|
41
|
+
settings: {},
|
|
42
|
+
questions: {
|
|
43
|
+
type: {
|
|
44
|
+
description: 'Select the type of release',
|
|
45
|
+
enum: {
|
|
46
|
+
patch: {
|
|
47
|
+
description:
|
|
48
|
+
'Patch version when you make backwards compatible bug fixes',
|
|
49
|
+
title: 'Patch Release',
|
|
50
|
+
emoji: '✅',
|
|
51
|
+
},
|
|
52
|
+
minor: {
|
|
53
|
+
description: 'Minor version when you add functionality',
|
|
54
|
+
title: 'Minor Release',
|
|
55
|
+
emoji: '🐞',
|
|
56
|
+
},
|
|
57
|
+
major: {
|
|
58
|
+
description: 'Major version when you make incompatible API changes',
|
|
59
|
+
title: 'Major Release',
|
|
60
|
+
emoji: '⭐️',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
subject: {
|
|
65
|
+
description:
|
|
66
|
+
'Write a short, imperative tense description of the change',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "ITCase",
|
|
5
|
-
"description": "Config",
|
|
5
|
+
"description": "ITCase Config ",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.12.0"
|
|
8
8
|
},
|
|
@@ -31,14 +31,20 @@
|
|
|
31
31
|
"registry": "https://registry.npmjs.org/"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"@commitlint/cli": "^20.3.0",
|
|
35
|
+
"@commitlint/config-conventional": "^20.3.0",
|
|
34
36
|
"@commitlint/cz-commitlint": "^20.3.0",
|
|
35
37
|
"@lehoczky/postcss-fluid": "^1.0.3",
|
|
38
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
39
|
+
"@semantic-release/git": "^10.0.1",
|
|
40
|
+
"@semantic-release/release-notes-generator": "14.1.0",
|
|
36
41
|
"@svgr/webpack": "^8.1.0",
|
|
37
42
|
"autoprefixer": "^10.4.23",
|
|
38
|
-
"inquirer": "^13.0.2",
|
|
39
|
-
"cssnano": "^7.1.2",
|
|
40
43
|
"commitizen": "^4.3.1",
|
|
44
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
45
|
+
"cssnano": "^7.1.2",
|
|
41
46
|
"cssnano-preset-default": "^7.0.10",
|
|
47
|
+
"inquirer": "^13.1.0",
|
|
42
48
|
"postcss-aspect-ratio-polyfill": "^2.0.0",
|
|
43
49
|
"postcss-clamp": "^4.1.0",
|
|
44
50
|
"postcss-cli": "^11.0.1",
|
|
@@ -65,14 +71,9 @@
|
|
|
65
71
|
"postcss-preset-env": "^10.6.0",
|
|
66
72
|
"postcss-pxtorem": "^6.1.0",
|
|
67
73
|
"postcss-sort-media-queries": "^5.2.0",
|
|
68
|
-
"@commitlint/cli": "^20.3.0",
|
|
69
|
-
"@commitlint/config-conventional": "^20.3.0",
|
|
70
74
|
"postcss-url": "^10.1.3",
|
|
71
75
|
"postcss-urlrewrite": "^0.3.0",
|
|
72
|
-
"
|
|
73
|
-
"@semantic-release/git": "^10.0.1",
|
|
74
|
-
"@semantic-release/release-notes-generator": "14.1.0",
|
|
75
|
-
"conventional-changelog-conventionalcommits": "^9.1.0"
|
|
76
|
+
"semantic-release": "^24.2.9"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"@itcase/lint": "^1.1.73",
|
|
@@ -81,7 +82,6 @@
|
|
|
81
82
|
"inquirer": "^13.1.0",
|
|
82
83
|
"lint-staged": "^16.2.7",
|
|
83
84
|
"prettier": "^3.7.4",
|
|
84
|
-
"semantic-release": "^24.2.9",
|
|
85
85
|
"stylelint": "^16.26.1",
|
|
86
86
|
"typescript": "^5.9.3"
|
|
87
87
|
}
|
|
@@ -8,27 +8,6 @@ const releaseRules = [
|
|
|
8
8
|
{ type: 'major', release: 'major' },
|
|
9
9
|
{ type: 'minor', release: 'minor' },
|
|
10
10
|
{ type: 'patch', release: 'patch' },
|
|
11
|
-
// Main changes
|
|
12
|
-
{ type: 'fix', release: 'patch' },
|
|
13
|
-
{ type: 'feat', release: 'patch' },
|
|
14
|
-
{
|
|
15
|
-
type: 'feat',
|
|
16
|
-
scope: 'minor',
|
|
17
|
-
release: 'minor',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
type: 'feat',
|
|
21
|
-
scope: 'major',
|
|
22
|
-
release: 'major',
|
|
23
|
-
},
|
|
24
|
-
{ type: 'styles', release: 'patch' },
|
|
25
|
-
// Special changes
|
|
26
|
-
{ type: 'chore', release: false },
|
|
27
|
-
{ type: 'docs', release: false },
|
|
28
|
-
{ type: 'docs', scope: 'readme', release: 'patch' },
|
|
29
|
-
{ type: 'refactor', release: 'patch' },
|
|
30
|
-
{ type: 'perf', release: 'patch' },
|
|
31
|
-
{ type: 'tests', release: false },
|
|
32
11
|
]
|
|
33
12
|
|
|
34
13
|
const semanticReleaseConfig = {
|
|
@@ -81,5 +60,5 @@ const semanticReleaseConfig = {
|
|
|
81
60
|
],
|
|
82
61
|
}
|
|
83
62
|
|
|
84
|
-
export {
|
|
63
|
+
export { noteKeywords, releaseRules }
|
|
85
64
|
export default semanticReleaseConfig
|
|
@@ -8,27 +8,6 @@ const releaseRules = [
|
|
|
8
8
|
{ type: 'major', release: 'major' },
|
|
9
9
|
{ type: 'minor', release: 'minor' },
|
|
10
10
|
{ type: 'patch', release: 'patch' },
|
|
11
|
-
// Main changes
|
|
12
|
-
{ type: 'fix', release: 'patch' },
|
|
13
|
-
{ type: 'feat', release: 'patch' },
|
|
14
|
-
{
|
|
15
|
-
type: 'feat',
|
|
16
|
-
scope: 'minor',
|
|
17
|
-
release: 'minor',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
type: 'feat',
|
|
21
|
-
scope: 'major',
|
|
22
|
-
release: 'major',
|
|
23
|
-
},
|
|
24
|
-
{ type: 'styles', release: 'patch' },
|
|
25
|
-
// Special changes
|
|
26
|
-
{ type: 'chore', release: false },
|
|
27
|
-
{ type: 'docs', release: false },
|
|
28
|
-
{ type: 'docs', scope: 'readme', release: 'patch' },
|
|
29
|
-
{ type: 'refactor', release: 'patch' },
|
|
30
|
-
{ type: 'perf', release: 'patch' },
|
|
31
|
-
{ type: 'tests', release: false },
|
|
32
11
|
]
|
|
33
12
|
|
|
34
13
|
const lernaSemanticReleaseConfig = {
|
|
@@ -8,27 +8,6 @@ const releaseRules = [
|
|
|
8
8
|
{ type: 'major', release: 'major' },
|
|
9
9
|
{ type: 'minor', release: 'minor' },
|
|
10
10
|
{ type: 'patch', release: 'patch' },
|
|
11
|
-
// Main changes
|
|
12
|
-
{ type: 'fix', release: 'patch' },
|
|
13
|
-
{ type: 'feat', release: 'patch' },
|
|
14
|
-
{
|
|
15
|
-
type: 'feat',
|
|
16
|
-
scope: 'minor',
|
|
17
|
-
release: 'minor',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
type: 'feat',
|
|
21
|
-
scope: 'major',
|
|
22
|
-
release: 'major',
|
|
23
|
-
},
|
|
24
|
-
{ type: 'styles', release: 'patch' },
|
|
25
|
-
// Special changes
|
|
26
|
-
{ type: 'chore', release: false },
|
|
27
|
-
{ type: 'docs', release: false },
|
|
28
|
-
{ type: 'docs', scope: 'readme', release: 'patch' },
|
|
29
|
-
{ type: 'refactor', release: 'patch' },
|
|
30
|
-
{ type: 'perf', release: 'patch' },
|
|
31
|
-
{ type: 'tests', release: false },
|
|
32
11
|
]
|
|
33
12
|
|
|
34
13
|
const semanticReleaseConfig = {
|
|
@@ -84,5 +63,5 @@ const semanticReleaseConfig = {
|
|
|
84
63
|
],
|
|
85
64
|
}
|
|
86
65
|
|
|
87
|
-
export {
|
|
66
|
+
export { noteKeywords, releaseRules }
|
|
88
67
|
export default semanticReleaseConfig
|
package/commitlint/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { releaseRules } from '../semantic-release/index.js'
|
|
2
|
-
|
|
3
|
-
const commitTypes = new Set(releaseRules.map((releaseRule) => releaseRule.type))
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
extends: ['@commitlint/config-conventional'],
|
|
7
|
-
parserPreset: 'conventional-changelog-conventionalcommits',
|
|
8
|
-
plugins: [
|
|
9
|
-
{
|
|
10
|
-
rules: {
|
|
11
|
-
'header-match-type-pattern': (parsed) => {
|
|
12
|
-
const { type } = parsed
|
|
13
|
-
if (!commitTypes.has(type)) {
|
|
14
|
-
const errorMessage =
|
|
15
|
-
`type must be in ['⭐️ major','🐞 minor','✅ patch']\n` +
|
|
16
|
-
` 'fix: my commit message'`
|
|
17
|
-
return [false, errorMessage]
|
|
18
|
-
}
|
|
19
|
-
return [true, '']
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
rules: {
|
|
25
|
-
'header-match-type-pattern': [2, 'always'],
|
|
26
|
-
'subject-empty': [0, 'always'],
|
|
27
|
-
'type-empty': [2, 'never'],
|
|
28
|
-
'type-enum': [2, 'always', Array.from(commitTypes)],
|
|
29
|
-
},
|
|
30
|
-
}
|