@govbr-ds/release-config 2.2.0 → 2.3.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 CHANGED
@@ -8,6 +8,10 @@ Compartilhar os padrões de commit entre os projetos do [GOVBR-DS](https://gov.b
8
8
 
9
9
  ```bash
10
10
  npm install --save-dev @govbr-ds/release-config
11
+
12
+ ou
13
+
14
+ pnpm add -D @govbr-ds/release-config
11
15
  ```
12
16
 
13
17
  ## Plugins
@@ -50,8 +54,7 @@ module.exports = {
50
54
  {
51
55
  onSuccessTemplate: {
52
56
  username: 'Username',
53
- content:
54
- "A versão v$npm_package_version do projeto LOREM IPSUM já está disponível!",
57
+ content: 'A versão v$npm_package_version do projeto LOREM IPSUM já está disponível!',
55
58
  },
56
59
  },
57
60
  ],
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Arquivo com as configurações compartilhadas entre os projetos.
3
- * Cada projeto deve importar essa configuração e usar conforme o README.md
2
+ * Configurações compartilhadas do semantic-release.
4
3
  */
4
+
5
5
  module.exports = {
6
6
  branches: [
7
7
  'main',
@@ -42,8 +42,9 @@ module.exports = {
42
42
  {
43
43
  preset: 'conventionalcommits',
44
44
  releaseRules: [
45
- // breaking precisa estar no topo devido a como o plugin se comporta: https://github.com/semantic-release/commit-analyzer#releaserules
45
+ // breaking precisa estar no topo: https://github.com/semantic-release/commit-analyzer#releaserules
46
46
  { breaking: true, release: 'major' },
47
+ { type: '*!', release: 'major' },
47
48
  { type: 'build', release: false },
48
49
  { type: 'chore', release: false },
49
50
  { type: 'ci', release: false },
@@ -73,12 +74,11 @@ module.exports = {
73
74
  presetConfig: {
74
75
  header: '# CHANGELOG',
75
76
  types: [
76
- { type: 'breaking', section: '💥 BREAKING CHANGES' },
77
77
  { type: 'deprecated', section: '👎 DEPRECIADO' },
78
78
  { type: 'feat', section: '✨ NOVIDADES' },
79
79
  { type: 'removed', section: '🚧 REMOVIDO' },
80
80
  { type: 'docs', section: '📚 DOCUMENTAÇÃO' },
81
- { type: 'fix', section: '🪲 CORREÇÕES' },
81
+ { type: 'fix', section: '🐛 CORREÇÕES' },
82
82
  { type: 'ops', section: '🔧 ATIVIDADES OPERACIONAIS' },
83
83
  { type: 'perf', section: '🚀 PERFORMANCE' },
84
84
  { type: 'refactor', section: '🔁 REFATORADO' },
@@ -95,51 +95,31 @@ module.exports = {
95
95
  noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
96
96
  },
97
97
  writerOpts: {
98
- commitsSort: ['subject', 'scope'],
99
- generateNotes: (commits, context) => {
100
- const breakingChangesType = context.options.presetConfig.types.find(
101
- (type) => type.type === 'breaking'
102
- )
103
-
104
- if (!breakingChangesType) {
105
- return ''
106
- }
107
-
108
- const breakingChangesCommits = commits.filter((commit) =>
109
- commit.notes?.some((note) =>
110
- context.options.parserOpts.noteKeywords.some((keyword) =>
111
- note.title.includes(keyword)
112
- )
113
- )
114
- )
115
-
116
- if (breakingChangesCommits.length === 0) {
117
- return ''
118
- }
119
-
120
- const breakingChangesSections = [
121
- `## ${context.nextRelease.version} (${context.date})\n`,
122
- `### ${breakingChangesType.section}\n`,
123
- ]
124
-
125
- for (const commit of breakingChangesCommits) {
126
- const scope = commit.scope ? `**${commit.scope}**: ` : ''
127
- const message = `${scope}${commit.header}`
128
- breakingChangesSections.push(`- ${message}`)
129
- if (
130
- commit.notes?.some((note) =>
131
- context.options.parserOpts.noteKeywords.some((keyword) =>
132
- note.title.includes(keyword)
133
- )
134
- ) &&
135
- commit.body
136
- ) {
137
- breakingChangesSections.push(` ${commit.body}`)
138
- }
139
- }
140
-
141
- return breakingChangesSections.join('\n')
142
- },
98
+ mainTemplate:
99
+ '{{> header}}\n' +
100
+ '\n' +
101
+ '{{#if noteGroups}}\n' +
102
+ '{{#each noteGroups}}\n' +
103
+ '\n' +
104
+ '### 💥 {{title}}\n' +
105
+ '\n' +
106
+ '{{#each notes}}\n' +
107
+ '* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}\n' +
108
+ '{{/each}}\n' +
109
+ '{{/each}}\n' +
110
+ '{{/if}}\n' +
111
+ '{{#each commitGroups}}\n' +
112
+ '\n' +
113
+ '{{#if title}}\n' +
114
+ '### {{title}}\n' +
115
+ '\n' +
116
+ '{{/if}}\n' +
117
+ '{{#each commits}}\n' +
118
+ '{{> commit root=@root}}\n' +
119
+ '{{/each}}\n' +
120
+ '\n' +
121
+ '{{/each}}\n',
122
+ commitsSort: ['scope', 'subject'],
143
123
  finalizeContext: (context) => {
144
124
  const date = new Date()
145
125
  context.date = date.toLocaleString('pt-BR', {
@@ -160,7 +140,8 @@ module.exports = {
160
140
  gitlab: [
161
141
  '@semantic-release/gitlab',
162
142
  {
163
- successComment: ':tada: Issue/Merge Request incluído(a) na versão ${nextRelease.version} :tada:\n\nPara mais detalhes:\n- [GitLab release]($CI_PROJECT_URL/-/releases/${nextRelease.version})\n- [GitLab tag]($CI_PROJECT_URL/-/tags/${nextRelease.version})',
143
+ successComment:
144
+ ':tada: Issue/Merge Request incluído(a) na versão ${nextRelease.version} :tada:\n\nPara mais detalhes:\n- [GitLab release]($CI_PROJECT_URL/-/releases/${nextRelease.version})\n- [GitLab tag]($CI_PROJECT_URL/-/tags/${nextRelease.version})',
164
145
  },
165
146
  ],
166
147
  npm: ['@semantic-release/npm'],
@@ -168,10 +149,9 @@ module.exports = {
168
149
  '@semantic-release/git',
169
150
  {
170
151
  assets: ['package.json', 'CHANGELOG.md'],
171
- message: 'chore(release): ${nextRelease.version} [skip ci] \n\n${nextRelease.notes} \n\nCommit gerado automaticamente durante o processo de release',
152
+ message:
153
+ 'chore(release): ${nextRelease.version} [skip ci] \n\n${nextRelease.notes} \n\nCommit gerado automaticamente durante o processo de release',
172
154
  },
173
155
  ],
174
156
  },
175
157
  }
176
-
177
-
package/package.json CHANGED
@@ -1,27 +1,25 @@
1
1
  {
2
2
  "name": "@govbr-ds/release-config",
3
- "version": "2.2.0",
4
- "description": "Configuração compartilhada do semantic-release para projetos do GovBR-DS no gitlab",
3
+ "version": "2.3.0",
4
+ "private": false,
5
+ "description": "Configuração compartilhada do semantic-release para projetos do GovBR-DS",
5
6
  "keywords": [
6
- "gitlab",
7
7
  "govbr-ds",
8
- "conventional-changelog",
9
- "semantic-release",
10
- "semantic-release-config"
8
+ "semantic-release"
11
9
  ],
12
10
  "homepage": "https://gov.br/ds/",
13
11
  "bugs": {
14
- "url": "https://gitlab.com/govbr-ds/govbr-ds-release-config/issues"
12
+ "url": "https://gitlab.com/govbr-ds/configs/govbr-ds-release-config/issues"
15
13
  },
16
14
  "repository": {
17
15
  "type": "git",
18
- "url": "git@gitlab.com:govbr-ds/govbr-ds-release-config.git"
16
+ "url": "git@gitlab.com:govbr-ds/configs/govbr-ds-release-config.git"
19
17
  },
20
18
  "license": "MIT",
21
19
  "author": "SERPRO <govbr-ds@serpro.gov.br> (http://serpro.gov.br/)",
22
- "main": "shared.config.js",
20
+ "main": "lib/shared.config.js",
23
21
  "files": [
24
- "shared.config.js"
22
+ "lib/shared.config.js"
25
23
  ],
26
24
  "scripts": {
27
25
  "commit": "git-cz",
@@ -40,20 +38,21 @@
40
38
  }
41
39
  },
42
40
  "dependencies": {
43
- "@govbr-ds/release-config": "^2.1.2",
41
+ "@govbr-ds/release-config": "^2.2.0",
44
42
  "@semantic-release/changelog": "^6.0.3",
45
43
  "@semantic-release/git": "^10.0.1",
46
- "@semantic-release/gitlab": "^12.0.4",
47
- "conventional-changelog-conventionalcommits": "^6.1.0",
48
- "semantic-release": "^21.0.7"
44
+ "@semantic-release/gitlab": "^12.0.6",
45
+ "conventional-changelog-conventionalcommits": "^7.0.2",
46
+ "js-yaml": "^4.1.0",
47
+ "semantic-release": "^22.0.5"
49
48
  },
50
49
  "devDependencies": {
51
50
  "@govbr-ds/commit-config": "latest",
52
51
  "git-pull-run": "^1.4.0",
53
52
  "husky": "^8.0.3",
54
- "lint-staged": "^13.2.3",
55
- "markdownlint-cli": "^0.35.0",
56
- "prettier": "^3.0.1"
53
+ "lint-staged": "^15.0.1",
54
+ "markdownlint-cli": "^0.37.0",
55
+ "prettier": "^3.0.3"
57
56
  },
58
57
  "engines": {
59
58
  "node": ">=18"