Open j-maas opened 6 years ago
Nope, you're right, this is a bug. Do you want to give it a shot at figuring out what happens and fixing it?
On Mon, May 14, 2018, 9:26 AM heupr[bot] notifications@github.com wrote:
Assigned #5816 https://github.com/yarnpkg/yarn/issues/5816 to @arcanis https://github.com/arcanis.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/yarnpkg/yarn/issues/5816#event-1624209611, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_Wa18OSpfW6rTG_t623qZvuqVQko3xks5tyT-ngaJpZM4T9WzR .
@arcanis I'm not sure if I'll have time, but in principle I'd like to try.
I'll write a new comment before I start, so that you know whether I'm working on this. Until then, if anyone would like to tackle this, go ahead.
I've started looking into it and I assume the root cause lies in micromatch or the arguments passed to it.
I will continue diggin for a bit.
~This behaviour is reportedly supported in a newer version of micromatch.
The newest version is 3.1.10, whereas yarn is dependent on 2.3.11.~
(It doesn't work in the newest version.)
I'm not sure how to add a test case for this bug. If you have any suggestions, I could try.
This is considered intended behavior micromatch. It thus should be handled in the call to the function.
Hi, @arcanis & @BYK is this issue still relevant?
Just ran into this in v1.10.1.
Edit: This explains why yarn add
would create a yarn.lock in some workspaces but not others.
I also just ran into this issue in yarn v1.15.2. Crazy.
I ran into what is probably the same issue, where instead of a trailing /
, it was caused by a preceding ./
For example:
...
"workspaces": {
"packages": [
"./packages/*"
],
},
...
Currently having this issue with this config:
"workspaces": [
"libs/common/client/",
"services/app/client/"
]
At the root, I can find the packages. But at the package level, it doesn't recognize it's part of a workspace. How do I fix this?
If I go to the package and add a dependency, it will create it in the packages node_modules instead of root.
@simkessy for now, the workaround is to change that to
"workspaces": [
"libs/common/client",
"services/app/client"
]
Wow, that was simple. This should be documented somewhere, wasted a lot of hours :(
Thanks @forivall !
Do you want to request a feature or report a bug?
Bug.
What is the current behavior? When the
workspaces
definition contains a trailing slash, running e. g.yarn workspaces info
in the root works just as expected. But when youcd
into the workspace folder and runyarn workspaces info
, it fails because it cannot detect that that folder is a workspace.If the current behavior is a bug, please provide the steps to reproduce.
package
.yarn init
insidepackage/
.yarn init
in the root.package/
(with trailing slash) as a workspace to the rootpackage.json
.yarn workspaces info
in the root. => Outputs workspace list correctly.yarn workspaces info
inpackage/
. => Fails withWhat is the expected behavior? Running
yarn workspaces info
should output the workspaces when run both inside root andpackage/
.If this behavior is intended, the documentation could reflect the reason why.
Please mention your node.js, yarn and operating system version. Node v8.11.1 Yarn v1.6.0 Ubuntu 16.04 LTS