feat: add plugin-client

This commit is contained in:
chenos 2022-02-07 21:54:35 +08:00
parent ab28a2be4c
commit 7cc821c06f
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,7 @@
node_modules
*.log
docs
__tests__
tsconfig.json
src
.fatherrc.ts

View File

@ -0,0 +1,13 @@
{
"name": "@nocobase/plugin-client",
"version": "0.6.0-alpha.0",
"main": "lib/index.js",
"license": "MIT",
"dependencies": {
"@nocobase/server": "^0.6.0-alpha.0"
},
"devDependencies": {
"@nocobase/test": "^0.6.0-alpha.0"
},
"gitHead": "e7df1f93c4e23b9a666d99ee7372c02bdaec97c4"
}

View File

@ -0,0 +1,25 @@
import { Plugin } from '@nocobase/server';
export default class PluginClient extends Plugin {
async beforeLoad() {
const cmd = this.app.findCommand('install');
if (cmd) {
cmd.option('--import-demo');
cmd.option('--lang [lang]');
}
this.app.on('afterInstall', async (app, options) => {
const [opts] = options?.cliArgs || [{}];
if (opts?.importDemo) {
}
if (opts?.lang) {
}
});
}
async load() {
}
}