bulk-release 2.15.2 → 2.15.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 +5 -0
- package/package.json +1 -1
- package/src/main/js/api/npm.js +2 -3
- package/src/main/js/util.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [2.15.3](https://github.com/semrel-extra/zx-bulk-release/compare/v2.15.2...v2.15.3) (2024-02-25)
|
|
2
|
+
|
|
3
|
+
### Fixes & improvements
|
|
4
|
+
* refactor: add util pipify ([2d5ce43](https://github.com/semrel-extra/zx-bulk-release/commit/2d5ce4382acd5c1ea9517177fb3bc3f39345a55b))
|
|
5
|
+
|
|
1
6
|
## [2.15.2](https://github.com/semrel-extra/zx-bulk-release/compare/v2.15.1...v2.15.2) (2024-02-25)
|
|
2
7
|
|
|
3
8
|
### Fixes & improvements
|
package/package.json
CHANGED
package/src/main/js/api/npm.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {log} from '../log.js'
|
|
2
2
|
import {$, fs, INI, fetch, tempy} from 'zx-extra'
|
|
3
|
-
import {unzip} from '../util.js'
|
|
4
|
-
import {Readable} from 'node:stream'
|
|
3
|
+
import {pipify, unzip} from '../util.js'
|
|
5
4
|
|
|
6
5
|
// https://stackoverflow.com/questions/19978452/how-to-extract-single-file-from-tar-gz-archive-using-node-js
|
|
7
6
|
|
|
@@ -27,7 +26,7 @@ export const fetchPkg = async (pkg) => {
|
|
|
27
26
|
})
|
|
28
27
|
clearTimeout(timeoutId)
|
|
29
28
|
|
|
30
|
-
await unzip(
|
|
29
|
+
await unzip(pipify(tarball.body), {cwd, strip: 1, omit: ['package.json']})
|
|
31
30
|
|
|
32
31
|
log({pkg})(`fetch duration '${id}': ${Date.now() - now}`)
|
|
33
32
|
pkg.fetched = true
|
package/src/main/js/util.js
CHANGED
|
@@ -2,6 +2,7 @@ import zlib from 'node:zlib'
|
|
|
2
2
|
import fs from 'node:fs/promises'
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
import tar from 'tar-stream'
|
|
5
|
+
import {Readable} from 'node:stream'
|
|
5
6
|
|
|
6
7
|
export const tpl = (str, context) =>
|
|
7
8
|
str?.replace(/\$\{\{\s*([.a-z0-9]+)\s*}}/gi, (matched, key) => get(context, key) ?? '')
|
|
@@ -114,3 +115,5 @@ export const unzip = (stream, {pick, omit, cwd = process.cwd(), strip = 0} = {})
|
|
|
114
115
|
.pipe(zlib.createGunzip())
|
|
115
116
|
.pipe(extract)
|
|
116
117
|
})
|
|
118
|
+
|
|
119
|
+
export const pipify = (stream) => stream.pipe ? stream : Readable.from(stream)
|