bulk-release 2.13.1 → 2.13.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.13.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.13.2...v2.13.3) (2023-12-19)
2
+
3
+ ### Fixes & improvements
4
+ * fix: getLatestMeta fallbacks to npm manifest ([eae8771](https://github.com/semrel-extra/zx-bulk-release/commit/eae877103df33b6b96d20924f7ff8cd4825b8877))
5
+
6
+ ## [2.13.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.13.1...v2.13.2) (2023-12-19)
7
+
8
+ ### Fixes & improvements
9
+ * perf: tweak up getCommits ([9206508](https://github.com/semrel-extra/zx-bulk-release/commit/9206508cdafbfd166734c804b4c68fe861de1f02))
10
+
1
11
  ## [2.13.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.13.0...v2.13.1) (2023-12-18)
2
12
 
3
13
  ### Fixes & improvements
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bulk-release",
3
3
  "alias": "bulk-release",
4
- "version": "2.13.1",
4
+ "version": "2.13.3",
5
5
  "description": "zx-based alternative for multi-semantic-release",
6
6
  "type": "module",
7
7
  "exports": {
@@ -90,7 +90,7 @@ export const getCommits = async (cwd, from, to = 'HEAD') => ctx(async ($) => {
90
90
  const ref = from ? `${from}..${to}` : to
91
91
 
92
92
  $.cwd = cwd
93
- return (await $.raw`git log ${ref} --format=+++%s__%b__%h__%H -- .`)
93
+ return (await $.raw`git log ${ref} --format=+++%s__%b__%h__%H -- ${cwd}`)
94
94
  .toString()
95
95
  .split('+++')
96
96
  .filter(Boolean)
@@ -38,7 +38,7 @@ export const fetchPkg = async (pkg) => {
38
38
  export const fetchManifest = async (pkg, {nothrow} = {}) => {
39
39
  const {npmRegistry, npmToken, npmConfig} = pkg.config
40
40
  const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
41
- const url = getManifestUrl(npmRegistry, pkg.name, pkg.version || 'latest')
41
+ const url = getManifestUrl(npmRegistry, pkg.name.replace('/', '%2f'), pkg.version || 'latest')
42
42
  const reqOpts = bearerToken ? {headers: {authorization: bearerToken}} : {}
43
43
 
44
44
  try {
@@ -216,22 +216,22 @@ export const parseDateTag = (date) => new Date(date.replaceAll('.', '-')+'Z')
216
216
  export const getArtifactPath = (tag) => tag.toLowerCase().replace(/[^a-z0-9-]/g, '-')
217
217
 
218
218
  export const getLatestMeta = async (pkg, tag) => {
219
- if (!tag) return
220
-
221
- const {absPath: cwd, config: {ghBasicAuth: basicAuth}} = pkg
222
- const {repoName} = await getRepo(cwd, {basicAuth})
223
-
224
- try {
225
- return JSON.parse(await ghGetAsset({repoName, tag, name: 'meta.json'}))
226
- } catch {}
227
-
228
- try {
229
- const _cwd = await fetchRepo({cwd, branch: 'meta', basicAuth})
230
- return await Promise.any([
231
- fs.readJson(path.resolve(_cwd, `${getArtifactPath(tag)}.json`)),
232
- fs.readJson(path.resolve(_cwd, getArtifactPath(tag), 'meta.json'))
233
- ])
234
- } catch {}
219
+ if (tag) {
220
+ const {absPath: cwd, config: {ghBasicAuth: basicAuth}} = pkg
221
+ const {repoName} = await getRepo(cwd, {basicAuth})
222
+
223
+ try {
224
+ return JSON.parse(await ghGetAsset({repoName, tag, name: 'meta.json'}))
225
+ } catch {}
226
+
227
+ try {
228
+ const _cwd = await fetchRepo({cwd, branch: 'meta', basicAuth})
229
+ return await Promise.any([
230
+ fs.readJson(path.resolve(_cwd, `${getArtifactPath(tag)}.json`)),
231
+ fs.readJson(path.resolve(_cwd, getArtifactPath(tag), 'meta.json'))
232
+ ])
233
+ } catch {}
234
+ }
235
235
 
236
236
  return fetchManifest(pkg, {nothrow: true})
237
237
  }