zx-bulk-release 2.5.1 → 2.5.3
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 +11 -0
- package/package.json +3 -2
- package/src/main/js/deps.js +1 -1
- package/src/main/js/npm.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.5.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.2...v2.5.3) (2023-04-13)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* perf: export meta utils (#25) ([9c682db](https://github.com/semrel-extra/zx-bulk-release/commit/9c682dbd987ba0dfce0c4d0e6754a8d4e73b47bc))
|
|
5
|
+
|
|
6
|
+
## [2.5.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.1...v2.5.2) (2023-04-11)
|
|
7
|
+
|
|
8
|
+
### Fixes & improvements
|
|
9
|
+
* perf: add `scope` to version bump commit msg tpl ([a671e59](https://github.com/semrel-extra/zx-bulk-release/commit/a671e59d5008440626e8f280fd9bfd0ac284f720))
|
|
10
|
+
* fix: let npmFetch be called w/o auth (dry-run mode) ([7008d19](https://github.com/semrel-extra/zx-bulk-release/commit/7008d19361cd2cdbd73df9420edd096fd4fda1a6))
|
|
11
|
+
|
|
1
12
|
## [2.5.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.0...v2.5.1) (2023-04-11)
|
|
2
13
|
|
|
3
14
|
### Fixes & improvements
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zx-bulk-release",
|
|
3
3
|
"alias": "bulk-release",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.3",
|
|
5
5
|
"description": "zx-based alternative for multi-semantic-release",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/main/js/index.js",
|
|
9
|
-
"./test-utils": "./src/test/js/test-utils.js"
|
|
9
|
+
"./test-utils": "./src/test/js/test-utils.js",
|
|
10
|
+
"./meta": "./src/main/js/meta.js"
|
|
10
11
|
},
|
|
11
12
|
"bin": "./src/main/js/cli.js",
|
|
12
13
|
"files": [
|
package/src/main/js/deps.js
CHANGED
package/src/main/js/npm.js
CHANGED
|
@@ -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
|
|
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,
|
|
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
|