mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-22 21:53:02 -04:00
Replace the unmaintained @pnpm/npm-conf package with a purpose-built module that reads only auth/registry-related settings from .npmrc files using read-ini-file + @pnpm/config.env-replace (both already deps). All non-registry settings (hoist-pattern, node-linker, etc.) are now only read from pnpm-workspace.yaml, CLI options, or environment variables. Registry-related settings (auth tokens, registry URLs, SSL certs, proxy settings) continue to be read from .npmrc for migration compatibility, and can also be set in pnpm-workspace.yaml. New modules: - loadNpmrcFiles.ts: reads .npmrc from standard locations, filters to auth/registry keys, returns structured layers - npmConfigTypes.ts: inlined npm config type definitions - npmDefaults.ts: inlined npm defaults (registry, unsafe-perm, etc.)
14 lines
417 B
TypeScript
14 lines
417 B
TypeScript
import os from 'node:os'
|
|
import path from 'node:path'
|
|
|
|
export const npmDefaults = {
|
|
registry: 'https://registry.npmjs.org/',
|
|
'package-lock': true,
|
|
'unsafe-perm': process.platform === 'win32' ||
|
|
process.platform === 'cygwin' ||
|
|
!(process.getuid && process.setuid && process.getgid && process.setgid) ||
|
|
process.getuid!() !== 0,
|
|
userconfig: path.resolve(os.homedir(), '.npmrc'),
|
|
maxsockets: 50,
|
|
}
|