fix(publish): ensure README file names are populated on package.json #4211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
#4133 reported an issue about
README.mdnot being visible in verdaccio when publishing. Looking into the issue I found #1843 that says thatverdacciorequiresreadmeFilenamefield to exist on the package.json that is published.with the 8.1.5 release, the read-package-json was swapped out for @npmcli/package-json, and the
npm-publish.tsfile was updated to useload, but it should be usingpreparesince the npm-publish needs to normalize the package.json data and the documentation states thatprepareshould be used before publishing.Motivation and Context
Currently if you run the project locally and visit the verdaccio web ui there is no README.md file. Any user using verdaccio can't see their README.md files when publishing to their private registry due to how the npm-publish file was updated.
You can re-create the issue locally:
npm run e2e-build-package-publishHow Has This Been Tested?
readmeFilenameand_preparedload()for publishing.Types of changes
Checklist:
*I had an error for
pack-directoryin thecore:testin themainbranch from the start of working on this issue so existing tests that were failing are still failing.(CI tests seem to be passing though so I've marked it with a checkmark.)