-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Require monorepo source workspace packages to be opted in via glob. #4570
Conversation
Naming aside (
|
fb14f19
to
3fa3cfe
Compare
…ontents before deps added)
3fa3cfe
to
2a60b09
Compare
I'm not opposed to supporting the private npm registry use case and I can see how a unified solution would be desireable; however, if supporting the other cases sacrifices usability for the monorepo case, then I think it's ok to support them via different mechanisms. I think the most common use case will be a monorepo w/ shared source + transitive source dependencies. With this solution, the configuration is very easy. With the #4092 solution, it's a lot more configuration, particularly for transitive source dependencies.
Moving the package changing its compiled status should be expected if the sources are specified via paths -- I don't think that would be a difficult issue to understand or debug. In general, specifying by path globs in a monorepo is a really user-friendly and flexible option. You can configure globs such that new packages in certain directories automatically get compiled without any additional config. Or you can configure without wildcards so that you have to specify each package if that's how you want to do it. It would be possible to support wildcards in the #4092 proposal, and I'm not opposed to doing that either, but that would be with package names instead of paths, so it's still a different dimension that what's desirable for monorepos. Summary:
|
3f45c34
to
f3ef35b
Compare
We took this out of 2.0 for now, maybe in 3.0, though! This complexity was too much to manage. Let's meet back in #4092. |
The current 2.0 implementation treats all monorepo packages included by the app as source packages, there is no way to opt them in or out, and this results in making some monorepos incompatible with react-scripts (see issues listed below).
This PR changes the behavior to require an app to opt source packages in via a glob pattern ("craSourceWorkspaces") in the app's package.json, similar to the "workspaces" glob pattern used by yarn to opt packages in to workspaces.
(This is an alternative implementation to the #4092 proposal.)
Fixes #4569, #4410, #4249.