@itcase/config 1.0.1 → 1.0.3
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/commitlint/index.js +28 -0
- package/package.json +3 -1
- package/semantic-release/index.js +45 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const commitTypes = ['major', 'minor', 'patch']
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
extends: ['@commitlint/config-conventional'],
|
|
5
|
+
parserPreset: 'conventional-changelog-conventionalcommits',
|
|
6
|
+
plugins: [
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
'header-match-type-pattern': (parsed) => {
|
|
10
|
+
const { type } = parsed
|
|
11
|
+
if (!commitTypes.includes(type)) {
|
|
12
|
+
const errorMessage =
|
|
13
|
+
`type must br in ['⭐️ major','🐞 minor','✅ patch']\n` +
|
|
14
|
+
` 'fix: my commit message'`
|
|
15
|
+
return [false, errorMessage]
|
|
16
|
+
}
|
|
17
|
+
return [true, '']
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
rules: {
|
|
23
|
+
'header-match-type-pattern': [2, 'always'],
|
|
24
|
+
'subject-empty': [0, 'always'],
|
|
25
|
+
'type-empty': [2, 'never'],
|
|
26
|
+
'type-enum': [2, 'always', commitTypes],
|
|
27
|
+
},
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Config",
|
|
6
6
|
"engines": {
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"url": "https://github.com/ITCase/itcase-config.git"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
+
"commitlint",
|
|
21
22
|
"lint-staged",
|
|
23
|
+
"semantic-release",
|
|
22
24
|
"postcss",
|
|
23
25
|
"svgr",
|
|
24
26
|
"README.md"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
branches: ['master'],
|
|
3
|
+
plugins: [
|
|
4
|
+
[
|
|
5
|
+
'@semantic-release/commit-analyzer',
|
|
6
|
+
{
|
|
7
|
+
parserOpts: {
|
|
8
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
9
|
+
},
|
|
10
|
+
preset: 'conventionalcommits',
|
|
11
|
+
releaseRules: [
|
|
12
|
+
{ release: 'major', type: 'major' },
|
|
13
|
+
{ release: 'minor', type: 'minor' },
|
|
14
|
+
{ release: 'patch', type: 'patch' },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
'@semantic-release/release-notes-generator',
|
|
20
|
+
{
|
|
21
|
+
parserOpts: {
|
|
22
|
+
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
23
|
+
},
|
|
24
|
+
preset: 'conventionalcommits',
|
|
25
|
+
writerOpts: {
|
|
26
|
+
commitsSort: ['subject', 'scope'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
'@semantic-release/changelog',
|
|
32
|
+
{
|
|
33
|
+
changelogFile: 'CHANGELOG.md',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'@semantic-release/npm',
|
|
37
|
+
[
|
|
38
|
+
'@semantic-release/git',
|
|
39
|
+
{
|
|
40
|
+
assets: ['package.json', 'CHANGELOG.md'],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
'@semantic-release/github',
|
|
44
|
+
],
|
|
45
|
+
}
|