purescript-deprecated / gulp-purescript

Gulp plugin providing PureScript compiler tasks
34 stars 8 forks source link

Updates 0.7 #29

Closed garyb closed 9 years ago

garyb commented 9 years ago

More changes :)


// Write individual files for the specified modules. The process writes nothing to stdout in this case.
purescript.pscDocs({
  docgen: {
    "Prelude": "docs/Prelude.md"
    "Prelude.Unsafe": "docs/Prelude.Unsafe.md"
  }
})

// Only generate docs for one module
purescript.pscDocs({
  docgen: "Prelude"
})

// Only generate docs for the listed modules, all included in the output
purescript.pscDocs({
  docgen: ["Prelude", "Prelude.Unsafe"]
})
garyb commented 9 years ago

I can squash the commits if you prefer also.

ethul commented 9 years ago

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.

garyb commented 9 years ago

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 imported. 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.

ethul commented 9 years ago

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).

ethul commented 9 years ago

Ah, and I am wondering if any exceptions will be thrown with glob.sync. Should we handle an error that may crop up here?

garyb commented 9 years ago

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?

ethul commented 9 years ago

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.