0.3.2 • Published 10 years ago
mandragora-bucket v0.3.2
mandragora-bucket
Dependencies
- nodejs > 0.12
- globally installed gulp
The purpose
mandragora-bucket provides bunch of gulp tasks that covers almost all needs of purescript project.
It can
- build projects via
psc
orpsc-make
- bundle
psc-make
d orpsc
ed projects with browserify - test projects with karma and check coverage with istanbul
- manage projects that have multiple entry points.
- watch
psc-make
andkarma
builds - produce docs
How to use it
default directory structure
root
- src/ -- Source code
- test/ -- Tests code
- dist/ -- temporary directory
- node_modules -- symlinks to project node_modules/ and psc-maked src
- entry-foo.js -- browserify entry one
- entry-bar.js -- browserify entry two
- test-main.js -- browserify test entry
- bower_components/
- node_modules/
- MODULES.md -- generated docs
- bower.json
- package.json
default config
{
paths: {
bower: [
'bower_components/purescript-*/src/**/*.purs',
'bower_components/purescript-*/purescript-*/src/**/*.purs'
],
src: ['src/**/*.purs'],
test: ['test/**/*.purs'],
docs: {
dest: 'MODULES.md'
}
},
tmpDir: 'dist'
}
- It takes
paths.bower
andpaths.src
to compile and watch in main tasks. - It takes
paths.bower
,paths.src
andpaths.test
for test tasks. gulp docs
emits documentation topaths.docs.dest
- Temporary directory is
tmpDir
minimal user config
{
entries: {
"Main": {
"name": "build",
"dir": "public"
}
}
}
Merging this config with default will add tasks that compile module Main
,
bundle results (for psc-make
) and put it to public
directory.
multiple entries config
{
"Entries.File": {
"name": "file",
"dir": "public"
},
"Entries.Notebook": {
"name": "notebook",
"dir": "public"
}
}
This config will add tasks for both Entries.File
and Entries.Notebook
.
using it in gulpfile
var mandragora = require("mandragora-bucket"),
gulp = require("gulp");
mandragora.config.entries = {
"Entry": {
"name": "result",
"dir": "out"
}
};
// use mandragora.config as default
mandragora(gulp);
// or provide config as second argument
mandragora(gulp, {
paths: {
bower: ["bower_components/purescript-*/src/**/*.purs"],
src: ["my/src"],
test: ["my/test"],
docs: {dest: "OTHER.md"},
},
tmpDir: "tmp",
entries: {
"Main": {
name: "result",
dir: "out"
}
}
});
Produced tasks
Call to mandragora.define(gulp)
or mandragor.define(gulp, config)
will produce
following tasks:
gulp bundle-test
-- psc-makeTest.Main
entry and cover all file from src with istanbulgulp karma
-- run tests inkarma
gulp cover
-- run tests inkarma
and send statictics tocoveralls
gulp watch-test
-- watch test and project sources, recompile it bygulp bundle-test
For each of entry in config.entries
i.e.
{
"Foo.Bar": {
"name": "baz",
"dir": "out"
}
}
suffix will be foo-bar
gulp make
-- runpsc-make
gulp entries
-- make entry files for browserifygulp psci
-- produce.psci_modules
for sourcesgulp docs
-- emit docsgulp prod-suffix
-- runpsc
gulp bundle-suffix
-- bundle this entrygulp bundle-prod-suffix
-- bundlepsc
result with it npm dependenciesgulp deploy-suffix
-- compile viapsc-make
, bundle it, move toentry.dir
asentry.name + ".js"
gulp deploy-prod-suffix
-- compile viapsc
, bundle it, move toentry.dir
asentry.name + ".js"
gulp watch-suffix
-- rungulp deploy-suffix
on source changegulp bundle-prod
-- compile all entries bypsc
and then bundle it
Notes
- Tasks for testing will cause exception if there is no
Test.Main
module. gulp deploy-prod
should run aftergulp bundle-prod
and move all its results to target directories. It doesn't.
0.3.2
10 years ago
0.3.1
10 years ago
0.3.0
10 years ago
0.2.5
10 years ago
0.2.4
10 years ago
0.2.3
10 years ago
0.2.2
10 years ago
0.2.1
10 years ago
0.2.0
10 years ago
0.1.12
10 years ago
0.1.11
10 years ago
0.1.10
10 years ago
0.1.9
10 years ago
0.1.8
10 years ago
0.1.7
10 years ago
0.1.6
10 years ago
0.1.5
10 years ago
0.1.4
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago