bulk-release 2.6.1 → 2.7.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/CHANGELOG.md +8 -0
- package/README.md +10 -0
- package/package.json +2 -2
- package/src/main/js/analyze.js +6 -6
- package/src/main/js/config.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [2.7.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.6.1...v2.7.0) (2023-04-30)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* fix: fix `latestVersion` fallback value ([9d25129](https://github.com/semrel-extra/zx-bulk-release/commit/9d25129dcf41c74cdd2d0670e86d20a32f7734c0))
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
* feat: let `releaseRules` be configured via opts ([4ae4606](https://github.com/semrel-extra/zx-bulk-release/commit/4ae4606678d13cf619e36861ce889e4e73c8a370))
|
|
8
|
+
|
|
1
9
|
## [2.6.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.6.0...v2.6.1) (2023-04-21)
|
|
2
10
|
|
|
3
11
|
### Fixes & improvements
|
package/README.md
CHANGED
|
@@ -151,6 +151,15 @@ export const analyze = async (pkg, packages, root) => {
|
|
|
151
151
|
}
|
|
152
152
|
```
|
|
153
153
|
|
|
154
|
+
Set `config.releaseRules` to override the default rules preset:
|
|
155
|
+
```ts
|
|
156
|
+
[
|
|
157
|
+
{group: 'Features', releaseType: 'minor', prefixes: ['feat']},
|
|
158
|
+
{group: 'Fixes & improvements', releaseType: 'patch', prefixes: ['fix', 'perf', 'refactor', 'docs', 'patch']},
|
|
159
|
+
{group: 'BREAKING CHANGES', releaseType: 'major', keywords: ['BREAKING CHANGE', 'BREAKING CHANGES']},
|
|
160
|
+
]
|
|
161
|
+
```
|
|
162
|
+
|
|
154
163
|
### `build`
|
|
155
164
|
Applies `config.cmd` to build pkg assets: bundles, docs, etc.
|
|
156
165
|
```js
|
|
@@ -311,6 +320,7 @@ zx-bulk-release
|
|
|
311
320
|
* [moonrepo/moon](https://github.com/moonrepo/moon)
|
|
312
321
|
* [ojkelly/yarn.build](https://github.com/ojkelly/yarn.build)
|
|
313
322
|
* [antfu/bumpp](https://github.com/antfu/bumpp)
|
|
323
|
+
* [googleapis/release-please](https://github.com/googleapis/release-please)
|
|
314
324
|
|
|
315
325
|
## License
|
|
316
326
|
[MIT](./LICENSE)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bulk-release",
|
|
3
3
|
"alias": "bulk-release",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"description": "zx-based alternative for multi-semantic-release",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"c8": "^7.13.0",
|
|
33
33
|
"uvu": "^0.5.6",
|
|
34
|
-
"verdaccio": "^5.
|
|
34
|
+
"verdaccio": "^5.24.1"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
package/src/main/js/analyze.js
CHANGED
|
@@ -5,12 +5,12 @@ import {log} from './log.js'
|
|
|
5
5
|
import {getCommits} from './git.js'
|
|
6
6
|
|
|
7
7
|
export const analyze = async (pkg) => {
|
|
8
|
-
const semanticChanges = await getSemanticChanges(pkg.absPath, pkg.latest.tag?.ref)
|
|
8
|
+
const semanticChanges = await getSemanticChanges(pkg.absPath, pkg.latest.tag?.ref, undefined, pkg.config.releaseRules)
|
|
9
9
|
const depsChanges = await updateDeps(pkg)
|
|
10
10
|
const changes = [...semanticChanges, ...depsChanges]
|
|
11
11
|
const releaseType = getNextReleaseType(changes)
|
|
12
12
|
const pre = pkg.context.flags.snapshot ? `-snap.${pkg.context.git.sha.slice(0, 7)}` : undefined
|
|
13
|
-
const latestVersion = pkg.latest.tag?.version || pkg.latest.meta?.
|
|
13
|
+
const latestVersion = pkg.latest.tag?.version || pkg.latest.meta?.version
|
|
14
14
|
|
|
15
15
|
pkg.changes = changes
|
|
16
16
|
pkg.releaseType = releaseType
|
|
@@ -34,15 +34,15 @@ export const semanticRules = [
|
|
|
34
34
|
{group: 'BREAKING CHANGES', releaseType: 'major', keywords: ['BREAKING CHANGE', 'BREAKING CHANGES']},
|
|
35
35
|
]
|
|
36
36
|
|
|
37
|
-
export const getSemanticChanges = async (cwd, from, to) => {
|
|
37
|
+
export const getSemanticChanges = async (cwd, from, to, rules = semanticRules) => {
|
|
38
38
|
const commits = await getCommits(cwd, from, to)
|
|
39
39
|
|
|
40
|
-
return analyzeCommits(commits)
|
|
40
|
+
return analyzeCommits(commits, rules)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export const analyzeCommits = (commits) =>
|
|
43
|
+
export const analyzeCommits = (commits, rules) =>
|
|
44
44
|
commits.reduce((acc, {subj, body, short, hash}) => {
|
|
45
|
-
|
|
45
|
+
rules.forEach(({group, releaseType, prefixes, keywords}) => {
|
|
46
46
|
const prefixMatcher = prefixes && new RegExp(`^(${prefixes.join('|')})(\\([a-z0-9\\-_,]+\\))?:\\s.+$`)
|
|
47
47
|
const keywordsMatcher = keywords && new RegExp(`(${keywords.join('|')}):\\s(.+)`)
|
|
48
48
|
const change = subj.match(prefixMatcher)?.[0] || body.match(keywordsMatcher)?.[2]
|
package/src/main/js/config.js
CHANGED
|
@@ -31,6 +31,7 @@ export const getPkgConfig = async (...cwds) =>
|
|
|
31
31
|
export const normalizePkgConfig = (config, env) => ({
|
|
32
32
|
...parseEnv(env),
|
|
33
33
|
...config,
|
|
34
|
+
releaseRules: config.releaseRules || config.semanticRules,
|
|
34
35
|
npmFetch: config.npmFetch || config.fetch || config.fetchPkg,
|
|
35
36
|
buildCmd: config.buildCmd || config.cmd,
|
|
36
37
|
get ghBasicAuth() {
|