Do you want to request a feature or report a bug?
Improvement for existing feature
What is the current behavior?
When using workspaces, all node modules are located in a single node_modules folder in the root of a project. Nested packages are able to reference to installed dependencies due to the way how Node.js resolves imports, basically looking at parent folders for node_modules. When a nested package (workspace) depends on a tool with CLI, Yarn creates symlinks to .bin folder files from the root modules folder.
What is the expected behavior?
Several tools (i.e. https://github.com/facebook/create-react-app/issues/3031, https://github.com/facebook/flow/issues/5107) need additional work to be done to support workspaces which breaks user experience when they trying to adopt workspaces in their projects. I can imagine even more tools have possible issues with workspaces, either not discovered or not reported yet.
Current proposal is to make symlink to whole node_modules folder in workspaces, instead of just symlinking CLIs. In this way, zero tools would need to make additional changes only in favor of supporting workspaces. It immediately allows the use of Flow and CRA (current versions) with workspaces.
Please mention your node.js, yarn and operating system version.
I use Yarn 1.3.2 with Node.js 8.9 on macOS 10.12.
I am facing the following issue. I guess its related.
Lets say I have my directory structure as follows
- project
- lib (a common library package)
- package.json
- workspace-1
- package.json (has workspace dependency: "lib": "./lib")
With Yarn install its doing two things.
symlinks in node_modules under main project directory. [ EXPECTED ]lib directory inside workspace-1/node_modules (not symlink) [ NOT EXPECTED ]And so any change I do in lib isn't reflected in workspace-1.
I have to delete the workspace level packages for it to work as expected.
Expectation:
I guess it isn't required to place the workspace dependencies under sub directory node_modules.
Even if it is the case for some reason they should be symlinked.
@madhusudhand https://github.com/yarnpkg/yarn/issues/5379#issuecomment-366993922
Most helpful comment
I am facing the following issue. I guess its related.
Lets say I have my directory structure as follows
With
Yarn installits doing two things.symlinksinnode_modulesunder main project directory. [ EXPECTED ]libdirectory insideworkspace-1/node_modules(not symlink) [ NOT EXPECTED ]And so any change I do in
libisn't reflected inworkspace-1.I have to delete the workspace level packages for it to work as expected.
Expectation:
I guess it isn't required to place the workspace dependencies under sub directory node_modules.
Even if it is the case for some reason they should be symlinked.