Skip to content

Commit

Permalink
feat(conventional-changelog-presets): supported new preset format
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the new preset format is a breaking change when compared to the previous preset format. updating to support the new format means that the old preset format is no longer supported. update your preset to the latest version to maintain compatibility
  • Loading branch information
travi committed Sep 1, 2023
1 parent 3f400dd commit f3b88d3
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 40 deletions.
6 changes: 3 additions & 3 deletions lib/load-parser-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export default async ({ preset, config, parserOpts, presetConfig }, { cwd }) =>

if (preset) {
const presetPackage = `conventional-changelog-${preset.toLowerCase()}`;
loadedConfig = importFrom.silent(__dirname, presetPackage) || importFrom(cwd, presetPackage);
loadedConfig = (importFrom.silent(__dirname, presetPackage) || importFrom(cwd, presetPackage))();
} else if (config) {
loadedConfig = importFrom.silent(__dirname, config) || importFrom(cwd, config);
loadedConfig = (importFrom.silent(__dirname, config) || importFrom(cwd, config))();
} else {
loadedConfig = conventionalChangelogAngular;
loadedConfig = conventionalChangelogAngular();
}

loadedConfig = await (typeof loadedConfig === "function"
Expand Down
84 changes: 54 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Gregor Martynus (https://twitter.com/gr2m)"
],
"dependencies": {
"conventional-changelog-angular": "^6.0.0",
"conventional-changelog-angular": "^7.0.0",
"conventional-commits-filter": "^3.0.0",
"conventional-commits-parser": "^5.0.0",
"debug": "^4.0.0",
Expand All @@ -28,12 +28,12 @@
"devDependencies": {
"ava": "5.3.1",
"c8": "8.0.1",
"conventional-changelog-atom": "3.0.0",
"conventional-changelog-atom": "4.0.0",
"conventional-changelog-conventionalcommits": "6.1.0",
"conventional-changelog-ember": "3.0.0",
"conventional-changelog-eslint": "4.0.0",
"conventional-changelog-express": "3.0.0",
"conventional-changelog-jshint": "3.0.0",
"conventional-changelog-ember": "4.0.0",
"conventional-changelog-eslint": "5.0.0",
"conventional-changelog-express": "4.0.0",
"conventional-changelog-jshint": "4.0.0",
"prettier": "3.0.3",
"semantic-release": "21.1.1",
"sinon": "15.2.0"
Expand Down
2 changes: 1 addition & 1 deletion test/load-parser-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ loadConfig.title = (providedTitle, config) => `${providedTitle} Load "${config}"
test('Load "conventional-changelog-angular" by default', async (t) => {
t.deepEqual(
await loadParserConfig({}, { cwd }),
(await (await import("conventional-changelog-angular")).default).parserOpts
(await (await import("conventional-changelog-angular")).default()).parserOpts
);
});

Expand Down

0 comments on commit f3b88d3

Please sign in to comment.