diff --git a/packages/plugin-client/.npmignore b/packages/plugin-client/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-client/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-client/package.json b/packages/plugin-client/package.json new file mode 100644 index 000000000..4efbbcc10 --- /dev/null +++ b/packages/plugin-client/package.json @@ -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" +} diff --git a/packages/plugin-client/src/index.ts b/packages/plugin-client/src/index.ts new file mode 100644 index 000000000..f088a3fb7 --- /dev/null +++ b/packages/plugin-client/src/index.ts @@ -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() { + + } +}