Cz-cli: Yarn workspaces support

Created on 4 Feb 2019  路  2Comments  路  Source: commitizen/cz-cli

Hello there, thanks for this project.

I use Yarn and Lerna with Yarn workspaces. But it disallows install packages to root space without --ignore-workspace-root-check or -W flag and I got an error:

$ commitizen init cz-lerna-changelog --yarn --dev --exact
Attempting to initialize using the npm package cz-lerna-changelog
yarn add v1.13.0
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Unfortunately, I see no any other way, except to add another flag to getYarnAddStringMappings. Perhaps there is another solution, but any solution to this problem would be great.

P.S.: I installed and configured packages manually, and everything seems to be working fine.

Most helpful comment

here is a workaround

before you run commitizen init ...

add a .yarnrc file in your project root

then add following content in this file

--*.ignore-workspace-root-check true

then run

commitizen init ...

everything should be ok

All 2 comments

Saw this issue too and just configured things manually

here is a workaround

before you run commitizen init ...

add a .yarnrc file in your project root

then add following content in this file

--*.ignore-workspace-root-check true

then run

commitizen init ...

everything should be ok

Was this page helpful?
0 / 5 - 0 ratings