@boll/cli
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Fri, 28 Aug 2020 19:05:59 GMT", | ||
"date": "Tue, 01 Sep 2020 17:48:45 GMT", | ||
"tag": "@boll/cli_v0.0.12", | ||
"version": "0.0.12", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Multi level inheritance for configuration.", | ||
"author": "jdh@microsoft.com", | ||
"commit": "7e9fae187282c79b1f23d98055fd79eab880a7d8", | ||
"package": "@boll/cli" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 28 Aug 2020 19:06:06 GMT", | ||
"tag": "@boll/cli_v0.0.11", | ||
@@ -8,0 +23,0 @@ "version": "0.0.11", |
# Change Log - @boll/cli | ||
This log was last generated on Fri, 28 Aug 2020 19:05:59 GMT and should not be manually modified. | ||
This log was last generated on Tue, 01 Sep 2020 17:48:45 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 0.0.12 | ||
Tue, 01 Sep 2020 17:48:45 GMT | ||
### Patches | ||
- Multi level inheritance for configuration. (jdh@microsoft.com) | ||
## 0.0.11 | ||
Fri, 28 Aug 2020 19:05:59 GMT | ||
Fri, 28 Aug 2020 19:06:06 GMT | ||
@@ -11,0 +19,0 @@ ### Patches |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -32,7 +43,12 @@ exports.Config = void 0; | ||
}; | ||
// TODO this will need a hand-crafted "deep merge" at some point | ||
Config.prototype.resolvedConfiguration = function () { | ||
if (this.configuration.extends) { | ||
return this.configRegistry.get(this.configuration.extends); | ||
return __assign(__assign({}, this.resolveParentConfiguration(this.configuration.extends)), this.configuration); | ||
}; | ||
Config.prototype.resolveParentConfiguration = function (baseConfigName) { | ||
if (!baseConfigName) { | ||
return {}; | ||
} | ||
return this.configuration; | ||
var baseConfig = this.configRegistry.get(baseConfigName); | ||
return __assign(__assign({}, this.resolveParentConfiguration(baseConfig.extends)), baseConfig); | ||
}; | ||
@@ -39,0 +55,0 @@ return Config; |
@@ -64,7 +64,8 @@ "use strict"; | ||
var baretest_1 = __importDefault(require("baretest")); | ||
var bootstrap_1 = require("../config/bootstrap"); | ||
var config_1 = require("../lib/config"); | ||
var config_registry_1 = require("../lib/config-registry"); | ||
var recommended_1 = require("../config/recommended"); | ||
var rule_registry_1 = require("../lib/rule-registry"); | ||
var config_registry_1 = require("../lib/config-registry"); | ||
var bootstrap_1 = require("../config/bootstrap"); | ||
var src_detector_1 = require("../rules/src-detector"); | ||
exports.test = baretest_1.default("Config"); | ||
@@ -96,1 +97,18 @@ exports.test.before(function () { | ||
}); }); | ||
exports.test("should allow multi-level inheritance of configs", function () { | ||
var configRegistry = new config_registry_1.ConfigRegistry(); | ||
var ruleRegistry = new rule_registry_1.RuleRegistry(); | ||
var called = false; | ||
ruleRegistry.register("foo", function () { | ||
called = true; | ||
return new src_detector_1.SrcDetector(); | ||
}); | ||
configRegistry.register({ name: "base", checks: [{ rule: "foo" }] }); | ||
configRegistry.register({ name: "level1", extends: "base" }); | ||
configRegistry.register({ name: "level2", extends: "level1" }); | ||
configRegistry.register({ name: "level3", extends: "level2" }); | ||
var config = new config_1.Config(configRegistry, ruleRegistry); | ||
config.load({ extends: "level3" }); | ||
config.buildSuite(); | ||
assert.ok(called, "Rule factory should have been invoked when creating suite."); | ||
}); |
{ | ||
"name": "@boll/cli", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "> TODO: description", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/microsoft/boll#readme", |
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
130498
2587