berry icon indicating copy to clipboard operation
berry copied to clipboard

docs(workspaces): Document --include use case

Open oskarols opened this issue 7 months ago • 2 comments

What's the problem this PR addresses?

Hi 👋 I find myself using yarn workspaces -Ap --include quite a lot to target specific packages in a monorepo for commands, e.g. to run yarn add foobar. I think the --include could use a separate example in the workspaces doc since it's so useful. 👍

Checklist

  • [ ] I have set the packages that need to be released for my changes to be effective.
  • [ ] I will check that all automated PR checks pass before the PR gets reviewed.

oskarols avatar May 06 '25 12:05 oskarols

Running yarn version check --interactive doesn't work unfortunately.

ERROR  Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
        1. You might have mismatching versions of React and the renderer (such as React DOM)
        2. You might be breaking the Rules of Hooks
        3. You might have more than one copy of React in the same app
        See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

 - 1. You might have mismatching versions of React and the renderer (such as React DOM)
 - 2. You might be breaking the Rules of Hooks
 - 3. You might have more than one copy of React in the same app
 - See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
 - resolveDispatcher (packages/plugin-version/node_modules/react/cjs/react.development.js:1476:13)
 - useState (packages/plugin-version/node_modules/react/cjs/react.development.js:1507:20)
 - useReleases (packages/plugin-version/sources/commands/version/check.tsx:208:39)
 - App (packages/plugin-version/sources/commands/version/check.tsx:248:47)
 - renderWithHooks (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:6412:18)
 - mountIndeterminateComponent (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:9238:13)
 - beginWork (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:10476:16)
 - Object.invokeGuardedCallbackProd (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:12101:10)
 - invokeGuardedCallback (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:12292:31)
 - beginWork$1 (packages/yarnpkg-libui/node_modules/react-reconciler/cjs/react-reconciler.development.js:16531:7)

Using yarn 4.9.1

oskarols avatar May 06 '25 12:05 oskarols

Why do you have node_modules directories for the workspaces? That shouldn't happen.

clemyan avatar May 09 '25 05:05 clemyan