purescript-contrib / pulp

A build tool for PureScript projects
GNU Lesser General Public License v3.0
445 stars 86 forks source link

Create `app.js` without `pulp server` #319

Closed adius closed 6 years ago

adius commented 6 years ago

I want to use the compiled program with node output/app.js as a CLI program. The file app.js generated by pulp server works exactly like this, but neither do the pulp build nor the pulp browserify versions.

Why is there no dedicated command to generate the app.js instead of having to misuse the server to build it?

nwolverson commented 6 years ago

pulp run also generates such an app wrapper (which is really just something like require('./output/Main').main(); but if you do pulp build --to app.js you also get a directly runnable bundle.

adius commented 6 years ago

Uhm aha, this does not seem particular intuitive or discoverable 😅

How about adding a pulp bundle command, which is basically pulp build --to output/bundle.js?

Another problem: If I want to use it is a executable I still need to add #! /usr/bin/env node to the top.

Would be cool if there was a command / flag as well. Maybe pulp bundle --executable

hdgarrood commented 6 years ago

I think this is sufficiently clear in the README as well as in the output of pulp build --help. I don't want to add more commands which do things which are already fairly straightforward.

adius commented 6 years ago

I shouldn't have to read the documentation first for such an essential command. pulp --help should be enough.

adius commented 6 years ago

And --to is the last command in the command options section. They should definitely not be sorted alphabetically, but by importance. Or there should be an additional examples section where the most important usage scenarios are described (a la https://github.com/tldr-pages/tldr)