@govbr-ds/release-config 4.1.0 → 4.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/package.json +3 -4
- package/src/index.js +35 -4
- package/src/templates/commit.hbs +0 -29
- package/src/templates/footer.hbs +0 -0
- package/src/templates/header.hbs +0 -9
- package/src/templates/template.hbs +0 -22
- package/src/writer.js +0 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@govbr-ds/release-config",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Configuração compartilhada do semantic-release para projetos do GovBR-DS",
|
|
6
6
|
"keywords": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git@gitlab.com
|
|
16
|
+
"url": "git+ssh://git@gitlab.com/govbr-ds/tools/govbr-ds-config-tools.git",
|
|
17
17
|
"directory": "packages/release"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
@@ -28,10 +28,9 @@
|
|
|
28
28
|
"@semantic-release/changelog": "^6.0.3",
|
|
29
29
|
"@semantic-release/commit-analyzer": "^12.0.0",
|
|
30
30
|
"@semantic-release/git": "^10.0.1",
|
|
31
|
-
"@semantic-release/gitlab": "^13.0.
|
|
31
|
+
"@semantic-release/gitlab": "^13.0.4",
|
|
32
32
|
"@semantic-release/release-notes-generator": "^13.0.0",
|
|
33
33
|
"compare-func": "^2.0.0",
|
|
34
|
-
"inquirer": "^9.2.19",
|
|
35
34
|
"semantic-release": "^23.0.8"
|
|
36
35
|
}
|
|
37
36
|
}
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createWriterOpts } from './writer.js'
|
|
2
|
-
|
|
3
1
|
const branches = [
|
|
4
2
|
'main',
|
|
5
3
|
'+([0-9])?(.{+([0-9]),x}).x', //1.x.x
|
|
@@ -70,7 +68,40 @@ const releaseNotesGenerator = [
|
|
|
70
68
|
parserOpts: {
|
|
71
69
|
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES', 'BREAKING'],
|
|
72
70
|
},
|
|
73
|
-
writerOpts:
|
|
71
|
+
writerOpts: {
|
|
72
|
+
groupBy: 'type',
|
|
73
|
+
commitsSort: ['scope', 'subject', 'header'],
|
|
74
|
+
finalizeContext: (context) => {
|
|
75
|
+
const date = new Date()
|
|
76
|
+
context.date = date.toLocaleString('pt-BR', {
|
|
77
|
+
timeZone: 'America/Sao_Paulo',
|
|
78
|
+
dateStyle: 'short',
|
|
79
|
+
})
|
|
80
|
+
return context
|
|
81
|
+
},
|
|
82
|
+
mainTemplate: `{{> header}}
|
|
83
|
+
{{#if noteGroups}}
|
|
84
|
+
{{#each noteGroups}}
|
|
85
|
+
|
|
86
|
+
### 💥 {{title}}
|
|
87
|
+
|
|
88
|
+
{{#each notes}}
|
|
89
|
+
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
|
90
|
+
{{/each}}
|
|
91
|
+
{{/each}}
|
|
92
|
+
{{/if}}
|
|
93
|
+
{{#each commitGroups}}
|
|
94
|
+
|
|
95
|
+
{{#if title}}
|
|
96
|
+
### {{title}}
|
|
97
|
+
|
|
98
|
+
{{/if}}
|
|
99
|
+
{{#each commits}}
|
|
100
|
+
{{> commit root=@root}}
|
|
101
|
+
{{/each}}
|
|
102
|
+
{{/each}}
|
|
103
|
+
`,
|
|
104
|
+
},
|
|
74
105
|
},
|
|
75
106
|
]
|
|
76
107
|
|
|
@@ -85,7 +116,7 @@ const gitlab = [
|
|
|
85
116
|
'@semantic-release/gitlab',
|
|
86
117
|
{
|
|
87
118
|
successComment:
|
|
88
|
-
':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})',
|
|
119
|
+
':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})',
|
|
89
120
|
failComment:
|
|
90
121
|
'A release a partir da branch ${branch.name} falhou devido aos seguintes erros:\n- ${errors.map(err => err.message).join("\\n- ")}',
|
|
91
122
|
failTitle: 'A release automática falhou 🚨',
|
package/src/templates/commit.hbs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
*{{#if scope}} **{{scope}}:**
|
|
2
|
-
{{~/if}} {{#if subject}}
|
|
3
|
-
{{~subject}}
|
|
4
|
-
{{~else}}
|
|
5
|
-
{{~header}}
|
|
6
|
-
{{~/if}}
|
|
7
|
-
|
|
8
|
-
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
|
|
9
|
-
([{{shortHash}}]({{commitUrlFormat}}))
|
|
10
|
-
{{~else}}
|
|
11
|
-
{{~shortHash}}
|
|
12
|
-
{{~/if}}{{~/if}}
|
|
13
|
-
|
|
14
|
-
{{~!-- commit references --}}
|
|
15
|
-
{{~#if references~}}
|
|
16
|
-
, closes
|
|
17
|
-
{{~#each references}} {{#if @root.linkReferences~}}
|
|
18
|
-
[
|
|
19
|
-
{{~#if this.owner}}
|
|
20
|
-
{{~this.owner}}/
|
|
21
|
-
{{~/if}}
|
|
22
|
-
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
|
|
23
|
-
{{~else}}
|
|
24
|
-
{{~#if this.owner}}
|
|
25
|
-
{{~this.owner}}/
|
|
26
|
-
{{~/if}}
|
|
27
|
-
{{~this.repository}}{{this.prefix}}{{this.issue}}
|
|
28
|
-
{{~/if}}{{/each}}
|
|
29
|
-
{{~/if}}
|
package/src/templates/footer.hbs
DELETED
|
File without changes
|
package/src/templates/header.hbs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{{> header}}
|
|
2
|
-
|
|
3
|
-
{{#if noteGroups}}
|
|
4
|
-
{{#each noteGroups}}
|
|
5
|
-
### 💥 {{title}}
|
|
6
|
-
|
|
7
|
-
{{#each notes}}
|
|
8
|
-
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
|
9
|
-
{{/each}}
|
|
10
|
-
{{/each}}
|
|
11
|
-
{{/if}}
|
|
12
|
-
{{#each commitGroups}}
|
|
13
|
-
|
|
14
|
-
{{#if title}}
|
|
15
|
-
### {{title}}
|
|
16
|
-
|
|
17
|
-
{{/if}}
|
|
18
|
-
{{#each commits}}
|
|
19
|
-
{{> commit root=@root}}
|
|
20
|
-
|
|
21
|
-
{{/each}}
|
|
22
|
-
{{/each}}
|
package/src/writer.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import compareFunc from 'compare-func'
|
|
2
|
-
import { readFile } from 'fs/promises'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
|
-
import { fileURLToPath } from 'url'
|
|
5
|
-
|
|
6
|
-
const dirname = fileURLToPath(new URL('.', import.meta.url))
|
|
7
|
-
|
|
8
|
-
export async function createWriterOpts() {
|
|
9
|
-
const [template, header, commit, footer] = await Promise.all([
|
|
10
|
-
readFile(resolve(dirname, './templates/template.hbs'), 'utf-8'),
|
|
11
|
-
readFile(resolve(dirname, './templates/header.hbs'), 'utf-8'),
|
|
12
|
-
readFile(resolve(dirname, './templates/commit.hbs'), 'utf-8'),
|
|
13
|
-
readFile(resolve(dirname, './templates/footer.hbs'), 'utf-8'),
|
|
14
|
-
])
|
|
15
|
-
const writerOpts = getWriterOpts()
|
|
16
|
-
|
|
17
|
-
writerOpts.mainTemplate = template
|
|
18
|
-
writerOpts.headerPartial = header
|
|
19
|
-
writerOpts.commitPartial = commit
|
|
20
|
-
writerOpts.footerPartial = footer
|
|
21
|
-
|
|
22
|
-
return writerOpts
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function getWriterOpts() {
|
|
26
|
-
return {
|
|
27
|
-
groupBy: 'type',
|
|
28
|
-
commitsSort: ['scope', 'subject', 'header'],
|
|
29
|
-
finalizeContext: (context) => {
|
|
30
|
-
const date = new Date()
|
|
31
|
-
context.date = date.toLocaleString('pt-BR', {
|
|
32
|
-
timeZone: 'America/Sao_Paulo',
|
|
33
|
-
dateStyle: 'short',
|
|
34
|
-
})
|
|
35
|
-
return context
|
|
36
|
-
},
|
|
37
|
-
notesSort: compareFunc,
|
|
38
|
-
}
|
|
39
|
-
}
|