You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have nonstandard sources in some of our spago.dhall files, and we want to use pscid in our projects. At the moment we have something along the lines of this in our package.json file:
"pscid": "set -o noglob && pscid -I $(npm run --silent sources:purs:directories | tr '\\n' ';')",
"sources:purs": "spago sources | sed '/*.purs/!d' && echo 'web/src/purs/**/*.purs' && printf 'more-sources/**/*.purs'",
"sources:purs:directories": "npm run --silent sources:purs | sed 's|/\\*\\*/\\*.purs||'"
so that sources:purs prints out a list of globs, sources:purs:directories strips the trailing **/*.purs, and then we use tr to join all of those directories together with ; and pass that to pscid, because pscid expects a list of directory names (not globs) separated by ;.
I would quite like to get rid of the sources:purs script and have this list of directories stored in the sources key of our spago.dhall files, but I wasn't able to come up with an easy way of getting this information out of spago.dhall without involving jq and dhall-to-json.
If spago sources could include any extra sources listed in spago.dhall this would be fairly straightforward to achieve. Perhaps it would make sense to include these only if a --with-local flag is passed or something, so as not to be a breaking change?
The text was updated successfully, but these errors were encountered:
When #273 went in I started wondering about the fact that the project sources are not returned by spago sources, and I think we should include them.
So yes, I'd say we should use the --with-local flag to add them to the output, nudge the tooling to support the new behaviour, and then switch to the new behaviour as default in some breaking release. Would purescript/purescript#3653 help in making this pain-free?
Btw I think you can incrementally improve on your current solution by exploiting Dhall's native support for JSON which just got merged to the Prelude: i.e. if it's ok for you to depend on the dhall binary then you could replace the jq + dhall-to-json pipeline with dhall + some Dhall code using this JSON stuff to pretty print the things as you wish
Yeah, having the compiler ignore repeated source files would definitely help. So add the flag for now, and then wait until purescript/purescript#3653 is fixed and released to make --with-local the default? That sounds good to me yeah :)
Update: since v0.13.2 is out with the fix for purescript/purescript#3653 it looks like we can even skip the flag and just add the project sources here 🎉
Possibly related to #276.
We have nonstandard
sources
in some of ourspago.dhall
files, and we want to usepscid
in our projects. At the moment we have something along the lines of this in ourpackage.json
file:so that
sources:purs
prints out a list of globs,sources:purs:directories
strips the trailing**/*.purs
, and then we usetr
to join all of those directories together with;
and pass that topscid
, becausepscid
expects a list of directory names (not globs) separated by;
.I would quite like to get rid of the
sources:purs
script and have this list of directories stored in thesources
key of ourspago.dhall
files, but I wasn't able to come up with an easy way of getting this information out ofspago.dhall
without involvingjq
anddhall-to-json
.If
spago sources
could include any extra sources listed inspago.dhall
this would be fairly straightforward to achieve. Perhaps it would make sense to include these only if a--with-local
flag is passed or something, so as not to be a breaking change?The text was updated successfully, but these errors were encountered: