zx-bulk-release 2.9.2 → 2.10.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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.10.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.9.3...v2.10.0) (2023-06-27)
2
+
3
+ ### Features
4
+ * feat: log `fetch`, `build` & `test` steps duration ([b7b3db3](https://github.com/semrel-extra/zx-bulk-release/commit/b7b3db3af378f3153f8ad8fa62eec79852da6c0b))
5
+
6
+ ## [2.9.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.9.2...v2.9.3) (2023-06-27)
7
+
8
+ ### Fixes & improvements
9
+ * perf: print gh release url in log ([08edaef](https://github.com/semrel-extra/zx-bulk-release/commit/08edaef76e67a7b7109c9fa1e1f0140f5e932d3b))
10
+
1
11
  ## [2.9.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.9.1...v2.9.2) (2023-06-10)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.9.2",
4
+ "version": "2.10.0",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "zx-extra": "^2.5.4"
30
30
  },
31
31
  "devDependencies": {
32
- "c8": "^7.14.0",
32
+ "c8": "^8.0.0",
33
33
  "uvu": "^0.5.6",
34
34
  "verdaccio": "^5.25.0"
35
35
  },
package/src/main/js/gh.js CHANGED
@@ -7,7 +7,7 @@ import {formatReleaseNotes} from './changelog.js'
7
7
  import {msgJoin} from './util.js'
8
8
 
9
9
  export const ghRelease = async (pkg) => {
10
- log({pkg})(`create gh release`)
10
+ log({pkg})('create gh release')
11
11
 
12
12
  const {ghBasicAuth: basicAuth, ghToken} = pkg.config
13
13
  if (!ghToken) return null
@@ -22,7 +22,10 @@ export const ghRelease = async (pkg) => {
22
22
  body: releaseNotes
23
23
  })
24
24
 
25
- await $.o({cwd})`curl -H 'Authorization: token ${ghToken}' -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${repoName}/releases -d ${releaseData}`
25
+ const {stdout} = await $.o({cwd})`curl -H 'Authorization: token ${ghToken}' -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/${repoName}/releases -d ${releaseData}`
26
+ const res = JSON.parse(stdout.toString().trim())
27
+
28
+ log({pkg})('gh release url:', res.url, res.html_url)
26
29
  }
27
30
 
28
31
  export const ghPages = queuefy(async (pkg) => {
@@ -3,6 +3,7 @@ import {$, fs, INI, fetch, tempy} from 'zx-extra'
3
3
 
4
4
  export const fetchPkg = async (pkg) => {
5
5
  const id = `${pkg.name}@${pkg.version}`
6
+ const now = Date.now()
6
7
 
7
8
  try {
8
9
  const cwd = pkg.absPath
@@ -11,8 +12,9 @@ export const fetchPkg = async (pkg) => {
11
12
  const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
12
13
  const authorization = bearerToken ? `--header='Authorization: ${bearerToken}'` : ''
13
14
  log({pkg})(`fetching '${id}' from ${npmRegistry}`)
14
- await $.raw`wget --timeout=10 --connect-timeout=5 ${authorization} -qO- ${tarballUrl} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
15
+ await $.raw`wget --timeout=15 --connect-timeout=5 ${authorization} -qO- ${tarballUrl} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
15
16
 
17
+ log({pkg})(`fetch duration '${id}': ${Date.now() - now}`)
16
18
  pkg.fetched = true
17
19
  } catch (e) {
18
20
  log({pkg, level: 'warn'})(`fetching '${id}' failed`, e)
@@ -79,10 +79,14 @@ export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within
79
79
 
80
80
  export const runCmd = async (pkg, name) => {
81
81
  const cmd = tpl(pkg.config[name], {...pkg, ...pkg.context})
82
+ const now = Date.now()
82
83
 
83
84
  if (cmd) {
84
85
  log({pkg})(`run ${name} '${cmd}'`)
85
- return $.o({cwd: pkg.absPath, quote: v => v, preferLocal: true})`${cmd}`
86
+ const result = await $.o({cwd: pkg.absPath, quote: v => v, preferLocal: true})`${cmd}`
87
+
88
+ log({pkg})(`duration ${name}: ${Date.now() - now}`)
89
+ return result
86
90
  }
87
91
  }
88
92