Yuki Takei 7 лет назад
Родитель
Сommit
b177404bd9

+ 0 - 2
src/server/plugins/plugin-utils-v2.js

@@ -1,7 +1,6 @@
 const path = require('path');
 
 class PluginUtilsV2 {
-
   /**
    * return a definition objects that has following structure:
    *
@@ -34,7 +33,6 @@ class PluginUtilsV2 {
       entries,
     };
   }
-
 }
 
 module.exports = PluginUtilsV2;

+ 4 - 5
src/server/plugins/plugin-utils.js

@@ -1,12 +1,12 @@
 const path = require('path');
 const fs = require('graceful-fs');
+const logger = require('@alias/logger')('growi:plugins:plugin-utils');
 
 const PluginUtilsV2 = require('./plugin-utils-v2');
 
 const pluginUtilsV2 = new PluginUtilsV2();
 
 class PluginUtils {
-
   /**
    * return a definition objects that has following structure:
    *
@@ -29,8 +29,7 @@ class PluginUtils {
     switch (meta.pluginSchemaVersion) {
       // v1 is deprecated
       case 1:
-        console.log('pluginSchemaVersion 1 is deprecated');
-        debug('pluginSchemaVersion 1 is deprecated');
+        logger.debug('pluginSchemaVersion 1 is deprecated');
         break;
       // v2 or above
       case 2:
@@ -56,7 +55,7 @@ class PluginUtils {
    * @memberOf PluginService
    */
   listPlugins(rootDir) {
-    var packagePath = path.join(rootDir, 'package.json');
+    const packagePath = path.join(rootDir, 'package.json');
 
     // Make sure package.json exists
     if (!fs.existsSync(packagePath)) {
@@ -68,7 +67,7 @@ class PluginUtils {
     const json = JSON.parse(content);
     const deps = json.dependencies || {};
 
-    let objs = {};
+    const objs = {};
     Object.keys(deps).forEach((name) => {
       if (/^(crowi|growi)-plugin-/.test(name)) {
         objs[name] = deps[name];

+ 0 - 2
src/server/plugins/plugin.service.js

@@ -2,7 +2,6 @@ const logger = require('@alias/logger')('growi:plugins:PluginService');
 const PluginUtils = require('./plugin-utils');
 
 class PluginService {
-
   constructor(crowi, app) {
     this.crowi = crowi;
     this.app = app;
@@ -44,7 +43,6 @@ class PluginService {
           entry(this.crowi, this.app);
         });
     }
-
   }
 }