feat: add @nocobase/preset-nocobase
This commit is contained in:
parent
a1bb52759b
commit
d3890b4b66
@ -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"
|
||||
},
|
||||
|
@ -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');
|
||||
|
7
packages/preset-nocobase/.npmignore
Normal file
7
packages/preset-nocobase/.npmignore
Normal file
@ -0,0 +1,7 @@
|
||||
node_modules
|
||||
*.log
|
||||
docs
|
||||
__tests__
|
||||
tsconfig.json
|
||||
src
|
||||
.fatherrc.ts
|
19
packages/preset-nocobase/package.json
Normal file
19
packages/preset-nocobase/package.json
Normal 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"
|
||||
}
|
19
packages/preset-nocobase/src/index.ts
Normal file
19
packages/preset-nocobase/src/index.ts
Normal 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]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user