cli-engine-config
Advanced tools
Comparing version 4.0.1-ts.17 to 4.0.1-ts.18
@@ -0,1 +1,2 @@ | ||
import { IFlag, IArg } from 'cli-flags'; | ||
export declare type UserConfig = { | ||
@@ -84,9 +85,2 @@ skipAnalytics?: boolean | undefined | null; | ||
} | ||
export declare type Arg = { | ||
name: string; | ||
description?: string; | ||
required?: boolean; | ||
optional?: boolean; | ||
hidden?: boolean; | ||
}; | ||
export declare type AlphabetUppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'X' | 'Y' | 'Z'; | ||
@@ -110,16 +104,2 @@ export declare type AlphabetLowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'x' | 'y' | 'z'; | ||
}; | ||
export declare type Flag = { | ||
char?: AlphabetLowercase | AlphabetUppercase; | ||
description?: string; | ||
hidden?: boolean; | ||
}; | ||
export declare type BooleanFlag = Flag & { | ||
parse: null; | ||
}; | ||
export declare type OptionFlag<T> = Flag & { | ||
required?: boolean; | ||
optional?: boolean; | ||
parse: (input: string | undefined, cmd: ICommand | undefined, name: string | undefined) => Promise<T | undefined> | T | undefined; | ||
completion?: Completion; | ||
}; | ||
export declare type Plugin = { | ||
@@ -141,5 +121,5 @@ name: string; | ||
buildHelpLine?: (config: Config) => [string, string]; | ||
args?: Arg[]; | ||
args?: IArg[]; | ||
flags?: { | ||
[name: string]: BooleanFlag | OptionFlag<any>; | ||
[name: string]: IFlag<any>; | ||
}; | ||
@@ -146,0 +126,0 @@ run: (options: Config) => Promise<RunReturn>; |
@@ -165,18 +165,7 @@ "use strict"; | ||
let pjson = fs.readJSONSync(path.join(existing.root, 'package.json')); | ||
existing.pjson = { | ||
...exports.defaultConfig.pjson, | ||
'cli-engine': { | ||
...exports.defaultConfig.pjson['cli-engine'], | ||
...(pjson['cli-engine'] || {}), | ||
}, | ||
...pjson, | ||
}; | ||
existing.pjson = Object.assign({}, exports.defaultConfig.pjson, { 'cli-engine': Object.assign({}, exports.defaultConfig.pjson['cli-engine'], (pjson['cli-engine'] || {})) }, pjson); | ||
validatePJSON(existing.pjson); | ||
} | ||
} | ||
const pjson = { | ||
name: 'cli-engine', | ||
version: '0.0.0', | ||
dependencies: {}, | ||
'cli-engine': { | ||
const pjson = Object.assign({ name: 'cli-engine', version: '0.0.0', dependencies: {}, 'cli-engine': { | ||
hooks: {}, | ||
@@ -186,19 +175,4 @@ defaultCommand: 'help', | ||
s3: { host: null }, | ||
}, | ||
...(existing.pjson || {}), | ||
}; | ||
return { | ||
_version: '1', | ||
pjson, | ||
channel: 'stable', | ||
home: os.homedir() || os.tmpdir(), | ||
root: path.join(__dirname, '..'), | ||
arch: os.arch() === 'ia32' ? 'x86' : os.arch(), | ||
platform: os.platform() === 'win32' ? 'windows' : os.platform(), | ||
mock: false, | ||
argv: process.argv.slice(1), | ||
version: pjson.version, | ||
defaultCommand: pjson['cli-engine'].defaultCommand, | ||
name: pjson.name, | ||
get hooks() { | ||
} }, (existing.pjson || {})); | ||
return Object.assign({ _version: '1', pjson, channel: 'stable', home: os.homedir() || os.tmpdir(), root: path.join(__dirname, '..'), arch: os.arch() === 'ia32' ? 'x86' : os.arch(), platform: os.platform() === 'win32' ? 'windows' : os.platform(), mock: false, argv: process.argv.slice(1), version: pjson.version, defaultCommand: pjson['cli-engine'].defaultCommand, name: pjson.name, get hooks() { | ||
return hooks(this); | ||
@@ -262,8 +236,5 @@ }, | ||
return registry(this); | ||
}, | ||
...existing, | ||
__cache: {}, | ||
}; | ||
} }, existing, { __cache: {} }); | ||
} | ||
exports.buildConfig = buildConfig; | ||
exports.defaultConfig = buildConfig(); |
{ | ||
"name": "cli-engine-config", | ||
"description": "base cli-engine config objects and interfaces", | ||
"version": "4.0.1-ts.17", | ||
"author": "Jeff Dickey @dickeyxxx", | ||
"version": "4.0.1-ts.18", | ||
"author": "Jeff Dickey @jdxcode", | ||
"bugs": "https://github.com/heroku/cli-engine-config/issues", | ||
@@ -16,2 +16,3 @@ "dependencies": { | ||
"@types/node": "8.0.53", | ||
"cli-flags": "1.0.16", | ||
"del-cli": "1.1.0", | ||
@@ -41,6 +42,11 @@ "husky": "^0.14.3", | ||
"main": "lib/config.js", | ||
"peerDependencies": { | ||
"cli-flags": "^1.0.6" | ||
}, | ||
"repository": "heroku/cli-engine-config", | ||
"scripts": { | ||
"posttest": "prettier -l 'src/**/*.ts'", | ||
"precommit": "lint-staged", | ||
"prepare": "del lib && tsc", | ||
"pretest": "tsc", | ||
"test": "jest" | ||
@@ -47,0 +53,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
12779
4
14
365