Skip to content

Commit 78f8f52

Browse files
authoredSep 18, 2023
Merge pull request #519 from semantic-release/beta
2 parents 84e84f9 + a681fbd commit 78f8f52

7 files changed

+51
-124
lines changed
 

‎.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
matrix:
1515
node-version:
16-
- 18.0.0
17-
- 19
16+
- 18.17.0
17+
- 20.6.1
1818
- 20
1919
os:
2020
- ubuntu-latest

‎.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18

‎lib/load-parser-config.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,12 @@ export default async ({ preset, config, parserOpts, presetConfig }, { cwd }) =>
2222

2323
if (preset) {
2424
const presetPackage = `conventional-changelog-${preset.toLowerCase()}`;
25-
loadedConfig = importFrom.silent(__dirname, presetPackage) || importFrom(cwd, presetPackage);
25+
loadedConfig = await (importFrom.silent(__dirname, presetPackage) || importFrom(cwd, presetPackage))(presetConfig);
2626
} else if (config) {
27-
loadedConfig = importFrom.silent(__dirname, config) || importFrom(cwd, config);
27+
loadedConfig = await (importFrom.silent(__dirname, config) || importFrom(cwd, config))();
2828
} else {
29-
loadedConfig = conventionalChangelogAngular;
29+
loadedConfig = await conventionalChangelogAngular();
3030
}
3131

32-
loadedConfig = await (typeof loadedConfig === "function"
33-
? isPlainObject(presetConfig)
34-
? loadedConfig(presetConfig)
35-
: promisify(loadedConfig)()
36-
: loadedConfig);
37-
3832
return { ...loadedConfig.parserOpts, ...parserOpts };
3933
};

‎package-lock.json

+33-101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"Gregor Martynus (https://twitter.com/gr2m)"
1818
],
1919
"dependencies": {
20-
"conventional-changelog-angular": "^6.0.0",
21-
"conventional-commits-filter": "^3.0.0",
20+
"conventional-changelog-angular": "^7.0.0",
21+
"conventional-commits-filter": "^4.0.0",
2222
"conventional-commits-parser": "^5.0.0",
2323
"debug": "^4.0.0",
2424
"import-from": "^4.0.0",
@@ -28,18 +28,18 @@
2828
"devDependencies": {
2929
"ava": "5.3.1",
3030
"c8": "8.0.1",
31-
"conventional-changelog-atom": "3.0.0",
31+
"conventional-changelog-atom": "4.0.0",
3232
"conventional-changelog-conventionalcommits": "6.1.0",
33-
"conventional-changelog-ember": "3.0.0",
34-
"conventional-changelog-eslint": "4.0.0",
35-
"conventional-changelog-express": "3.0.0",
36-
"conventional-changelog-jshint": "3.0.0",
33+
"conventional-changelog-ember": "4.0.0",
34+
"conventional-changelog-eslint": "5.0.0",
35+
"conventional-changelog-express": "4.0.0",
36+
"conventional-changelog-jshint": "4.0.0",
3737
"prettier": "3.0.3",
3838
"semantic-release": "22.0.0",
3939
"sinon": "16.0.0"
4040
},
4141
"engines": {
42-
"node": ">=18"
42+
"node": "^18.17 || >=20.6.1"
4343
},
4444
"files": [
4545
"lib",

‎test/integration.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ test('Accept a partial "parseOpts" object as option', async (t) => {
9999

100100
test("Exclude commits if they have a matching revert commits", async (t) => {
101101
const commits = [
102-
{ hash: "123", message: "feat(scope): First feature" },
103-
{ hash: "456", message: "revert: feat(scope): First feature\n\nThis reverts commit 123.\n" },
104102
{ message: "fix(scope): First fix" },
103+
{ hash: "456", message: "revert: feat(scope): First feature\n\nThis reverts commit 123.\n" },
104+
{ hash: "123", message: "feat(scope): First feature" },
105105
];
106106
const releaseType = await analyzeCommits({}, { cwd, commits, logger: t.context.logger });
107107

108108
t.is(releaseType, "patch");
109-
t.true(t.context.log.calledWith("Analyzing commit: %s", commits[2].message));
109+
t.true(t.context.log.calledWith("Analyzing commit: %s", commits[0].message));
110110
t.true(t.context.log.calledWith("The release type for the commit is %s", "patch"));
111111
t.true(t.context.log.calledWith("Analysis of %s commits complete: %s release", 3, "patch"));
112112
});

‎test/load-parser-config.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ loadConfig.title = (providedTitle, config) => `${providedTitle} Load "${config}"
3636
test('Load "conventional-changelog-angular" by default', async (t) => {
3737
t.deepEqual(
3838
await loadParserConfig({}, { cwd }),
39-
(await (await import("conventional-changelog-angular")).default).parserOpts
39+
(await (await import("conventional-changelog-angular")).default()).parserOpts
4040
);
4141
});
4242

0 commit comments

Comments
 (0)
Please sign in to comment.