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

Fix: (#5816) Trailing slash breaks workspace #8483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sfsr12
Copy link

@sfsr12 sfsr12 commented Dec 3, 2020

Summary
This fixes #5816 for both types of failure described. Both if the pattern starts with ./ or ends with /

With the silent nature of the failure, it makes it difficult to notice. This will prevent the issue.
Also, if you "yarn add" anything to the workspaces a yarn.lock is created and node_modules are installed at the workspace level.

Test plan

Simply create a package that includes workspaces. If you use a pattern that starts with ./ or ends with / you will get the following message when you try to run workspace functions from any directory besides the workspace root.

> yarn workspaces info
error Cannot find the root of your workspace - are you sure you're currently in a workspace?
info Visit https://yarnpkg.com/en/docs/cli/workspaces for documentation about this command.

After this change you get proper output

> yarn workspaces info
{
  "workspace-a": {
    "location": "packages/workspace-a",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  },
  "workspace-b": {
    "location": "packages/workspace-b",
    "workspaceDependencies": [
      "workspace-a"
    ],
    "mismatchedWorkspaceDependencies": []
  },
  "yarn": {
    "location": "packages/yarnsfsr",
    "workspaceDependencies": [],
    "mismatchedWorkspaceDependencies": []
  }
}

@sfsr12
Copy link
Author

sfsr12 commented Dec 6, 2020

Never done this before - so not sure if I did something wrong.

It is saying it fails various tests - but I don't think that is related to my code.

Any help would be appreciated.

Thanks

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

Successfully merging this pull request may close these issues.

Trailing slash breaks workspace features when yarn run inside workspace folder
1 participant