mission v0.0.9
Mission: common tasks in Web development
Bundled tasks for developing single page apps.
Usage
npm install --save-dev mission shelljsConfig in CoffeeScript or JavaScript:
#!/usr/bin/env coffee
require 'shelljs/make'
mission = require 'mission'
target.coffee = ->
mission.coffee
from: 'src/'
files: ['a.coffee', 'dir/b.coffee']
to: 'lib/'
options:
bare: yesHere's mine: https://github.com/jiyinyiyong/mk/blob/master/make.coffee
Run it like this:
chmod +x make.coffee
./make.coffee coffeeor like me:
alias mk='coffee make.coffee'
mk coffeeOther configurations
Say if you want to compile only one file:
target.coffee = ->
mission.coffee
file: 'a.coffee'
from: 'src/'
to: 'lib/'
options:
bare: yesOr you may need to find some files that are deep in folders:
target.coffee = ->
mission.coffee
find: /\.coffee$/
from: 'src/'
to: 'lib/'
options:
bare: yesfrom and to are optional, you mat only need to write file sometimes:
target.coffee = ->
mission.watch
file: 'dir'
trigger: (filename, extname) ->Usage
tree: creates file treebump: bump version withsemver.uglify: minify JavaScript codecoffee: compile CoffeeScript to JavaScript, with sourceMap supportwatch: watch directories, callbackfilenames andextnamestime: log the time it costrealod: reload tab withdevtools-reloader-stationbrowserify: combine JavaScript code on CommonJSbrowserifyVender: helper forbrowserifyto generatevender.jscssmin: combine CSS files and minify codedot: precompile dot files to JavaScriptjade: compile Jade to HTMLless: compile LESS to CSS
SourceMap is enabled by default, and here I have to use command line.
Related to: https://github.com/less/less.js/issues/1985
Anyway, mission.less needs to be updated in the future.
rsync: run Rsync with some default configscopy: copy files and directorieswait: waitchan.done = falseto betrueand run taskcirruHtmlcompile Cirru HTMLcirruHtmlJscompile Cirru to template in JavaScript(not tested)
Notice
Asynchronous callings are hard to handle in ShellJS. In this angle, Grunt did a good job in sequencing tasks.
But you can try wait to reduce the pain.
mission would keep watching .done and run task when it's true.
target.test = ->
a = done: no
mission.wait a, ->
console.log 'finish task'
setTimeout ->
a.done = yes
, 2000Development
Compile *.coffee:
./make.coffee compileChangelog
0.0.8add
externaloption for browserifyadd
browserifyVendertask for multiple bundling
0.0.7- Add
cirruHtmlJsand renamecirruHtml
- Add
0.0.6- Updated Cirru HTML to fix double quote in attributes
0.0.5- Added
sourceMapsupport
- Added
0.0.4- Added flexibility and some default options to
rsync
- Added flexibility and some default options to
License
MIT
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
12 years ago