Replies: 1 comment 1 reply
-
|
For running something on changed workspaces only there is a feature request for that #2374, if that were to be implemented you could do this with yarn workspaces foreach --since="<deployed branch>" version <new version> --deferred
yarn version apply --allUntil that is implemented #2374 (comment) links to a third party plugin https://github.com/Dcard/yarn-plugins/tree/31803e17fe1c128d86928961bb3007dc2d25a859/packages/changed that you can try using
The published package will use the version instead of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently migrating a monorepo from
yarnclassic tov3and trying to droplernaalong the way.The latter is a bit awkward, because there seems to be no easy way to bump changed workspaces and their dependencies to a common version (like
lernadoes in the fixed versioning mode). I've worked around that with a script that...semverto bump the version defined in my rootpackage.jsonyarn version checkto find changed packages,yarn workspace <ws> version <new-version> --deferredyarn version apply --all(for some reason--immediate"forgets" what I selected for the other packages)I guess the script could be simplified by making it a yarn plugin and using the API, but that works for now. Maybe a simple command to bump all changed workspaces and their dependencies to a shared version, e.g.
yarn version <strategy> --changed --sharedor something along these lines.However, I'm not sure what's the recommended way to set up the workspace versions and their inter-dependencies. I'm currently using
workspace:links, but that means the packages cannot be linked into projects that don't useyarn v2. I should probably be using the actual versions, but then I'm not sure if I need to define the local workspace links usingresolutionsin the root package.json and what happens when those are linked (not necessarily with yarn 2) into an external project.I think the workspaces docs could use some best practices/examples for this.
Beta Was this translation helpful? Give feedback.
All reactions