@pnpm/config
Advanced tools
Comparing version 1.3.2 to 2.0.0
@@ -0,1 +1,3 @@ | ||
import { PnpmConfigs } from './PnpmConfigs'; | ||
export { PnpmConfigs }; | ||
export declare const types: any; | ||
@@ -8,3 +10,3 @@ declare const _default: (opts: { | ||
}; | ||
}) => Promise<any>; | ||
}) => Promise<PnpmConfigs>; | ||
export default _default; |
@@ -37,2 +37,3 @@ "use strict"; | ||
'independent-leaves': Boolean, | ||
'link-workspace-packages': Boolean, | ||
'lock': Boolean, | ||
@@ -90,2 +91,3 @@ 'lock-stale-duration': Number, | ||
'globalconfig': npmDefaults.globalconfig, | ||
'link-workspace-packages': false, | ||
'lock': true, | ||
@@ -120,8 +122,18 @@ 'package-lock': npmDefaults['package-lock'], | ||
pnpmConfig.globalPrefix = path.join(npmGlobalPrefix, 'pnpm-global'); | ||
pnpmConfig.prefix = pnpmConfig.global | ||
? pnpmConfig.globalPrefix | ||
: (cliArgs['prefix'] ? path.resolve(cliArgs['prefix']) : npmConfig.localPrefix); // tslint:disable-line | ||
pnpmConfig.bin = pnpmConfig.global | ||
? pnpmConfig.globalBin | ||
: path.join(pnpmConfig.prefix, 'node_modules', '.bin'); | ||
if (pnpmConfig.global) { | ||
const independentLeavesSuffix = pnpmConfig.independentLeaves ? '_independent_leaves' : ''; | ||
const shamefullyFlattenSuffix = pnpmConfig.shamefullyFlatten ? '_shamefully_flatten' : ''; | ||
const subfolder = '1' + independentLeavesSuffix + shamefullyFlattenSuffix; | ||
pnpmConfig.prefix = path.join(pnpmConfig.globalPrefix, subfolder); | ||
pnpmConfig.bin = pnpmConfig.globalBin; | ||
pnpmConfig.allowNew = true; | ||
pnpmConfig.ignoreCurrentPrefs = true; | ||
pnpmConfig.saveProd = true; | ||
pnpmConfig.saveDev = false; | ||
pnpmConfig.saveOptional = false; | ||
} | ||
else { | ||
pnpmConfig.prefix = (cliArgs['prefix'] ? path.resolve(cliArgs['prefix']) : npmConfig.localPrefix); // tslint:disable-line | ||
pnpmConfig.bin = path.join(pnpmConfig.prefix, 'node_modules', '.bin'); | ||
} | ||
pnpmConfig.packageManager = packageManager; | ||
@@ -128,0 +140,0 @@ if (pnpmConfig.only === 'prod' || pnpmConfig.only === 'production' || !pnpmConfig.only && pnpmConfig.production) { |
{ | ||
"name": "@pnpm/config", | ||
"version": "1.3.2", | ||
"version": "2.0.0", | ||
"description": "Gets configs for pnpm", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17363
9
231