charlie-yao / react-aria-widgets

Implementations of WAI-ARIA widgets and design patterns in React.
MIT License
2 stars 0 forks source link

Dependency management with Yarn workspaces #54

Closed charlie-yao closed 2 years ago

charlie-yao commented 2 years ago

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

charlie-yao commented 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.