-
Notifications
You must be signed in to change notification settings - Fork 23
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
Local packages in mono repos #19
Comments
Thanks for the PR, but I don't think this is what I would want to do. The problems are that
What I think should be done is to write this information out somewhere in spago2nix generate (if not already available otherwise), and to adjust the build to feed in source globs. It's kind of a pain, but local packages are also an abomination anway |
Ok, I think I get your point. What do you think, does this go into the right direction: #21 ? This should cover 1. and 2., but not yet 3. |
Well, no. Now it's impure. We have a relative path inside the generated nix file. After this, I think (again) the first solution is better. But I may be wrong, it's kind of tricky. |
@justinwoo I just came across this and was wondering what do suggest other than local packages when you have a monorepo? Currently we are using extra source directories but it seems...wrong somehow. |
There is code that is shared between plutus playground and plutus SCB that is not used by marlowe playground or marlowe dashboard. The same will be true for Marlowe once SCP-1672 is implemented. There is also code that is useful to all web projects. We wouldn't normally mind mixing these 3 types in one location however some of the purescript code depends on code generated by the psgenerator scripts. If we have them all together we have to add lots of superfluous types to our psgenerators. It started to get our of hand when I looked at implementing SCP-1672. This commit splits these 3 types into 3 different directories and should allow the psgenerator scripts to be simplified. web-common-marlowe doesn't have anything in it yet but it will do with SCP-1672 Currently we're sticking with the model of "add an extra source directory" rather than having full on purescript or node modules. This is because it's currently much simpler, also spago2nix can't handle local modules yet (justinwoo/spago2nix#19). Finally, it makes it much easier to make changes to web-common and web-common-* during development of the main client projects because they are symlinks in the project, this means (in VSCode at least) that intellisense etc work perfectly.
There is code that is shared between plutus playground and plutus SCB that is not used by marlowe playground or marlowe dashboard. The same will be true for Marlowe once SCP-1672 is implemented. There is also code that is useful to all web projects. We wouldn't normally mind mixing these 3 types in one location however some of the purescript code depends on code generated by the psgenerator scripts. If we have them all together we have to add lots of superfluous types to our psgenerators. It started to get our of hand when I looked at implementing SCP-1672. This commit splits these 3 types into 3 different directories and should allow the psgenerator scripts to be simplified. web-common-marlowe doesn't have anything in it yet but it will do with SCP-1672 Currently we're sticking with the model of "add an extra source directory" rather than having full on purescript or node modules. This is because it's currently much simpler, also spago2nix can't handle local modules yet (justinwoo/spago2nix#19). Finally, it makes it much easier to make changes to web-common and web-common-* during development of the main client projects because they are symlinks in the project, this means (in VSCode at least) that intellisense etc work perfectly.
Consider a setup as described here: https://github.com/spacchetti/spago#monorepo
When
spago2nix
is run insideapp1
it just produces a comment for the local package:(See
spago2nix/src/Generate.purs
Line 208 in 96d0fd2
With this the nix build fails because of a missing module from the dependency.
How should this be handled?
Should we just generate something like this instead of the the comment?:
The text was updated successfully, but these errors were encountered: