Skip to content

Commit

Permalink
feat(devtool): add internal devtool plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cpselvis committed Jan 16, 2020
1 parent 2f2323e commit ef053c5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"typescript": "^3.7.2"
},
"dependencies": {
"@feflow/feflow-plugin-devtool": "0.0.1",
"@typescript-eslint/eslint-plugin": "^2.8.0",
"@typescript-eslint/parser": "^2.8.0",
"eslint": "^6.6.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/feflow-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@feflow/cli",
"version": "0.17.1",
"version": "0.17.2",
"description": "A front-end flow tool.",
"main": "./lib/index.js",
"directories": {
Expand Down Expand Up @@ -48,6 +48,7 @@
"typescript": "^3.5.2"
},
"dependencies": {
"@feflow/feflow-plugin-devtool": "0.0.1",
"@feflow/report": "^0.1.0",
"abbrev": "^1.1.1",
"bunyan": "^1.8.12",
Expand Down
18 changes: 16 additions & 2 deletions packages/feflow-cli/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default class Feflow {
await this.checkCliUpdate();
await this.checkUpdate();
await this.loadNative();
await this.loadInternalPlugins();
await loadPlugins(this);
await loadDevkits(this);
}
Expand Down Expand Up @@ -261,6 +262,20 @@ export default class Feflow {
});
}

loadInternalPlugins() {
[
'@feflow/feflow-plugin-devtool'
].map((name: string) => {
try {
this.logger.debug('Plugin loaded: %s', chalk.magenta(name));
return require(name)(this);
} catch (err) {
this.logger.error({err: err}, 'Plugin load failed: %s', chalk.magenta(name));
}
});
}


call(name: any, ctx: any) {
const args = ctx.args;
if((args.h || args.help) && name != "help"){
Expand All @@ -276,8 +291,7 @@ export default class Feflow {
});
}

async updateCli(packageManager: string) {

async updateCli(packageManager: string) {
return new Promise((resolve, reject) => {
const args = [
'install',
Expand Down

0 comments on commit ef053c5

Please sign in to comment.