Skip to content

Commit

Permalink
fix(config-loader): accounted for normalization of preset interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Sep 15, 2023
1 parent 50ee729 commit 3ff9458
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/load-parser-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@ 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 = await (importFrom.silent(__dirname, presetPackage) || importFrom(cwd, presetPackage))(presetConfig);
} else if (config) {
loadedConfig = (importFrom.silent(__dirname, config) || importFrom(cwd, config))();
loadedConfig = await (importFrom.silent(__dirname, config) || importFrom(cwd, config))();
} else {
loadedConfig = conventionalChangelogAngular();
loadedConfig = await conventionalChangelogAngular();
}

loadedConfig = await (typeof loadedConfig === "function"
? isPlainObject(presetConfig)
? loadedConfig(presetConfig)
: promisify(loadedConfig)()
: loadedConfig);

return { ...loadedConfig.parserOpts, ...parserOpts };
};

0 comments on commit 3ff9458

Please sign in to comment.