Skip to content

Conversation

@jchiem
Copy link
Contributor

@jchiem jchiem commented Jul 31, 2025

Description

#4133 reported an issue about README.md not being visible in verdaccio when publishing. Looking into the issue I found #1843 that says that verdaccio requires readmeFilename field 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.ts file was updated to use load, but it should be using prepare since the npm-publish needs to normalize the package.json data and the documentation states that prepare should 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:

  1. Run npm run e2e-build-package-publish
  2. View the packages in the verdaccio web ui, all packages show up with the following content for the README:
lerna-before

How Has This Been Tested?

  • npm-publish.spec.ts was updated to include a test for readmeFilename and _prepared
  • Documentation from @npmcli/package-json suggests this should be used instead of load() for publishing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed. *

*I had an error for pack-directory in the core:test in the main branch 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.)

@nx-cloud
Copy link

nx-cloud bot commented Jul 31, 2025

View your CI Pipeline Execution ↗ for commit c4ac20f

Command Status Duration Result
nx run-many --t e2e --parallel=1 ✅ Succeeded 10m 26s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 1m 22s View ↗
nx run-many -t build --parallel=3 ✅ Succeeded 1m 8s View ↗
nx run-many -t lint --parallel=3 ✅ Succeeded 1m 7s View ↗
nx run integration:integration --ci --maxWorkers=2 ✅ Succeeded 15s View ↗
nx run-many -t build ✅ Succeeded 4s View ↗
nx-cloud record -- npx nx format:check ✅ Succeeded 2s View ↗
nx run-many -t test --parallel=3 --ci --maxWork... ✅ Succeeded 3m 24s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-31 08:01:51 UTC

@JamesHenry JamesHenry changed the title fix(core/npm-publish): ensure prepare is used instead of load fix(publish): ensure prepare is used instead of load Jul 31, 2025
@JamesHenry JamesHenry changed the title fix(publish): ensure prepare is used instead of load fix(publish): ensure README file names are populated on packag.json Jul 31, 2025
@JamesHenry JamesHenry changed the title fix(publish): ensure README file names are populated on packag.json fix(publish): ensure README file names are populated on package.json Jul 31, 2025
Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jchiem!

@JamesHenry JamesHenry merged commit 362875d into lerna:main Jul 31, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants