spago
spago copied to clipboard
Consider `sources` behaviour in `spago.dhall`
While implementing #420 I noticed that we get weird behaviour if spago.dhall
lists a glob path like src/**/*.js
, because we're assume they're all .purs
globs.
It's also true since #407 that if you list e.g. src/**/*.purs
we will watch src/**/*.js
as well, so the globs in spago.dhall
aren't a true reflection of the files we're including.
Now that we've iterated on the initial sources
idea a few times, I think it'd be good to consider what we want from it and refactor the related code at the same time.
For example, maybe users should just list directories (sources = ["src", "test"]
) and we'll find all the relevant files therein? Or we could make the filetypes explicit (sources = ["src/**/*.js", "src/**/*.purs"]
) and actually pay attention to them.
@elliotdavies great analysis! Something I'd like to add is that PureScript's FFI makes it so that JS files are "implicitly read" by the compiler if they are nearby the .purs
files
So I'd say we could keep the current globs behaviour (i.e. specify globs for .purs
files), and:
- ignore globs with
.js
files - ..but watch the
.js
equivalents of the included.purs
globs
That sounds good to me - in which case we should document that, and do some checks for .js
globs so that we can throw warnings / errors.
@elliotdavies Hey, I was wondering if I could take this issue?
@juanpaucar Please do! 😁
The new Spago does not support sources
anymore, closing