zx-bulk-release 1.22.0 → 1.22.1

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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## [1.22.1](https://github.com/semrel-extra/zx-bulk-release/compare/v1.22.0...v1.22.1) (2022-07-30)
2
+
3
+ ### Fixes & improvements
4
+ * fix: fix commit msg chunks join ([e2a9299](https://github.com/semrel-extra/zx-bulk-release/commit/e2a9299c08c288f5fd8ff14575fcd841017dd3d6))
5
+
1
6
  ## [1.22.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.21.0...v1.22.0) (2022-07-30)
2
7
 
3
8
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": "./src/main/js/index.js",
@@ -3,7 +3,7 @@ import {fs, path, $} from 'zx-extra'
3
3
  import {push, fetch, parseRepo} from './repo.js'
4
4
  import {parseEnv} from './config.js'
5
5
  import {fetchManifest, npmPublish} from './npm.js'
6
- import {runHook, tpl} from './util.js'
6
+ import {restJoin, runHook} from './util.js'
7
7
 
8
8
  export const publish = async (pkg) => {
9
9
  await fs.writeJson(pkg.manifestPath, pkg.manifest, {spaces: 2})
@@ -64,10 +64,11 @@ const pushChangelog = async (pkg) => {
64
64
  if (!opts) return
65
65
 
66
66
  console.log(`[${pkg.name}] push changelog`)
67
- const [branch = 'changelog', file = `${pkg.name.replace(/[^a-z0-9-]/ig, '')}-changelog.md`, msg = `chore: update changelog ${pkg.name}`] = typeof opts === 'string'
67
+ const [branch = 'changelog', file = `${pkg.name.replace(/[^a-z0-9-]/ig, '')}-changelog.md`, ..._msg] = typeof opts === 'string'
68
68
  ? opts.split(' ')
69
69
  : [opts.branch, opts.file, opts.msg]
70
70
  const _cwd = await fetch({cwd: pkg.absPath, branch})
71
+ const msg = restJoin(_msg, pkg, 'chore: update changelog ${{name}}')
71
72
  const releaseNotes = await formatReleaseNotes(pkg)
72
73
 
73
74
  await $.o({cwd: _cwd})`echo ${releaseNotes}"\n$(cat ./${file})" > ./${file}`
@@ -99,9 +100,10 @@ const ghPages = async (pkg) => {
99
100
  const {config: {ghPages: opts}} = pkg
100
101
  if (!opts) return
101
102
 
102
- const [branch = 'gh-pages', from = 'docs', to = '.', msg = `docs: update docs ${pkg.name} ${pkg.version}`] = typeof opts === 'string'
103
+ const [branch = 'gh-pages', from = 'docs', to = '.', ..._msg] = typeof opts === 'string'
103
104
  ? opts.split(' ')
104
105
  : [opts.branch, opts.from, opts.to, opts.msg]
106
+ const msg = restJoin(_msg, pkg, 'docs: update docs ${{name}} ${{version}}')
105
107
 
106
108
  console.log(`[${pkg.name}] publish docs to ${branch}`)
107
109
 
@@ -22,3 +22,5 @@ export const runHook = async (pkg, name) => {
22
22
  await $.o({cwd: pkg.absPath, quote: v => v})`${cmd}`
23
23
  }
24
24
  }
25
+
26
+ export const restJoin = (rest, context, def) => tpl(rest.filter(Boolean).join(' ') || def, context)