Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically exclude nested workspaces to allow simple globs #7147

Open
bdwain opened this issue Mar 25, 2019 · 1 comment
Open

Automatically exclude nested workspaces to allow simple globs #7147

bdwain opened this issue Mar 25, 2019 · 1 comment

Comments

@bdwain
Copy link
Contributor

bdwain commented Mar 25, 2019

Do you want to request a feature or report a bug?
feature

What is the current behavior?
If you use ** in a glob for the workspaces option, it treats all projects that the pattern finds as workspaces, and if any are nested, it errors out

What is the desired behavior?
Since yarn is already detecting workspaces that are nested inside of each other, would it be possible to just ignore them (not treat them as workspaces) instead of erroring when they are detected?

Please mention your node.js, yarn and operating system version.
node 10.14
yarn 1.15.2
OS X Mojave

Motivation
If you have more than 1 level of nesting in your workspaces folder, including all projects in the workspaces option can be annoying.

/projects
   /foo
      /project1
        /subfolder
           /package.json (imported as project1/subfolder)
   /bar
      /project2
      /blah
         /project3
             /node_modules
                /conflicted-package/package.json

In the example below, I can't just say "workspaces": ["projects/**/*"] because it picks up the subfolder nested project (which is not intended to be a workspace) and also any node modules (such as conflicted-package) that are unable to be hoisted. Instead, I need to have a long list of included folders and follow a strict folder structure.

Ideally, any package.json that is nested under a workspace would just be treated as not a workspace so that we could easily glob all projects.

@bdwain
Copy link
Contributor Author

bdwain commented May 7, 2019

any update on this? As a way to make the behavior opt-in, it could only be done if a field is set in package.json (ignoreNestedWorkspaces)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant