zx-bulk-release 2.5.0 → 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 +11 -0
- package/package.json +1 -1
- package/src/main/js/analyze.js +3 -2
- package/src/main/js/deps.js +1 -1
- package/src/main/js/npm.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
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
|
+
|
|
7
|
+
## [2.5.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.5.0...v2.5.1) (2023-04-11)
|
|
8
|
+
|
|
9
|
+
### Fixes & improvements
|
|
10
|
+
* perf: set connect timeout for npmFetch ([ab5a4eb](https://github.com/semrel-extra/zx-bulk-release/commit/ab5a4eba2ce8ee1b4257eff7d048fc905ddd98d1))
|
|
11
|
+
|
|
1
12
|
## [2.5.0](https://github.com/semrel-extra/zx-bulk-release/compare/v2.4.2...v2.5.0) (2023-04-09)
|
|
2
13
|
|
|
3
14
|
### Features
|
package/package.json
CHANGED
package/src/main/js/analyze.js
CHANGED
|
@@ -10,12 +10,13 @@ export const analyze = async (pkg) => {
|
|
|
10
10
|
const changes = [...semanticChanges, ...depsChanges]
|
|
11
11
|
const releaseType = getNextReleaseType(changes)
|
|
12
12
|
const pre = pkg.context.flags.snapshot ? `-snap.${pkg.context.git.sha.slice(0, 7)}` : undefined
|
|
13
|
+
const latestVersion = pkg.latest.tag?.version || pkg.latest.meta?.versio
|
|
13
14
|
|
|
14
15
|
pkg.changes = changes
|
|
15
16
|
pkg.releaseType = releaseType
|
|
16
17
|
pkg.version = resolvePkgVersion(
|
|
17
18
|
releaseType,
|
|
18
|
-
|
|
19
|
+
latestVersion,
|
|
19
20
|
pkg.manifest.version,
|
|
20
21
|
pre
|
|
21
22
|
)
|
|
@@ -23,7 +24,7 @@ export const analyze = async (pkg) => {
|
|
|
23
24
|
pkg.manifest.version = pkg.version
|
|
24
25
|
pkg.tag = releaseType ? formatTag({name: pkg.name, version: pkg.version}) : null
|
|
25
26
|
|
|
26
|
-
log({pkg})('semantic changes', changes)
|
|
27
|
+
log({pkg})('semantic changes', changes, 'nextVersion', pkg.version, 'latestVersion', latestVersion)
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const releaseSeverityOrder = ['major', 'minor', 'patch']
|
package/src/main/js/deps.js
CHANGED
package/src/main/js/npm.js
CHANGED
|
@@ -5,12 +5,13 @@ export const fetchPkg = async (pkg) => {
|
|
|
5
5
|
const id = `${pkg.name}@${pkg.version}`
|
|
6
6
|
|
|
7
7
|
try {
|
|
8
|
-
log({pkg})(`fetching '${id}'`)
|
|
9
8
|
const cwd = pkg.absPath
|
|
10
9
|
const {npmRegistry, npmToken, npmConfig} = pkg.config
|
|
11
|
-
const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
|
|
12
10
|
const tarballUrl = getTarballUrl(npmRegistry, pkg.name, pkg.version)
|
|
13
|
-
|
|
11
|
+
const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
|
|
12
|
+
const authorization = bearerToken ? `--header='Authorization: ${bearerToken}'` : ''
|
|
13
|
+
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}`
|
|
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
|