fix(pack): use the correct compression algorithm

This commit is contained in:
Zoltan Kochan
2021-07-24 21:05:26 +03:00
parent 3c044519e3
commit efca3896c1
2 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-publishing": patch
---
Use the correct compression algorithm to pack.

View File

@@ -1,10 +1,10 @@
import fs from 'fs'
import path from 'path'
import { createGzip } from 'zlib'
import { types as allTypes, UniversalOptions, Config } from '@pnpm/config'
import { readProjectManifest } from '@pnpm/cli-utils'
import exportableManifest from '@pnpm/exportable-manifest'
import fg from 'fast-glob'
import gunzip from 'gunzip-maybe'
import pick from 'ramda/src/pick'
import realpathMissing from 'realpath-missing'
import renderHelp from 'render-help'
@@ -93,7 +93,7 @@ async function packPkg (destFile: string, filesMap: Record<string, string>, proj
pack.entry({ name }, fs.readFileSync(source))
}
const tarball = fs.createWriteStream(destFile)
pack.pipe(gunzip()).pipe(tarball)
pack.pipe(createGzip()).pipe(tarball)
pack.finalize()
return new Promise((resolve, reject) => {
tarball.on('close', () => resolve()).on('error', reject)