imdone-core 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -185,8 +185,10 @@ export class PluginManager extends Emitter {
185
185
 
186
186
  async createPlugin(pluginClass, path = undefined) {
187
187
  const name = pluginClass.pluginName
188
- if (!name || !this.isPlugin(pluginClass))
188
+ if (!name) {
189
189
  throw new Error(`${pluginClass.name} is not a plugin`)
190
+ }
191
+
190
192
  const pluginInstance = new pluginClass(this.project)
191
193
  const packageInfo = await this.getPackageInfo(path)
192
194
  let info = {
@@ -220,18 +222,6 @@ export class PluginManager extends Emitter {
220
222
  })
221
223
  }
222
224
 
223
- isPlugin(pluginClass) {
224
- // const pluginClassName = Plugin.name.toString()
225
- // return pluginClass.proname.toString() === pluginClassName
226
- const pluginClassPrototypeName = Object.getPrototypeOf(pluginClass.prototype).constructor.name
227
- const pluginClassName = Plugin.name.toString()
228
- logger.log('pluginClassPrototypeName', pluginClassPrototypeName)
229
- logger.log('pluginClassName', pluginClassName)
230
- return pluginClassPrototypeName === pluginClassName
231
-
232
- // return Object.getPrototypeOf(pluginClass.prototype) === Plugin.prototype
233
- }
234
-
235
225
  eachPlugin(cb) {
236
226
  Object.keys(this.pluginsMap).forEach((key) => {
237
227
  cb(this.getPlugin(key))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imdone-core",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "imdone-core",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,6 @@ export class PluginManager extends Emitter<[never]> {
22
22
  getPackageInfo(path: any): Promise<{} | undefined>;
23
23
  createPlugin(pluginClass: any, path?: undefined): Promise<any>;
24
24
  destroyPlugins(): void;
25
- isPlugin(pluginClass: any): boolean;
26
25
  eachPlugin(cb: any): void;
27
26
  eachPluginAsync(cb: any): Promise<void>;
28
27
  getPlugins(): any[];