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.11k stars 41 forks source link

Typescript config files support #192

Open Mister-Hope opened 4 days ago

Mister-Hope commented 4 days ago

βœ… Checklist

πŸ“„ System Info

not needed

πŸ”Ž Description

See https://commitlint.js.org/reference/configuration.html

So https://cz-git.qbb.sh/config/#typescript-template should be fixed

πŸ”— Reproduction link / repo:

No response

Zhengqbbb commented 4 days ago

commitlint Replace ts-node with cosmiconfig-typescript-loader package https://github.com/conventional-changelog/commitlint/pull/3722

Although the speed has improved, The cosmiconfig-typescript-loader package added ,cz-git and czg will double the size, and I am still considering it. πŸ˜Άβ€πŸŒ«οΈ This makes me wonder the TypeScript support is important. If it's just type support, the issue #193 also can do?

image
Mister-Hope commented 4 days ago
  1. commitlint.config.ts is supported by commitlint directly, so the docs need to be corrected, there is nothing to do with your pacakge
  2. Even if you want to have cz.config.ts supported, you should externalize cosmiconfig-typescript-loader, tools like rollup and tsup can do that easily
Mister-Hope commented 4 days ago

Besides, I think you have misunderstood my original issue complaining about the deps number.

Since your package is strongly relying on commitlint, so you should try to reuse package that is required by it as much as possible while keeping the same major, this way you can externalize them safely as they are supposed to be installed to workspace anyway. (e.g.: cosmiconfig-typescript-loader)

The main target for tool package like this is trying to avoid requiring any new package that is heavy. A package is heavy means that it has too many deps or a lot of unused features for your usage. You can try to bundle packages with cz-git, only if they:

Zhengqbbb commented 4 days ago

Thank you for your reply.

  1. However, I don't understand with my documentation not supporting commitlint.config.ts Please feel free to point it out.

    Since your package is strongly relying on commitlint, so you should try to reuse package

  2. Like @commitlint/load package have too many dep package.json. I have try but cjs project treeshakable effect is not well
  3. Although I don't agree that a lightweight CLI tool, which requires the fastest startup speed (Include npx bunx usage), should resolve the ts configuration file at this time, I will keep an open opinion and will not add it in the short term.
Mister-Hope commented 4 days ago

However, I don't understand with my documentation not supporting commitlint.config.ts Please feel free to point it out.

image image

No offense, but as I am pointing out the link in issue body, it should not be hard to find these.

Zhengqbbb commented 4 days ago

Done Btw, I will try to configure loading for TypeScript using node > 22 LTS (2024-10-29), instead of adding extra dependencies.