zx-bulk-release 2.2.3 → 2.2.5

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.5](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.4...v2.2.5) (2023-03-24)
2
+
3
+ ### Fixes & improvements
4
+ * perf: print err.stack on process failure ([5f3271f](https://github.com/semrel-extra/zx-bulk-release/commit/5f3271fa4e85d6d8f0b23ad240c9d566fddf69be))
5
+
6
+ ## [2.2.4](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.3...v2.2.4) (2023-03-24)
7
+
8
+ ### Fixes & improvements
9
+ * fix: add debug notes ([3cf101b](https://github.com/semrel-extra/zx-bulk-release/commit/3cf101b3330a5b0415684d9c3b097bb1832b4365))
10
+
1
11
  ## [2.2.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.2.2...v2.2.3) (2023-03-24)
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.3",
3
+ "version": "2.2.5",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,8 +34,6 @@ 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)
39
37
  return this.ghUser && this.ghToken ? `${this.ghUser}:${this.ghToken}` : false
40
38
  }
41
39
  })
@@ -68,7 +68,6 @@ export const getRepo = async (_cwd, {basicAuth} = {}) => {
68
68
  const cwd = await getRoot(_cwd)
69
69
  if (repos[cwd]) return repos[cwd]
70
70
 
71
- console.log('!!! has basic auth', !!basicAuth)
72
71
  const originUrl = await getOrigin(cwd)
73
72
  const [, , repoHost, repoName] = originUrl.replace(':', '/').replace(/\.git/, '').match(/.+(@|\/\/)([^/]+)\/(.+)$/) || []
74
73
  const repoPublicUrl = `https://${repoHost}/${repoName}`
@@ -90,7 +89,7 @@ export const getRepo = async (_cwd, {basicAuth} = {}) => {
90
89
  const origins = {}
91
90
  export const getOrigin = async (cwd) => {
92
91
  if (!origins[cwd]) {
93
- origins[cwd] = (await $.o({cwd})`git config --get remote.origin.url`).toString().trim()
92
+ origins[cwd] = $.o({cwd})`git config --get remote.origin.url`.then(r => r.toString().trim())
94
93
  }
95
94
 
96
95
  return origins[cwd]
@@ -45,9 +45,9 @@ export const pushMeta = async (pkg) => {
45
45
  }
46
46
 
47
47
  export const getLatest = async (pkg) => {
48
- const {absPath: cwd, name} = pkg
48
+ const {absPath: cwd, name, config: {ghBasicAuth: basicAuth}} = pkg
49
49
  const tag = await getLatestTag(cwd, name)
50
- const meta = await getLatestMeta(cwd, tag?.ref) || await fetchManifest(pkg, {nothrow: true})
50
+ const meta = await getLatestMeta(cwd, tag?.ref, basicAuth) || await fetchManifest(pkg, {nothrow: true})
51
51
 
52
52
  return {
53
53
  tag,
@@ -155,11 +155,11 @@ export const parseDateTag = (date) => new Date(date.replaceAll('.', '-')+'Z')
155
155
 
156
156
  export const getArtifactPath = (tag) => tag.toLowerCase().replace(/[^a-z0-9-]/g, '-')
157
157
 
158
- export const getLatestMeta = async (cwd, tag) => {
158
+ export const getLatestMeta = async (cwd, tag, basicAuth) => {
159
159
  if (!tag) return null
160
160
 
161
161
  try {
162
- const _cwd = await fetchRepo({cwd, branch: 'meta'})
162
+ const _cwd = await fetchRepo({cwd, branch: 'meta', basicAuth})
163
163
  return await Promise.any([
164
164
  fs.readJson(path.resolve(_cwd, `${getArtifactPath(tag)}.json`)),
165
165
  fs.readJson(path.resolve(_cwd, getArtifactPath(tag), 'meta.json'))
@@ -63,7 +63,7 @@ export const run = async ({cwd = process.cwd(), env, flags = {}} = {}) => within
63
63
  }})
64
64
  } catch (e) {
65
65
  report
66
- .log({level: 'error'})(e)
66
+ .log({level: 'error'})(e, e.stack)
67
67
  .set('error', e)
68
68
  .setStatus('failure')
69
69
  throw e