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
Added repository references to packages #185
base: main
Are you sure you want to change the base?
Added repository references to packages #185
Conversation
|
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Thinkmill/manypkg.git", | ||
"directory": "packages/gatsby-source-workspace" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually I was using just smth like:
"repository": { | |
"type": "git", | |
"url": "https://github.com/Thinkmill/manypkg.git", | |
"directory": "packages/gatsby-source-workspace" | |
}, | |
"repository": "https://github.com/Thinkmill/manypkg/tree/main/packages/gatsby-source-workspace", |
is there any practical difference between those two? Are both supported in the same way by various tools that might be interested in this metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the difference would be that in this case the URL contains the name of the branch. Right now main
seems safe but the world already renamed master
to main
so this wouldn't have been future-proof if introduced in the past. Right now it seems unlikely that we'll do a similar change anytime soon but still it doesn't seem necessary to include branch names in the repo reference.
But really the main purpose is to have the NPM registry reference this repo so automated tools can find the repo from a package name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know any package using this pattern that is published to npm? I vaguely remember investigating this in the past (over a year ago or something) and IIRC I was very surprised that npm site didn't actually support this despite it being documented in the npm docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - here's jest-diff - the url
field appears on the sidebar under Repository
here, albeit not to the directory
itself but rather the repo URL only.
Also, here's an example straight from the docs
No description provided.