|
1 | 1 | 'use strict';
|
2 | 2 |
|
3 |
| -const plugin_manager = function () { |
| 3 | +const plugin_manager = function() { |
4 | 4 | const path = require('path');
|
5 | 5 | const logger = require('./log');
|
6 | 6 |
|
@@ -37,23 +37,25 @@ const plugin_manager = function () {
|
37 | 37 | * @param {object} patternlab
|
38 | 38 | */
|
39 | 39 | function initializePlugins(patternlab) {
|
40 |
| - const foundPlugins = Object.keys(patternlab.config.plugins || {}) |
| 40 | + const foundPlugins = Object.keys(patternlab.config.plugins || {}); |
41 | 41 | foundPlugins.forEach(plugin => {
|
42 | 42 | logger.info(`Found plugin: ${plugin}`);
|
43 | 43 | logger.info(`Attempting to load and initialize plugin.`);
|
44 |
| - const pluginModule = loadPlugin(path.join(process.cwd(), 'node_modules', plugin)); |
| 44 | + const pluginModule = loadPlugin( |
| 45 | + path.join(process.cwd(), 'node_modules', plugin) |
| 46 | + ); |
45 | 47 | pluginModule(patternlab);
|
46 | 48 | });
|
47 | 49 | }
|
48 | 50 |
|
49 | 51 | async function raiseEvent(patternlab, eventName, args) {
|
50 | 52 | patternlab.events.emit(eventName, args);
|
51 |
| - await (async function () { |
| 53 | + await (async function() { |
52 | 54 | const hookHandlers = (patternlab.hooks[eventName] || []).map(h =>
|
53 | 55 | h(args)
|
54 | 56 | );
|
55 | 57 |
|
56 |
| - const results = await Promise.all(hookHandlers); |
| 58 | + await Promise.all(hookHandlers); |
57 | 59 | })();
|
58 | 60 | }
|
59 | 61 |
|
|
0 commit comments