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

README is not correctly shown on verdaccio using pnpm publish #4091

Closed
FolknR opened this issue Dec 8, 2021 · 12 comments
Closed

README is not correctly shown on verdaccio using pnpm publish #4091

FolknR opened this issue Dec 8, 2021 · 12 comments

Comments

@FolknR
Copy link
Contributor

FolknR commented Dec 8, 2021

pnpm version: 6.23.6

Code to reproduce the issue:

pnpm publish

Expected behavior:

The readme file is being passed and shown correctly

Actual behavior:

The readme file isn't present in the publishing request body

Additional information:

Readme file is uploaded correctly
There is no issue using pnpm v5
There is no issue using npm

  • node -v prints: v16.13.1
  • Windows, macOS, or Linux?: Windows
@zkochan
Copy link
Member

zkochan commented Dec 10, 2021

I am not sure what is the reason. Might be that the content of the readme should be added to the package.json on publish. If that is the case, you can try it, here is the manifest prepared for publish:

const publishManifest = await exportableManifest(projectDir, manifest)
pack.entry({ mode, mtime, name: 'package/package.json' }, JSON.stringify(publishManifest, null, 2))

probably we can pass the readme to the exportableManifest and it can add it to the proper field of package.json

@FolknR
Copy link
Contributor Author

FolknR commented Dec 10, 2021

I am not sure what is the reason. Might be that the content of the readme should be added to the package.json on publish. If that is the case, you can try it, here is the manifest prepared for publish:

const publishManifest = await exportableManifest(projectDir, manifest)
pack.entry({ mode, mtime, name: 'package/package.json' }, JSON.stringify(publishManifest, null, 2))

probably we can pass the readme to the exportableManifest and it can add it to the proper field of package.json

Yes, your described option works, thanks. Should I create a PR?

@zkochan
Copy link
Member

zkochan commented Dec 10, 2021

sure, go ahead

FolknR pushed a commit to FolknR/pnpm that referenced this issue Dec 13, 2021
….json

add readme file to published package.json to prevent missing in the verdaccio registry

pnpm#4091
FolknR pushed a commit to FolknR/pnpm that referenced this issue Dec 14, 2021
….json

add readme file to published package.json to prevent missing in the verdaccio registry

pnpm#4091
FolknR pushed a commit to FolknR/pnpm that referenced this issue Dec 15, 2021
….json

add readme file to published package.json to prevent missing in the verdaccio registry

pnpm#4091
@dangreen
Copy link
Contributor

@zkochan @FolknR Hi guys. No other managers are doing that. Why is pnpm doing this by default? It's increasing package.json's and whole package size.

dangreen added a commit to TrigenSoftware/scripts that referenced this issue Jan 12, 2022
dangreen added a commit to TrigenSoftware/scripts that referenced this issue Jan 12, 2022
@zkochan
Copy link
Member

zkochan commented Jan 12, 2022

So, is it an issue with Verdaccio then? How does it work with npm if npm doesn't populate this field?

cc @juanpicado

@dangreen
Copy link
Contributor

npm reads README.* from package root

https://docs.npmjs.com/about-package-readme-files

also

https://docs.npmjs.com/cli/v8/configuring-npm/package-json#files

README & LICENSE can have any case and extension.

@Yukiniro
Copy link

I have the same problem. But what field should I use in package.json.

@juanpicado
Copy link
Member

README not being shown for packages (pnpm 6 only) verdaccio/verdaccio#2469

yes it does https://github.com/npm/read-package-json/blob/main/read-json.js#L295

yarn was doing it until v2, yarnpkg/berry#1702

@dangreen
Copy link
Contributor

@zkochan @FolknR how soon are you going to revert/fix it?

@zkochan
Copy link
Member

zkochan commented Jan 19, 2022

It is not in priority for me. If someone wants to do it, the easiest way is probably to add a setting for it.

@zkochan zkochan added this to the v6.24 milestone Jan 19, 2022
@FolknR
Copy link
Contributor Author

FolknR commented Jan 20, 2022

@dangreen I'll fix it this week

@dangreen
Copy link
Contributor

@FolknR Thanks, but I'm already working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants