Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Updates for 0.7 #43

Merged
merged 5 commits into from
Jul 2, 2015
Merged

Updates for 0.7 #43

merged 5 commits into from
Jul 2, 2015

Conversation

garyb
Copy link
Member

@garyb garyb commented Jun 29, 2015

This isn't ready yet, but I wanted to see what you thought @ethul

Changes involved: removal of psc, renamed pscMake to psc, added src option for accepting source file globs rather than the previous stream of files from gulp.

Since we don't have a stream anymore, I wrapped the task in a Promise instead, as this way you can still use it in gulp tasks without having to manually pipe callbacks in with the task definition. This part in particular I wonder if you have any thoughts on - maybe there's a better way? Also I just used promise from npm for this, but q, bluebird, etc. would work too, if you have a preference.

Still to do: add a task for pscBundle, update dotPsci and pscDocs (if needed), remove a bunch of now uneeded stream-related stuff.

@ethul
Copy link
Contributor

ethul commented Jun 29, 2015

Thanks for kick-starting these updates @garyb. I think they look good.

I have some parallel changes (nothing major), but I can merge them in after you're ready with this PR.

Regarding using promises, I could really go either way. I think either a callback-based psc entry function or a promise-based one would work. Both are easy to use through gulp. If you keep the promise approach, the promise module looks like a good choice to me.

One question I had was about the src option for accepting globs. From what I gather, the haskell System.FilePath.Glob and the javascript glob module (as just one example of a glob module we may need to use) have differing syntax for globbing.

This doesn't pose an issue for psc, but if we want to generate a .psci file, I believe we'll need to ensure that what we are able to glob with javascript will be the same as what will end up being globbed by the purescript compiler. Therefore, I was wondering if we should only allow limited glob capabilities (by parsing the user's glob string and validating it). But maybe this isn't really an issue. I am curious on your thoughts.

@garyb
Copy link
Member Author

garyb commented Jun 29, 2015

Ah, that's an excellent point with the globbing syntax - I suppose we probably should validate the globs and at least raise a warning if it looks like the pattern is unsuitable. Perhaps for now we just make it work though, and then refine later. I suspect most people won't be using anything more advanced than the bower_components/purescript-*/**/*.purs, type glob anyway for PureScript projects.

@garyb garyb force-pushed the 0.7-updates-again branch from 997954c to c76e143 Compare June 30, 2015 00:20
@garyb
Copy link
Member Author

garyb commented Jun 30, 2015

Ok, this is mostly ready now, I've ham-fisted my way through most of the changes, but there's some things I couldn't quite figure out how to do:

  • pscBundle is done now as a promisified task and has an output option, but ideally I'd like to be able to use it as a stream so we can pipe it to a file, or another process, or whatever as with the old psc task.
  • for dotPsci I've made an options parser so we pass it src and ffi options to include both :m and :f (foreign) commands in the generated file, but I've not touched the task as again I'm not really sure what I'm doing when it comes to producing streams.

Would you mind having a look when you get a minute? Hopefully it'll be a quick change for someone who knows what they're doing 😄

@ethul
Copy link
Contributor

ethul commented Jun 30, 2015

Awesome! Thank you for the updates. I will take a look at the streaming.

By the way, what do you think of renaming dotPsci to just psci?

@garyb
Copy link
Member Author

garyb commented Jun 30, 2015

Sounds good to me 👍

ethul added 2 commits July 1, 2015 00:29
Renaming the task to `psci` and writing the result of the command to the
`.psci` file.

Note that previous commits resolved #40
Note that this is part of the updates for PureScript 0.7, which along
with previous commits resolves #38
ethul added 2 commits July 2, 2015 08:15
Migrating back to a stream implementation for the tasks to allow
conventient piping with other streams such as `gulp.dest`.
Merging stream refactoring for 0.7 updates.
ethul added a commit that referenced this pull request Jul 2, 2015
@ethul ethul merged commit 9e123f6 into master Jul 2, 2015
@ethul ethul deleted the 0.7-updates-again branch July 2, 2015 16:09
@garyb
Copy link
Member Author

garyb commented Jul 2, 2015

I had the version set as 0.5.0-rc.2 in here so we'll need to update that before releasing.

@ethul
Copy link
Contributor

ethul commented Jul 2, 2015

Will do. Thanks for the heads up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants