@govbr-ds/nx-release-config 5.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -0
  3. package/nx.json +116 -0
  4. package/package.json +29 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 SERPRO
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @govbr-ds/nx-release-config
2
+
3
+ Preset compartilhado para releases de monorepos que usam o Nx Release.
4
+
5
+ ## Uso
6
+
7
+ Instale o preset e o Nx no monorepo consumidor:
8
+
9
+ ```bash
10
+ pnpm add -D @govbr-ds/nx-release-config nx
11
+ ```
12
+
13
+ No `nx.json`, estenda a configuração:
14
+
15
+ ```json
16
+ {
17
+ "extends": "@govbr-ds/nx-release-config/nx.json"
18
+ }
19
+ ```
20
+
21
+ O preset publica os projetos em `packages/*`, habilita Conventional Commits,
22
+ compartilha os tipos e seus impactos SemVer, cria commit, tag e Release no
23
+ GitLab e mantém o changelog do workspace.
24
+
25
+ Não declare um bloco `release` parcial no projeto consumidor. O Nx substitui
26
+ esse bloco no primeiro nível em vez de mesclá-lo profundamente, descartando as
27
+ opções do preset. Se o projeto não usa o layout `packages/*`, copie o bloco
28
+ `release` completo do preset para o `nx.json` e altere apenas `projects`.
29
+
30
+ ## Comandos
31
+
32
+ ```bash
33
+ pnpm exec nx release --dry-run
34
+ pnpm exec nx release --printConfig
35
+ pnpm exec nx release --yes
36
+ ```
37
+
38
+ Use `--dry-run` para revisar versões e changelogs antes de publicar. O Nx
39
+ calcula a release antes de alterar arquivos; o pipeline deve executar a etapa
40
+ de release como uma única operação e interromper em qualquer erro. Para a CI,
41
+ configure `NPM_TOKEN` e `GITLAB_TOKEN`; o segundo precisa de escopo `api`,
42
+ permissão para push e acesso à branch protegida.
package/nx.json ADDED
@@ -0,0 +1,116 @@
1
+ {
2
+ "extends": "nx/presets/npm.json",
3
+ "$schema": "./node_modules/nx/schemas/nx-schema.json",
4
+ "release": {
5
+ "projects": [
6
+ "packages/*"
7
+ ],
8
+ "version": {
9
+ "conventionalCommits": true
10
+ },
11
+ "git": {
12
+ "commitMessage": "chore(release): {version} [skip ci]"
13
+ },
14
+ "conventionalCommits": {
15
+ "types": {
16
+ "build": {
17
+ "semverBump": "none",
18
+ "changelog": false
19
+ },
20
+ "bump": {
21
+ "semverBump": "none",
22
+ "changelog": {
23
+ "title": "🆙 ATUALIZAÇÃO DE VERSÃO"
24
+ }
25
+ },
26
+ "chore": {
27
+ "semverBump": "none",
28
+ "changelog": false
29
+ },
30
+ "ci": {
31
+ "semverBump": "none",
32
+ "changelog": false
33
+ },
34
+ "deprecated": {
35
+ "semverBump": "none",
36
+ "changelog": {
37
+ "title": "⚠️ RECURSOS DESCONTINUADOS"
38
+ }
39
+ },
40
+ "docs": {
41
+ "semverBump": "patch",
42
+ "changelog": {
43
+ "title": "📚 DOCUMENTAÇÃO"
44
+ }
45
+ },
46
+ "feat": {
47
+ "semverBump": "minor",
48
+ "changelog": {
49
+ "title": "✨ NOVIDADES"
50
+ }
51
+ },
52
+ "fix": {
53
+ "semverBump": "patch",
54
+ "changelog": {
55
+ "title": "🐛 CORREÇÕES"
56
+ }
57
+ },
58
+ "lint": {
59
+ "semverBump": "none",
60
+ "changelog": false
61
+ },
62
+ "ops": {
63
+ "semverBump": "none",
64
+ "changelog": false
65
+ },
66
+ "perf": {
67
+ "semverBump": "patch",
68
+ "changelog": {
69
+ "title": "🚀 DESEMPENHO"
70
+ }
71
+ },
72
+ "refactor": {
73
+ "semverBump": "patch",
74
+ "changelog": {
75
+ "title": "🔁 REFATORAÇÕES"
76
+ }
77
+ },
78
+ "removed": {
79
+ "semverBump": "major",
80
+ "changelog": {
81
+ "title": "🚧 REMOÇÕES"
82
+ }
83
+ },
84
+ "revert": {
85
+ "semverBump": "minor",
86
+ "changelog": {
87
+ "title": "⏪ REVERSÕES"
88
+ }
89
+ },
90
+ "site": {
91
+ "semverBump": "none",
92
+ "changelog": false
93
+ },
94
+ "test": {
95
+ "semverBump": "none",
96
+ "changelog": false
97
+ },
98
+ "wip": {
99
+ "semverBump": "none",
100
+ "changelog": false
101
+ }
102
+ }
103
+ },
104
+ "changelog": {
105
+ "workspaceChangelog": {
106
+ "createRelease": "gitlab",
107
+ "renderOptions": {
108
+ "authors": false,
109
+ "applyUsernameToAuthors": false,
110
+ "commitReferences": true,
111
+ "versionTitleDate": true
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@govbr-ds/nx-release-config",
3
+ "version": "5.0.0",
4
+ "private": false,
5
+ "description": "Configuração compartilhada de releases com Nx para projetos GovBR-DS",
6
+ "keywords": [
7
+ "govbr-ds",
8
+ "nx",
9
+ "release"
10
+ ],
11
+ "license": "MIT",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "nx.json",
17
+ "README.md"
18
+ ],
19
+ "dependencies": {
20
+ "@govbr-ds/commit-types": "5.0.0"
21
+ },
22
+ "exports": {
23
+ ".": "./nx.json",
24
+ "./nx.json": "./nx.json"
25
+ },
26
+ "scripts": {
27
+ "generate": "node generate-nx-json.cjs"
28
+ }
29
+ }