cakehelper
Utility library for easing the setup of a projects cake tasks.
Last updated 7 years ago by whenraptorsattack .
Original npm · Tarball · package.json
$ cnpm install cakehelper 
SYNC missed versions from official npm registry.

Utility library for easing the setup of a projects cake tasks.

##Usage

npm install cakehelper
CakeHelper = require "cakehelper"

paths =
  "base"      : [ "./src", "./public" ]
  "styles"    : [ "./src/resources/css", "./public/resources/css" ]
  "templates" : [ "./src/resources/templates", "./public/resources/templates" ]

tasks = new CakeHelper { paths }

task "compile", "Compiles all source files", -> tasks.do "compile"

##CoffeeScript You may optionally set a path of "coffee": [ inPath, outPath ]. If not set it will default to using the base path.

###API

# Compiles all .coffee files
tasks.do "compile:coffee"

# Watches for and compiles all changes to .coffee files
tasks.do "watch:coffee"

##Styles

###Stylus You may optionally set a path of "styles": [ inPath, outPath ]. If not set it will default to using the base path.

####API

# Compiles all the .styl files
tasks.do "compile:stylus"

# Watches for and compiles all changes to .styl files
tasks.do "watch:stylus"

###Less You may optionally set a path of "styles": [ inPath, outPath ]. If not set it will default to using the base path.

####API

# Compiles all the .less files
tasks.do "compile:less"

# Watches for and compiles all changes to .less files
tasks.do "watch:less"

##Templates

###Dust You may optionally set a path of "templates": [ inPath, outPath ]. If not set it will default to using the base path.

####API

# Compiles all the .dust files
tasks.do "compile:dust"

# Watchs for and compiles all changes to .dust files
tasks.do "watch:dust"

###Jade Jade has three different types of compilation:

  1. Raw - Compiles a .jade template file into a simple javascript function for runtime use
  2. AMD - Compiles a .jade template file into an AMD module for runtime use
  3. JML - Jade Markup compiles a .jml file into an html file for runtime use

####Paths Each of these will look for a different path property before falling back to the base path.

They all use the following form:

"jade:<type>": [ inPath, outPath ]

####API Each type of compilation can use the following form of invocation as well

# Compiles all of the given types files
tasks.do "compile:jade:<form>"

# Watches for and compiles all changes to the given types files
tasks.do "watch:jade:<form>"

Jade also has an aggregate API:

# Effectively runs through all three types, compiling out all the files
tasks.do "compile:jade:all"

# Watches for and compiles all changes to all types
tasks.do "watch:jade:all"

Current Tags

  • 0.0.1                                ...           latest (7 years ago)

1 Versions

  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |