bulk-release 2.2.14 → 2.2.16

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.2.16](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.15...v2.2.16) (2023-03-28)
2
+
3
+ ### Fixes & improvements
4
+ * fix: fix pkg version resolver ([0b7bd4b](https://github.com/semrel-extra/zx-bulk-release/commit/0b7bd4b765b87c4e05d7da838831006506e27e30))
5
+
6
+ ## [2.2.15](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.14...v2.2.15) (2023-03-28)
7
+
8
+ ### Fixes & improvements
9
+ * fix: apply queuefy to changelog push ([b8b353d](https://github.com/semrel-extra/zx-bulk-release/commit/b8b353d439916ac57f717a3d463c710702b00d4d))
10
+
1
11
  ## [2.2.14](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.13...v2.2.14) (2023-03-28)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.2.14",
4
+ "version": "2.2.16",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -12,7 +12,7 @@ export const analyze = async (pkg) => {
12
12
 
13
13
  pkg.changes = changes
14
14
  pkg.releaseType = releaseType
15
- pkg.version = resolvePkgVersion(releaseType, pkg.latest.tag?.version || pkg.manifest.version)
15
+ pkg.version = resolvePkgVersion(releaseType, pkg.latest.tag?.version || pkg.latest.meta?.version)
16
16
  pkg.manifest.version = pkg.version
17
17
  pkg.tag = releaseType ? formatTag({name: pkg.name, version: pkg.version}) : null
18
18
 
@@ -1,10 +1,11 @@
1
1
  import {$} from 'zx-extra'
2
- import {log} from './log.js'
2
+ import {queuefy} from 'queuefy'
3
3
  import {fetchRepo, getRepo, pushCommit} from './git.js'
4
- import {msgJoin} from './util.js'
4
+ import {log} from './log.js'
5
5
  import {formatTag} from './meta.js'
6
+ import {msgJoin} from './util.js'
6
7
 
7
- export const pushChangelog = async (pkg) => {
8
+ export const pushChangelog = queuefy(async (pkg) => {
8
9
  const {absPath: cwd, config: {changelog: opts, gitCommitterEmail, gitCommitterName, ghBasicAuth: basicAuth}} = pkg
9
10
  if (!opts) return
10
11
 
@@ -18,7 +19,7 @@ export const pushChangelog = async (pkg) => {
18
19
 
19
20
  await $.o({cwd: _cwd})`echo ${releaseNotes}"\n$(cat ./${file})" > ./${file}`
20
21
  await pushCommit({cwd, branch, msg, gitCommitterEmail, gitCommitterName, basicAuth})
21
- }
22
+ })
22
23
 
23
24
  export const formatReleaseNotes = async (pkg) => {
24
25
  const {name, version, absPath: cwd, config: {ghBasicAuth: basicAuth}} = pkg
@@ -9,8 +9,8 @@ export const fetchPkg = async (pkg) => {
9
9
  const cwd = pkg.absPath
10
10
  const {npmRegistry, npmToken, npmConfig} = pkg.config
11
11
  const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
12
- const tarball = getTarballUrl(npmRegistry, pkg.name, pkg.version)
13
- await $.raw`wget --timeout=10 --header='Authorization: ${bearerToken}' -qO- ${tarball} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
12
+ const tarballUrl = getTarballUrl(npmRegistry, pkg.name, pkg.version)
13
+ await $.raw`wget --timeout=10 --header='Authorization: ${bearerToken}' -qO- ${tarballUrl} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
14
14
 
15
15
  pkg.fetched = true
16
16
  } catch (e) {
@@ -24,7 +24,7 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
24
24
  const url = getManifestUrl(npmRegistry, pkg.name, pkg.version)
25
25
 
26
26
  try {
27
- const res = await fetch(url, {authorization: bearerToken})
27
+ const res = await fetch(url, {headers: {authorization: bearerToken}})
28
28
  if (!res.ok) throw res
29
29
 
30
30
  return res.json() // NOTE .json() is async too
@@ -53,9 +53,9 @@ export const getTarballUrl = (registry, name, version) => `${registry}/${name}/-
53
53
 
54
54
  export const getManifestUrl = (registry, name, version) => `${registry}/${name}/${version}`
55
55
 
56
- export const getBearerToken = async (npmRegistry, npmToken, npmConfig) => {
56
+ export const getBearerToken = (npmRegistry, npmToken, npmConfig) => {
57
57
  const token = npmConfig
58
- ? getAuthToken(npmRegistry, INI.parse(await fs.readFile(npmConfig, 'utf8')))
58
+ ? getAuthToken(npmRegistry, INI.parse(fs.readFileSync(npmConfig, 'utf8')))
59
59
  : npmToken
60
60
  return `Bearer ${token}`
61
61
  }