@gasket/engine
Advanced tools
Comparing version 6.43.1 to 6.43.2-canary-esm-port.0
@@ -1,3 +0,4 @@ | ||
const debug = require('debug')('gasket:engine'); | ||
const { Loader, pluginIdentifier } = require('@gasket/resolve'); | ||
import { default as diagnostics } from 'diagnostics'; | ||
import { Loader, pluginIdentifier } from '@gasket/resolve'; | ||
const debug = diagnostics('gasket:engine'); | ||
@@ -7,19 +8,23 @@ let dynamicNamingId = 0; | ||
class PluginEngine { | ||
export class PluginEngine { | ||
constructor(config, { resolveFrom } = {}) { | ||
this.config = config || {}; | ||
this.loader = new Loader({ resolveFrom }); | ||
return (async () => { | ||
this.config = config || {}; | ||
this.loader = new Loader({ resolveFrom }); | ||
this._hooks = {}; | ||
this._plans = {}; | ||
this._traceDepth = 0; | ||
this._hooks = {}; | ||
this._plans = {}; | ||
this._traceDepth = 0; | ||
this._registerPlugins(); | ||
this._registerHooks(); | ||
await this._registerPlugins(); | ||
this._registerHooks(); | ||
// Allow methods to be called without context (to support destructuring) | ||
[ | ||
'exec', 'execWaterfall', 'execMap', 'execApply', | ||
'execSync', 'execWaterfallSync', 'execMapSync', 'execApplySync' | ||
].forEach(method => { this[method] = this[method].bind(this); }); | ||
// Allow methods to be called without context (to support destructuring) | ||
[ | ||
'exec', 'execWaterfall', 'execMap', 'execApply', | ||
'execSync', 'execWaterfallSync', 'execMapSync', 'execApplySync' | ||
].forEach(method => { this[method] = this[method].bind(this); }); | ||
return this; | ||
})(); | ||
} | ||
@@ -31,5 +36,4 @@ | ||
*/ | ||
_registerPlugins() { | ||
const { plugins } = this.loader.loadConfigured(this.config.plugins); | ||
async _registerPlugins() { | ||
const { plugins } = await this.loader.loadConfigured(this.config.plugins); | ||
// map the plugin name to module content | ||
@@ -530,3 +534,1 @@ // if loaded from a file path, prefer module.name | ||
} | ||
module.exports = PluginEngine; |
{ | ||
"name": "@gasket/engine", | ||
"version": "6.43.1", | ||
"version": "6.43.2-canary-esm-port.0", | ||
"description": "Plugin engine for gasket", | ||
@@ -10,2 +10,3 @@ "main": "lib/engine.js", | ||
], | ||
"type": "module", | ||
"scripts": { | ||
@@ -43,3 +44,3 @@ "lint": "eslint .", | ||
"dependencies": { | ||
"@gasket/resolve": "^6.43.1", | ||
"@gasket/resolve": "^6.43.2-canary-esm-port.0", | ||
"debug": "^4.3.1" | ||
@@ -74,3 +75,3 @@ }, | ||
}, | ||
"gitHead": "a10c40dc23d0648ab60c757245de23579806b058" | ||
"gitHead": "f7e3283fa63e20f353587fe7f4653ebf684538c8" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
30209
576
Yes
2