Yuki Takei 3 лет назад
Родитель
Сommit
d956ac154b
2 измененных файлов с 8 добавлено и 4 удалено
  1. 3 3
      packages/app/src/interfaces/plugin.ts
  2. 5 1
      packages/app/src/server/service/plugin.ts

+ 3 - 3
packages/app/src/interfaces/plugin.ts

@@ -1,7 +1,7 @@
 export const GrowiPluginResourceType = {
 export const GrowiPluginResourceType = {
-  Template: 'Template',
-  Style: 'Style',
-  Script: 'Script',
+  Template: 'template',
+  Style: 'style',
+  Script: 'script',
 } as const;
 } as const;
 export type GrowiPluginResourceType = typeof GrowiPluginResourceType[keyof typeof GrowiPluginResourceType];
 export type GrowiPluginResourceType = typeof GrowiPluginResourceType[keyof typeof GrowiPluginResourceType];
 
 

+ 5 - 1
packages/app/src/server/service/plugin.ts

@@ -37,6 +37,10 @@ export class PluginService {
       });
       });
     }
     }
 
 
+    if (growiPlugin.types == null) {
+      throw new Error('\'growiPlugin\' section must have a \'types\' property.');
+    }
+
     return [{
     return [{
       isEnabled: true,
       isEnabled: true,
       installedPath,
       installedPath,
@@ -45,7 +49,7 @@ export class PluginService {
         name: growiPlugin.name ?? packageName,
         name: growiPlugin.name ?? packageName,
         desc: growiPlugin.desc ?? packageDesc,
         desc: growiPlugin.desc ?? packageDesc,
         author: growiPlugin.author ?? packageAuthor,
         author: growiPlugin.author ?? packageAuthor,
-        types: [],
+        types: growiPlugin.types,
       },
       },
     }];
     }];
   }
   }