Open xenoterracide opened 2 years ago
This is extremely confusing. Thanks for posting your workaround!
I can't even run yarn build
without it descending into recursive hell:
dashboard-enterprise on ξ will-this-let-me-hate-yarn-less [$β!?] via ο’ v16.14.0 took 6s
β― yarn workspaces foreach --interlaced --verbose --topological-dev run build
β€ YN0000: [dashboard-enterprise]: Process started
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process started
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process started
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process started
^C
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process exited (exit code 129), completed in 0s 486ms
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: Failed with errors in 0s 490ms
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process exited (exit code 1), completed in 3s 366ms
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: β€ YN0000: Failed with errors in 3s 369ms
β€ YN0000: [dashboard-enterprise]: β€ YN0000: [dashboard-enterprise]: Process exited (exit code 1), completed in 6s 99ms
β€ YN0000: [dashboard-enterprise]: β€ YN0000: The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph
β€ YN0000: [dashboard-enterprise]: β€ YN0000: Failed with errors in 6s 102ms
β€ YN0000: [dashboard-enterprise]: Process exited (exit code 1), completed in 8s 565ms
β€ YN0000: The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph
β€ YN0000: Failed with errors in 8s 573ms
dashboard-enterprise on ξ will-this-let-me-hate-yarn-less [$β!?] via ο’ v16.14.0 took 9s
Adding the --exclude
flag worked for me:
β― yarn workspaces foreach --verbose --interlaced --parallel --jobs unlimited --topological-dev --exclude dashboard-enterprise run build
It's sad how long that is compared to lerna run build --stream
but oh well.
(is workspaces in this repo? I don't know...)
Describe the user story
As a corporate developer, I have to use the npm script name in CI, workspace commands become recursive.
this seems all good and well, except when I renamed the library after some discussions, I forgot to rename it in this command. what happened then is that it started recursing. Honestly I'm having trouble with the idea that if I run
yarn test
that it also runs it in every workspace, or that with workspaces it's considering the root package as a valid location. I can see though that as designed it's not aware of the current location. this is actually massively unintuitive and frustrating, that in any given workspace I have to runyarn workspace mywork :foo
because otherwise it would run all of them.Describe the solution you'd like
In my worst case I think that making the root repo excluded by default would be good. Thus my suggestion would be that at the root
would be equivalent to
Describe the drawbacks of your solution
breaks backwards compatibility
Describe alternatives you've considered
alternatively an
--exclude-root
so that naming doesn't matter would also be acceptable, but I'm having trouble with why I would want a script like this to also run itself.Additional
could yarn be generally more package aware? so that in sub workspaces doing
yarn foo
won't run it like it's the root repo? and or maybe you could haveyarn workspace this foo
again to avoid the naming issue... There are plenty of workarounds, but it's all kind of frustrating.I still think it would be awesome if yarn could have its own scripts defintions that aren't partial to the npm spec. maybe something that could go in
.yarnrc.yml
and be more optimized (not forking), that however could start as a contrib plugin