-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fields added to package.json #1630
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
Conversation
Thanks for the effort, but unfortunately unnecessary. Npm automatically populates the github info from the short string field, which is nicer and the new npm search no longer uses the keywords array in the search. You may want to report the issues to the validator tool. |
Ok, I will check with them. Thanks. |
Awesome! Npm itself uses https://npmjs.org/package/read-package-json to read the file, so that would probably be a good reference implementation. Npm itself will throw errors for invalid fields, warnings for missing / wrong fields on publish or package read and this module is currently clean for that as well, so I don't understand what the validator is validating against, as I would assume it should work like npm. |
Looking through the GitHub repo for that validator tool, there at lots of open issues regarding the issues I noted above regarding incorrect validation for npm packages like JoshuaKGoldberg/package-json-validator#29 and JoshuaKGoldberg/package-json-validator#44 |
I should note that the only non-valid field was the repository url. keywords and bugs were only at warning level. There is also a recommendation for the 'homepage' field, which I left alone. package-json-validator
Looking at the open issues you provided, it seems that the normalization rules are different between https://www.npmjs.com/package/normalize-package-data and https://www.npmjs.com/package/read-package-json |
The repository field in our repo is definitely valid. I liked you to the issue reporting that the validator is incorrectly thinking it is invalid. Also the bugs and homepage URLs are auto populated from the repository short string to their GitHub addresses, which is why we don't need to specify them yet they show up on the npmjs.com site and in the npm repository just fine, so there is nothing to change here, I think you just accidentally stumbled across some bugs in that validator tools, which is why I suggested to file issues there and hopefully they'll get it fixed. |
Yes it's valid, it's the validator that is a bit outdated. I hope to get a weekend to give it some love soon :) |
I've added/modified a few fields in the package.json file: repository, keywords and bugs, so they validate with http://package-json-validator.com.
Let me know if these changes are ok and if you would like anything modified with them.