Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] publishing a tarball does not include readme #3548

Closed
1 task done
wraithgar opened this issue Jul 15, 2021 · 2 comments · Fixed by #4480
Closed
1 task done

[BUG] publishing a tarball does not include readme #3548

wraithgar opened this issue Jul 15, 2021 · 2 comments · Fixed by #4480
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@wraithgar
Copy link
Member

wraithgar commented Jul 15, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When publishing from a tarball, the readme attribute is not in the manifest.

Expected Behavior

fullMetadata: true in pacote.manifest works properly for tarballs.

Steps To Reproduce

This was technically introduced in [email protected] but that was because that was when publishing from a tarball was added back in to v7. This has likely never worked in v7.

cli/lib/publish.js

Lines 193 to 197 in 665a7bd

getManifest (spec, opts) {
if (spec.type === 'directory')
return readJson(`${spec.fetchSpec}/package.json`)
return pacote.manifest(spec, { ...opts, fullMetadata: true })
}

> m = pacote.manifest('.', { fullMetadata: true })
Promise { <pending> }
> m
Promise {
  {
    name: 'npm-readme-repro',
    version: '1.0.0',
    description: 'Example publishing an npm package.',
    main: 'index.js',
    scripts: { test: 'echo "Error: no test specified" && exit 1' },
    repository: {
      type: 'git',
      url: 'git+https://github.com/jcansdale-test/npm-readme-repro.git'
    },
    keywords: [],
    author: 'Gar <[email protected]>',
    license: 'ISC',
    bugs: {
      url: 'https://github.com/jcansdale-test/npm-readme-repro/issues'
    },
    homepage: 'https://github.com/jcansdale-test/npm-readme-repro#readme',
    _id: '[email protected]',
    _integrity: null,
    _resolved: '/Users/wraithgar/Development/npm/npm-readme-repro',
    _from: 'file:',
    [Symbol(newline)]: '\n',
    [Symbol(indent)]: '  '
  }
}

Environment

See steps to reproduce for relevant environment info.

@wraithgar wraithgar added Release 7.x work is associated with a specific npm 7 release Bug thing that needs fixing Needs Triage needs review for next steps labels Jul 15, 2021
@eligao
Copy link

eligao commented Oct 22, 2021

Same here. "readme" gone missing on NPM v7 and v8, but works well on v6

@darcyclarke darcyclarke added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Jan 19, 2022
@fritzy fritzy self-assigned this Feb 3, 2022
@fritzy
Copy link
Contributor

fritzy commented Mar 2, 2022

This just got merged for this week's release.

@fritzy fritzy closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants