From efca3896c1898e45accb3e99acf3453ff36ea26f Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 24 Jul 2021 21:05:26 +0300 Subject: [PATCH] fix(pack): use the correct compression algorithm --- .changeset/empty-garlics-live.md | 5 +++++ packages/plugin-commands-publishing/src/pack.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/empty-garlics-live.md diff --git a/.changeset/empty-garlics-live.md b/.changeset/empty-garlics-live.md new file mode 100644 index 0000000000..fab77541a5 --- /dev/null +++ b/.changeset/empty-garlics-live.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-publishing": patch +--- + +Use the correct compression algorithm to pack. diff --git a/packages/plugin-commands-publishing/src/pack.ts b/packages/plugin-commands-publishing/src/pack.ts index 44945fe167..f2248c16b0 100644 --- a/packages/plugin-commands-publishing/src/pack.ts +++ b/packages/plugin-commands-publishing/src/pack.ts @@ -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, 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)