bulk-release 2.2.15 → 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 +5 -0
- package/package.json +1 -1
- package/src/main/js/analyze.js +1 -1
- package/src/main/js/npm.js +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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
|
+
|
|
1
6
|
## [2.2.15](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.14...v2.2.15) (2023-03-28)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/analyze.js
CHANGED
|
@@ -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.
|
|
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
|
|
package/src/main/js/npm.js
CHANGED
|
@@ -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
|
|
13
|
-
await $.raw`wget --timeout=10 --header='Authorization: ${bearerToken}' -qO- ${
|
|
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 =
|
|
56
|
+
export const getBearerToken = (npmRegistry, npmToken, npmConfig) => {
|
|
57
57
|
const token = npmConfig
|
|
58
|
-
? getAuthToken(npmRegistry, INI.parse(
|
|
58
|
+
? getAuthToken(npmRegistry, INI.parse(fs.readFileSync(npmConfig, 'utf8')))
|
|
59
59
|
: npmToken
|
|
60
60
|
return `Bearer ${token}`
|
|
61
61
|
}
|