commitizen 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +45 -0
- package/.github/workflows/release.yml +9 -4
- package/CONTRIBUTING.md +21 -3
- package/README.md +7 -4
- package/babel.config.js +1 -1
- package/junit-testresults.xml +152 -0
- package/package.json +31 -6
- package/azure-pipelines.yml +0 -24
- package/jobs/build.yml +0 -49
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
|
|
7
|
+
# Cancel superseded runs for the same branch or pull request.
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
node:
|
|
19
|
+
- 22
|
|
20
|
+
- 24
|
|
21
|
+
- 26
|
|
22
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
|
|
27
|
+
- uses: actions/setup-node@v7
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node }}
|
|
30
|
+
|
|
31
|
+
# The tests create git repositories and commit to them.
|
|
32
|
+
- run: |
|
|
33
|
+
git config --global user.email "example@example.com"
|
|
34
|
+
git config --global user.name "Example Git User"
|
|
35
|
+
|
|
36
|
+
# The exact version is pinned in package.json "packageManager".
|
|
37
|
+
- run: npm install -g pnpm@12
|
|
38
|
+
|
|
39
|
+
# `prepare` builds dist/ during install. The init tests drive real
|
|
40
|
+
# npm/yarn/pnpm installs using the pinned npm-cli/yarn-cli devDependencies.
|
|
41
|
+
- run: pnpm install --frozen-lockfile
|
|
42
|
+
|
|
43
|
+
- run: pnpm test
|
|
44
|
+
|
|
45
|
+
- run: pnpm run check-coverage
|
|
@@ -13,15 +13,20 @@ jobs:
|
|
|
13
13
|
issues: write
|
|
14
14
|
pull-requests: write
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
17
|
-
- uses: actions/setup-node@
|
|
16
|
+
- uses: actions/checkout@v7
|
|
17
|
+
- uses: actions/setup-node@v7
|
|
18
18
|
with:
|
|
19
19
|
# semantic-release 26 requires Node >= 26.13
|
|
20
20
|
node-version: 26
|
|
21
|
-
# npm@latest
|
|
22
|
-
#
|
|
21
|
+
# npm@latest: releases are staged with `npm stage publish` (see
|
|
22
|
+
# "release" in package.json), signed in through npm trusted publishing
|
|
23
|
+
# (OIDC). A maintainer approves each staged version with 2FA.
|
|
23
24
|
- run: npm install -g npm@latest pnpm@12
|
|
24
25
|
- run: pnpm install --frozen-lockfile
|
|
26
|
+
- run: |
|
|
27
|
+
git config --global user.email "example@example.com"
|
|
28
|
+
git config --global user.name "Example Git User"
|
|
29
|
+
- run: pnpm test
|
|
25
30
|
- run: pnpm run semantic-release
|
|
26
31
|
env:
|
|
27
32
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/CONTRIBUTING.md
CHANGED
|
@@ -4,9 +4,8 @@ Thanks for considering a contribution to commitizen!
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
* **Node.js 22
|
|
8
|
-
|
|
9
|
-
commitizen itself only needs Node.js 22.12 or newer.
|
|
7
|
+
* **The latest Node.js 22, 24 or 26**, at least 22.23.5, 24.22.3 or 26.13.1
|
|
8
|
+
(the November 2026 security releases). This is also what Babel 8 needs.
|
|
10
9
|
The supported development range is declared in `devEngines.runtime` in
|
|
11
10
|
`package.json`, and pnpm refuses to install with a Node.js outside it. If your
|
|
12
11
|
`node` is managed by pnpm, pnpm picks a matching version for this repository
|
|
@@ -59,6 +58,25 @@ which semantic-release requires.
|
|
|
59
58
|
|
|
60
59
|
All other commit types will trigger no new release.
|
|
61
60
|
|
|
61
|
+
Releases are staged, not published straight to npm. When a release commit lands
|
|
62
|
+
on `master`, the release workflow tags the version, runs `npm stage publish`
|
|
63
|
+
(signed in through npm trusted publishing) and creates a draft GitHub release.
|
|
64
|
+
Nothing reaches npm until a maintainer with publish rights approves it with 2FA,
|
|
65
|
+
using npm 12 or newer:
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
npm stage list commitizen
|
|
69
|
+
npm stage download <stage-id> # optional: inspect the tarball
|
|
70
|
+
npm stage approve <stage-id>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then publish the draft release at
|
|
74
|
+
https://github.com/commitizen/cz-cli/releases.
|
|
75
|
+
|
|
76
|
+
To abandon a staged version instead, run `npm stage reject <stage-id>`,
|
|
77
|
+
delete the draft release, and delete its tag (`git push origin :refs/tags/vX.Y.Z`)
|
|
78
|
+
so the next release can reuse the version.
|
|
79
|
+
|
|
62
80
|
## Gotchas
|
|
63
81
|
|
|
64
82
|
### Editors that strip trailing whitespace can break tests
|
package/README.md
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
When you commit with Commitizen, you'll be prompted to fill out any required commit fields at commit time. No more waiting until later for a git commit hook to run and reject your commit (though [that](https://github.com/kentcdodds/validate-commit-msg) can still be helpful). No more digging through [CONTRIBUTING.md](CONTRIBUTING.md) to find what the preferred format is. Get instant feedback on your commit message formatting and be prompted for required fields.
|
|
4
4
|
|
|
5
|
-
[](#backers) [](#sponsors) [](#backers) [](#sponsors) [](https://github.com/commitizen/cz-cli/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/commitizen) [](https://www.npmjs.com/package/commitizen) [](https://github.com/semantic-release/semantic-release) [](https://stackoverflow.com/tags/commitizen)
|
|
7
7
|
|
|
8
8
|
## Installing the command line tool
|
|
9
9
|
|
|
10
|
-
Commitizen requires Node.js 22.
|
|
10
|
+
Commitizen requires Node.js 22.23.5+, 24.22.3+ or 26.13.1+ (the November 2026
|
|
11
|
+
security releases) and is tested against Node.js 22, 24 & 26. Use the latest
|
|
12
|
+
release of your line.
|
|
11
13
|
|
|
12
14
|
Installation is as simple as running the following command (if you see `EACCES` error, reading [fixing npm permissions](https://docs.npmjs.com/getting-started/fixing-npm-permissions) may help):
|
|
13
15
|
|
|
@@ -172,12 +174,12 @@ For `husky` users, add the following configuration to the project's `package.jso
|
|
|
172
174
|
Add the "Commitizen friendly" badge to your README using the following markdown:
|
|
173
175
|
|
|
174
176
|
```
|
|
175
|
-
[](
|
|
177
|
+
[](https://commitizen.github.io/cz-cli/)
|
|
176
178
|
```
|
|
177
179
|
|
|
178
180
|
Your badge will look like this:
|
|
179
181
|
|
|
180
|
-
[](
|
|
182
|
+
[](https://commitizen.github.io/cz-cli/)
|
|
181
183
|
|
|
182
184
|
It may also make sense to change your `README.md` or `CONTRIBUTING.md` files to include or link to the Commitizen project so that your new contributors may learn more about installing and using Commitizen.
|
|
183
185
|
|
|
@@ -279,6 +281,7 @@ We know that every project and build process has different requirements, so we'v
|
|
|
279
281
|
- [cz-emoji-conventional](https://www.npmjs.com/package/cz-emoji-conventional)
|
|
280
282
|
- [cz-git](https://github.com/Zhengqbbb/cz-git)
|
|
281
283
|
- [cz-vinyl](https://github.com/Exlint/cz-vinyl)
|
|
284
|
+
- [commit-jazzer](https://github.com/Zilero232/commit-jazzer)
|
|
282
285
|
|
|
283
286
|
To create an adapter, just fork one of these great adapters and modify it to suit your needs. We pass you an instance of [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/), but you can capture input using whatever means necessary. Just call the `commit` callback with a string and we'll be happy. Publish it to npm, and you'll be all set!
|
|
284
287
|
|
package/babel.config.js
CHANGED
|
@@ -11,7 +11,7 @@ module.exports = (api) => {
|
|
|
11
11
|
"@babel/preset-env",
|
|
12
12
|
{
|
|
13
13
|
targets: {
|
|
14
|
-
node: "22.
|
|
14
|
+
node: "22.23.5",
|
|
15
15
|
},
|
|
16
16
|
// Babel 8 no longer converts ES modules to CommonJS by default. dist/
|
|
17
17
|
// must stay CommonJS: adapters and other consumers require('commitizen').
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<testsuite name="Mocha Tests" tests="150" failures="0" errors="0" skipped="1" timestamp="Thu, 03 Dec 2026 16:46:47 GMT" time="46.97">
|
|
2
|
+
<testcase classname="adapter" name="resolves adapter paths" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="4.873"/>
|
|
3
|
+
<testcase classname="adapter" name="resolves scoped adapter paths" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.359"/>
|
|
4
|
+
<testcase classname="adapter" name="gets adapter prompter functions" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"><skipped/></testcase>
|
|
5
|
+
<testcase classname="adapter" name="gets adapter prompter functions for default export adapters" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.717"/>
|
|
6
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="maps npm flags" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
7
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="uses --save for a prod install (save without saveDev)" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
8
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="maps yarn flags" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
9
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="maps pnpm flags and always ignores dependency build scripts" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
10
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="pnpm adds --save-exact for either `exact` or `saveExact`" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
11
|
+
<testcase classname="adapter (unit) getInstallStringMappings" name="falls back to the npm mapping for an unknown package manager" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
12
|
+
<testcase classname="adapter (unit) generateInstallAdapterCommand" name="builds an npm install command by default" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
13
|
+
<testcase classname="adapter (unit) generateInstallAdapterCommand" name="builds a yarn add command" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
14
|
+
<testcase classname="adapter (unit) generateInstallAdapterCommand" name="builds a pnpm add command" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
15
|
+
<testcase classname="adapter (unit) generateInstallAdapterCommand" name="falls back to "install" for an unrecognised package manager" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
16
|
+
<testcase classname="adapter (unit) getNearestNodeModulesDirectory" name="searches from the current directory when no options are given" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.02"/>
|
|
17
|
+
<testcase classname="adapter (unit) getNearestNodeModulesDirectory" name="accepts a directory string" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.027"/>
|
|
18
|
+
<testcase classname="adapter (unit) getNearestNodeModulesDirectory" name="accepts an options object with cwd" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.015"/>
|
|
19
|
+
<testcase classname="adapter (unit) addPathToAdapterConfig" name="adds config.commitizen.path, preserving the detected indentation" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.013"/>
|
|
20
|
+
<testcase classname="adapter (unit) addPathToAdapterConfig" name="falls back to a two-space indent when none can be detected" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.012"/>
|
|
21
|
+
<testcase classname="adapter (unit) addPathToAdapterConfig" name="leaves package.json untouched when the bare adapter name is already configured" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.015"/>
|
|
22
|
+
<testcase classname="adapter (unit) addPathToAdapterConfig" name="leaves package.json untouched when the ./node_modules adapter path is already configured" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.012"/>
|
|
23
|
+
<testcase classname="commitizen cache" name="creates the cache file when setting a value for the first time" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
24
|
+
<testcase classname="commitizen cache" name="merges into an existing cache instead of clobbering it" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
25
|
+
<testcase classname="commitizen cache" name="overwrites the value for a key that already exists" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
26
|
+
<testcase classname="commitizen cache" name="reads a stored value back by key" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
27
|
+
<testcase classname="commitizen cache" name="returns undefined for a missing key" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
28
|
+
<testcase classname="commitizen cache" name="returns undefined (rather than throwing) when the cache file does not exist" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
29
|
+
<testcase classname="commitizen cache" name="throws from readCacheSync when the cache file does not exist" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
30
|
+
<testcase classname="cli git-cz bootstrap when config is provided" name="passes config to useGitCzStrategy" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
31
|
+
<testcase classname="cli git-cz bootstrap when config is not provided and the config is returned from configLoader.load" name="uses config from configLoader.load()" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
32
|
+
<testcase classname="cli git-cz bootstrap when config is not provided and the config is not returned from configLoader.load" name="tells commitizen to use the git strategy" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
33
|
+
<testcase classname="cli git-cz bootstrap when argv is overridden" name="uses the overridden argv" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
34
|
+
<testcase classname="cli git-cz bootstrap when called with no arguments" name="defaults environment to {} and argv to process.argv" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
35
|
+
<testcase classname="cli commitizen" name="slices argv down to the raw git args before parsing" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
36
|
+
<testcase classname="cli commitizen" name="defaults environment and argv when called with no arguments" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
37
|
+
<testcase classname="cli commitizen init command" name="calls init() with cwd, the adapter name and the parsed args" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
38
|
+
<testcase classname="cli commitizen init command" name="logs, but does not throw, when init() fails" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
39
|
+
<testcase classname="cli commitizen init command" name="errors when no adapter name is provided" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
40
|
+
<testcase classname="cli commitizen any other invocation" name="prints usage help and runs no command" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
41
|
+
<testcase classname="cli commitizen any other invocation" name="prints usage help for an unknown command" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
42
|
+
<testcase classname="cli strategies barrel" name="re-exports the git and git-cz strategies" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
43
|
+
<testcase classname="cli parsers barrel" name="re-exports the git-cz and commitizen parsers" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
44
|
+
<testcase classname="cli strategies/git" name="spawns "git commit" with the raw args and inherited stdio" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
45
|
+
<testcase classname="cli strategies/git" name="rethrows when the child process emits an error" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
46
|
+
<testcase classname="cli strategies/git" name="does not spawn git in debug mode, it just logs" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
47
|
+
<testcase classname="cli strategies/git-cz" name="delegates to the plain git strategy when --amend is present" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
48
|
+
<testcase classname="cli strategies/git-cz" name="runs the commit flow, wiring the prompter and options through" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
49
|
+
<testcase classname="cli strategies/git-cz" name="flags retryLastCommit when the first arg is --retry" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
50
|
+
<testcase classname="cli strategies/git-cz" name="flags hookMode when --hook was parsed" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
51
|
+
<testcase classname="cli strategies/git-cz" name="stages all files when -a / --all is passed" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
52
|
+
<testcase classname="cli strategies/git-cz" name="throws when the staging area is clean and --allow-empty is absent" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
53
|
+
<testcase classname="cli strategies/git-cz" name="proceeds when the staging area is clean but --allow-empty is present" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
54
|
+
<testcase classname="cli strategies/git-cz" name="rethrows an error from the staging check" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
55
|
+
<testcase classname="cli strategies/git-cz" name="rethrows an error surfaced by the commit callback" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.008"/>
|
|
56
|
+
<testcase classname="cli strategies/git-cz" name="exits with code 0 when the commit succeeds" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.012"/>
|
|
57
|
+
<testcase classname="commit" name="should commit simple messages" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.713"/>
|
|
58
|
+
<testcase classname="commit" name="should commit message with quotes" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.176"/>
|
|
59
|
+
<testcase classname="commit" name="should commit multiline messages" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.872"/>
|
|
60
|
+
<testcase classname="commit" name="should allow to override git commit options" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.171"/>
|
|
61
|
+
<testcase classname="commit" name="should respect original behavior of -a option" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.198"/>
|
|
62
|
+
<testcase classname="commit" name="should save directly to .git/COMMIT_EDITMSG with --hook option" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.154"/>
|
|
63
|
+
<testcase classname="commit" name="should throw error if staging area is empty" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.167"/>
|
|
64
|
+
<testcase classname="commitizen commit (unit)" name="logs and bails when the cache directory cannot be created" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
65
|
+
<testcase classname="commitizen commit (unit)" name="runs the prompter and commits the message it returns, caching the attempt" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.008"/>
|
|
66
|
+
<testcase classname="commitizen commit (unit)" name="propagates an Error raised by the adapter prompter without committing" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
67
|
+
<testcase classname="commitizen commit (unit)" name="replays the previous attempt from cache when retryLastCommit is set" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
68
|
+
<testcase classname="configLoader" name="errors appropriately for invalid json" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
69
|
+
<testcase classname="configLoader" name="parses json files with comments" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
70
|
+
<testcase classname="configLoader" name="parses rc files that start with a UTF-8 byte order mark" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
71
|
+
<testcase classname="configLoader" name="returns undefined when no config path is given" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
72
|
+
<testcase classname="configLoader" name="returns undefined when the config file does not exist" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
73
|
+
<testcase classname="configLoader" name="normalizes package.json configs" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
74
|
+
<testcase classname="configLoader" name="returns undefined for a package.json with neither config.commitizen nor czConfig" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
75
|
+
<testcase classname="configLoader" name="returns undefined for a package.json with no content" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
76
|
+
<testcase classname="configLoader" name="normalizes .cz.json configs" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
77
|
+
<testcase classname="configLoader" name="normalizes .czrc configs" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
78
|
+
<testcase classname="configLoader loader" name="loads an explicitly provided config path directly" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
79
|
+
<testcase classname="configLoader loader" name="discovers a config file in the given directory" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
80
|
+
<testcase classname="configLoader loader" name="returns undefined when nothing is found (and not falling through to $HOME during tests)" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
81
|
+
<testcase classname="configLoader loader" name="defaults the search directory to process.cwd()" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
82
|
+
<testcase classname="configLoader findup" name="walks up parent directories to find a matching file" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
83
|
+
<testcase classname="configLoader findup" name="returns undefined when the file is never found on the way up to the root" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
84
|
+
<testcase classname="configLoader findup" name="skips matches rejected by the filter callback" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
85
|
+
<testcase classname="git helpers log" name="passes stdout to the callback on success" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.004"/>
|
|
86
|
+
<testcase classname="git helpers log" name="throws when git errors" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.004"/>
|
|
87
|
+
<testcase classname="git helpers whatChanged" name="passes stdout to the callback on success" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.003"/>
|
|
88
|
+
<testcase classname="git helpers whatChanged" name="throws when git errors" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.003"/>
|
|
89
|
+
<testcase classname="git helpers commit (non-hook mode)" name="spawns "git commit -m <message>" plus any extra args" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
90
|
+
<testcase classname="git helpers commit (non-hook mode)" name="inherits stdio when not quiet" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
91
|
+
<testcase classname="git helpers commit (non-hook mode)" name="reports child-process errors through the callback" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
92
|
+
<testcase classname="git helpers commit (non-hook mode)" name="only calls the callback once even if error fires repeatedly and exit follows" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.008"/>
|
|
93
|
+
<testcase classname="git helpers commit (non-hook mode)" name="resolves with null on a zero exit code" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
94
|
+
<testcase classname="git helpers commit (non-hook mode)" name="warns about git config and errors on exit code 128" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
95
|
+
<testcase classname="git helpers commit (non-hook mode)" name="errors (without the config warning) on a non-128 non-zero exit code" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
96
|
+
<testcase classname="git helpers commit (--hook mode)" name="writes the message to <git-dir>/COMMIT_EDITMSG" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.008"/>
|
|
97
|
+
<testcase classname="git helpers commit (--hook mode)" name="falls back to "r+" when the file cannot be opened for "w" (Windows hidden files)" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
98
|
+
<testcase classname="git helpers commit (--hook mode)" name="reports the error (and still closes the fd) when the write fails" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
99
|
+
<testcase classname="git helpers commit (--hook mode)" name="reports the error when even the "r+" fallback fails" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.007"/>
|
|
100
|
+
<testcase classname="init" name="installs an adapter with --save-dev" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.807"/>
|
|
101
|
+
<testcase classname="init" name="installs an adapter with --save" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.777"/>
|
|
102
|
+
<testcase classname="init" name="errors on previously installed adapter" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.79"/>
|
|
103
|
+
<testcase classname="init" name="succeeds if force is true" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="2.953"/>
|
|
104
|
+
<testcase classname="init" name="installs an adapter without --save-exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.782"/>
|
|
105
|
+
<testcase classname="init" name="installs an adapter with --save-exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.761"/>
|
|
106
|
+
<testcase classname="init" name="installs an commitizen with includeCommitizen" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="2.436"/>
|
|
107
|
+
<testcase classname="init alternative package managers: yarn" name="installs an adapter with yarn" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="3.36"/>
|
|
108
|
+
<testcase classname="init alternative package managers: yarn" name="installs an adapter with yarn --dev" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.616"/>
|
|
109
|
+
<testcase classname="init alternative package managers: yarn" name="errors (with yarn) on previously installed adapter" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.575"/>
|
|
110
|
+
<testcase classname="init alternative package managers: yarn" name="succeeds (with yarn) if force is true" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="3.319"/>
|
|
111
|
+
<testcase classname="init alternative package managers: yarn" name="installs (with yarn) an adapter without --save-exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.566"/>
|
|
112
|
+
<testcase classname="init alternative package managers: yarn" name="installs an adapter with yarn --exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="1.501"/>
|
|
113
|
+
<testcase classname="init alternative package managers: pnpm" name="installs an adapter with pnpm" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.4"/>
|
|
114
|
+
<testcase classname="init alternative package managers: pnpm" name="installs an adapter with pnpm --dev" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.12"/>
|
|
115
|
+
<testcase classname="init alternative package managers: pnpm" name="errors (with pnpm) on previously installed adapter" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.118"/>
|
|
116
|
+
<testcase classname="init alternative package managers: pnpm" name="succeeds (with pnpm) if force is true" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.333"/>
|
|
117
|
+
<testcase classname="init alternative package managers: pnpm" name="installs (with pnpm) an adapter without --save-exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.128"/>
|
|
118
|
+
<testcase classname="init alternative package managers: pnpm" name="installs an adapter with pnpm --exact" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.119"/>
|
|
119
|
+
<testcase classname="commitizen init (unit)" name="throws when the repo path or adapter name is missing" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.012"/>
|
|
120
|
+
<testcase classname="commitizen init (unit)" name="swallows and logs an install failure instead of throwing" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.022"/>
|
|
121
|
+
<testcase classname="commitizen init (unit)" name="also installs commitizen when includeCommitizen is set" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
122
|
+
<testcase classname="commitizen init (unit) install command built from real CLI arguments" name="defaults to a dev install" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
123
|
+
<testcase classname="commitizen init (unit) install command built from real CLI arguments" name="--save installs to dependencies, not devDependencies" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
124
|
+
<testcase classname="commitizen init (unit) install command built from real CLI arguments" name="--save-dev --save-exact pins an exact dev install with npm" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
125
|
+
<testcase classname="commitizen init (unit) install command built from real CLI arguments" name="--pnpm --save-dev --save-exact pins an exact dev install with pnpm" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.01"/>
|
|
126
|
+
<testcase classname="commitizen init (unit) install command built from real CLI arguments" name="--yarn --dev --exact pins an exact dev install with yarn" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.009"/>
|
|
127
|
+
<testcase classname="parsers git-cz" name="should parse --message "Hello, World!"" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
128
|
+
<testcase classname="parsers git-cz" name="should parse --message="Hello, World!"" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
129
|
+
<testcase classname="parsers git-cz" name="should parse -amwip" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
130
|
+
<testcase classname="parsers git-cz" name="should parse -am=wip" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
131
|
+
<testcase classname="parsers git-cz" name="should parse -am wip" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
132
|
+
<testcase classname="parsers git-cz" name="should parse -a -m wip -n" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
133
|
+
<testcase classname="parsers git-cz" name="should parse -a -m=wip -n" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
134
|
+
<testcase classname="parsers commitizen" name="should parse out the --amend option" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
135
|
+
<testcase classname="parsers commitizen" name="should parse out the --hook option" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
136
|
+
<testcase classname="parsers commitizen" name="should expose kebab-case init flags under the camelCase names init() reads" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
137
|
+
<testcase classname="staging" name="should determine if a repo is clean" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.02"/>
|
|
138
|
+
<testcase classname="staging" name="should determine if --all flag adds files to staging area" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.011"/>
|
|
139
|
+
<testcase classname="common util" name="isFunction determines if a function is passed" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
140
|
+
<testcase classname="common util" name="isInTest is true while the mocha "it" global is present" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
141
|
+
<testcase classname="common util getParsedJsonFromFile" name="parses the JSON contents of a file" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
142
|
+
<testcase classname="common util getParsedJsonFromFile" name="logs and returns undefined when the file is missing" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
143
|
+
<testcase classname="common util getParsedJsonFromFile" name="logs and returns undefined when the file is not valid JSON" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
144
|
+
<testcase classname="common util getParsedJsonFromFile" name="getParsedPackageJsonFromPath reads package.json from a directory" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
145
|
+
<testcase classname="common util directory finders" name="findPackageRoot returns the starting directory when it has a package.json" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
146
|
+
<testcase classname="common util directory finders" name="findPackageRoot walks up from a file to the nearest package.json" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
147
|
+
<testcase classname="common util directory finders" name="findPackageRoot throws when no package.json exists up to the filesystem root" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
148
|
+
<testcase classname="common util directory finders" name="findNearestNodeModules returns node_modules in the starting directory" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
149
|
+
<testcase classname="common util directory finders" name="findNearestNodeModules walks up and returns a path relative to the start" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
150
|
+
<testcase classname="common util directory finders" name="findNearestNodeModules defaults to the current working directory" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0.001"/>
|
|
151
|
+
<testcase classname="common util directory finders" name="findNearestNodeModules returns undefined when there is no node_modules" file="/home/runner/work/cz-cli/cz-cli/test/tests/index.js" time="0"/>
|
|
152
|
+
</testsuite>
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commitizen",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Git commit, but play nice with conventions.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"packageManager": "pnpm@12.
|
|
6
|
+
"packageManager": "pnpm@12.25.1",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"check-coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
|
|
9
9
|
"commit": "node bin/git-cz",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"homepage": "https://github.com/commitizen/cz-cli",
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/commitizen/cz-cli.git"
|
|
28
|
+
"url": "git+https://github.com/commitizen/cz-cli.git"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"commit",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@babel/preset-env": "8.1.4",
|
|
51
51
|
"@babel/register": "8.1.2",
|
|
52
52
|
"@istanbuljs/nyc-config-babel": "3.0.0",
|
|
53
|
+
"@semantic-release/exec": "7.1.0",
|
|
53
54
|
"babel-plugin-istanbul": "8.0.0",
|
|
54
55
|
"chai": "6.3.0",
|
|
55
56
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
@@ -82,12 +83,12 @@
|
|
|
82
83
|
},
|
|
83
84
|
"engineStrict": true,
|
|
84
85
|
"engines": {
|
|
85
|
-
"node": "
|
|
86
|
+
"node": "^22.23.5 || ^24.22.3 || >=26.13.1"
|
|
86
87
|
},
|
|
87
88
|
"devEngines": {
|
|
88
89
|
"runtime": {
|
|
89
90
|
"name": "node",
|
|
90
|
-
"version": "^22.
|
|
91
|
+
"version": "^22.23.5 || ^24.22.3 || ^26.13.1",
|
|
91
92
|
"onFail": "error"
|
|
92
93
|
}
|
|
93
94
|
},
|
|
@@ -96,6 +97,30 @@
|
|
|
96
97
|
"url": "https://opencollective.com/commitizen"
|
|
97
98
|
},
|
|
98
99
|
"release": {
|
|
99
|
-
"preset": "conventionalcommits"
|
|
100
|
+
"preset": "conventionalcommits",
|
|
101
|
+
"plugins": [
|
|
102
|
+
"@semantic-release/commit-analyzer",
|
|
103
|
+
"@semantic-release/release-notes-generator",
|
|
104
|
+
[
|
|
105
|
+
"@semantic-release/npm",
|
|
106
|
+
{
|
|
107
|
+
"npmPublish": false
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
[
|
|
111
|
+
"@semantic-release/exec",
|
|
112
|
+
{
|
|
113
|
+
"publishCmd": "npm stage publish --tag latest --provenance --loglevel verbose"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"@semantic-release/github",
|
|
118
|
+
{
|
|
119
|
+
"draftRelease": true,
|
|
120
|
+
"successComment": false,
|
|
121
|
+
"releasedLabels": false
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
]
|
|
100
125
|
}
|
|
101
126
|
}
|
package/azure-pipelines.yml
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Node.js
|
|
2
|
-
# Build a general Node.js project with npm.
|
|
3
|
-
# Add steps that analyze code, save build artifacts, deploy, and more:
|
|
4
|
-
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
- template: jobs/build.yml # Template reference
|
|
8
|
-
parameters:
|
|
9
|
-
name: macOS
|
|
10
|
-
pool:
|
|
11
|
-
vmImage: 'macOS-latest'
|
|
12
|
-
|
|
13
|
-
- template: jobs/build.yml # Template reference
|
|
14
|
-
parameters:
|
|
15
|
-
name: Linux
|
|
16
|
-
pool:
|
|
17
|
-
vmImage: 'ubuntu-latest'
|
|
18
|
-
|
|
19
|
-
- template: jobs/build.yml # Template reference
|
|
20
|
-
parameters:
|
|
21
|
-
name: Windows
|
|
22
|
-
pool:
|
|
23
|
-
vmImage: 'windows-latest'
|
|
24
|
-
sign: true # Extra step on Windows only
|
package/jobs/build.yml
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# File: jobs/build.yml
|
|
2
|
-
|
|
3
|
-
parameters:
|
|
4
|
-
name: ''
|
|
5
|
-
pool: ''
|
|
6
|
-
sign: false
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
- job: ${{ parameters.name }}
|
|
10
|
-
pool: ${{ parameters.pool }}
|
|
11
|
-
strategy:
|
|
12
|
-
maxParallel: 3
|
|
13
|
-
matrix:
|
|
14
|
-
node-26:
|
|
15
|
-
node_version: ^26.8.1
|
|
16
|
-
node-24:
|
|
17
|
-
node_version: ^24.20.0
|
|
18
|
-
node-22:
|
|
19
|
-
node_version: ^22.23.2
|
|
20
|
-
steps:
|
|
21
|
-
- task: UseNode@1
|
|
22
|
-
displayName: "Install Node.js"
|
|
23
|
-
inputs:
|
|
24
|
-
version: $(node_version)
|
|
25
|
-
- script: git config --global user.email "example@example.com"
|
|
26
|
-
- script: git config --global user.name "Example Git User"
|
|
27
|
-
- script: npm install -g pnpm@12
|
|
28
|
-
displayName: "Setup pnpm"
|
|
29
|
-
# `prepare` builds dist/ during install. The init tests drive real npm/yarn/pnpm
|
|
30
|
-
# installs using the pinned npm-cli/yarn-cli devDependencies.
|
|
31
|
-
- script: pnpm install --frozen-lockfile
|
|
32
|
-
- script: pnpm test && pnpm run write-coverage && pnpm run check-coverage
|
|
33
|
-
- script: bash logo/generate.sh
|
|
34
|
-
condition: eq(variables['Agent.OS'], 'Linux')
|
|
35
|
-
- task: PublishTestResults@2
|
|
36
|
-
displayName: 'Publish Test Results'
|
|
37
|
-
inputs:
|
|
38
|
-
testResultsFiles: 'junit-testresults.xml'
|
|
39
|
-
searchFolder: '$(System.DefaultWorkingDirectory)'
|
|
40
|
-
testRunTitle: TestRun ${{ parameters.name }} $(node_version)
|
|
41
|
-
- task: PublishCodeCoverageResults@2
|
|
42
|
-
displayName: 'Publish code coverage results'
|
|
43
|
-
inputs:
|
|
44
|
-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
|
|
45
|
-
- task: PublishBuildArtifacts@1
|
|
46
|
-
displayName: Publish packages
|
|
47
|
-
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
|
|
48
|
-
inputs:
|
|
49
|
-
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
|