@anycli/engine
Advanced tools
Comparing version 0.1.29 to 0.1.30
@@ -0,1 +1,9 @@ | ||
<a name="0.1.30"></a> | ||
## [0.1.30](https://github.com/anycli/engine/compare/1ebfdf6a39b7ed4ad3d14803684ebaca2b36b287...v0.1.30) (2018-01-31) | ||
### Bug Fixes | ||
* typescript 2.7 ([2149ec8](https://github.com/anycli/engine/commit/2149ec8)) | ||
<a name="0.1.29"></a> | ||
@@ -2,0 +10,0 @@ ## [0.1.29](https://github.com/anycli/engine/compare/d441f0ec3466786513beb76793aa388b1947ad3d...v0.1.29) (2018-01-31) |
@@ -1,5 +0,5 @@ | ||
import { ICommandOptions } from '@anycli/config'; | ||
import * as Config from '@anycli/config'; | ||
import Engine from './engine'; | ||
export declare function run(argv?: string[], opts?: ICommandOptions): Promise<void>; | ||
export declare function run(argv?: string[], opts?: Config.IConfig | Config.ICommandOptions): Promise<void>; | ||
export default run; | ||
export { Engine }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const command_1 = require("@anycli/command"); | ||
const config_1 = require("@anycli/config"); | ||
const cli_ux_1 = require("cli-ux"); | ||
const command_1 = require("./command"); | ||
const engine_1 = require("./engine"); | ||
exports.Engine = engine_1.default; | ||
class Command extends command_1.default { | ||
async run() { | ||
cli_ux_1.default.config.errlog = this.config.errlog; | ||
const id = this.argv[0]; | ||
await this.engine.runHook('init', { id }); | ||
const cachedCommand = this.engine.findCommand(id); | ||
if (!cachedCommand) | ||
return this.commandNotFound(id); | ||
this.debug('found command', cachedCommand.id); | ||
const command = await cachedCommand.load(); | ||
this.debug('loaded command', command.id); | ||
await command.run(this.argv.slice(1), { config: this.config }); | ||
} | ||
async init(argv, opts) { | ||
const root = opts.root || module.parent.filename; | ||
this.argv = argv; | ||
this.config = await config_1.read({ root }); | ||
this.initDebug(this.config); | ||
this.engine = new engine_1.default(); | ||
this.config.engine = this.engine; | ||
await this.engine.load(this.config); | ||
} | ||
async commandNotFound(id) { | ||
await this.engine.runHook('command_not_found', { id }); | ||
throw new Error(`command not found: ${id}`); | ||
} | ||
} | ||
function run(argv = process.argv.slice(2), opts = {}) { | ||
return Command.run(argv, opts); | ||
return command_1.default.run(argv, opts); | ||
} | ||
exports.run = run; | ||
exports.default = run; |
{ | ||
"name": "@anycli/engine", | ||
"description": "main anycli component", | ||
"version": "0.1.29", | ||
"version": "0.1.30", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -9,3 +9,3 @@ "bugs": "https://github.com/anycli/engine/issues", | ||
"@anycli/manifest-file": "^0.2.0", | ||
"cli-ux": "^3.3.9", | ||
"cli-ux": "^3.3.10", | ||
"debug": "^3.1.0", | ||
@@ -17,11 +17,11 @@ "fs-extra": "^5.0.0", | ||
"devDependencies": { | ||
"@anycli/command": "^0.2.8", | ||
"@anycli/config": "^0.2.0", | ||
"@anycli/help": "^0.2.3", | ||
"@anycli/command": "^0.2.11", | ||
"@anycli/config": "^0.2.2", | ||
"@anycli/help": "^0.3.0", | ||
"@anycli/not-found": "^0.1.5", | ||
"@anycli/plugins": "^0.1.7", | ||
"@anycli/tslint": "^0.1.3", | ||
"@anycli/plugins": "^0.1.8", | ||
"@anycli/tslint": "^0.2.0", | ||
"@anycli/version": "^0.1.15", | ||
"@commitlint/cli": "^6.0.2", | ||
"@commitlint/config-conventional": "^6.0.2", | ||
"@commitlint/cli": "^6.0.5", | ||
"@commitlint/config-conventional": "^6.0.4", | ||
"@types/chai": "^4.1.2", | ||
@@ -46,3 +46,3 @@ "@types/fs-extra": "^5.0.0", | ||
"ts-node": "^4.1.0", | ||
"typescript": "^2.6.2" | ||
"typescript": "^2.7.1" | ||
}, | ||
@@ -49,0 +49,0 @@ "anycli": { |
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
27396
15
422
Updatedcli-ux@^3.3.10