Skip to content

Commit

Permalink
fix: publish of tarballs includes README in packument (#4480)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzy committed Mar 2, 2022
1 parent 2db3eff commit defe79a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ class Publish extends BaseCommand {
if (spec.type === 'directory') {
return readJson(`${spec.fetchSpec}/package.json`)
}
return pacote.manifest(spec, { ...opts, fullMetadata: true })
return pacote.manifest(spec, {
...opts,
fullMetadata: true,
fullReadJson: true,
})
}
}
module.exports = Publish
4 changes: 4 additions & 0 deletions test/lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ t.test('can publish a tarball', async t => {
name: 'my-cool-tarball',
version: '1.2.3',
}),
'README.md': 'This is my readme',
},
})
const tar = require('tar')
Expand All @@ -311,6 +312,9 @@ t.test('can publish a tarball', async t => {
{
name: 'my-cool-tarball',
version: '1.2.3',
readme: 'This is my readme',
description: 'This is my readme',
readmeFilename: 'README.md',
},
'sent manifest to lib pub'
)
Expand Down

0 comments on commit defe79a

Please sign in to comment.