@nowa/core
Advanced tools
Comparing version 0.7.2 to 0.8.0-beta.29048b3e
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="0.8.0-beta.29048b3e"></a> | ||
# [0.8.0-beta.29048b3e](https://github.com/nowa-webpack/nowa2/compare/@nowa/core@0.7.2...@nowa/core@0.8.0-beta.29048b3e) (2018-09-14) | ||
### Features | ||
* support loading advanced config & solution ([29048b3](https://github.com/nowa-webpack/nowa2/commit/29048b3)) | ||
<a name="0.7.2"></a> | ||
@@ -8,0 +19,0 @@ ## [0.7.2](https://github.com/nowa-webpack/nowa2/compare/@nowa/core@0.7.1...@nowa/core@0.7.2) (2018-09-04) |
@@ -6,3 +6,3 @@ "use strict"; | ||
apply(runner, { logger }) { | ||
runner.$register('load-plugins', ({ config, solution }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
runner.$register('load-plugins', ({ config = {}, solution = {} }) => tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const allPlugins = [...((solution.nowa && solution.nowa.plugins) || []), ...((config.nowa && config.nowa.plugins) || [])]; | ||
@@ -9,0 +9,0 @@ logger.debug(`got ${allPlugins.length} plugin(s) to load`); |
@@ -17,5 +17,9 @@ import { Module } from './core/module'; | ||
'init-context': [undefined, IRuntime['context']]; | ||
'load-advanced': [Pick<IRuntime, 'context'>, { | ||
config: IRuntime['raw']['config']; | ||
solution: IRuntime['raw']['solution']; | ||
} | null]; | ||
'load-config': [Pick<IRuntime, 'context'>, IRuntime['raw']['config']]; | ||
'load-solution': [Pick<IRuntime, 'context'> & Pick<IRuntime['raw'], 'config'>, IRuntime['raw']['solution']]; | ||
'load-plugins': [Pick<IRuntime, 'context'> & Pick<IRuntime['raw'], 'config' | 'solution'>, Array<IPlugin<Runner>>]; | ||
'load-plugins': [Pick<IRuntime, 'context'> & Partial<Pick<IRuntime['raw'], 'config' | 'solution'>>, Array<IPlugin<Runner>>]; | ||
'load-commands': [Pick<IRuntime, 'context'> & Pick<IRuntime['raw'], 'config' | 'solution'>, IRuntime['raw']['commands']]; | ||
@@ -22,0 +26,0 @@ 'parse-config': [Pick<IRuntime, 'context'> & IRuntime['raw'], IRuntime['parsed']['config']]; |
@@ -22,2 +22,15 @@ "use strict"; | ||
this.runtime.context = yield this.$applyHookBail('init-context'); | ||
logger.debug('apply load-advanced-config'); | ||
const advanced = yield this.$applyHookBail('load-advanced', { context: this.runtime.context }); | ||
if (advanced) { | ||
const advancedPlugins = yield this.$applyHookBail('load-plugins', { | ||
config: advanced.config, | ||
context: this.runtime.context, | ||
solution: advanced.solution, | ||
}); | ||
logger.debug(`load ${advancedPlugins.length} advanced plugin(s)`); | ||
for (const plugin of advancedPlugins) { | ||
yield plugin.apply(this, this.$createUtils(plugin.name)); | ||
} | ||
} | ||
logger.debug('apply load-config'); | ||
@@ -24,0 +37,0 @@ this.runtime.raw.config = yield this.$applyHookBail('load-config', { context: this.runtime.context }); |
{ | ||
"name": "@nowa/core", | ||
"version": "0.7.2", | ||
"version": "0.8.0-beta.29048b3e", | ||
"description": "the nowa core", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57532
37
1238
15