@gasket/engine
Advanced tools
Comparing version 6.0.0-canary.0 to 6.0.0-canary.8
# `@gasket/engine` | ||
### 6.0.0 | ||
- Remove package name fallbacks ([#227]) | ||
### 5.3.2 | ||
@@ -54,3 +58,4 @@ | ||
[#160]: https://github.com/godaddy/gasket/pull/160 | ||
[#227]: https://github.com/godaddy/gasket/pull/227 | ||
[Loader]:/packages/gasket-resolve/docs/api.md#Loader | ||
[Loader]:/packages/gasket-resolve/docs/api.md#loader |
@@ -61,10 +61,3 @@ const { Loader, pluginIdentifier } = require('@gasket/resolve'); | ||
if (!(name in this._plugins)) { | ||
// TODO (kinetifex): remove fallback logic in next major revision | ||
// check if we can fall back to a project scope plugin if short name | ||
const identifier = pluginIdentifier.lookup(rawName, id => id.longName in this._plugins); | ||
if (identifier) { | ||
console.warn(`Plugin '${pluginName}' has dependency of '${rawName}' which resolved to '${identifier.longName}'. This fallback behavior is DEPRECATED.`); | ||
} else { | ||
throw new Error(`Missing dependency ${rawName} of plugin '${pluginName}'`); | ||
} | ||
throw new Error(`Missing dependency ${rawName} of plugin '${pluginName}'`); | ||
} | ||
@@ -109,32 +102,13 @@ }); | ||
const hookConfig = this._getHookConfig(event); | ||
const { first, last } = timing || {}; | ||
const { first, last, before, after } = timing || {}; | ||
// normalize to long name form | ||
// const before = (timing.before || []).map(rawName => pluginIdentifier(rawName).longName); | ||
// const after = (timing.after || []).map(rawName => pluginIdentifier(rawName).longName); | ||
const beforeNorm = (before || []).map(rawName => pluginIdentifier(rawName).longName); | ||
const afterNorm = (after || []).map(rawName => pluginIdentifier(rawName).longName); | ||
// TODO (kinetifex): ▲ uncomment normalization and ▼ remove fallback logic in next major revision | ||
// normalize to long name form with fallback support for short names | ||
const [before, after] = ['before', 'after'].map(timingType => { | ||
const arr = (timing || {})[timingType] || []; | ||
return arr.reduce((acc, rawName) => { | ||
let { longName } = pluginIdentifier(rawName); | ||
if (!(longName in this._plugins)) { | ||
const identifier = pluginIdentifier.lookup(rawName, id => id.longName in this._plugins); | ||
if (identifier) { | ||
console.warn(`Plugin '${pluginName}' has '${timingType}' timing of '${rawName}' which resolved to '${identifier.longName}'. This fallback behavior is DEPRECATED.`); | ||
longName = identifier.longName; | ||
} | ||
} | ||
acc.push(longName); | ||
return acc; | ||
}, []); | ||
}); | ||
hookConfig.subscribers[pluginName || `dynamic-${dynamicNamingId++}`] = { | ||
ordering: { | ||
first: !!first, | ||
before, | ||
after, | ||
before: beforeNorm, | ||
after: afterNorm, | ||
last: !!last | ||
@@ -141,0 +115,0 @@ }, |
{ | ||
"name": "@gasket/engine", | ||
"version": "6.0.0-canary.0", | ||
"version": "6.0.0-canary.8", | ||
"description": "Plugin engine for gasket", | ||
@@ -38,3 +38,3 @@ "main": "lib/engine.js", | ||
"dependencies": { | ||
"@gasket/resolve": "^6.0.0-canary.0" | ||
"@gasket/resolve": "^6.0.0-canary.8" | ||
}, | ||
@@ -52,3 +52,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "62beeef23361fa8d1e3373de9fa45e2f0dc4e432" | ||
"gitHead": "250c46f89642884b8110842773798b60d7a5a87c" | ||
} |
26856
454