-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add npm private packages support #435
Conversation
if !fileExists(rcFilePath) { | ||
err = ioutil.WriteFile( | ||
rcFilePath, | ||
[]byte("_authToken=${ESM_NPM_TOKEN}"), |
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.
does the npmrc supports ${ESM_NPM_TOKEN}
expression?
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.
Yup, the .npmrc
is supported, Is designed for private packages in CI/CD.
But .yarnrc
is not, and but .yarnrc.yml
is supported 🤣 Yarn is so confused.
Actually, I tried to use other ways to implement it, such as:
- Environment variables begin with
npm_config_
, but yarn will lower case all suffix, so the_authToken
to be transformed to_authtoken
, the_auth_token
to be transformed to_auth-token
- Use
--use-yarnrc <path>
for providing a specific.yarnrc
file, but it was not supported to decode the environment variable expression
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.
thanks for the explain! i didn't known this before
nice! 👍 |
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.
LGTM! thanks 👍
pls ignore the testing failed, it's caused by types checking, i will fix then. thanks |
Background
For the business case, I want to self-hosting this server and serve with some private packages hosted on the npm-registry
Changes
npm-token
flag to provide NPM private token.npmrc
file in the temporary yarn installing directory to provide the_authToken
--no-default-rc
flag of theyarn installing
command to support reading.npmrc