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

Explore private github npm module #5

Open
tranzmatt opened this issue Sep 26, 2018 · 3 comments
Open

Explore private github npm module #5

tranzmatt opened this issue Sep 26, 2018 · 3 comments

Comments

@tranzmatt
Copy link

tranzmatt commented Sep 26, 2018

I'd like to use this graph over an npm module stored in a private repo on github that has a dependency that's also a private github repo, such as:

github:tranzmatt/my-project

package.json:

"dependencies": {
"project-dep": "github:tranzmatt/project-dep"
}

I have ssh and github token access, so how can I integrate that into npmgraph? Thanks.

@broofa
Copy link
Collaborator

broofa commented Sep 26, 2018

First, npmgraph would have to recognize/parse github URIs in dependency blocks, which it currently doesn't do. Not a big deal, 'just needs to be coded.

The bigger hurdle is that it would have to fetch the package.json file from the [private] github repo. There are a variety of security issues with this. It'll almost certainly require some server logic to work around the (I assume) lack of CORS support on GitHub. (NPMGraph currently runs entirely in-browser. There's no server for it.) And that server will probably need to be configured with your github credentials, which isn't a responsibility I want. So you'll probably need to run npmgraph locally.

... which isn't a big deal. Just pull this repo, npm i, and then static-server from the command line. But that's just a generic static file server. Supporting an endpoint to fetch private github projects will require a custom server.

This probably isn't a ton of work, and I think it'd be nice to have (I'd certainly use it at my work), but I don't have time to pursue this. Feel free to take a crack at. I'm happy to answer questions.

@broofa
Copy link
Collaborator

broofa commented Aug 22, 2020

See also #9

@broofa
Copy link
Collaborator

broofa commented Sep 26, 2023

Probably not quite what you're after, but I've got a PR up that allows you to paste a URL to a private package.json file (as long as you use the "Raw" link). It won't pull in also-private dependencies, however.

#156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants