From e57197061447eb9ea74b8d81ab003ad3b4652be6 Mon Sep 17 00:00:00 2001 From: Yasuyuki Matsumoto <42740055+ya2s@users.noreply.github.com> Date: Mon, 29 Sep 2025 22:08:29 +0900 Subject: [PATCH 1/3] feat(config-pnpm-scopes): allow global scope (#4553) --- @commitlint/config-pnpm-scopes/index.test.ts | 8 ++++---- @commitlint/config-pnpm-scopes/index.ts | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/@commitlint/config-pnpm-scopes/index.test.ts b/@commitlint/config-pnpm-scopes/index.test.ts index 5b28bf7d1e..8fd934b3e6 100644 --- a/@commitlint/config-pnpm-scopes/index.test.ts +++ b/@commitlint/config-pnpm-scopes/index.test.ts @@ -51,11 +51,11 @@ test("scope-enum has expected modifier", async () => { expect(modifier).toBe("always"); }); -test("returns empty value for empty pnpm repository", async () => { +test("returns global scope for empty pnpm repository", async () => { const { "scope-enum": fn } = config.rules; const cwd = await npm.bootstrap("fixtures/empty", __dirname); const [, , value] = await fn({ cwd }); - expect(value).toEqual([]); + expect(value).toEqual(["global"]); }); test("returns expected value for basic pnpm repository", async () => { @@ -63,7 +63,7 @@ test("returns expected value for basic pnpm repository", async () => { const cwd = await npm.bootstrap("fixtures/basic", __dirname); const [, , value] = await fn({ cwd }); - expect(value).toEqual(["a", "b"]); + expect(value).toEqual(["a", "b", "global"]); }); test("returns expected value for scoped pnpm repository", async () => { @@ -72,5 +72,5 @@ test("returns expected value for scoped pnpm repository", async () => { const [, , value] = await fn({ cwd }); - expect(value).toEqual(["a", "b"]); + expect(value).toEqual(["a", "b", "global"]); }); diff --git a/@commitlint/config-pnpm-scopes/index.ts b/@commitlint/config-pnpm-scopes/index.ts index 57283cc30a..10dde7a74c 100644 --- a/@commitlint/config-pnpm-scopes/index.ts +++ b/@commitlint/config-pnpm-scopes/index.ts @@ -69,16 +69,17 @@ function getProjects(context: any) { const cwd = ctx.cwd || process.cwd(); return findWorkspacePackages(cwd).then((projects: any) => { - return projects - .reduce((projects: any, project: any) => { - const name = project.name; + const scopes = projects.reduce((acc: any, project: any) => { + const name = project.name; - if (name) { - projects.push(name.charAt(0) === "@" ? name.split("/")[1] : name); - } + if (name) { + acc.add(name.charAt(0) === "@" ? name.split("/")[1] : name); + } + + return acc; + }, new Set()); + scopes.add("global"); - return projects; - }, []) - .sort(); + return Array.from(scopes).sort(); }); } From 82936c90a2845b4f5721eef3c71d6183416d5b78 Mon Sep 17 00:00:00 2001 From: Maciek Lamberski <166641+macieklamberski@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:41:17 +0200 Subject: [PATCH 2/3] fix(resolve-extends): add import attribute for JSON config files (#4551) * fix(resolve-extends): add import attribute for JSON config files * fix(resolve-extends): use require() for JSON files instead of import attributes --- @commitlint/resolve-extends/src/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/@commitlint/resolve-extends/src/index.ts b/@commitlint/resolve-extends/src/index.ts index 8c6942db27..b44bd3956a 100644 --- a/@commitlint/resolve-extends/src/index.ts +++ b/@commitlint/resolve-extends/src/index.ts @@ -1,3 +1,4 @@ +import { createRequire } from "node:module"; import fs from "node:fs"; import path from "node:path"; import { pathToFileURL, fileURLToPath } from "node:url"; @@ -10,6 +11,11 @@ import { validateConfig } from "@commitlint/config-validator"; import type { ParserPreset, UserConfig } from "@commitlint/types"; const dynamicImport = async (id: string): Promise => { + if (id.endsWith(".json")) { + const require = createRequire(import.meta.url); + return require(id); + } + const imported = await import( path.isAbsolute(id) ? pathToFileURL(id).toString() : id ); From a8e86d252ad9e77e0b9bd929fd8409f824727f11 Mon Sep 17 00:00:00 2001 From: escapedcat Date: Tue, 30 Sep 2025 14:31:45 +0200 Subject: [PATCH 3/3] v20.1.0 --- @alias/commitlint/CHANGELOG.md | 8 ++++++++ @alias/commitlint/package.json | 4 ++-- @commitlint/cli/CHANGELOG.md | 8 ++++++++ @commitlint/cli/package.json | 4 ++-- @commitlint/config-pnpm-scopes/CHANGELOG.md | 11 +++++++++++ @commitlint/config-pnpm-scopes/package.json | 2 +- @commitlint/core/CHANGELOG.md | 8 ++++++++ @commitlint/core/package.json | 4 ++-- @commitlint/cz-commitlint/CHANGELOG.md | 8 ++++++++ @commitlint/cz-commitlint/package.json | 4 ++-- @commitlint/load/CHANGELOG.md | 8 ++++++++ @commitlint/load/package.json | 4 ++-- @commitlint/prompt-cli/CHANGELOG.md | 8 ++++++++ @commitlint/prompt-cli/package.json | 4 ++-- @commitlint/prompt/CHANGELOG.md | 8 ++++++++ @commitlint/prompt/package.json | 4 ++-- @commitlint/resolve-extends/CHANGELOG.md | 11 +++++++++++ @commitlint/resolve-extends/package.json | 2 +- @commitlint/travis-cli/CHANGELOG.md | 8 ++++++++ @commitlint/travis-cli/package.json | 4 ++-- CHANGELOG.md | 16 ++++++++++++++++ lerna.json | 2 +- 22 files changed, 121 insertions(+), 19 deletions(-) diff --git a/@alias/commitlint/CHANGELOG.md b/@alias/commitlint/CHANGELOG.md index bdf200d130..1b3070e71a 100644 --- a/@alias/commitlint/CHANGELOG.md +++ b/@alias/commitlint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package commitlint + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package commitlint diff --git a/@alias/commitlint/package.json b/@alias/commitlint/package.json index 26a439bfff..d268076b51 100644 --- a/@alias/commitlint/package.json +++ b/@alias/commitlint/package.json @@ -1,7 +1,7 @@ { "name": "commitlint", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Lint your commit messages", "files": [ "cli.js" @@ -36,7 +36,7 @@ }, "license": "MIT", "dependencies": { - "@commitlint/cli": "^20.0.0", + "@commitlint/cli": "^20.1.0", "@commitlint/types": "^20.0.0" }, "devDependencies": { diff --git a/@commitlint/cli/CHANGELOG.md b/@commitlint/cli/CHANGELOG.md index 6d2653b48d..7d1038bbea 100644 --- a/@commitlint/cli/CHANGELOG.md +++ b/@commitlint/cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/cli + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/cli diff --git a/@commitlint/cli/package.json b/@commitlint/cli/package.json index 3f75d94eff..7a5ccfc778 100644 --- a/@commitlint/cli/package.json +++ b/@commitlint/cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/cli", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Lint your commit messages", "files": [ "index.cjs", @@ -50,7 +50,7 @@ "dependencies": { "@commitlint/format": "^20.0.0", "@commitlint/lint": "^20.0.0", - "@commitlint/load": "^20.0.0", + "@commitlint/load": "^20.1.0", "@commitlint/read": "^20.0.0", "@commitlint/types": "^20.0.0", "tinyexec": "^1.0.0", diff --git a/@commitlint/config-pnpm-scopes/CHANGELOG.md b/@commitlint/config-pnpm-scopes/CHANGELOG.md index e791537348..27daf022c2 100644 --- a/@commitlint/config-pnpm-scopes/CHANGELOG.md +++ b/@commitlint/config-pnpm-scopes/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + + +### Features + +* **config-pnpm-scopes:** allow global scope ([#4553](https://github.com/conventional-changelog/commitlint/issues/4553)) ([e571970](https://github.com/conventional-changelog/commitlint/commit/e57197061447eb9ea74b8d81ab003ad3b4652be6)) + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/config-pnpm-scopes diff --git a/@commitlint/config-pnpm-scopes/package.json b/@commitlint/config-pnpm-scopes/package.json index c8e0b376e1..861dffcf97 100644 --- a/@commitlint/config-pnpm-scopes/package.json +++ b/@commitlint/config-pnpm-scopes/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/config-pnpm-scopes", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Shareable commitlint config enforcing pnpm workspaces names as scopes", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/@commitlint/core/CHANGELOG.md b/@commitlint/core/CHANGELOG.md index a8b7356e3c..51c59d17ca 100644 --- a/@commitlint/core/CHANGELOG.md +++ b/@commitlint/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/core + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/core diff --git a/@commitlint/core/package.json b/@commitlint/core/package.json index 00e22fac4e..1407cce57f 100644 --- a/@commitlint/core/package.json +++ b/@commitlint/core/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/core", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Lint your commit messages", "main": "lib/core.js", "types": "lib/core.d.ts", @@ -38,7 +38,7 @@ "dependencies": { "@commitlint/format": "^20.0.0", "@commitlint/lint": "^20.0.0", - "@commitlint/load": "^20.0.0", + "@commitlint/load": "^20.1.0", "@commitlint/read": "^20.0.0" }, "devDependencies": { diff --git a/@commitlint/cz-commitlint/CHANGELOG.md b/@commitlint/cz-commitlint/CHANGELOG.md index 8f88dd471c..7f1b3bc6b8 100644 --- a/@commitlint/cz-commitlint/CHANGELOG.md +++ b/@commitlint/cz-commitlint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/cz-commitlint + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/cz-commitlint diff --git a/@commitlint/cz-commitlint/package.json b/@commitlint/cz-commitlint/package.json index f0d1d53369..dd10160dda 100644 --- a/@commitlint/cz-commitlint/package.json +++ b/@commitlint/cz-commitlint/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/cz-commitlint", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Commitizen adapter using the commitlint.config.js", "main": "./lib/index.js", "exports": { @@ -44,7 +44,7 @@ }, "dependencies": { "@commitlint/ensure": "^20.0.0", - "@commitlint/load": "^20.0.0", + "@commitlint/load": "^20.1.0", "@commitlint/types": "^20.0.0", "chalk": "^5.3.0", "lodash.isplainobject": "^4.0.6", diff --git a/@commitlint/load/CHANGELOG.md b/@commitlint/load/CHANGELOG.md index 5b97964c51..0e17e68544 100644 --- a/@commitlint/load/CHANGELOG.md +++ b/@commitlint/load/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/load + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/load diff --git a/@commitlint/load/package.json b/@commitlint/load/package.json index cf663c1c01..583a00ee61 100644 --- a/@commitlint/load/package.json +++ b/@commitlint/load/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/load", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Load shared commitlint configuration", "main": "lib/load.js", "types": "lib/load.d.ts", @@ -47,7 +47,7 @@ "dependencies": { "@commitlint/config-validator": "^20.0.0", "@commitlint/execute-rule": "^20.0.0", - "@commitlint/resolve-extends": "^20.0.0", + "@commitlint/resolve-extends": "^20.1.0", "@commitlint/types": "^20.0.0", "chalk": "^5.3.0", "cosmiconfig": "^9.0.0", diff --git a/@commitlint/prompt-cli/CHANGELOG.md b/@commitlint/prompt-cli/CHANGELOG.md index 3b62bb3296..dd443bf1b9 100644 --- a/@commitlint/prompt-cli/CHANGELOG.md +++ b/@commitlint/prompt-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/prompt-cli + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/prompt-cli diff --git a/@commitlint/prompt-cli/package.json b/@commitlint/prompt-cli/package.json index 45360d532b..830198ec30 100644 --- a/@commitlint/prompt-cli/package.json +++ b/@commitlint/prompt-cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/prompt-cli", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "commit prompt using commitlint.config.js", "main": "cli.js", "files": [ @@ -38,7 +38,7 @@ "@commitlint/utils": "^20.0.0" }, "dependencies": { - "@commitlint/prompt": "^20.0.0", + "@commitlint/prompt": "^20.1.0", "inquirer": "^9.2.15", "tinyexec": "^1.0.0" }, diff --git a/@commitlint/prompt/CHANGELOG.md b/@commitlint/prompt/CHANGELOG.md index 548cd69083..f3804b12ac 100644 --- a/@commitlint/prompt/CHANGELOG.md +++ b/@commitlint/prompt/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/prompt + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/prompt diff --git a/@commitlint/prompt/package.json b/@commitlint/prompt/package.json index d6bcb5b283..3d57dc6c3e 100644 --- a/@commitlint/prompt/package.json +++ b/@commitlint/prompt/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/prompt", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "commitizen prompt using commitlint.config.js", "main": "./lib/index.js", "files": [ @@ -46,7 +46,7 @@ }, "dependencies": { "@commitlint/ensure": "^20.0.0", - "@commitlint/load": "^20.0.0", + "@commitlint/load": "^20.1.0", "@commitlint/types": "^20.0.0", "chalk": "^5.3.0", "inquirer": "^9.2.15" diff --git a/@commitlint/resolve-extends/CHANGELOG.md b/@commitlint/resolve-extends/CHANGELOG.md index bc1f1cf23d..70308b3a70 100644 --- a/@commitlint/resolve-extends/CHANGELOG.md +++ b/@commitlint/resolve-extends/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + + +### Bug Fixes + +* **resolve-extends:** add import attribute for JSON config files ([#4551](https://github.com/conventional-changelog/commitlint/issues/4551)) ([82936c9](https://github.com/conventional-changelog/commitlint/commit/82936c90a2845b4f5721eef3c71d6183416d5b78)) + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/resolve-extends diff --git a/@commitlint/resolve-extends/package.json b/@commitlint/resolve-extends/package.json index 65b22693be..87bd312318 100644 --- a/@commitlint/resolve-extends/package.json +++ b/@commitlint/resolve-extends/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/resolve-extends", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Lint your commit messages", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/@commitlint/travis-cli/CHANGELOG.md b/@commitlint/travis-cli/CHANGELOG.md index 4f6fa54d40..579b28545c 100644 --- a/@commitlint/travis-cli/CHANGELOG.md +++ b/@commitlint/travis-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + +**Note:** Version bump only for package @commitlint/travis-cli + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) **Note:** Version bump only for package @commitlint/travis-cli diff --git a/@commitlint/travis-cli/package.json b/@commitlint/travis-cli/package.json index b21a0cad6f..ed08b7cf2b 100644 --- a/@commitlint/travis-cli/package.json +++ b/@commitlint/travis-cli/package.json @@ -1,7 +1,7 @@ { "name": "@commitlint/travis-cli", "type": "module", - "version": "20.0.0", + "version": "20.1.0", "description": "Lint all relevant commits for a change or PR on Travis CI", "main": "lib/cli.js", "types": "lib/cli.d.ts", @@ -43,7 +43,7 @@ "@commitlint/utils": "^20.0.0" }, "dependencies": { - "@commitlint/cli": "^20.0.0", + "@commitlint/cli": "^20.1.0", "tinyexec": "^1.0.0" }, "gitHead": "e82f05a737626bb69979d14564f5ff601997f679" diff --git a/CHANGELOG.md b/CHANGELOG.md index d35bb415e2..27d8b8092c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [20.1.0](https://github.com/conventional-changelog/commitlint/compare/v20.0.0...v20.1.0) (2025-09-30) + + +### Bug Fixes + +* **resolve-extends:** add import attribute for JSON config files ([#4551](https://github.com/conventional-changelog/commitlint/issues/4551)) ([82936c9](https://github.com/conventional-changelog/commitlint/commit/82936c90a2845b4f5721eef3c71d6183416d5b78)) + + +### Features + +* **config-pnpm-scopes:** allow global scope ([#4553](https://github.com/conventional-changelog/commitlint/issues/4553)) ([e571970](https://github.com/conventional-changelog/commitlint/commit/e57197061447eb9ea74b8d81ab003ad3b4652be6)) + + + + + # [20.0.0](https://github.com/conventional-changelog/commitlint/compare/v19.9.1...v20.0.0) (2025-09-25) diff --git a/lerna.json b/lerna.json index 31e5726446..b007de9a8f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,4 @@ { "npmClient": "yarn", - "version": "20.0.0" + "version": "20.1.0" }