zx-bulk-release 1.23.0 → 1.24.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 +39 -17
- package/package.json +1 -1
- package/src/main/js/analyze.js +2 -0
- package/src/main/js/index.js +1 -1
- package/src/main/js/npm.js +1 -1
- package/src/main/js/util.js +1 -1
- package/src/test/js/integration.test.js +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [1.24.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.23.0...v1.24.0) (2022-10-15)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
* feat: add pkg.tag to report ([c3e6d76](https://github.com/semrel-extra/zx-bulk-release/commit/c3e6d76b9001f6935b17eac8496425ce519230e0))
|
|
5
|
+
|
|
6
|
+
### Fixes & improvements
|
|
7
|
+
* fix: fix report format ([274401c](https://github.com/semrel-extra/zx-bulk-release/commit/274401c8685469801258574c20ae3c4c94f6956f))
|
|
8
|
+
|
|
1
9
|
## [1.23.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.22.3...v1.23.0) (2022-10-14)
|
|
2
10
|
|
|
3
11
|
### Features
|
package/README.md
CHANGED
|
@@ -240,24 +240,46 @@ Each release stores its result into the `meta` branch.
|
|
|
240
240
|
|
|
241
241
|
### Report
|
|
242
242
|
|
|
243
|
-
Release process state is reported to the console and
|
|
244
|
-
```
|
|
243
|
+
Release process state is reported to the console and to a file if `--report` flag is set to `/some/path/release-report.json`, for example.
|
|
244
|
+
```js
|
|
245
245
|
{
|
|
246
|
-
status: 'success' | 'failure' | 'pending'
|
|
247
|
-
error:
|
|
248
|
-
queue: ['a', 'b', 'c', 'd']
|
|
249
|
-
packages: [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
246
|
+
status: 'success', // 'sucess' | 'failure' | 'pending'
|
|
247
|
+
error: null, // null or Error
|
|
248
|
+
queue: ['a', 'b', 'c', 'd'] // release queue
|
|
249
|
+
packages: [{
|
|
250
|
+
name: 'a',
|
|
251
|
+
version: '1.1.0',
|
|
252
|
+
path: '/pkg/abs/path',
|
|
253
|
+
config: { // pkg config
|
|
254
|
+
changelog: 'changelog',
|
|
255
|
+
npmFetch: true
|
|
256
|
+
},
|
|
257
|
+
changes: [{ // semantic changes
|
|
258
|
+
group: 'Features',
|
|
259
|
+
releaseType: 'minor',
|
|
260
|
+
change: 'feat: add feat',
|
|
261
|
+
subj: 'feat: add feat',
|
|
262
|
+
body: '',
|
|
263
|
+
short: '792512c',
|
|
264
|
+
hash: '792512cccd69c6345d9d32d3d73e2591ea1776b5'
|
|
265
|
+
}],
|
|
266
|
+
tag: {
|
|
267
|
+
version: 'v1.1.0',
|
|
268
|
+
name: 'a',
|
|
269
|
+
ref: '2022.6.22-a.v1.1.0-f0'
|
|
270
|
+
},
|
|
271
|
+
releaseType: 'minor', // 'major' | 'minor' | 'patch'
|
|
272
|
+
prevVersion: '1.0.0' // previous version or null
|
|
273
|
+
}, {
|
|
274
|
+
name: 'b',
|
|
275
|
+
// ...
|
|
276
|
+
}],
|
|
277
|
+
events: [
|
|
278
|
+
{msg: ['zx-bulk-release'], scope:'~', date: 1665839585488, level: 'info'},
|
|
279
|
+
{msg: ['queue:',['a','b']], scope:'~', date: 1665839585493, level: 'info'},
|
|
280
|
+
{msg: ["run buildCmd 'yarn && yarn build && yarn test'"], scope: 'a', date:1665839585719, level:'info'},
|
|
281
|
+
// ...
|
|
282
|
+
]
|
|
261
283
|
}
|
|
262
284
|
```
|
|
263
285
|
|
package/package.json
CHANGED
package/src/main/js/analyze.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {ctx, semver} from 'zx-extra'
|
|
2
2
|
import {updateDeps} from './deps.js'
|
|
3
|
+
import {formatTag} from './tag.js';
|
|
3
4
|
import {log} from './util.js'
|
|
4
5
|
|
|
5
6
|
export const analyze = async (pkg, packages) => {
|
|
@@ -12,6 +13,7 @@ export const analyze = async (pkg, packages) => {
|
|
|
12
13
|
pkg.releaseType = releaseType
|
|
13
14
|
pkg.version = resolvePkgVersion(releaseType, pkg.latest.tag?.version || pkg.manifest.version)
|
|
14
15
|
pkg.manifest.version = pkg.version
|
|
16
|
+
pkg.tag = releaseType ? formatTag({name: pkg.name, version: pkg.version}) : null
|
|
15
17
|
|
|
16
18
|
log({pkg})('semantic changes', changes)
|
|
17
19
|
}
|
package/src/main/js/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within
|
|
|
29
29
|
reporter.setState('version', pkg.version, name)
|
|
30
30
|
reporter.setState('prevVersion', pkg.latest.tag?.version || pkg.manifest.version, name)
|
|
31
31
|
reporter.setState('releaseType', pkg.releaseType, name)
|
|
32
|
+
reporter.setState('tag', pkg.tag, name)
|
|
32
33
|
|
|
33
34
|
if (!pkg.releaseType) {
|
|
34
35
|
reporter.setStatus('skipped', name)
|
|
@@ -37,7 +38,6 @@ export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within
|
|
|
37
38
|
|
|
38
39
|
reporter.setStatus('building', name)
|
|
39
40
|
await build(pkg, packages)
|
|
40
|
-
reporter.setStatus('')
|
|
41
41
|
|
|
42
42
|
if (flags.dryRun) {
|
|
43
43
|
reporter.setStatus('success', name)
|
package/src/main/js/npm.js
CHANGED
|
@@ -38,7 +38,7 @@ export const fetchManifest = async (pkg, {nothrow, env = $.env} = {}) => {
|
|
|
38
38
|
|
|
39
39
|
export const npmPublish = (pkg) => ctx(async ($) => {
|
|
40
40
|
const {absPath: cwd, name, version, manifest} = pkg
|
|
41
|
-
if (manifest.private) return
|
|
41
|
+
if (manifest.private || pkg.config?.npmPublish === false) return
|
|
42
42
|
const {npmRegistry, npmToken, npmConfig} = parseEnv($.env)
|
|
43
43
|
const npmrc = npmConfig ? npmConfig : path.resolve(cwd, '.npmrc')
|
|
44
44
|
|
package/src/main/js/util.js
CHANGED
|
@@ -7,7 +7,7 @@ import {formatTag} from '../../main/js/tag.js'
|
|
|
7
7
|
import {addCommits, createFakeRepo, createNpmRegistry, fixtures} from './test-utils.js'
|
|
8
8
|
|
|
9
9
|
const test = suite('integration')
|
|
10
|
-
const report = tempy.temporaryFile()
|
|
10
|
+
const report = tempy.temporaryFile({extension: 'json'})
|
|
11
11
|
|
|
12
12
|
const cwd = await createFakeRepo({
|
|
13
13
|
commits: [
|
|
@@ -164,8 +164,7 @@ await $`yarn install`
|
|
|
164
164
|
|
|
165
165
|
test('run() dry-run', async () => {
|
|
166
166
|
await run({cwd, flags: {dryRun: true, report}})
|
|
167
|
-
|
|
168
|
-
const r = JSON.parse(await fs.readJson(report))
|
|
167
|
+
const r = await fs.readJson(report)
|
|
169
168
|
const [a, b] = r.packages
|
|
170
169
|
|
|
171
170
|
assert.equal(r.queue, ['a', 'b'])
|