-
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
Implement handling of local packages in the package-set #96
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX on this is pretty good, though you still need to specify the upstream dependencies. Granted not everyone would run into this.
You still need to do something like
let additions = {
tiled =
mkPackage
(../purescript-tiled/spago.dhall).dependencies
"../purescript-tiled"
"local"
,pixijs =
mkPackage
(../purescript-pixijs/spago.dhall).dependencies
"../purescript-pixijs"
"local"
}
Which isn't bad (unfortunately I can't find a way of dynamically building that as a dhall function). So this works great for me
You could use record update on those, right? It's just that you need to override the url section? |
@justinwoo: note that his example has additions, not overrides, so you need to specify the dependencies somehow: either listing them or pulling them from a spago config if the package you're importing has one @btrepp: I'll add this note to the README |
So in this case you'd want to have a new mkPackage function that can make local library package definitions? Where one of the args passed in would be either the path or the imported record? |
@justinwoo could you make an example of how it would look like? I though about having a |
mkLocalPackage would be useful enough. mkPackage is also fine overall since you know that's what you're making rather than just some random record that you hope is fine, and also since you want to ensure that records are of type Package. |
Implements support for local packages, as described in #88 (comment) (use case:
bower link
)Basically we now try to distinguish if "URL"s in the package-set are referring to remote repos, or local filesystem path. In the latter case instead of trying to clone them, we just include their sources in the build (if they are listed as a dependency ofc). This basically mirrors the behaviour of
stack
.Practical example: let's say I find a bug in simple-json. I manage to fix it locally, but I also want to see if the fix works for my project.
Since simple-json is already in the package-set, I can add the local package to the overrides in
packages.dhall
:Note that if I
list-packages
, it is correctly listed as a local package:After adding it to the
dependencies
inspago.dhall
, if I dospago install
, it will not download it, but only its dependencies: