zx-bulk-release 2.2.1 → 2.2.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 +5 -0
- package/package.json +1 -1
- package/src/main/js/git.js +6 -1
- package/src/main/js/log.js +1 -1
- package/src/main/js/processor.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [2.2.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.1...v2.2.2) (2023-03-24)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* fix: fix gitPush retry ([268da72](https://github.com/semrel-extra/zx-bulk-release/commit/268da727036b0d3bf20b1ef10053440c5f56dad0))
|
|
5
|
+
|
|
1
6
|
## [2.2.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.0...v2.2.1) (2023-03-23)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/git.js
CHANGED
|
@@ -53,8 +53,12 @@ export const pushCommit = async ({cwd, from, to, branch, origin, msg, ignoreFile
|
|
|
53
53
|
return await $.raw`git push origin HEAD:refs/heads/${branch}`
|
|
54
54
|
} catch (e) {
|
|
55
55
|
retries -= 1
|
|
56
|
+
log({level: 'error'})('git push failed', 'branch', branch, 'retries left', retries, e)
|
|
56
57
|
branches[keyByValue(branches, _cwd)] = null
|
|
57
|
-
|
|
58
|
+
|
|
59
|
+
if (retries === 0) {
|
|
60
|
+
throw e
|
|
61
|
+
}
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
})
|
|
@@ -64,6 +68,7 @@ export const getRepo = async (_cwd, {basicAuth} = {}) => {
|
|
|
64
68
|
const cwd = await getRoot(_cwd)
|
|
65
69
|
if (repos[cwd]) return repos[cwd]
|
|
66
70
|
|
|
71
|
+
console.log('!!! has basic auth', !!basicAuth)
|
|
67
72
|
const originUrl = await getOrigin(cwd)
|
|
68
73
|
const [, , repoHost, repoName] = originUrl.replace(':', '/').replace(/\.git/, '').match(/.+(@|\/\/)([^/]+)\/(.+)$/) || []
|
|
69
74
|
const repoPublicUrl = `https://${repoHost}/${repoName}`
|
package/src/main/js/log.js
CHANGED
|
@@ -53,7 +53,7 @@ export const createReport = ({logger = console, file = null} = {}) => ({
|
|
|
53
53
|
},
|
|
54
54
|
log(ctx = {}) {
|
|
55
55
|
return function (...chunks) {
|
|
56
|
-
const {pkg, scope = pkg?.name || '~', level = 'info'} = ctx
|
|
56
|
+
const {pkg, scope = pkg?.name || $.scope || '~', level = 'info'} = ctx
|
|
57
57
|
const msg = chunks.map(c => typeof c === 'string' ? tpl(c, ctx) : c)
|
|
58
58
|
const event = {msg, scope, date: Date.now(), level}
|
|
59
59
|
this.events.push(event)
|
package/src/main/js/processor.js
CHANGED
|
@@ -114,7 +114,8 @@ const contextify = async (pkg, packages, root) => {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const build = async (pkg, packages, run = runCmd, self = build) => {
|
|
117
|
+
const build = async (pkg, packages, run = runCmd, self = build) => within(async () => {
|
|
118
|
+
$.scope = pkg.name
|
|
118
119
|
if (pkg.built) return
|
|
119
120
|
|
|
120
121
|
await Promise.all([
|
|
@@ -130,9 +131,10 @@ const build = async (pkg, packages, run = runCmd, self = build) => {
|
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
pkg.built = true
|
|
133
|
-
}
|
|
134
|
+
})
|
|
134
135
|
|
|
135
|
-
const publish = async (pkg, run = runCmd) => {
|
|
136
|
+
const publish = async (pkg, run = runCmd) => within(async () => {
|
|
137
|
+
$.scope = pkg.name
|
|
136
138
|
await fs.writeJson(pkg.manifestPath, pkg.manifest, {spaces: 2})
|
|
137
139
|
await pushTag(pkg)
|
|
138
140
|
|
|
@@ -144,4 +146,4 @@ const publish = async (pkg, run = runCmd) => {
|
|
|
144
146
|
ghPages(pkg),
|
|
145
147
|
run(pkg, 'publishCmd')
|
|
146
148
|
])
|
|
147
|
-
}
|
|
149
|
+
})
|