fix(config): use locale while parsing variables as camelcase (#8189)

close #8188
This commit is contained in:
Berkay Aydın
2024-06-12 03:43:57 +03:00
committed by GitHub
parent 42779050c2
commit 7d103943b3
2 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/config": patch
---
fix parsing of config variables in Turkish locale. Example: recursive-install parameter has problems on parsing.

View File

@@ -298,8 +298,8 @@ export async function getConfig (
const rcOptions = Object.keys(rcOptionsTypes)
const pnpmConfig: ConfigWithDeprecatedSettings = Object.fromEntries([
...rcOptions.map((configKey) => [camelcase(configKey), npmConfig.get(configKey)]) as any, // eslint-disable-line
...Object.entries(cliOptions).filter(([name, value]) => typeof value !== 'undefined').map(([name, value]) => [camelcase(name), value]),
...rcOptions.map((configKey) => [camelcase(configKey, { locale: 'en-US' }), npmConfig.get(configKey)]) as any, // eslint-disable-line
...Object.entries(cliOptions).filter(([name, value]) => typeof value !== 'undefined').map(([name, value]) => [camelcase(name, { locale: 'en-US' }), value]),
]) as unknown as ConfigWithDeprecatedSettings
// Resolving the current working directory to its actual location is crucial.
// This prevents potential inconsistencies in the future, especially when processing or mapping subdirectories.