@pnpm/config
Advanced tools
Comparing version 6.0.0 to 7.0.0
@@ -1,4 +0,15 @@ | ||
import { IncludedDependencies, Registries } from '@pnpm/types'; | ||
import { ProjectManifest, Registries } from '@pnpm/types'; | ||
export declare type UniversalOptions = Pick<Config, 'color' | 'dir' | 'rawConfig' | 'rawLocalConfig'>; | ||
export declare type Project = { | ||
dir: string; | ||
manifest: ProjectManifest; | ||
writeProjectManifest(manifest: ProjectManifest, force?: boolean | undefined): Promise<void>; | ||
}; | ||
export declare type ProjectsGraph = Record<string, { | ||
dependencies: string[]; | ||
package: Project; | ||
}>; | ||
export interface Config { | ||
allProjects?: Project[]; | ||
selectedProjectsGraph?: ProjectsGraph; | ||
allowNew: boolean; | ||
@@ -20,3 +31,2 @@ bail: boolean; | ||
ignoreScripts?: boolean; | ||
include: IncludedDependencies; | ||
save?: boolean; | ||
@@ -29,3 +39,2 @@ saveProd?: boolean; | ||
production?: boolean; | ||
development?: boolean; | ||
fetchRetries?: number; | ||
@@ -54,4 +63,2 @@ fetchRetryFactor?: number; | ||
sideEffectsCache?: boolean; | ||
sideEffectsCacheRead?: boolean; | ||
sideEffectsCacheWrite?: boolean; | ||
sideEffectsCacheReadonly?: boolean; | ||
@@ -58,0 +65,0 @@ shamefullyHoist?: boolean; |
@@ -1,3 +0,3 @@ | ||
import { Config, UniversalOptions } from './Config'; | ||
export { Config, UniversalOptions }; | ||
import { Config, Project, ProjectsGraph, UniversalOptions } from './Config'; | ||
export { Config, UniversalOptions, Project, ProjectsGraph }; | ||
export declare const types: any; | ||
@@ -9,3 +9,2 @@ export declare type CliOptions = Record<string, unknown> & { | ||
cliOptions: CliOptions; | ||
command?: string[] | undefined; | ||
packageManager: { | ||
@@ -12,0 +11,0 @@ name: string; |
@@ -76,17 +76,6 @@ "use strict"; | ||
exports.default = async (opts) => { | ||
var _a, _b, _c, _d, _e, _f, _g, _h; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
const packageManager = (_a = opts.packageManager, (_a !== null && _a !== void 0 ? _a : { name: 'pnpm', version: 'undefined' })); | ||
const cliOptions = (_b = opts.cliOptions, (_b !== null && _b !== void 0 ? _b : {})); | ||
const command = (_c = opts.command, (_c !== null && _c !== void 0 ? _c : [])); | ||
const warnings = new Array(); | ||
switch (command[command.length - 1]) { | ||
case 'update': | ||
if (typeof cliOptions['frozen-lockfile'] !== 'undefined') { | ||
throw new error_1.default('CONFIG_BAD_OPTION', 'The "frozen-lockfile" option cannot be used with the "update" command'); | ||
} | ||
if (typeof cliOptions['prefer-frozen-lockfile'] !== 'undefined') { | ||
throw new error_1.default('CONFIG_BAD_OPTION', 'The "prefer-frozen-lockfile" option cannot be used with the "update" command'); | ||
} | ||
break; | ||
} | ||
if (cliOptions['hoist'] === false) { | ||
@@ -123,3 +112,2 @@ if (cliOptions['shamefully-hoist'] === true) { | ||
'color': 'auto', | ||
'depth': (command[0] === 'list' || command[1] === 'list') ? 0 : Infinity, | ||
'fetch-retries': 2, | ||
@@ -160,3 +148,3 @@ 'fetch-retry-factor': 10, | ||
]); | ||
const cwd = (_d = (cliOptions['dir'] && path.resolve(cliOptions['dir'])), (_d !== null && _d !== void 0 ? _d : npmConfig.localPrefix)); // tslint:disable-line | ||
const cwd = (_c = (cliOptions['dir'] && path.resolve(cliOptions['dir'])), (_c !== null && _c !== void 0 ? _c : npmConfig.localPrefix)); // tslint:disable-line | ||
pnpmConfig.workspaceDir = opts.workspaceDir; | ||
@@ -181,3 +169,3 @@ pnpmConfig.rawLocalConfig = Object.assign.apply(Object, [ | ||
}; | ||
const npmGlobalPrefix = (_f = (_e = pnpmConfig.globalDir, (_e !== null && _e !== void 0 ? _e : pnpmConfig.rawConfig['pnpm-prefix'])), (_f !== null && _f !== void 0 ? _f : (process.platform !== 'win32' | ||
const npmGlobalPrefix = (_e = (_d = pnpmConfig.globalDir, (_d !== null && _d !== void 0 ? _d : pnpmConfig.rawConfig['pnpm-prefix'])), (_e !== null && _e !== void 0 ? _e : (process.platform !== 'win32' | ||
? npmConfig.globalPrefix | ||
@@ -189,3 +177,3 @@ : findBestGlobalPrefixOnWindows_1.default(npmConfig.globalPrefix, process.env)))); | ||
pnpmConfig.globalDir = pnpmConfig.globalDir ? npmGlobalPrefix : path.join(npmGlobalPrefix, 'pnpm-global'); | ||
pnpmConfig.lockfileDir = (_h = (_g = pnpmConfig.lockfileDir, (_g !== null && _g !== void 0 ? _g : pnpmConfig.lockfileDirectory)), (_h !== null && _h !== void 0 ? _h : pnpmConfig.shrinkwrapDirectory)); | ||
pnpmConfig.lockfileDir = (_g = (_f = pnpmConfig.lockfileDir, (_f !== null && _f !== void 0 ? _f : pnpmConfig.lockfileDirectory)), (_g !== null && _g !== void 0 ? _g : pnpmConfig.shrinkwrapDirectory)); | ||
pnpmConfig.useLockfile = (() => { | ||
@@ -274,7 +262,7 @@ if (typeof pnpmConfig['lockfile'] === 'boolean') | ||
pnpmConfig.production = true; | ||
pnpmConfig.development = false; | ||
pnpmConfig.dev = false; | ||
} | ||
else if (pnpmConfig.only === 'dev' || pnpmConfig.only === 'development' || pnpmConfig.dev) { | ||
pnpmConfig.production = false; | ||
pnpmConfig.development = true; | ||
pnpmConfig.dev = true; | ||
pnpmConfig.optional = false; | ||
@@ -284,14 +272,7 @@ } | ||
pnpmConfig.production = true; | ||
pnpmConfig.development = true; | ||
pnpmConfig.dev = true; | ||
} | ||
pnpmConfig.include = { | ||
dependencies: pnpmConfig.production !== false, | ||
devDependencies: pnpmConfig.development !== false, | ||
optionalDependencies: pnpmConfig.optional !== false, | ||
}; | ||
if (typeof pnpmConfig.filter === 'string') { | ||
pnpmConfig.filter = pnpmConfig.filter.split(' '); | ||
} | ||
pnpmConfig.sideEffectsCacheRead = pnpmConfig.sideEffectsCache || pnpmConfig.sideEffectsCacheReadonly; | ||
pnpmConfig.sideEffectsCacheWrite = pnpmConfig.sideEffectsCache; | ||
if (!pnpmConfig.ignoreScripts && pnpmConfig.workspaceDir) { | ||
@@ -298,0 +279,0 @@ pnpmConfig.extraBinPaths = [path.join(pnpmConfig.workspaceDir, 'node_modules', '.bin')]; |
{ | ||
"name": "@pnpm/config", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "Gets configuration options for pnpm", | ||
@@ -13,6 +13,6 @@ "main": "lib/index.js", | ||
"tsc": "rimraf lib && tsc", | ||
"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts", | ||
"test-with-preview": "pnpm run lint && ts-node test", | ||
"lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts", | ||
"test-with-preview": "ts-node test", | ||
"pretest": "npm config rm fetch-retry-maxtimeout", | ||
"test": "pnpm run lint && pnpm run tsc && ts-node test" | ||
"test": "pnpm run tsc && ts-node test" | ||
}, | ||
@@ -36,3 +36,3 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/config", | ||
"@pnpm/error": "1.0.0", | ||
"@pnpm/types": "4.0.0", | ||
"@pnpm/types": "5.0.0", | ||
"@zkochan/npm-conf": "1.2.4", | ||
@@ -51,5 +51,4 @@ "camelcase": "5.3.1", | ||
"rimraf": "3.0.0", | ||
"tape": "4.11.0", | ||
"tempy": "0.3.0" | ||
} | ||
} |
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
7
22832
475
+ Added@pnpm/types@5.0.0(transitive)
- Removed@pnpm/types@4.0.0(transitive)
Updated@pnpm/types@5.0.0