fix: remove sample plugin client files

This commit is contained in:
chenos 2022-11-01 18:00:00 +08:00
parent 85ead5375a
commit 7cded4395a
11 changed files with 37 additions and 10 deletions

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-command/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-custom-block/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-custom-page/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-custom-signup-page/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-ratelimit/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-shop-actions/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-shop-events/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-shop-i18n/client';

View File

@ -1 +0,0 @@
export { default } from '@nocobase/plugin-sample-shop-modeling/client';

View File

@ -1,4 +1,5 @@
import { Plugin } from '@nocobase/server';
import path from 'path';
export class PresetNocoBase extends Plugin {
async addBuiltInPlugins() {
@ -53,7 +54,15 @@ export class PresetNocoBase extends Plugin {
await this.addBuiltInPlugins();
});
}
beforeLoad() {}
beforeLoad() {
this.db.addMigrations({
namespace: this.getName(),
directory: path.resolve(__dirname, './migrations'),
context: {
plugin: this,
},
});
}
}
export default PresetNocoBase;

View File

@ -0,0 +1,27 @@
import { Migration } from '@nocobase/server';
export default class DelSamplePluginMigration extends Migration {
async up() {
const r1 = await this.app.version.satisfies('>=0.8.0-alpha.1');
const r2 = await this.app.version.satisfies('<=0.8.0-alpha.6');
if (r1 && r2) {
const repository = this.context.db.getRepository('applicationPlugins');
await repository.destroy({
filter: {
'name.$in': [
'sample-command',
'sample-shop-modeling',
'sample-hello',
'sample-shop-events',
'sample-shop-i18n',
'sample-shop-actions',
'sample-ratelimit',
'sample-custom-signup-page',
'sample-custom-block',
'sample-custom-page',
],
},
});
}
}
}