@itcase/config 1.6.27 → 1.6.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.6.27",
3
+ "version": "1.6.29",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config ",
6
6
  "engines": {
@@ -1,11 +1,45 @@
1
1
  /* eslint-disable perfectionist/sort-objects */
2
2
 
3
3
  import {
4
+ CHANGELOG_FILE,
5
+ COMMITS_SORT,
6
+ PRESET,
4
7
  releaseNoteKeywords,
5
8
  releaseNotesTypes,
6
9
  releaseRules,
7
10
  } from './config.js'
8
11
 
12
+ const releaseNotesGeneratorConfig = {
13
+ parserOpts: { noteKeywords: releaseNoteKeywords },
14
+ presetConfig: {
15
+ types: releaseNotesTypes,
16
+ },
17
+ writerOpts: { commitsSort: COMMITS_SORT },
18
+ }
19
+
20
+ const commonPlugins = {
21
+ commitAnalyzer: [
22
+ '@semantic-release/commit-analyzer',
23
+ {
24
+ parserOpts: { noteKeywords: releaseNoteKeywords },
25
+ releaseRules: releaseRules,
26
+ },
27
+ ],
28
+ releaseNotesGenerator: [
29
+ '@semantic-release/release-notes-generator',
30
+ releaseNotesGeneratorConfig,
31
+ ],
32
+ changelog: ['@semantic-release/changelog', { changelogFile: CHANGELOG_FILE }],
33
+ github: [
34
+ '@semantic-release/github',
35
+ {
36
+ failTitle: false,
37
+ failComment: false,
38
+ failCommentCondition: false,
39
+ },
40
+ ],
41
+ }
42
+
9
43
  /**
10
44
  * Создает базовую конфигурацию semantic-release с общими плагинами
11
45
  * @param {Object} options - Опции для кастомизации конфигурации
@@ -15,48 +49,23 @@ import {
15
49
  * @param {Array} options.additionalPlugins - Дополнительные плагины для добавления
16
50
  * @returns {Object} Конфигурация semantic-release
17
51
  */
18
- export function createSemanticReleaseConfig({
52
+ function createSemanticReleaseConfig({
19
53
  branches,
20
54
  npmConfig = {},
21
- gitConfig = {
22
- message: 'release: publishing new version ${nextRelease.version} [skip ci]',
23
- assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
24
- },
55
+ gitConfig,
25
56
  additionalPlugins = [],
26
57
  }) {
27
58
  const plugins = [
28
- [
29
- '@semantic-release/commit-analyzer',
30
- {
31
- parserOpts: { noteKeywords: releaseNoteKeywords },
32
- releaseRules: releaseRules,
33
- },
34
- ],
35
- [
36
- '@semantic-release/release-notes-generator',
37
- {
38
- presetConfig: {
39
- types: releaseNotesTypes,
40
- },
41
- parserOpts: { noteKeywords: releaseNoteKeywords },
42
- writerOpts: { commitsSort: ['subject', 'scope'] },
43
- },
44
- ],
45
- [
46
- '@semantic-release/changelog',
47
- {
48
- changelogFile: 'CHANGELOG.md',
49
- },
50
- ],
51
- ...(Object.keys(npmConfig).length > 0
52
- ? [['@semantic-release/npm', npmConfig]]
53
- : ['@semantic-release/npm']),
59
+ commonPlugins.commitAnalyzer,
60
+ commonPlugins.releaseNotesGenerator,
61
+ commonPlugins.changelog,
62
+ ['@semantic-release/npm', npmConfig],
54
63
  ['@semantic-release/git', gitConfig],
55
- '@semantic-release/github',
64
+ commonPlugins.github,
56
65
  ...additionalPlugins,
57
66
  ]
58
67
 
59
- const preset = 'conventionalcommits'
68
+ const preset = PRESET
60
69
 
61
70
  return {
62
71
  branches,
@@ -65,29 +74,4 @@ export function createSemanticReleaseConfig({
65
74
  }
66
75
  }
67
76
 
68
- export const commonPlugins = {
69
- commitAnalyzer: [
70
- '@semantic-release/commit-analyzer',
71
- {
72
- parserOpts: { noteKeywords: releaseNoteKeywords },
73
- releaseRules: releaseRules,
74
- },
75
- ],
76
- releaseNotesGenerator: [
77
- '@semantic-release/release-notes-generator',
78
- {
79
- presetConfig: {
80
- types: releaseNotesTypes,
81
- },
82
- parserOpts: { noteKeywords: releaseNoteKeywords },
83
- writerOpts: { commitsSort: ['subject', 'scope'] },
84
- },
85
- ],
86
- changelog: [
87
- '@semantic-release/changelog',
88
- {
89
- changelogFile: 'CHANGELOG.md',
90
- },
91
- ],
92
- github: '@semantic-release/github',
93
- }
77
+ export { commonPlugins, createSemanticReleaseConfig }
@@ -26,4 +26,15 @@ const releaseNotesTypes = [
26
26
  // Keywords for important notes. This value is case insensitive.
27
27
  const releaseNoteKeywords = ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING']
28
28
 
29
- export { releaseNoteKeywords, releaseNotesTypes, releaseRules }
29
+ const CHANGELOG_FILE = 'CHANGELOG.md'
30
+ const PRESET = 'conventionalcommits'
31
+ const COMMITS_SORT = ['subject', 'scope']
32
+
33
+ export {
34
+ CHANGELOG_FILE,
35
+ COMMITS_SORT,
36
+ PRESET,
37
+ releaseNoteKeywords,
38
+ releaseNotesTypes,
39
+ releaseRules,
40
+ }
@@ -2,6 +2,10 @@ import { createSemanticReleaseConfig } from './common.js'
2
2
 
3
3
  const semanticReleasePackage = createSemanticReleaseConfig({
4
4
  branches: ['master'],
5
+ gitConfig: {
6
+ message: 'release: publishing new version ${nextRelease.version} [skip ci]',
7
+ assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
8
+ },
5
9
  })
6
10
 
7
11
  export { semanticReleasePackage }
@@ -2,6 +2,10 @@ import { createSemanticReleaseConfig } from './common.js'
2
2
 
3
3
  const semanticReleaseProject = createSemanticReleaseConfig({
4
4
  branches: ['docker/master'],
5
+ gitConfig: {
6
+ message: 'release: publishing new version ${nextRelease.version} [skip ci]',
7
+ assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
8
+ },
5
9
  npmConfig: {
6
10
  npmPublish: false,
7
11
  },
@@ -2,6 +2,10 @@ import { createSemanticReleaseConfig } from './common.js'
2
2
 
3
3
  const semanticReleaseVSMarketplace = createSemanticReleaseConfig({
4
4
  branches: ['master'],
5
+ gitConfig: {
6
+ message: 'release: publishing new version ${nextRelease.version} [skip ci]',
7
+ assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
8
+ },
5
9
  npmConfig: {
6
10
  npmPublish: false,
7
11
  },