zx-bulk-release 2.0.0 → 2.0.1

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,8 @@
1
+ ## [2.0.1](https://github.com/semrel-extra/zx-bulk-release/compare/v2.0.0...v2.0.1) (2023-03-22)
2
+
3
+ ### Fixes & improvements
4
+ * perf: optimize pkg fetch ([749ea0b](https://github.com/semrel-extra/zx-bulk-release/commit/749ea0b29f854e57a447f4cdefe06ab32acba497))
5
+
1
6
  ## [2.0.0](https://github.com/semrel-extra/zx-bulk-release/compare/v1.26.2...v2.0.0) (2023-03-21)
2
7
 
3
8
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-bulk-release",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "zx-based alternative for multi-semantic-release",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,20 +1,19 @@
1
1
  import {parseEnv} from './config.js'
2
2
  import {log} from './log.js'
3
- import {$, ctx, fs, path, tempy, copy, INI, fetch} from 'zx-extra'
3
+ import {$, ctx, fs, path, tempy, INI, fetch} from 'zx-extra'
4
4
 
5
5
  export const fetchPkg = async (pkg, {env = $.env} = {}) => {
6
6
  try {
7
+ log({pkg})(`fetching '${pkg.name}@${pkg.version}'`)
7
8
  const cwd = pkg.absPath
8
9
  const {npmRegistry, npmToken, npmConfig} = parseEnv(env)
9
10
  const temp = tempy.temporaryDirectory()
10
11
  const bearerToken = getBearerToken(npmRegistry, npmToken, npmConfig)
11
12
  const tarball = getTarballUrl(npmRegistry, pkg.name, pkg.version)
12
13
 
13
- await $.raw`wget --header='Authorization: ${bearerToken}' -qO- ${tarball} | tar xvz -C ${temp}`
14
- await copy({from: ['**/*', '!package.json'], to: cwd, baseFrom: `${temp}/package`})
14
+ await $.raw`wget --header='Authorization: ${bearerToken}' -qO- ${tarball} | tar xvz -C ${cwd} --strip-components=1 --exclude='package.json'`
15
15
 
16
16
  pkg.fetched = true
17
- log({pkg})(`fetched '${pkg.name}@${pkg.version}'`)
18
17
  } catch (e) {
19
18
  log({pkg})(`fetching '${pkg.name}@${pkg.version}' failed`, e)
20
19
  }