fix(core): update package entrypoint metadata#4294
Conversation
|
View your CI Pipeline Execution ↗ for commit fb2ef1b
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| }, | ||
| "main": "./src/public_api.js", | ||
| "types": "./src/public_api.d.ts", | ||
| "main": "./dist/fesm2022/o3r-core.mjs", |
There was a problem hiding this comment.
Thank you for your contribution.
You pointed out a real issue (as ./src/public_api.js and ./src/public_api.d.ts do not exist anymore in the latest ngPackagr build) but I do not think it is the correct way to fix it.
Did you try to just remove the main and types fields instead?
Problem
@o3r/core@14.3.2publishes top-levelmainandtypesentries that point to./src/public_api.jsand./src/public_api.d.ts, but those files are not included in the npm tarball.The package already exposes the generated files through
exports:./fesm2022/o3r-core.mjs./types/o3r-core.d.tsFix
Point the source package metadata to the generated files under
dist/. The existingpatch-package-json-mainpostbuild step strips the leadingdist/before publish, producing valid package metadata in the npm tarball.Validation
@o3r/core@14.3.2tarball lackssrc/public_api.*fesm2022/o3r-core.mjsandtypes/o3r-core.d.ts./fesm2022/o3r-core.mjsand./types/o3r-core.d.tsgit diff --check