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

--github option should open the github project in the browser #36

Open
ranyitz opened this issue May 29, 2018 · 4 comments
Open

--github option should open the github project in the browser #36

ranyitz opened this issue May 29, 2018 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ranyitz
Copy link
Owner

ranyitz commented May 29, 2018

qnm lodash --github

should open https://github.com/lodash/lodash

@ranyitz ranyitz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 29, 2018
@ealush
Copy link
Contributor

ealush commented Apr 4, 2021

A few questions:

  1. Are --github and --homepage mutually exclusive the same way open and homepage are?
  2. I am assuming this should rely on the "repository" field. What about cases in which it is not github? Maybe use "repo" instead?
  3. What about non-http repository fields? Or maybe we should only rely on packageJson?.repository?.url for safety? - it will limit the amount of repos that will actually be able to make use of it, though. Alternatively, we can run a url validity check. Would it be cool if I install an external dependency for that?

@ranyitz
Copy link
Owner Author

ranyitz commented Apr 4, 2021

  1. You are correct, currently --homepage does this functionality, and uses npm own words so I think that it's clear enough.

open will open the package.json of a chosen package in your editor, so it's different.

  1. We could use the repository field if it starts with https since GitHub knows to redirect.

  2. Good point, yeah sure, we can add another dependency (we're using ncc to bundle everything so it will run fast when using npx)


To say the truth I haven't used the --homepage flag myself, since for the most part, I just need to know the local versions, so I wouldn't invest a lot in supporting edge cases of this feature. Unless there are people who will ask for it.

@ealush
Copy link
Contributor

ealush commented Apr 4, 2021

Regarding 1. I meant that when using open, the function returns, so the homepage option is ignored. My question is when using homepage along with repo, should it also immediately return as well, or should it open both the homepage and the repo project in the browser?

@ranyitz
Copy link
Owner Author

ranyitz commented Apr 4, 2021

I don't mind, feel free to choose what you think is best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants