Closed garyb closed 9 years ago
I can squash the commits if you prefer also.
Looks good! Thanks for the updates.
Can you please add the docgen
option to the README? Also, regarding the version bump to 0.5.0, should we wait to bump this until PureScript 0.7 is out? Or would you like version 0.5.0 up on NPM to use presently?
Regarding using glob for the ffi
option, is it possible for files to sneak into the result of the glob. Do we only want directory paths as a result? Maybe I don't fully understand the ffi
option usage yet.
And I am okay with the commits, no need to squash. But I will leave it up to you.
Ah yep, good point about the README!
ffi
should only have files in it actually, it's basically the same as the inputs for .purs
, but for .js
files for things that have been foreign import
ed. At a command line level it'd be used something like this:
psc --ffi=X.js --ffi=Y.js --ffi=Z.js X.purs Y.purs Z.purs
The JS and PS will be associated by scanning the JS files for a comment like // module X
rather than using filenames or anything.
Yeah, I wouldn't publish it just yet, just figured I'd bump the version for when it's ready.
Thanks for clarifying. Makes sense.
Can we say something in the README for the ffi
options like:
Sets one or more --ffi=<string> that specifies files for code...
I just removed the words location of
, but I think it helps indicate we want files as values.
Noted on the publishing. The bump works for me, but I will hang off on putting it on NPM until purescript 0.7 is out (unless we need it sooner).
Ah, and I am wondering if any exceptions will be thrown with glob.sync
. Should we handle an error that may crop up here?
What do you suggest we do for that - fail silently and return []
? There's not really a way of handling errors in the option building at the moment, is there?
You're right there is no way currently to handle errors during the option building.
I was testing out when exceptions would be thrown by glob, and it seems to only throw on input that is not a string. So I think we already enforce a string is required as input to glob. Perhaps leaving it as-is is the best thing to do. I think that works.
More changes :)
ffi
option I added wasn't very useful in its previous form, as you'd always have to specify the full list of file paths or useglob
to do the work - figured I may as well integrate that into the plugin.docgen
option forpsc-docs
- it works a bit likecodegen
forpsc
:psc-docs
now requires all the input files, so this option lets you filter what modules to generate the docs for. It has a few permutations that are acceptable in the config: