Closed charlie-yao closed 2 years ago
For now, I think I'm just going to have each workspace declare the dependencies that they need. If I publish react-aria-widgets
as an independent NPM package, it should probably declare all of the dependencies that it needs in its own package.json
rather than some implicit method.
Both the widget workspace and the demo workspace share a lot of dev dependencies. Are there best practices out there for managing things?
I vaguely remember reading that some people think it's a good idea to have a root workspace manage common dev dependencies and their versioning, and have things propagate down the tree. But maybe I'm missing something, because the way I understand workspaces to work is that they're designed to be isolated. In other words, a workspace won't have access to a command like
eslint
if it's not an explicit dependency, which is what we're trying to avoid.I suppose some tools like eslint can inspect multiple folders, but I wonder if things like babel, webpack, etc., work the same way.
Or, would it be possible to declare the dependency of a version in a root workspace, and have any downstream workspaces just use that version?
Potentially helpful links: https://github.com/yarnpkg/berry/discussions/2825