Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.13k stars 41 forks source link

[Bug report] When czg reads commitlint.config, the extends content cannot take effect #186

Closed shlroland closed 1 month ago

shlroland commented 1 month ago

✅ Checklist

📄 System Info

System:
    OS: macOS 14.6.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 188.33 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.17.0 - ~/Library/Caches/fnm_multishells/47421_1726756844280/bin/node
    Yarn: 1.22.22 - ~/Library/pnpm/yarn
    npm: 10.8.2 - ~/Library/Caches/fnm_multishells/47421_1726756844280/bin/npm
    pnpm: 9.10.0 - ~/Library/Caches/fnm_multishells/47421_1726756844280/bin/pnpm
    bun: 1.1.20 - ~/.bun/bin/bun
    Watchman: 0.0.0 - /opt/local/bin/watchman
  npmPackages:
    cz-git: ^1.7.0 => 1.9.4
    czg: ^1.9.4 => 1.9.4

🔎 Description

Concise Description

I configured a commitlint configuration file in the monorepo project. When I installed it in the root directory and used it in commitlint.config.js, the content of extends did not take effect. like this

// commitlint.config.js
export default {
  extends: ['@shlroland/commitlint-config']
}

Expected behavior

When I switch back to commitizen + cz-git, at this time, extends can take effect.

Steps to reproduce

Screenshots or Screen Recording(if possible)

🔗 Reproduction link / repo:

No response

Zhengqbbb commented 1 month ago

Could u tell me what configuration is not effective? It works normally on my side.

.commitlintrc.cjs

/** @type {import('czg').UserConfig} */
module.exports = {
    extends: ['@shlroland/commitlint-config'],
}

CleanShot 2024-09-26 at 23 09 15@2x


Try it to see if the configuration is overwritten.

CZ_DEBUG=1 czg -a
shlroland commented 1 month ago
CZ_DEBUG=1 czg -a
image

The debug information is also normal.

Reproduced repository link: https://github.com/shlroland/lint-config/tree/tmp

Zhengqbbb commented 1 month ago

Strange 🤔. When I use the pre-release version, it returns to normal. The fix for the pre-released version is likely due to an upgrade @commlint/resolve-extends. I will debug it tomorrow.

image

In the meantime, you can install 1.10.0-beta.1 for use, which will be released over the weekend.

pnpm i -D czg@next
npm i -g czg@next

czg -v

CleanShot 2024-09-27 at 00 55 26@2x

Zhengqbbb commented 1 month ago

Thank you very much for pointing out this issue.

It has been confirmed that the issue belongs to the upstream package @commitlint/resolve-extends@19.0.3 bug.


  1. I upgraded all @commitlint packages to the latest version 19.5.0, and released 1.10.0-beta.2, which works normally with extends.
  2. I downgraded @commitlint/resolve-extends to 19.0.3, and released 1.10.0-beta.3, which behaves abnormally.
image

I will release the fix version v1.10.0 over the weekend, upgrading all @commitlint packages to the latest v19.5.0.

I have released a next pre-release version 🌟(v1.10.0-beta.4)🌟 for testing.

Welcome to try it out! 👀 Let me know if there are still any issues. 🎉

pnpm i -D czg@next
npm i -g czg@next

czg -v #v1.10.0-beta.4
czg -a
shlroland commented 1 month ago

Thank you for your timely reply and your hard work in fixing the problem overnight. I'll try it out.

Zhengqbbb commented 1 month ago

The latest version 🌟(v1.10.0)🌟 should be resolve this issue request , please have a try. 💪 👀 Let me know if there are still any issues. 🎉