microsoft / ado-npm-auth

This package can automatically use the azureauth CLI to fetch tokens and update a user's .npmrc file for authenticating to Azure DevOps npm feeds.
MIT License
9 stars 7 forks source link

Always use public registry for npm exec azureauth #27

Closed ecraig12345 closed 2 months ago

ecraig12345 commented 3 months ago

The public registry was being used for npm exec azureauth when actually running the command, but not when checking if it's installed. This led to an incorrect message "Error: AzureAuth is not installed" when actually it was installed.

This PR updates azureAuthCommand() to also return the env with npm_config_registry set, and updates the calling code to pass it through.

I also updated the repo root package.json to have scripts for repo-wide build/test/etc.

(I'm guessing the pnpm-lock.yaml updates were caused by me having a different local pnpm version than whoever set up the repo. The PR build also failed without the lock file updates, so if you'd like to lock to an earlier pnpm version, that should probably be specified using corepack.)