|
@@ -4,13 +4,14 @@
|
|
|
* @author Yuki Takei <yuki@weseek.co.jp>
|
|
* @author Yuki Takei <yuki@weseek.co.jp>
|
|
|
*/
|
|
*/
|
|
|
require('module-alias/register');
|
|
require('module-alias/register');
|
|
|
|
|
+const logger = require('@alias/logger')('growi:bin:generate-plugin-definitions-source');
|
|
|
|
|
|
|
|
const fs = require('graceful-fs');
|
|
const fs = require('graceful-fs');
|
|
|
const normalize = require('normalize-path');
|
|
const normalize = require('normalize-path');
|
|
|
const swig = require('swig-templates');
|
|
const swig = require('swig-templates');
|
|
|
|
|
|
|
|
const helpers = require('@commons/util/helpers');
|
|
const helpers = require('@commons/util/helpers');
|
|
|
-const PluginUtils = require('../src/server/plugins/plugin-utils');
|
|
|
|
|
|
|
+const PluginUtils = require('@server/plugins/plugin-utils');
|
|
|
|
|
|
|
|
const pluginUtils = new PluginUtils();
|
|
const pluginUtils = new PluginUtils();
|
|
|
|
|
|
|
@@ -20,12 +21,16 @@ const OUT = helpers.root('tmp/plugins/plugin-definitions.js');
|
|
|
|
|
|
|
|
// list plugin names
|
|
// list plugin names
|
|
|
let pluginNames = pluginUtils.listPluginNames(helpers.root());
|
|
let pluginNames = pluginUtils.listPluginNames(helpers.root());
|
|
|
|
|
+logger.info('Detected plugins: ', pluginNames);
|
|
|
|
|
+
|
|
|
// add from PLUGIN_NAMES_TOBE_LOADED when development
|
|
// add from PLUGIN_NAMES_TOBE_LOADED when development
|
|
|
if (process.env.NODE_ENV === 'development'
|
|
if (process.env.NODE_ENV === 'development'
|
|
|
&& process.env.PLUGIN_NAMES_TOBE_LOADED !== undefined
|
|
&& process.env.PLUGIN_NAMES_TOBE_LOADED !== undefined
|
|
|
&& process.env.PLUGIN_NAMES_TOBE_LOADED.length > 0) {
|
|
&& process.env.PLUGIN_NAMES_TOBE_LOADED.length > 0) {
|
|
|
const pluginNamesDev = process.env.PLUGIN_NAMES_TOBE_LOADED.split(',');
|
|
const pluginNamesDev = process.env.PLUGIN_NAMES_TOBE_LOADED.split(',');
|
|
|
|
|
|
|
|
|
|
+ logger.info('Detected plugins from PLUGIN_NAMES_TOBE_LOADED: ', pluginNamesDev);
|
|
|
|
|
+
|
|
|
// merge and remove duplicates
|
|
// merge and remove duplicates
|
|
|
if (pluginNamesDev.length > 0) {
|
|
if (pluginNamesDev.length > 0) {
|
|
|
pluginNames = pluginNames.concat(pluginNamesDev);
|
|
pluginNames = pluginNames.concat(pluginNamesDev);
|