@pnpm/config
Advanced tools
Comparing version 4.0.0-2 to 4.0.0-3
@@ -1,6 +0,6 @@ | ||
import { PnpmConfigs } from './PnpmConfigs'; | ||
export { PnpmConfigs }; | ||
import { Config } from './Config'; | ||
export { Config }; | ||
export declare const types: any; | ||
declare const _default: (opts: { | ||
cliArgs: object; | ||
cliArgs: Record<string, any>; | ||
command?: string[] | undefined; | ||
@@ -12,3 +12,3 @@ packageManager: { | ||
}) => Promise<{ | ||
configs: PnpmConfigs; | ||
config: Config; | ||
warnings: string[]; | ||
@@ -15,0 +15,0 @@ }>; |
@@ -152,5 +152,2 @@ "use strict"; | ||
process.execPath = originalExecPath; | ||
if (!cliArgs['user-agent']) { | ||
cliArgs['user-agent'] = `${packageManager.name}/${packageManager.version} npm/? node/${process.version} ${process.platform} ${process.arch}`; | ||
} | ||
const pnpmConfig = Object.keys(exports.types) // tslint:disable-line | ||
@@ -163,4 +160,18 @@ .reduce((acc, configKey) => { | ||
}, {}); | ||
pnpmConfig.rawNpmConfig = Object.assign.apply(Object, npmConfig.list.reverse().concat([cliArgs])); | ||
pnpmConfig.registries = Object.assign({ default: getScopeRegistries_1.normalizeRegistry(pnpmConfig.registry || 'https://registry.npmjs.org/') }, getScopeRegistries_1.default(pnpmConfig.rawNpmConfig)); | ||
pnpmConfig.localConfig = Object.assign.apply(Object, [ | ||
{}, | ||
...npmConfig.list.slice(3, pnpmConfig.workspacePrefix && pnpmConfig.workspacePrefix !== pnpmConfig.localPrefix ? 5 : 4), | ||
cliArgs, | ||
]); // tslint:disable-line:no-any | ||
pnpmConfig.userAgent = pnpmConfig.localConfig['user-agent'] | ||
? pnpmConfig.localConfig['user-agent'] | ||
: `${packageManager.name}/${packageManager.version} npm/? node/${process.version} ${process.platform} ${process.arch}`; | ||
const defaultRegistry = getScopeRegistries_1.normalizeRegistry(pnpmConfig.registry || 'https://registry.npmjs.org/'); | ||
pnpmConfig.rawNpmConfig = Object.assign.apply(Object, [ | ||
{ registry: defaultRegistry }, | ||
...npmConfig.list, | ||
cliArgs, | ||
{ 'user-agent': pnpmConfig.userAgent }, | ||
]); // tslint:disable-line:no-any | ||
pnpmConfig.registries = Object.assign({ default: defaultRegistry }, getScopeRegistries_1.default(pnpmConfig.rawNpmConfig)); | ||
const npmGlobalPrefix = pnpmConfig.rawNpmConfig['pnpm-prefix'] || | ||
@@ -295,3 +306,3 @@ (process.platform !== 'win32' | ||
} | ||
return { configs: pnpmConfig, warnings }; | ||
return { config: pnpmConfig, warnings }; | ||
}; | ||
@@ -298,0 +309,0 @@ async function findWorkspacePrefix(prefix) { |
{ | ||
"name": "@pnpm/config", | ||
"version": "4.0.0-2", | ||
"description": "Gets configs for pnpm", | ||
"version": "4.0.0-3", | ||
"description": "Gets configuration options for pnpm", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts", |
# @pnpm/config | ||
> Gets configs for pnpm | ||
> Gets configution options for pnpm | ||
@@ -18,5 +18,5 @@ <!--@shields('npm')--> | ||
```ts | ||
import getConfigs from '@pnpm/config' | ||
import getConfig from '@pnpm/config' | ||
getConfigs().then(pnpmConfigs => console.log(pnpmConfigs)) | ||
getConfig().then(pnpmConfig => console.log(pnpmConfig)) | ||
``` | ||
@@ -23,0 +23,0 @@ |
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
22468
468