From f3b88d3e7409b0bac38cb58bd04f19506f2f6159 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Fri, 1 Sep 2023 15:57:32 -0500 Subject: [PATCH] feat(conventional-changelog-presets): supported new preset format 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 --- lib/load-parser-config.js | 6 +-- package-lock.json | 84 +++++++++++++++++++++------------ package.json | 12 ++--- test/load-parser-config.test.js | 2 +- 4 files changed, 64 insertions(+), 40 deletions(-) diff --git a/lib/load-parser-config.js b/lib/load-parser-config.js index ee4a6c0f..8c4bbdbd 100644 --- a/lib/load-parser-config.js +++ b/lib/load-parser-config.js @@ -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" diff --git a/package-lock.json b/package-lock.json index 26493e38..a6e3b074 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-development", "license": "MIT", "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", @@ -20,12 +20,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" @@ -480,6 +480,18 @@ "semantic-release": ">=20.1.0" } }, + "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-changelog-angular": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", + "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@semantic-release/commit-analyzer/node_modules/conventional-commits-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", @@ -691,6 +703,18 @@ "semantic-release": ">=20.1.0" } }, + "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-changelog-angular": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", + "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-commits-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz", @@ -1672,23 +1696,23 @@ } }, "node_modules/conventional-changelog-angular": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz", - "integrity": "sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-7.0.0.tgz", + "integrity": "sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==", "dependencies": { "compare-func": "^2.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-atom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-3.0.0.tgz", - "integrity": "sha512-pnN5bWpH+iTUWU3FaYdw5lJmfWeqSyrUkG+wyHBI9tC1dLNnHkbAOg1SzTQ7zBqiFrfo55h40VsGXWMdopwc5g==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-4.0.0.tgz", + "integrity": "sha512-q2YtiN7rnT1TGwPTwjjBSIPIzDJCRE+XAUahWxnh+buKK99Kks4WLMHoexw38GXx9OUxAsrp44f9qXe5VEMYhw==", "dev": true, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-conventionalcommits": { @@ -1704,42 +1728,42 @@ } }, "node_modules/conventional-changelog-ember": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-3.0.0.tgz", - "integrity": "sha512-7PYthCoSxIS98vWhVcSphMYM322OxptpKAuHYdVspryI0ooLDehRXWeRWgN+zWSBXKl/pwdgAg8IpLNSM1/61A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-4.0.0.tgz", + "integrity": "sha512-D0IMhwcJUg1Y8FSry6XAplEJcljkHVlvAZddhhsdbL1rbsqRsMfGx/PIkPYq0ru5aDgn+OxhQ5N5yR7P9mfsvA==", "dev": true, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-eslint": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-4.0.0.tgz", - "integrity": "sha512-nEZ9byP89hIU0dMx37JXQkE1IpMmqKtsaR24X7aM3L6Yy/uAtbb+ogqthuNYJkeO1HyvK7JsX84z8649hvp43Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-5.0.0.tgz", + "integrity": "sha512-6JtLWqAQIeJLn/OzUlYmzd9fKeNSWmQVim9kql+v4GrZwLx807kAJl3IJVc3jTYfVKWLxhC3BGUxYiuVEcVjgA==", "dev": true, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-express": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-3.0.0.tgz", - "integrity": "sha512-HqxihpUMfIuxvlPvC6HltA4ZktQEUan/v3XQ77+/zbu8No/fqK3rxSZaYeHYant7zRxQNIIli7S+qLS9tX9zQA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-4.0.0.tgz", + "integrity": "sha512-yWyy5c7raP9v7aTvPAWzqrztACNO9+FEI1FSYh7UP7YT1AkWgv5UspUeB5v3Ibv4/o60zj2o9GF2tqKQ99lIsw==", "dev": true, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-jshint": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-3.0.0.tgz", - "integrity": "sha512-bQof4byF4q+n+dwFRkJ/jGf9dCNUv4/kCDcjeCizBvfF81TeimPZBB6fT4HYbXgxxfxWXNl/i+J6T0nI4by6DA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-4.0.0.tgz", + "integrity": "sha512-LyXq1bbl0yG0Ai1SbLxIk8ZxUOe3AjnlwE6sVRQmMgetBk+4gY9EO3d00zlEt8Y8gwsITytDnPORl8al7InTjg==", "dev": true, "dependencies": { "compare-func": "^2.0.0" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/conventional-changelog-writer": { diff --git a/package.json b/package.json index 228fceab..4d17235b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/test/load-parser-config.test.js b/test/load-parser-config.test.js index 83da1506..6c3de649 100644 --- a/test/load-parser-config.test.js +++ b/test/load-parser-config.test.js @@ -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 ); });