Skip to content

Commit

Permalink
fix: Include registry URL pathname in npmrc auth token config
Browse files Browse the repository at this point in the history
  • Loading branch information
bdr99 committed Mar 28, 2024
1 parent 79051c0 commit d25abcd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/npm/__tests__/use-npm-environment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("useNpmEnvironment", () => {
},
});
expect(npmrcContents).toContain(
"//example.com/:_authToken=${NODE_AUTH_TOKEN}"
"//example.com/cool-registry/:_authToken=${NODE_AUTH_TOKEN}"
);
expect(npmrcContents).toContain(
"registry=http://example.com/cool-registry/"
Expand Down
2 changes: 1 addition & 1 deletion src/npm/use-npm-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function useNpmEnvironment<TReturn>(

const config = [
"; created by jsdevtools/npm-publish",
`//${registry.host}/:_authToken=\${NODE_AUTH_TOKEN}`,
`//${registry.host}${registry.pathname}:_authToken=\${NODE_AUTH_TOKEN}`,
`registry=${registry.href}`,
"",
].join(os.EOL);
Expand Down

0 comments on commit d25abcd

Please sign in to comment.