#Express Brunch with Jade
Express Brunch with Jade is a Brunch app skeleton that has everything hipsters has, but adds a custom Express Server, public & server file watcher, built-in socket.io reload, custom Backbone model/view/collection helpers, Jade client & server side templates and over 70 mocha BDD tests.
Express Brunch with Jade's custom server.coffee file watches any files you specify, server and/or public static file compiled by brunch, reloads the Express App and sends a socket.io reload command to the client when it detects a change.
Files & Directories that are watched and ignored are configured under the server section in the config.coffee:
example:
server:
path: 'server.coffee'
port: 3333
base: '/'
app: 'express'
debug: 'brunch:server'
persistent: true
interval: 100
watched: ['public', 'express']
ignore: /(^[.#]|(?:~)$)/
source: /.*\.coffee$/
linter:
enabled: on
coffeelint:
pattern: /.*\.coffee$/
options:
indentation:
value: 4
level: "error"
tester:
enabled: on
mocha:
pattern: /^.*_test\.coffee$/
options:
reporter:'spec'
The server walk and watch functionality has been made into its own module called Cordell.
- Express v3.2.0
- Jade-Brunch 1.5.0
- HTML5 Boilerplate v4.1.0
- Twitter Bootstrap v2.3.1
- Font Awesome v3.0.2
- Backbone v1.0.0
- Underscore 1.4.4
- jQuery v1.9.1
- Normalize.css v1.1.0
- Modernizr v2.6.2
- Coffeelint 1.4.4
brunch new <appname> --skeleton git://github.com/jerfowler/ExpressBrunchJade.git
cd <appname>
brunch w -s
or
$ git clone git://github.com/jerfowler/ExpressBrunchJade.git
$ cd ExpressBrunchJade
$ npm install
$ brunch w -s
or
$ git clone git://github.com/jerfowler/ExpressBrunchJade.git && cd ExpressBrunchJade && npm install && brunch w -s
The traditional uglify-brunch plugin has been replaced with ugly-blanket-brunch, which creates separate cov.js and min.js files.
Optimization must be enabled when starting brunch
$ brunch w -s -o
The brunch test
command is pretty much broke. It uses jsdom, which has many issues... Plans are in the works for brunch to use phantomjs in the future. Until then, there are better ways to run tests:
brunch w -s -o
Note: Doesn't work in IE. Some tests fail with global leak detected
in firefox if firebug isn't on...
npm install -g mocha-phantomjs
mocha-phantomjs public/test/index.html
Note: Windows phantomjs support is sketchy (path issues)
npm install -g karma
karma start --browsers Chrome,ChromeCanary,Firefox,PhantomJS
Note: On Windows x64, use karma.x64_ENV.bat
to help with browser paths
Brunch debug events can be monitored by setting the DEBUG=brunch:*
environment variable.