Skip to content

Commit

Permalink
Merge pull request #645 from semantic-release/beta
Browse files Browse the repository at this point in the history
promote beta to stable
  • Loading branch information
travi authored May 31, 2024
2 parents 990752b + 2bce0d3 commit fff490d
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 100 deletions.
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

0 comments on commit fff490d

Please sign in to comment.