I have a Node.js package that currently resides in a subdirectory of a GitHub repository. I can currently publish it without setting the repository field, but then my users will get a warning and there is less useful information on the Node Package Repository page than their could be (issues and pull requests links are missing).
If I set the repository
field in package.json
to point to the parent repository, will that work? Will anything break because the package.json
file is not at the root of that repository (npm, in particular)?
If I set the repository field in package.json to point to the parent repository, will that work?
Yes. This field is not used by any critical npm functionality. It's just so if contributors want to clone a repo so they can work on the project.
Will anything break because the package.json file is not at the root of that repository (npm, in particular)?
No. I don't believe anything will break.
repository
field to the parent project's top-level .git
path. The purpose of this field is for SCM (git, etc) to be able to clone the project. In your case, the closest thing is the parent project. This should avoid the warning message.bugs
field to the issues page. This should then show up on the npm web site. I don't think repository
and bugs
are related directly or any assumptions are made about one based on the other by npm.homepage
to the github URL to the directory containing this npm module within the parent repo. Stick a README.md file there and github will render it below the directory contents.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With