Skip to content

Commit d25abcd

Browse files
committed
fix: Include registry URL pathname in npmrc auth token config
1 parent 79051c0 commit d25abcd

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

dist/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/npm/__tests__/use-npm-environment.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe("useNpmEnvironment", () => {
4949
},
5050
});
5151
expect(npmrcContents).toContain(
52-
"//example.com/:_authToken=${NODE_AUTH_TOKEN}"
52+
"//example.com/cool-registry/:_authToken=${NODE_AUTH_TOKEN}"
5353
);
5454
expect(npmrcContents).toContain(
5555
"registry=http://example.com/cool-registry/"

src/npm/use-npm-environment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function useNpmEnvironment<TReturn>(
4040

4141
const config = [
4242
"; created by jsdevtools/npm-publish",
43-
`//${registry.host}/:_authToken=\${NODE_AUTH_TOKEN}`,
43+
`//${registry.host}${registry.pathname}:_authToken=\${NODE_AUTH_TOKEN}`,
4444
`registry=${registry.href}`,
4545
"",
4646
].join(os.EOL);

0 commit comments

Comments
 (0)