From a68167199e131e1f72fd259d45848112744a3982 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Fri, 1 Sep 2023 17:18:01 -0500 Subject: [PATCH 1/5] 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-changelog-config.js | 12 ++--- package-lock.json | 84 +++++++++++++++++++----------- package.json | 16 +++--- test/integration.test.js | 3 +- test/load-changelog-config.test.js | 15 +++--- 5 files changed, 75 insertions(+), 55 deletions(-) diff --git a/lib/load-changelog-config.js b/lib/load-changelog-config.js index f2b21dbd..8b9dd489 100644 --- a/lib/load-changelog-config.js +++ b/lib/load-changelog-config.js @@ -25,19 +25,13 @@ export default async ({ preset, config, parserOpts, writerOpts, presetConfig }, 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 { parserOpts: { ...loadedConfig.parserOpts, ...parserOpts }, writerOpts: { ...loadedConfig.writerOpts, ...writerOpts }, diff --git a/package-lock.json b/package-lock.json index 4afdd218..a6bf7d26 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-changelog-writer": "^6.0.0", "conventional-commits-filter": "^4.0.0", "conventional-commits-parser": "^5.0.0", @@ -23,12 +23,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": "7.0.1", - "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", "escape-string-regexp": "5.0.0", "fs-extra": "11.1.1", "prettier": "3.0.3", @@ -474,6 +474,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-filter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", @@ -639,6 +651,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-filter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", @@ -1352,23 +1376,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": { @@ -1384,42 +1408,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 4bfead53..66a3be2f 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "Gregor Martynus (https://twitter.com/gr2m)" ], "dependencies": { - "conventional-changelog-angular": "^6.0.0", + "conventional-changelog-angular": "^7.0.0", "conventional-changelog-writer": "^6.0.0", "conventional-commits-filter": "^4.0.0", "conventional-commits-parser": "^5.0.0", @@ -25,12 +25,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": "7.0.1", - "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", "escape-string-regexp": "5.0.0", "fs-extra": "11.1.1", "prettier": "3.0.3", @@ -92,8 +92,8 @@ "lint:fix": "prettier --write \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"", "pretest": "npm run lint", "semantic-release": "semantic-release", - "test": "c8 ava -v", - "test:ci": "c8 ava -v" + "test": "c8 ava --verbose", + "test:ci": "c8 ava --verbose" }, "type": "module", "ava": { diff --git a/test/integration.test.js b/test/integration.test.js index 4764c316..4c380107 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -6,6 +6,7 @@ import escape from "escape-string-regexp"; import { temporaryDirectory } from "tempy"; import * as td from "testdouble"; import streamBuffers from "stream-buffers"; +import conventionalChangelogEslint from "conventional-changelog-eslint"; const cwd = process.cwd(); const host = "https://github.com"; @@ -178,7 +179,7 @@ test.serial('Accept a "parseOpts" and "writerOpts" objects as option', async (t) referenceActions: ["keyword"], issuePrefixes: ["#", "JIRA-"], }, - writerOpts: (await promisify((await import("conventional-changelog-eslint")).default)()).writerOpts, + writerOpts: (await conventionalChangelogEslint()).writerOpts, }, { cwd, options: { repositoryUrl }, lastRelease, nextRelease, commits } ); diff --git a/test/load-changelog-config.test.js b/test/load-changelog-config.test.js index 40c3a724..45830037 100644 --- a/test/load-changelog-config.test.js +++ b/test/load-changelog-config.test.js @@ -1,4 +1,5 @@ import test from "ava"; +import conventionalChangelogAngular from "conventional-changelog-angular"; import loadChangelogConfig from "../lib/load-changelog-config.js"; const cwd = process.cwd(); @@ -42,7 +43,7 @@ loadConfig.title = (providedTitle, config) => `${providedTitle} Load "${config}" test('Load "conventional-changelog-angular" by default', async (t) => { const changelogConfig = await loadChangelogConfig({}, { cwd }); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.deepEqual(changelogConfig.parserOpts, angularChangelogConfig.parserOpts); t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts); @@ -54,7 +55,7 @@ test('Accept a "parserOpts" object as option', async (t) => { headerCorrespondence: ["tag", "shortDesc"], }; const changelogConfig = await loadChangelogConfig({ parserOpts: customParserOptions }, { cwd }); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); @@ -65,7 +66,7 @@ test('Accept a "parserOpts" object as option', async (t) => { test('Accept a "writerOpts" object as option', async (t) => { const customWriterOptions = { commitGroupsSort: "title", commitsSort: ["scope", "subject"] }; const changelogConfig = await loadChangelogConfig({ writerOpts: customWriterOptions }, { cwd }); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort); t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort); @@ -79,7 +80,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a preset', a headerCorrespondence: ["tag", "shortDesc"], }; const changelogConfig = await loadChangelogConfig({ parserOpts: customParserOptions, preset: "angular" }, { cwd }); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); @@ -90,7 +91,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a preset', a test('Accept a "writerOpts" object as option that overwrite a preset', async (t) => { const customWriterOptions = { commitGroupsSort: "title", commitsSort: ["scope", "subject"] }; const changelogConfig = await loadChangelogConfig({ writerOpts: customWriterOptions, preset: "angular" }, { cwd }); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort); t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort); @@ -110,7 +111,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a config', a }, { cwd } ); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); @@ -127,7 +128,7 @@ test('Accept a "writerOpts" object as option that overwrite a config', async (t) }, { cwd } ); - const angularChangelogConfig = await (await import("conventional-changelog-angular")).default; + const angularChangelogConfig = await conventionalChangelogAngular(); t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort); t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort); From 4fe35635f8186ab42fa604d2ef85819b07f43f53 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Tue, 5 Sep 2023 23:02:39 -0500 Subject: [PATCH 2/5] fix(deps): update dependency conventional-changlog-writer to v7 --- package-lock.json | 117 +++++++++++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 92 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index a6bf7d26..1a6e8180 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "conventional-changelog-angular": "^7.0.0", - "conventional-changelog-writer": "^6.0.0", + "conventional-changelog-writer": "^7.0.0", "conventional-commits-filter": "^4.0.0", "conventional-commits-parser": "^5.0.0", "debug": "^4.0.0", @@ -663,6 +663,27 @@ "node": ">=14" } }, + "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-changelog-writer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.1.tgz", + "integrity": "sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==", + "dev": true, + "dependencies": { + "conventional-commits-filter": "^3.0.0", + "dateformat": "^3.0.3", + "handlebars": "^4.7.7", + "json-stringify-safe": "^5.0.1", + "meow": "^8.1.2", + "semver": "^7.0.0", + "split": "^1.0.1" + }, + "bin": { + "conventional-changelog-writer": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@semantic-release/release-notes-generator/node_modules/conventional-commits-filter": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", @@ -685,7 +706,8 @@ "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", - "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" + "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -1020,6 +1042,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, "engines": { "node": ">=6" } @@ -1028,6 +1051,7 @@ "version": "6.2.2", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, "dependencies": { "camelcase": "^5.3.1", "map-obj": "^4.0.0", @@ -1447,35 +1471,33 @@ } }, "node_modules/conventional-changelog-writer": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-6.0.1.tgz", - "integrity": "sha512-359t9aHorPw+U+nHzUXHS5ZnPBOizRxfQsWT5ZDHBfvfxQOAik+yfuhKXG66CN5LEWPpMNnIMHUTCKeYNprvHQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-7.0.0.tgz", + "integrity": "sha512-9/6vTDd3wDbH9yayZNOq53UWI4QqYlbiLBtWf+alsQA/bBFHG+k3KnQ8Fu/xzHqsbQfzPg3w1H1piWYn/GD9Tw==", "dependencies": { - "conventional-commits-filter": "^3.0.0", - "dateformat": "^3.0.3", + "conventional-commits-filter": "^4.0.0", "handlebars": "^4.7.7", "json-stringify-safe": "^5.0.1", - "meow": "^8.1.2", - "semver": "^7.0.0", - "split": "^1.0.1" + "meow": "^12.0.1", + "semver": "^7.5.2", + "split2": "^4.0.0" }, "bin": { - "conventional-changelog-writer": "cli.js" + "conventional-changelog-writer": "cli.mjs" }, "engines": { - "node": ">=14" + "node": ">=16" } }, - "node_modules/conventional-changelog-writer/node_modules/conventional-commits-filter": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-3.0.0.tgz", - "integrity": "sha512-1ymej8b5LouPx9Ox0Dw/qAO2dVdfpRFq28e5Y0jJEU8ZrLdy0vOSkkIInwmxErFGhg6SALro60ZrwYFVTUDo4Q==", - "dependencies": { - "lodash.ismatch": "^4.4.0", - "modify-values": "^1.0.1" - }, + "node_modules/conventional-changelog-writer/node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", "engines": { - "node": ">=14" + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/conventional-commits-filter": { @@ -1651,6 +1673,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true, "engines": { "node": "*" } @@ -1680,6 +1703,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1688,6 +1712,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dev": true, "dependencies": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -1703,6 +1728,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2208,6 +2234,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, "engines": { "node": ">=6" } @@ -2248,6 +2275,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -2504,6 +2532,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2723,6 +2752,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2788,7 +2818,8 @@ "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", - "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==" + "integrity": "sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==", + "dev": true }, "node_modules/lodash.isplainobject": { "version": "4.0.6", @@ -2850,6 +2881,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, "engines": { "node": ">=8" }, @@ -2936,6 +2968,7 @@ "version": "8.1.2", "resolved": "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz", "integrity": "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==", + "dev": true, "dependencies": { "@types/minimist": "^1.2.0", "camelcase-keys": "^6.2.2", @@ -2960,6 +2993,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -2971,22 +3005,26 @@ "node_modules/meow/node_modules/hosted-git-info": { "version": "2.8.9", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true }, "node_modules/meow/node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/meow/node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/meow/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -2998,6 +3036,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -3012,6 +3051,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -3023,6 +3063,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -3040,6 +3081,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, "dependencies": { "@types/normalize-package-data": "^2.4.0", "normalize-package-data": "^2.5.0", @@ -3054,6 +3096,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, "dependencies": { "find-up": "^4.1.0", "read-pkg": "^5.2.0", @@ -3070,6 +3113,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, "engines": { "node": ">=8" } @@ -3078,6 +3122,7 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, "dependencies": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -3089,6 +3134,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, "engines": { "node": ">=8" } @@ -3097,6 +3143,7 @@ "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, "bin": { "semver": "bin/semver" } @@ -3105,6 +3152,7 @@ "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, "engines": { "node": ">=10" } @@ -3165,6 +3213,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, "engines": { "node": ">=4" } @@ -3193,6 +3242,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, "dependencies": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0", @@ -3206,6 +3256,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3214,6 +3265,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3257,6 +3309,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -6587,6 +6640,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, "engines": { "node": ">=6" } @@ -6657,6 +6711,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -6682,7 +6737,8 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/path-type": { "version": "4.0.0", @@ -6905,6 +6961,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, "engines": { "node": ">=8" } @@ -7118,6 +7175,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, "dependencies": { "indent-string": "^4.0.0", "strip-indent": "^3.0.0" @@ -7130,6 +7188,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, "engines": { "node": ">=8" } @@ -7168,6 +7227,7 @@ "version": "1.22.4", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -7688,6 +7748,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "dev": true, "dependencies": { "through": "2" }, @@ -7827,6 +7888,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, "dependencies": { "min-indent": "^1.0.0" }, @@ -7909,6 +7971,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -8050,6 +8113,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, "engines": { "node": ">=8" } @@ -8058,6 +8122,7 @@ "version": "0.18.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 66a3be2f..66bb25f1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "dependencies": { "conventional-changelog-angular": "^7.0.0", - "conventional-changelog-writer": "^6.0.0", + "conventional-changelog-writer": "^7.0.0", "conventional-commits-filter": "^4.0.0", "conventional-commits-parser": "^5.0.0", "debug": "^4.0.0", From 8a042da4945bff92c773bacfc9136d20f237d57c Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Sun, 10 Sep 2023 09:30:02 -0500 Subject: [PATCH 3/5] test(integration): reversed the list of commits to align with conventional-changelog expectations based on https://github.com/conventional-changelog/conventional-changelog/issues/1121#issuecomment-1709206347. however, assuming the previous order actually aligned with how core provides the list, this will need to be coordinated with reversing that list somewhere --- test/integration.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration.test.js b/test/integration.test.js index 4c380107..1db7b017 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -610,9 +610,9 @@ test.serial("Ignore malformatted commits and include valid ones", async (t) => { test.serial("Exclude commits if they have a matching revert commits", async (t) => { const { generateNotes } = await import("../index.js"); const commits = [ - { hash: "111", message: "fix(scope1): First fix" }, - { hash: "222", message: "feat(scope2): First feature" }, { hash: "333", message: "revert: feat(scope2): First feature\n\nThis reverts commit 222.\n" }, + { hash: "222", message: "feat(scope2): First feature" }, + { hash: "111", message: "fix(scope1): First fix" }, ]; const changelog = await generateNotes({}, { cwd, options: { repositoryUrl }, lastRelease, nextRelease, commits }); From 73d53562c2fcff6d90011456b87fb3b178922e49 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Sat, 16 Sep 2023 23:24:18 -0500 Subject: [PATCH 4/5] test(writer-opts): compared the transform function accounting for generation with each load as confirmed in https://github.com/conventional-changelog/conventional-changelog/issues/1121#issuecomment-1708376158 --- test/load-changelog-config.test.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/load-changelog-config.test.js b/test/load-changelog-config.test.js index 45830037..65b5c32e 100644 --- a/test/load-changelog-config.test.js +++ b/test/load-changelog-config.test.js @@ -4,6 +4,21 @@ import loadChangelogConfig from "../lib/load-changelog-config.js"; const cwd = process.cwd(); +/** + * assertion to compare loaded writerOpts with the expected writerOpts from the angular preset + * + * @param {Object} t AVA assertion library. + * @param {Object} loadedWriterOpts + * @param {Object} angularPresetWriterOpts + */ +function assertWriterOptsAreFromAngularPreset(t, loadedWriterOpts, angularPresetWriterOpts) { + const { transform: loadedTransform, ...loadedWriterOptsWithoutTransform } = loadedWriterOpts; + const { transform: angularPresetTransform, ...angularPresetWriterOptsWithoutTransform } = angularPresetWriterOpts; + + t.deepEqual(loadedWriterOptsWithoutTransform, angularPresetWriterOptsWithoutTransform); + t.is(loadedTransform.toString(), angularPresetTransform.toString()); +} + /** * AVA macro to verify that `loadChangelogConfig` return a config object with parserOpts and writerOpts. * @@ -46,7 +61,7 @@ test('Load "conventional-changelog-angular" by default', async (t) => { const angularChangelogConfig = await conventionalChangelogAngular(); t.deepEqual(changelogConfig.parserOpts, angularChangelogConfig.parserOpts); - t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts); + assertWriterOptsAreFromAngularPreset(t, changelogConfig.writerOpts, angularChangelogConfig.writerOpts); }); test('Accept a "parserOpts" object as option', async (t) => { @@ -60,7 +75,7 @@ test('Accept a "parserOpts" object as option', async (t) => { t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); t.deepEqual(changelogConfig.parserOpts.noteKeywords, angularChangelogConfig.parserOpts.noteKeywords); - t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts); + assertWriterOptsAreFromAngularPreset(t, changelogConfig.writerOpts, angularChangelogConfig.writerOpts); }); test('Accept a "writerOpts" object as option', async (t) => { @@ -85,7 +100,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a preset', a t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); t.truthy(changelogConfig.parserOpts.noteKeywords); - t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts); + assertWriterOptsAreFromAngularPreset(t, changelogConfig.writerOpts, angularChangelogConfig.writerOpts); }); test('Accept a "writerOpts" object as option that overwrite a preset', async (t) => { @@ -116,7 +131,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a config', a t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern); t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence); t.truthy(changelogConfig.parserOpts.noteKeywords); - t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts); + assertWriterOptsAreFromAngularPreset(t, changelogConfig.writerOpts, angularChangelogConfig.writerOpts); }); test('Accept a "writerOpts" object as option that overwrite a config', async (t) => { From 9c4e5f58a167acb9520594dfed248d1542cb4f31 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Sat, 16 Sep 2023 23:34:50 -0500 Subject: [PATCH 5/5] feat(node-versions): raised the minimum node version to v18.17 and dropped v19 support BREAKING CHANGE: the minimum required node version is now v18.17, v19 support has been dropped, and the minimum required in the v20 range is v20.6.1 --- .github/workflows/test.yml | 5 +++-- .nvmrc | 1 + package-lock.json | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 844a0189..8438179f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,9 @@ jobs: strategy: matrix: node-version: - - 18.0.0 - - 19 + - 18.17.0 + - 20.6.1 + - 20 os: - ubuntu-latest runs-on: "${{ matrix.os }}" diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..3f430af8 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18 diff --git a/package-lock.json b/package-lock.json index 16d9b989..194e8767 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,7 @@ "testdouble": "3.19.0" }, "engines": { - "node": ">=18" + "node": "^18.17 || >=20.6.1" }, "peerDependencies": { "semantic-release": ">=20.1.0" diff --git a/package.json b/package.json index abddd572..3d55844a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "testdouble": "3.19.0" }, "engines": { - "node": ">=18" + "node": "^18.17 || >=20.6.1" }, "files": [ "lib",