A build tool for PureScript.
$ cabal install purescript
$ npm install -g pulp
The structure of a pulp
project should look like this:
root
- bower.json
- src/
- test/
Put your .purs
source files in the src
directory, and any tests
you might have in the test
directory.
Also, create a bower.json
file (see
http://bower.io/#defining-a-package). pulp
expects to find this
file in the root of your project. You can invoke pulp
from a
subdirectory; if there is no bower.json
to be found in the current
directory, pulp
will look through parent directories until it finds
it.
pulp
supports the following commands:
pulp init
generates a project skeleton with abower.json
file and a simple example program.pulp dep
does dependency management through Bower; essentially, it just passes you on to a locally installed version ofbower
. Thus,pulp dep install foo --save
is the equivalent ofbower install foo --save
except you don't need to install Bower globally.pulp build
invokes the PureScript compiler. Currently, it just compiles all.purs
files in yoursrc
and dependencies into the target directory, which defaults tooutput
.pulp test
runs your test suite: it expects aTest.Main
package in thetest
directory, containing amain
function, which is required and run using Node. It's expected that failing tests will cause the program to terminate with an error.Test.QuickCheck
works well for this purpose.pulp run
will first runpulp build
, then launch the compiled project code in a Node process. The entry point will be themain
function in the module specified with the--main
option, or, by default, the moduleMain
.pulp browserify
also runspulp build
, then runs the project code through Browserify. The entry point is decided in the same way as withpulp run
. You can specify an output file using--to
; the default is to output the bundle to stdout, which is convenient for doing things likepulp browserify | uglifyjs -c
.pulp docs
generates a project documentation file using PureScript'spsc-docs
command.pulp psci
launches a PureScript REPL usingpsci
with the project's modules and dependencies installed.
You can launch any of the above commands with the --watch
or -w
option, which will cause pulp
to run indefinitely, watching your
src
and test
folders for changes, and re-running the command
whenever something changes.
Copyright 2014 Bodil Stokke
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
See the LICENSE file for further details.