Skip to content

promote beta to stable #645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { format } from "url";
import { find, merge } from "lodash-es";
import getStream from "get-stream";
import intoStream from "into-stream";
import { sync as parser } from "conventional-commits-parser";
import { CommitParser } from "conventional-commits-parser";
import writer from "./wrappers/conventional-changelog-writer.js";
import filter from "conventional-commits-filter";
import { filterRevertedCommitsSync } from "conventional-commits-filter";
import { readPackageUp } from "read-pkg-up";
import debugFactory from "debug";
import loadChangelogConfig from "./lib/load-changelog-config.js";
Expand Down Expand Up @@ -43,7 +43,8 @@ export async function generateNotes(pluginConfig, context) {

const { issue, commit, referenceActions, issuePrefixes } =
find(HOSTS_CONFIG, (conf) => conf.hostname === hostname) || HOSTS_CONFIG.default;
const parsedCommits = filter(
const parser = new CommitParser({ referenceActions, issuePrefixes, ...parserOpts });
const parsedCommits = filterRevertedCommitsSync(
commits
.filter(({ message, hash }) => {
if (!message.trim()) {
Expand All @@ -55,7 +56,7 @@ export async function generateNotes(pluginConfig, context) {
})
.map((rawCommit) => ({
...rawCommit,
...parser(rawCommit.message, { referenceActions, issuePrefixes, ...parserOpts }),
...parser.parse(rawCommit.message),
}))
);
const previousTag = lastRelease.gitTag || lastRelease.gitHead;
Expand Down
4 changes: 2 additions & 2 deletions lib/load-changelog-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async ({ preset, config, parserOpts, writerOpts, presetConfig },
}

return {
parserOpts: { ...loadedConfig.parserOpts, ...parserOpts },
writerOpts: { ...loadedConfig.writerOpts, ...writerOpts },
parserOpts: { ...loadedConfig.parser, ...parserOpts },
writerOpts: { ...loadedConfig.writer, ...writerOpts },
};
};
Loading