Yuki Takei 3 лет назад
Родитель
Сommit
d956ac154b

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

@@ -1,7 +1,7 @@
 export const GrowiPluginResourceType = {
-  Template: 'Template',
-  Style: 'Style',
-  Script: 'Script',
+  Template: 'template',
+  Style: 'style',
+  Script: 'script',
 } as const;
 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 [{
       isEnabled: true,
       installedPath,
@@ -45,7 +49,7 @@ export class PluginService {
         name: growiPlugin.name ?? packageName,
         desc: growiPlugin.desc ?? packageDesc,
         author: growiPlugin.author ?? packageAuthor,
-        types: [],
+        types: growiPlugin.types,
       },
     }];
   }