fix: remove sample plugin client files
This commit is contained in:
		
							parent
							
								
									85ead5375a
								
							
						
					
					
						commit
						7cded4395a
					
				| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-command/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-custom-block/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-custom-page/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-custom-signup-page/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-ratelimit/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-shop-actions/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-shop-events/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-shop-i18n/client'; |  | ||||||
| @ -1 +0,0 @@ | |||||||
| export { default } from '@nocobase/plugin-sample-shop-modeling/client'; |  | ||||||
| @ -1,4 +1,5 @@ | |||||||
| import { Plugin } from '@nocobase/server'; | import { Plugin } from '@nocobase/server'; | ||||||
|  | import path from 'path'; | ||||||
| 
 | 
 | ||||||
| export class PresetNocoBase extends Plugin { | export class PresetNocoBase extends Plugin { | ||||||
|   async addBuiltInPlugins() { |   async addBuiltInPlugins() { | ||||||
| @ -53,7 +54,15 @@ export class PresetNocoBase extends Plugin { | |||||||
|       await this.addBuiltInPlugins(); |       await this.addBuiltInPlugins(); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|   beforeLoad() {} |   beforeLoad() { | ||||||
|  |     this.db.addMigrations({ | ||||||
|  |       namespace: this.getName(), | ||||||
|  |       directory: path.resolve(__dirname, './migrations'), | ||||||
|  |       context: { | ||||||
|  |         plugin: this, | ||||||
|  |       }, | ||||||
|  |     }); | ||||||
|  |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export default PresetNocoBase; | export default PresetNocoBase; | ||||||
|  | |||||||
| @ -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', | ||||||
|  |           ], | ||||||
|  |         }, | ||||||
|  |       }); | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user