Skip to content

Commit

Permalink
fix: remove sample plugin client files
Browse files Browse the repository at this point in the history
  • Loading branch information
chenos committed Nov 1, 2022
1 parent 85ead53 commit 7cded43
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-command.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-custom-block.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-custom-page.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-ratelimit.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-shop-actions.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-shop-events.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-shop-i18n.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/app/client/src/plugins/sample-shop-modeling.ts

This file was deleted.

11 changes: 10 additions & 1 deletion packages/presets/nocobase/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Plugin } from '@nocobase/server';
import path from 'path';

export class PresetNocoBase extends Plugin {
async addBuiltInPlugins() {
Expand Down Expand Up @@ -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;
Original file line number Diff line number Diff line change
@@ -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',
],
},
});
}
}
}

0 comments on commit 7cded43

Please sign in to comment.