You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a monorepo setup (like with yarn workspaces) it is not possible to install commitizen at the root and then use it in the packages. Being in a folder like packages/package-1 with its own package.json an running yarn cz will result in the fallback "just commit" mode, even though it it properly configured in the root. This is because cz looks for a configuration in the next available package.json or .czrc. If it finds any of these files it seems to stop with an error and the defaulting to commit instead of going up the ladder to the next higher package.json and finding its configuration.
A workaround is to copy-paste the config in all the package.jsons but there is no reason for this strange behaviour.
Reacted by Wayne Van Son, Vincent Clemson, Filip Macek, Lukas, Anthony Caron, Jeremy Simkins, Robbe Claessens, MCMXC, Alexander Mattoni, daviddm and 20 more
+1 for this! I'm just configuring a monorepo at the moment, and currently this restriction means I always have to run cz from the monorepo root, rather than anywhere within the monorepo. Considering I'm often cd'd into one of the packages/* in my terminal, this is a minor inconvenience.
I have a .czrc config in the monorepo root, so it'd be cool if Commitizen recognised that, or if the .czrc file supported an extends parameter so I could put a .czrc file in each package directory that points back to the root ../../.czrc for centralisation sake.
A cleaner solution would maybe be some magic in the CLI tool that looks for a .czrc in root of the .git folder though, maybe?
Reacted by Onuralp Taner, Gina, JW, Michael A. Davis, Starlink and Benjamin Lemoine
Activity
pmcelhaney commentedon Nov 22, 2021
The best way to fix this is probably to use cosmiconfig (#773)
saxoncameron commentedon Jul 28, 2022
+1 for this! I'm just configuring a monorepo at the moment, and currently this restriction means I always have to run
czfrom the monorepo root, rather than anywhere within the monorepo. Considering I'm oftencd'd into one of thepackages/*in my terminal, this is a minor inconvenience.I have a
.czrcconfig in the monorepo root, so it'd be cool if Commitizen recognised that, or if the.czrcfile supported anextendsparameter so I could put a.czrcfile in each package directory that points back to the root../../.czrcfor centralisation sake.A cleaner solution would maybe be some magic in the CLI tool that looks for a
.czrcin root of the.gitfolder though, maybe?Ne-Ne commentedon Aug 19, 2022
Support for this would be awesome 🙏🏻