Skip to content

Commit a42ac0f

Browse files
fix(cli): remove unused createNpmEnv export
1 parent db9c411 commit a42ac0f

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

cli/src/npm-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { logCommand, logSuccess, logError, logDebug } from './logger.ts'
1212
const execFileAsync = promisify(execFile)
1313
export const NPM_REGISTRY_URL = 'https://registry.npmjs.org/'
1414

15-
export function createNpmEnv(overrides: Record<string, string> = {}): Record<string, string> {
15+
function createNpmEnv(overrides: Record<string, string> = {}): Record<string, string> {
1616
return {
1717
...(process.env as Record<string, string>),
1818
...overrides,

test/unit/cli/npm-client.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import {
55
validateScopeTeam,
66
validatePackageName,
77
extractUrls,
8-
createNpmEnv,
9-
NPM_REGISTRY_URL,
108
} from '../../../cli/src/npm-client'
119

1210
describe('validateUsername', () => {
@@ -186,15 +184,3 @@ describe('extractUrls', () => {
186184
expect(extractUrls(npmOutput)).toEqual(['https://www.npmjs.com/login?next=/login/cli/abc123'])
187185
})
188186
})
189-
190-
describe('createNpmEnv', () => {
191-
it('enforces npmjs registry for all npm commands', () => {
192-
const env = createNpmEnv()
193-
expect(env.npm_config_registry).toBe(NPM_REGISTRY_URL)
194-
})
195-
196-
it('does not allow overriding enforced registry', () => {
197-
const env = createNpmEnv({ npm_config_registry: 'https://registry.npmmirror.com/' })
198-
expect(env.npm_config_registry).toBe(NPM_REGISTRY_URL)
199-
})
200-
})

0 commit comments

Comments
 (0)