Add Azure Artifacts npm authentication refresh - #2339
Open
MackinnonBuck wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment on lines
+86
to
+88
| const result = spawnSync(invocation.command, invocation.args, { | ||
| stdio: "inherit", | ||
| }); |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds cross-platform Azure Artifacts npm authentication setup for Microsoft contributors.
Changes:
- Adds guarded credential refresh and scoped
.npmrcgeneration. - Adds comprehensive Vitest coverage.
- Documents setup and ignores generated configurations.
Show a summary per file
| File | Description |
|---|---|
scripts/npm-auth-refresh.mjs |
Implements configuration and authentication refresh. |
scripts/npm-auth-refresh.d.mts |
Declares script types. |
nodejs/test/npm-auth-refresh.test.ts |
Tests CLI and platform behavior. |
nodejs/package.json |
Adds the refresh command. |
CONTRIBUTING.md |
Documents contributor setup. |
.gitignore |
Ignores generated .npmrc files. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/6 changed files
- Comments generated: 2
- Review effort level: Balanced
| export function writeProjectNpmConfigs(npmrcPaths) { | ||
| const config = buildProjectNpmConfig(); | ||
| for (const npmrcPath of npmrcPaths) { | ||
| writeFileSync(npmrcPath, config, "utf8"); |
| }, | ||
| { | ||
| command: "artifacts-npm-credprovider", | ||
| args: ["-c", npmrcPath], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@githubwhile storing credentials at user levelValidation
npm test -- npm-auth-refresh.test.ts(15 passed)npm run lint(passed with 3 existing warnings)npm run typechecknpx tsc --noEmit --strict --skipLibCheck --module NodeNext --moduleResolution NodeNext --target ES2022 --esModuleInterop test\npm-auth-refresh.test.tsnpx prettier --config .prettierrc.json --check test\npm-auth-refresh.test.ts ..\scripts\npm-auth-refresh.mjs ..\scripts\npm-auth-refresh.d.mtsnode .\scripts\npm-auth-refresh.mjs --helpnpm run format:checkwas also run; on this Windows checkout it reports existing CRLF formatting drift in 104 untouched Node files. All new auth files pass the targeted Prettier check above.