feat: add plugin-client
This commit is contained in:
parent
ab28a2be4c
commit
7cc821c06f
7
packages/plugin-client/.npmignore
Normal file
7
packages/plugin-client/.npmignore
Normal file
@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
*.log
|
||||
docs
|
||||
__tests__
|
||||
tsconfig.json
|
||||
src
|
||||
.fatherrc.ts
|
13
packages/plugin-client/package.json
Normal file
13
packages/plugin-client/package.json
Normal 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"
|
||||
}
|
25
packages/plugin-client/src/index.ts
Normal file
25
packages/plugin-client/src/index.ts
Normal 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() {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user