Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: semantic-release/npm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.1.2
Choose a base ref
...
head repository: semantic-release/npm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.1.3
Choose a head ref
  • 2 commits
  • 4 files changed
  • 3 contributors

Commits on May 4, 2021

  1. chore(deps): lock file maintenance (#358)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    renovate[bot] and renovate-bot authored May 4, 2021
    Copy the full SHA
    a8b1026 View commit details
  2. fix: use NPM_CONFIG_USERCONFIG in get-registry to match auth (#362)

    Previously NPM_CONFIG_USERCONFIG was only used for getting the auth token and not used for actually getting the registry from .npmrc.
    jameshartig authored May 4, 2021
    Copy the full SHA
    13200ca View commit details
Showing with 378 additions and 365 deletions.
  1. +7 −6 README.md
  2. +5 −1 lib/get-registry.js
  3. +348 −358 package-lock.json
  4. +18 −0 test/get-registry.test.js
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -45,12 +45,13 @@ Both the [token](https://docs.npmjs.com/getting-started/working_with_tokens) and

### Environment variables

| Variable | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |
| `NPM_USERNAME` | Npm username created via [npm adduser](https://docs.npmjs.com/cli/adduser) or on [npmjs.com](https://www.npmjs.com) |
| `NPM_PASSWORD` | Password of the npm user. |
| `NPM_EMAIL` | Email address associated with the npm user |
| Variable | Description |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |
| `NPM_USERNAME` | Npm username created via [npm adduser](https://docs.npmjs.com/cli/adduser) or on [npmjs.com](https://www.npmjs.com) |
| `NPM_PASSWORD` | Password of the npm user. |
| `NPM_EMAIL` | Email address associated with the npm user |
| `NPM_CONFIG_USERCONFIG` | Path to non-default .npmrc file |

Use either `NPM_TOKEN` for token authentication or `NPM_USERNAME`, `NPM_PASSWORD` and `NPM_EMAIL` for legacy authentication

6 changes: 5 additions & 1 deletion lib/get-registry.js
Original file line number Diff line number Diff line change
@@ -7,5 +7,9 @@ module.exports = ({publishConfig: {registry} = {}, name}, {cwd, env}) =>
env.NPM_CONFIG_REGISTRY ||
getRegistryUrl(
name.split('/')[0],
rc('npm', {registry: 'https://registry.npmjs.org/'}, {config: path.resolve(cwd, '.npmrc')})
rc(
'npm',
{registry: 'https://registry.npmjs.org/'},
{config: env.NPM_CONFIG_USERCONFIG || path.resolve(cwd, '.npmrc')}
)
);
Loading