Files
pnpm/config/reader/src/npmDefaults.ts
Zoltan Kochan 8bba5c3858 refactor(config): only read auth/registry from .npmrc, add registries to pnpm-workspace.yaml (#11189)
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.)
2026-04-04 02:44:12 +02:00

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,
}