Skip to content

Commit cecd607

Browse files
authored
fix(core): fix local registry not being considered when using bun (#30459)
1 parent 3be73ed commit cecd607

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/js/src/plugins/jest/start-local-registry.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,28 @@ export function startLocalRegistry({
4949
);
5050

5151
const registry = `http://${listenAddress}:${port}`;
52+
const authToken = 'secretVerdaccioToken';
5253

5354
console.log(`Local registry started on ${registry}`);
5455

5556
process.env.npm_config_registry = registry;
5657
execSync(
57-
`npm config set //${listenAddress}:${port}/:_authToken "secretVerdaccioToken" --ws=false`,
58+
`npm config set //${listenAddress}:${port}/:_authToken "${authToken}" --ws=false`,
5859
{
5960
windowsHide: false,
6061
}
6162
);
6263

64+
// bun
65+
process.env.BUN_CONFIG_REGISTRY = registry;
66+
process.env.BUN_CONFIG_TOKEN = authToken;
6367
// yarnv1
6468
process.env.YARN_REGISTRY = registry;
6569
// yarnv2
6670
process.env.YARN_NPM_REGISTRY_SERVER = registry;
6771
process.env.YARN_UNSAFE_HTTP_WHITELIST = listenAddress;
6872

69-
console.log('Set npm and yarn config registry to ' + registry);
73+
console.log('Set npm, bun, and yarn config registry to ' + registry);
7074

7175
resolve(() => {
7276
childProcess.kill();

0 commit comments

Comments
 (0)