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

Deprecate in favor of @npmcli/package-json #33

Open
lukekarrys opened this issue Jun 1, 2023 · 5 comments
Open

Deprecate in favor of @npmcli/package-json #33

lukekarrys opened this issue Jun 1, 2023 · 5 comments

Comments

@lukekarrys
Copy link
Member

The functionality of this package has been moved to @npmcli/package-json as part of npm/package-json#32. We should consider deprecating and archiving this package after examining its use across the rest of our packages and the ecosystem.

@43081j
Copy link

43081j commented Mar 3, 2024

for what its worth, i don't think we should consider the two equivalent

read-package-json-fast:
https://npmgraph.js.org/?q=read-package-json-fast

@npmcli/package-json:
https://npmgraph.js.org/?q=@npmcli/package-json

we will be pulling so many more packages in, most likely for functionality we're not using. whereas read-package-json-fast is very, very focused (does one thing).

maybe we can at least have that subset of functionality still exposed in its own package?

@wraithgar
Copy link
Member

wraithgar commented Mar 4, 2024

This decision is a balance against "pure single package for its own sake" and "consolidating package parsing logic in all of npm". The latter was deemed more important. We have had several bugs in the past crop up because one of the 4 package parsing libs inside npm got a change, but the others didn't. It invites errors.

@43081j
Copy link

43081j commented Mar 4, 2024

while that does make sense, it means there won't be a light way of reading a package JSON anymore.

all good, though. we will just read the file directly without the normalisation 👍

@wraithgar
Copy link
Member

Unless you need to normalize it like npm does, this library absolutely is not needed. A try/catch around json-parse-even-better-errors would get you all of the parsing this does, including indentation detection.

@43081j
Copy link

43081j commented Mar 4, 2024

i figured as much. we were mostly using it for the errors and normalisation, but in this particular case we don't really need that

thanks for the info 👍 deprecate away 🎉

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

No branches or pull requests

3 participants