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

[documentation] private package example? #24

Open
kidd opened this issue Feb 15, 2020 · 3 comments
Open

[documentation] private package example? #24

kidd opened this issue Feb 15, 2020 · 3 comments

Comments

@kidd
Copy link

kidd commented Feb 15, 2020

I'm quite new to nix. Even I got yarn2nix to work for 100% public dependencies, now an app I'm trying to package depends on a private repo.

The readme points somewhere to the nix docs about adding creds to netrc (I couldn't get that working .. :/), but I guess a common usecase for private packages is when they still live in the usual registry.nmpjs.org, but you'd need a token to get them.

The usual way is to npm config set //registry.npmjs.org/:_authToken=$MY_TOKEN, but I failed to get that working.

Could someone with more nix-fu add a snippet to solve this (if it's easy enough) in the readme?

Thanks!

@kidd kidd changed the title [docuentation] private package example? [docmuentation] private package example? Feb 15, 2020
@kidd kidd changed the title [docmuentation] private package example? [documentation] private package example? Feb 15, 2020
@Profpatsch
Copy link
Owner

Profpatsch commented Feb 17, 2020

The readme points somewhere to the nix docs about adding creds to netrc (I couldn't get that working .. :/), but I guess a common usecase for private packages is when they still live in the usual registry.nmpjs.org, but you'd need a token to get them.

I wasn’t aware npm supports private packages that live in their registry, could you point me to documentation on how that works?

@kidd
Copy link
Author

kidd commented Feb 17, 2020

I'm not very familiar with those but here you have a couple of links on its usage. The info around that is very sparse, which I find it very strange :/

https://blog.npmjs.org/post/118393368555/deploying-with-npm-private-modules
https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow
https://docs.npmjs.com/about-private-packages

In one of those links it tells about .npmrc file. Instead of that, what I do is to npm config set //registry.npmjs.org/:_authToken=123 (that I guess it ends up doing the same, but at least it's cli friendly).

Last question: Is there any relation between this current repo and https://github.com/moretea/yarn2nix ? I got confused a couple of times with those being named the same but being different (not forked one from the other).

Hacking around I got to build it once overriding preBuild phase and running that command. Unfortunately, I'm not sure how I did it and I 'lost' the changes that made it work. I'll keep trying and come back if I get to "reproduce" it :)

Cheers!

@Profpatsch
Copy link
Owner

Thanks, I’ll take a look.

Is there any relation between this current repo and https://github.com/moretea/yarn2nix ?

They try to achieve the same thing (thus the same name), but their implementation is independent of each other.

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

No branches or pull requests

2 participants