purescript / spago

🍝 PureScript package manager and build tool
BSD 3-Clause "New" or "Revised" License
793 stars 132 forks source link

Feature request: Decline build if modules from indirect dependencies are imported #415

Closed m-bock closed 4 years ago

m-bock commented 5 years ago

Currently one can use all the modules that are indirect dependencies of the direct dependencies. It would be a bit nicer, if we could just use the modules that are explicitly declared.

f-f commented 5 years ago

Yes, this would be a nice to have! A way we could do it would be to:

Dretch commented 5 years ago

Perhaps there could also be a error or a warning when packages are in the dependency list but are not actually directly imported.

Benjmhart commented 5 years ago

I can try and tackle this one over the next week or two

hdgarrood commented 5 years ago

As it happens there is an issue for this inside the compiler https://github.com/purescript/purescript/issues/3493, and I think it might be preferable to do this inside the compiler rather than in Spago. Although having said this, the work we are looking at in that issue is going to be quite a bit more involved than what is being discussed here, so perhaps it's a good stopgap anyway.

Benjmhart commented 5 years ago

@f-f I'm looking at implementation on this one now that I've had some time to examine. this and the referenced issue https://github.com/spacchetti/spago/issues/165 - it seems like this is blocked until we do something with the ideas in https://github.com/spacchetti/spago/issues/165

f-f commented 4 years ago

I just realized this is a duplicate of #598, I'll close this one as the new one is more up to date