bulk-release 2.5.1 → 2.5.2

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,9 @@
1
+ ## [2.5.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.1...v2.5.2) (2023-04-11)
2
+
3
+ ### Fixes & improvements
4
+ * perf: add `scope` to version bump commit msg tpl ([a671e59](https://github.com/semrel-extra/zx-bulk-release/commit/a671e59d5008440626e8f280fd9bfd0ac284f720))
5
+ * fix: let npmFetch be called w/o auth (dry-run mode) ([7008d19](https://github.com/semrel-extra/zx-bulk-release/commit/7008d19361cd2cdbd73df9420edd096fd4fda1a6))
6
+
1
7
  ## [2.5.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.0...v2.5.1) (2023-04-11)
2
8
 
3
9
  ### 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.5.1",
4
+ "version": "2.5.2",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -21,7 +21,7 @@ export const updateDeps = async (pkg) => {
21
21
  group: 'Dependencies',
22
22
  releaseType: 'patch',
23
23
  change: 'perf',
24
- subj: `perf: ${name} updated to ${next}`,
24
+ subj: `perf: ${scope} ${name} updated to ${next}`,
25
25
  })
26
26
  }})
27
27
 
@@ -7,10 +7,11 @@ export const fetchPkg = async (pkg) => {
7
7
  try {
8
8
  const cwd = pkg.absPath
9
9
  const {npmRegistry, npmToken, npmConfig} = pkg.config
10
- const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
11
10
  const tarballUrl = getTarballUrl(npmRegistry, pkg.name, pkg.version)
11
+ const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
12
+ const authorization = bearerToken ? `--header='Authorization: ${bearerToken}'` : ''
12
13
  log({pkg})(`fetching '${id}' from ${npmRegistry}`)
13
- await $.raw`wget --timeout=10 --connect-timeout=5 --header='Authorization: ${bearerToken}' -qO- ${tarballUrl} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
14
+ await $.raw`wget --timeout=10 --connect-timeout=5 ${authorization} -qO- ${tarballUrl} | tar -xvz --strip-components=1 --exclude='package.json' -C ${cwd}`
14
15
 
15
16
  pkg.fetched = true
16
17
  } catch (e) {
@@ -22,9 +23,10 @@ export const fetchManifest = async (pkg, {nothrow} = {}) => {
22
23
  const {npmRegistry, npmToken, npmConfig} = pkg.config
23
24
  const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
24
25
  const url = getManifestUrl(npmRegistry, pkg.name, pkg.version)
26
+ const reqOpts = bearerToken ? {headers: {authorization: bearerToken}} : {}
25
27
 
26
28
  try {
27
- const res = await fetch(url, {headers: {authorization: bearerToken}})
29
+ const res = await fetch(url, reqOpts)
28
30
  if (!res.ok) throw res
29
31
 
30
32
  return res.json() // NOTE .json() is async too
@@ -67,7 +69,7 @@ export const getBearerToken = (npmRegistry, npmToken, npmConfig) => {
67
69
  const token = npmConfig
68
70
  ? getAuthToken(npmRegistry, INI.parse(fs.readFileSync(npmConfig, 'utf8')))
69
71
  : npmToken
70
- return `Bearer ${token}`
72
+ return token ? `Bearer ${token}` : null
71
73
  }
72
74
 
73
75
  // NOTE registry-auth-token does not work with localhost:4873