Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !4001

Add support for new yarn workspaces config format

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/detrohutt/patch-2 into next Feb 09, 2018
  • Overview 9
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: detrohutt

With the addition of the nohoist feature, yarn has enabled a new optional format for the workspaces key in package.json:

"workspaces": {
   "packages": ["packages/*"],
    "nohoist": ["**"]
}

This feature is already available in the current yarn nightly build and I'm successfully using it with the following setup:

yarn@1.4.1-20180208.2355 (nightly) react-scripts@2.0.0-next.47d2d941 (with my patch) lerna@2.8.0 (with a similar patch)

With these patches applied, everything worked out-of-the-box*, aside from needing to make use of the nohoist option. *(obviously, I also needed to configure lerna to use yarn and workspaces)

With the nightly build of yarn installed all enabling nohoist required was:

  1. Adding the settings shown above to my package.json
  2. Adding the following to my .yarnrc:
--workspaces-experimental true
--workspaces-nohoist-experimental true

I could put together a demo lerna repo with my patches applied if needed, but I'm pretty busy with my current project, so if it's not necessary I won't bother.

Similarly, I'd be willing to add a new test to prove it gets the values from workspaces.packages when present. But I'm wondering if that's overkill for such a simple change.

Let me know if you have any questions or concerns! :)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/detrohutt/patch-2