zx-bulk-release 2.2.1 → 2.2.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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.2.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.2...v2.2.3) (2023-03-24)
2
+
3
+ ### Fixes & improvements
4
+ * fix: debug ([c1699e6](https://github.com/semrel-extra/zx-bulk-release/commit/c1699e6c7d8bbc180c4ef17dfdb9f25816814578))
5
+
6
+ ## [2.2.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.1...v2.2.2) (2023-03-24)
7
+
8
+ ### Fixes & improvements
9
+ * fix: fix gitPush retry ([268da72](https://github.com/semrel-extra/zx-bulk-release/commit/268da727036b0d3bf20b1ef10053440c5f56dad0))
10
+
1
11
  ## [2.2.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.0...v2.2.1) (2023-03-23)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,6 +34,8 @@ export const normalizePkgConfig = (config, env) => ({
34
34
  npmFetch: config.npmFetch || config.fetch || config.fetchPkg,
35
35
  buildCmd: config.buildCmd || config.cmd,
36
36
  get ghBasicAuth() {
37
+ console.log('this.ghToken', !!this.ghToken)
38
+ console.log('this.ghUser', !!this.ghUser)
37
39
  return this.ghUser && this.ghToken ? `${this.ghUser}:${this.ghToken}` : false
38
40
  }
39
41
  })
@@ -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
- log({level: 'warn'})('git push failed', 'retries left', retries, e)
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}`
@@ -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)
@@ -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
+ })