Skip to content

Commit defe79a

Browse files
authored
fix: publish of tarballs includes README in packument (#4480)
1 parent 2db3eff commit defe79a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/commands/publish.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ class Publish extends BaseCommand {
195195
if (spec.type === 'directory') {
196196
return readJson(`${spec.fetchSpec}/package.json`)
197197
}
198-
return pacote.manifest(spec, { ...opts, fullMetadata: true })
198+
return pacote.manifest(spec, {
199+
...opts,
200+
fullMetadata: true,
201+
fullReadJson: true,
202+
})
199203
}
200204
}
201205
module.exports = Publish

test/lib/commands/publish.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ t.test('can publish a tarball', async t => {
290290
name: 'my-cool-tarball',
291291
version: '1.2.3',
292292
}),
293+
'README.md': 'This is my readme',
293294
},
294295
})
295296
const tar = require('tar')
@@ -311,6 +312,9 @@ t.test('can publish a tarball', async t => {
311312
{
312313
name: 'my-cool-tarball',
313314
version: '1.2.3',
315+
readme: 'This is my readme',
316+
description: 'This is my readme',
317+
readmeFilename: 'README.md',
314318
},
315319
'sent manifest to lib pub'
316320
)

0 commit comments

Comments
 (0)