Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] commitizen and commitlint configure load extract common #24

Closed
3 tasks done
Zhengqbbb opened this issue May 9, 2022 · 3 comments
Closed
3 tasks done
Assignees
Labels
enhancement New feature or request lightweight Smaller or less dependent

Comments

@Zhengqbbb
Copy link
Owner

Zhengqbbb commented May 9, 2022

💭 Describe the feature

Lightweight Feature

Mainly to remove the typescript file configuration (commitlint)

  • Loading the ts configuration file will cause slow startup and large dependencies
  • And the common logic of commitizen and commitlint can be extracted

image

💡 Proposed Solution

  • Use cosmiconfig module. extract common to @cz-git/loader
  • Not supported typescript configure . Ditch heavy dependencies: ts-load and typescript
  • Support configure:
    • commitizen:
      • json: [".czrc", ".cz.json", "package.json"]
    • commitlint:
      • json: [".commitlintrc", ".commitlintrc.json"]
      • js: [".commitlintrc.js", ".commitlintrc.js", ".commitlintrc.cjs ", "commitlint.config.js", "commitlint.config.cjs"]
      • yml: [".commitlintrc.yaml", ".commitlintrc.yml"]
@Zhengqbbb Zhengqbbb added the enhancement New feature or request label May 9, 2022
@Zhengqbbb Zhengqbbb self-assigned this May 9, 2022
@Zhengqbbb Zhengqbbb added the lightweight Smaller or less dependent label May 9, 2022
@Zhengqbbb
Copy link
Owner Author

Zhengqbbb commented May 13, 2022

After commitlint simplification 🤔 238 ms => 63 ms. maybe is resolve node_modules plugin

update : If use extends 63ms => 230ms

After commitzen simplification 131 ms => 42 ms

@Zhengqbbb
Copy link
Owner Author

Zhengqbbb commented May 13, 2022

⚡️After completing the first version of the optimization, the test results:
use bunder build: 1.65 MB => 656 KB
dev build get result config speed : 215 ms => 110 ms
bunder build get result config speed: 127 ms => 53ms

Zhengqbbb added a commit that referenced this issue May 14, 2022
use cosmiconfig extract common

BREAKING CHANGE :
No supprt typescript config define file. `commitlint.config.ts`

link #24, #25
@Zhengqbbb
Copy link
Owner Author

$ npm i -D cz-git

+ cz-git@1.3.1
added 1 package from 1 contributor and audited 1 package in 0.611s

$ du -sh ./node_modules
5.6M	./node_modules/cz-git/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lightweight Smaller or less dependent
Projects
None yet
Development

No branches or pull requests

1 participant