@untool/core
Advanced tools
Comparing version 0.16.0 to 0.17.0
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="0.17.0"></a> | ||
# [0.17.0](https://github.com/untool/untool/compare/v0.16.0...v0.17.0) (2018-08-17) | ||
### Features | ||
* **core:** let `bootstrap`/`Mixin` accept options ([e52aceb](https://github.com/untool/untool/commit/e52aceb)) | ||
<a name="0.16.0"></a> | ||
@@ -8,0 +20,0 @@ # [0.16.0](https://github.com/untool/untool/compare/v0.15.1...v0.16.0) (2018-08-06) |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
const debug = require('debug')('untool:config'); | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
const debug = require('debug')('untool:core'); | ||
@@ -8,9 +10,10 @@ const define = require('mixinable'); | ||
exports.Mixin = class Mixin { | ||
constructor(config) { | ||
constructor(config, options) { | ||
this.config = config; | ||
this.options = options; | ||
} | ||
}; | ||
exports.bootstrap = function bootstrap(overrides, ...args) { | ||
const config = environmentalize(getConfig(overrides)); | ||
exports.bootstrap = function bootstrap(configOverrides = {}, options = {}) { | ||
const config = environmentalize(getConfig(configOverrides)); | ||
const mixins = config.mixins.core.map((mixin) => require(mixin)); | ||
@@ -25,3 +28,3 @@ const strategies = { | ||
return define(strategies)(...mixins)(config, ...args); | ||
return define(strategies, mixins)(config, options); | ||
}; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
const isPlainObject = require('is-plain-object'); | ||
@@ -2,0 +4,0 @@ |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
const debug = require('debug')('untool:runtime'); | ||
@@ -19,3 +21,3 @@ const define = require('mixinable'); | ||
); | ||
const createMixinable = define(strategies)(...mixins); | ||
const createMixinable = define(strategies, mixins); | ||
@@ -22,0 +24,0 @@ debug(mixins.map(({ name, strategies }) => ({ [name]: strategies }))); |
{ | ||
"name": "@untool/core", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "untool core", | ||
@@ -33,3 +33,3 @@ "main": "lib/core.js", | ||
"lodash.mergewith": "^4.6.1", | ||
"mixinable": "^3.1.2", | ||
"mixinable": "^4.0.0", | ||
"supports-color": "^5.4.0" | ||
@@ -39,3 +39,4 @@ }, | ||
"node": ">8.6.0" | ||
} | ||
}, | ||
"gitHead": "9d9952d8df5e891d74249232c458e262b90f5f18" | ||
} |
@@ -130,3 +130,3 @@ # `@untool/core` | ||
### `Mixin(config, [...args])` | ||
### `Mixin(config, options)` | ||
@@ -145,3 +145,3 @@ ```javascript | ||
The `Mixin` constructor expects at least one arguments: `config`, the main configuration object. This argument is made available as a homonymous instance property. | ||
The `Mixin` constructor expects two arguments: `config`, the main configuration object, and `options`, an object containing more ephemeral settings. These arguments are made available as a homonymous instance properties. | ||
@@ -153,4 +153,4 @@ ```javascript | ||
class MyMixin extends Mixin { | ||
constructor(config, ...args) { | ||
super(config, ...args); | ||
constructor(config, options) { | ||
super(config, options); | ||
} | ||
@@ -191,6 +191,6 @@ myMethod(...args) { | ||
### `bootstrap([overrides], [...args])` (build only) | ||
### `bootstrap([configOverrides], [options])` (build only) | ||
This is a semi-private function that is mainly being used internally, for example by [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md). It returns the core mixin container - this allows you to call all defined mixin methods. | ||
You will only ever have to call it if you want to use `@untool/core` programmatically. You can pass it an `overrides` object that will be merged into the main config object. Whatever other arguments it receives are being passed along to the core container's mixins' constructors. | ||
You will only ever have to call it if you want to use `@untool/core` programmatically. You can pass it an `configOverrides` object that will be merged into the main config object, and and options object mixins might use instead of CLI arguments. |
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
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
23544
8
247
+ Addedmixinable@4.0.0(transitive)
- Removedmixinable@3.1.2(transitive)
Updatedmixinable@^4.0.0