feat: add @nocobase/preset-nocobase

This commit is contained in:
chenos 2021-09-06 16:00:38 +08:00
parent a1bb52759b
commit d3890b4b66
5 changed files with 48 additions and 19 deletions

View File

@ -27,6 +27,7 @@
},
"dependencies": {
"@nocobase/client": "^0.4.0-alpha.7",
"@nocobase/preset-nocobase": "^0.4.0-alpha.7",
"@umijs/preset-react": "1.x",
"umi": "^3.0.0"
},

View File

@ -41,26 +41,9 @@ const api = new Server({
},
});
const plugins = [
'@nocobase/plugin-collections',
'@nocobase/plugin-ui-router',
'@nocobase/plugin-ui-schema',
'@nocobase/plugin-users',
'@nocobase/plugin-action-logs',
'@nocobase/plugin-file-manager',
'@nocobase/plugin-permissions',
'@nocobase/plugin-export',
'@nocobase/plugin-system-settings',
// '@nocobase/plugin-automations',
'@nocobase/plugin-china-region',
];
console.log(`@nocobase/preset-nocobase/${__filename.endsWith('.ts') ? 'src' : 'lib'}/index`);
for (const plugin of plugins) {
api.registerPlugin(plugin, [
require(`${plugin}/${__filename.endsWith('.ts') ? 'src' : 'lib'}/server`)
.default,
]);
}
api.registerPlugin('@nocobase/preset-nocobase', require(`@nocobase/preset-nocobase/${__filename.endsWith('.ts') ? 'src' : 'lib'}/index`).default);
if (process.argv.length < 3) {
process.argv.push('start', '--port', '2000');

View File

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

View File

@ -0,0 +1,19 @@
{
"name": "@nocobase/preset-nocobase",
"version": "0.4.0-alpha.7",
"main": "lib/index.js",
"license": "MIT",
"dependencies": {
"@nocobase/plugin-action-logs": "^0.4.0-alpha.7",
"@nocobase/plugin-automations": "^0.4.0-alpha.7",
"@nocobase/plugin-china-region": "^0.4.0-alpha.7",
"@nocobase/plugin-collections": "^0.4.0-alpha.7",
"@nocobase/plugin-file-manager": "^0.4.0-alpha.7",
"@nocobase/plugin-pages": "^0.4.0-alpha.7",
"@nocobase/plugin-permissions": "^0.4.0-alpha.7",
"@nocobase/plugin-ui-router": "^0.4.0-alpha.7",
"@nocobase/plugin-ui-schema": "^0.4.0-alpha.7",
"@nocobase/plugin-users": "^0.4.0-alpha.7"
},
"gitHead": "f0b335ac30f29f25c95d7d137655fa64d8d67f1e"
}

View File

@ -0,0 +1,19 @@
export default function (api) {
const plugins = [
'@nocobase/plugin-collections',
'@nocobase/plugin-ui-router',
'@nocobase/plugin-ui-schema',
'@nocobase/plugin-users',
'@nocobase/plugin-action-logs',
'@nocobase/plugin-file-manager',
'@nocobase/plugin-permissions',
'@nocobase/plugin-export',
'@nocobase/plugin-system-settings',
// // '@nocobase/plugin-automations',
'@nocobase/plugin-china-region',
];
console.log(plugins);
for (const plugin of plugins) {
this.registerPlugin(plugin, [require(`${plugin}/${__filename.endsWith('.ts') ? 'src' : 'lib'}/server`).default]);
}
}