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

Added repository references to packages #185

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vergilfromadyen
Copy link

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jul 3, 2023

⚠️ No Changeset found

Latest commit: 7b247c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +9 to +13
"repository": {
"type": "git",
"url": "https://github.com/Thinkmill/manypkg.git",
"directory": "packages/gatsby-source-workspace"
},
Copy link
Collaborator

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:

Suggested change
"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?

Copy link
Author

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.

Copy link
Collaborator

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.

Copy link
Author

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

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

Successfully merging this pull request may close these issues.

None yet

2 participants