lerna-changelog
Advanced tools
Comparing version 0.8.1 to 0.8.2
# Changelog | ||
## v0.8.2 (2018-10-14) | ||
#### :bug: Bug Fix | ||
* [#125](https://github.com/lerna/lerna-changelog/pull/125) Fix `nextVersion` config handling ([@Turbo87](https://github.com/Turbo87)) | ||
#### :house: Internal | ||
* [#124](https://github.com/lerna/lerna-changelog/pull/124) yarn: Add `integrity` hashes ([@Turbo87](https://github.com/Turbo87)) | ||
#### Committers: 1 | ||
- Tobias Bieniek ([@Turbo87](https://github.com/Turbo87)) | ||
## v0.8.1 (2018-10-10) | ||
@@ -4,0 +16,0 @@ |
@@ -40,3 +40,2 @@ "use strict"; | ||
var progress_bar_1 = require("./progress-bar"); | ||
var configuration_1 = require("./configuration"); | ||
var find_pull_request_id_1 = require("./find-pull-request-id"); | ||
@@ -48,6 +47,5 @@ var Git = require("./git"); | ||
var Changelog = (function () { | ||
function Changelog(options) { | ||
if (options === void 0) { options = {}; } | ||
function Changelog(config) { | ||
var _this = this; | ||
this.config = this.loadConfig(options); | ||
this.config = config; | ||
this.github = new github_api_1.default(this.config); | ||
@@ -57,3 +55,3 @@ this.renderer = new markdown_renderer_1.default({ | ||
baseIssueUrl: this.github.getBaseIssueUrl(this.config.repo), | ||
unreleasedName: this.config.nextVersion, | ||
unreleasedName: this.config.nextVersion || "Unreleased", | ||
}); | ||
@@ -85,5 +83,2 @@ } | ||
}; | ||
Changelog.prototype.loadConfig = function (options) { | ||
return configuration_1.load(options); | ||
}; | ||
Changelog.prototype.getCommitInfos = function (from, to) { | ||
@@ -90,0 +85,0 @@ return __awaiter(this, void 0, void 0, function () { |
@@ -52,10 +52,2 @@ "use strict"; | ||
describe("Changelog", function () { | ||
describe("contructor", function () { | ||
var MockedChangelog = require("./changelog").default; | ||
it("set cli options", function () { | ||
var changelog = new MockedChangelog({ tagFrom: "1", tagTo: "2" }); | ||
expect(changelog.config.tagFrom).toBe("1"); | ||
expect(changelog.config.tagTo).toBe("2"); | ||
}); | ||
}); | ||
describe("packageFromPath", function () { | ||
@@ -62,0 +54,0 @@ var MockedChangelog = require("./changelog").default; |
@@ -41,6 +41,7 @@ "use strict"; | ||
var changelog_1 = require("./changelog"); | ||
var configuration_1 = require("./configuration"); | ||
var configuration_error_1 = require("./configuration-error"); | ||
function run() { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var yargs, argv, options, result, highlighted, e_1; | ||
var yargs, argv, options, config, result, highlighted, e_1; | ||
return __generator(this, function (_a) { | ||
@@ -91,4 +92,2 @@ switch (_a.label) { | ||
tagTo: argv["to"] || argv["tag-to"], | ||
nextVersion: argv["next-version"], | ||
nextVersionFromMetadata: argv["next-version-from-metadata"], | ||
}; | ||
@@ -98,3 +97,9 @@ _a.label = 1; | ||
_a.trys.push([1, 3, , 4]); | ||
return [4, new changelog_1.default().createMarkdown(options)]; | ||
config = configuration_1.load({ | ||
nextVersionFromMetadata: argv["next-version-from-metadata"], | ||
}); | ||
if (argv["next-version"]) { | ||
config.nextVersion = argv["next-version"]; | ||
} | ||
return [4, new changelog_1.default(config).createMarkdown(options)]; | ||
case 2: | ||
@@ -101,0 +106,0 @@ result = _a.sent(); |
@@ -18,4 +18,3 @@ "use strict"; | ||
var config = fromPackageConfig(rootPath) || fromLernaConfig(rootPath) || {}; | ||
Object.assign(config, options); | ||
var repo = config.repo, nextVersion = config.nextVersion, nextVersionFromMetadata = config.nextVersionFromMetadata, labels = config.labels, cacheDir = config.cacheDir, ignoreCommitters = config.ignoreCommitters; | ||
var repo = config.repo, nextVersion = config.nextVersion, labels = config.labels, cacheDir = config.cacheDir, ignoreCommitters = config.ignoreCommitters; | ||
if (!repo) { | ||
@@ -27,8 +26,8 @@ repo = findRepo(rootPath); | ||
} | ||
if (nextVersionFromMetadata) { | ||
if (options.nextVersionFromMetadata || config.nextVersionFromMetadata) { | ||
nextVersion = findNextVersion(rootPath); | ||
if (!nextVersion) { | ||
throw new configuration_error_1.default('Could not infer "nextVersion" from the "package.json" file.'); | ||
} | ||
} | ||
if (!nextVersion) { | ||
throw new configuration_error_1.default('Could not infer "nextVersion" from the "package.json" file.'); | ||
} | ||
if (!labels) { | ||
@@ -35,0 +34,0 @@ labels = { |
"use strict"; | ||
var __assign = (this && this.__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; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -23,5 +6,4 @@ var UNRELEASED_TAG = "___unreleased___"; | ||
var MarkdownRenderer = (function () { | ||
function MarkdownRenderer(_a) { | ||
var _b = _a.unreleasedName, unreleasedName = _b === void 0 ? "Unreleased" : _b, options = __rest(_a, ["unreleasedName"]); | ||
this.options = __assign({ unreleasedName: unreleasedName }, options); | ||
function MarkdownRenderer(options) { | ||
this.options = options; | ||
} | ||
@@ -28,0 +10,0 @@ MarkdownRenderer.prototype.renderMarkdown = function (releases) { |
{ | ||
"name": "lerna-changelog", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Generate a changelog for a lerna monorepo", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
89889
20
1134