-
Notifications
You must be signed in to change notification settings - Fork 132
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
Compiling packages in a monorepo #377
Comments
Thanks for the detailed report! This makes sense. The first thing that pops into mind is that Spago could detect where a shared |
Yeah. That seems like it could work, as well. |
Update: since #402 we do some kind of detection of where the |
Hey! I'm up for giving this a pop. What what I can tell, we can now use |
@danieljharvey that would be great!
Yes, we now have |
Ace, thanks. Will there ever be more than one path to the actual Purescript package sets? Is that a reasonable measure of whether we’re at the root? Or can we end up with multiple references to them? |
@danieljharvey we can have multiple
Where:
Now if we do |
This would be a very nice improvement for my learning repository: purescript-jordans-reference. It currently has ~ 15 projects that all have to recompile most of the same code. |
Fixed in #422 |
Concern
Compiling everything in a monorepo is too slow for large monorepos. Compiling individual packages requires recompilation work.
Context
Let's say I've got a monorepo setup similar to what's in the README:
As the project grows, compiling everything from the top becomes slower and slower. If I wanted to iterate quickly within the
lib1
package, I can move to that directory and run the build:This puts the
output
directory inlib1
and compiles everything there.If I then wanted to iterate in
lib2
, I could move to that directory and run the build:Unfortunately, because the
output
directory is inlib1
, I've got to recompile everything intolib2/output
.Workaround
This can be mitigated by running
$ spago build --watch -- --output ../output
in both
lib1
andlib2
. They compile to a top-leveloutput
directory, and compilation results can be shared between them. If I then move toapp1
orapp1/test
and do similar, they also get the benefits of the pre-compiled results.Questions
spago
make this easier somehow?One thing that's been in the back of my head is allowing
build
to know which package to build:$ spago build lib1
spago
could do the bookkeeping of theoutput
directory.I'm open to other ideas as well.
The text was updated successfully, but these errors were encountered: