Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Conversation

misak113
Copy link
Contributor

@misak113 misak113 commented Sep 6, 2017

Current .npmrc will keep keys with not replaced Environment variables. However values are replaced. So it may confuse somebody & has no option to solve this problem

.npmrc example

registry=${NPM_REGISTRY_URL}
//${NPM_REGISTRY_HOST}/:_authToken=${NPM_AUTH_TOKEN}
always-auth=true

With env.vars:

export NPM_REGISTRY_URL=http://my.registry.com/
export NPM_REGISTRY_HOST=my.registry.com
export NPM_AUTH_TOKEN=xxxxxxxxxxxxxxx

NOW it will produce bellow options:

registry=http://my.registry.com/
//${NPM_REGISTRY_HOST}/:_authToken=xxxxxxxxxxxxxxx
always-auth=true

But expected options are:

registry=http://my.registry.com/
//my.registry.com/:_authToken=xxxxxxxxxxxxxxx
always-auth=true

Probably it is expected state & it would be very helpful when it will be merged for private registries which are using CI for publishing npm packages. For example: Then no more "npm login | answer_input $AUTH_TOKEN ... # etc. constructions" are necessary.

* as additional replacement for values in .npmrc for example
@misak113 misak113 requested a review from a team as a code owner September 6, 2017 17:21
@misak113
Copy link
Contributor Author

Did anyone get this PR? Just asking. It's my first contribution here.

@iarna
Copy link
Contributor

iarna commented Sep 14, 2017

@misak113, yup we've seen it, we just haven't had an opportunity to comment yet.

Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked with @iarna and while this is pretty darn weird, we think we should accept it because it can be a nice escape valve, and I'm having a hard time figuring out how this would cause huge problems that the current replacement doesn't already.

@zkat zkat changed the base branch from latest to release-next March 6, 2018 23:03
@zkat zkat merged commit e6b9c1c into npm:release-next Mar 8, 2018
zkat pushed a commit that referenced this pull request Mar 8, 2018
 as additional replacement for values in .npmrc for example

PR-URL: #18426
Credit: @misak113
Reviewed-By: @zkat
Reviewed-By: @iarna
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants