A Spine based skeleton for Brunch following the Hem workflow
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
public
.gitignore
README.md
config.coffee
package.json

README.md

Brunch with Spine and Sass - The Hem way

A Spine based skeleton for Brunch following the Hem workflow.

Philosophy:

The idea behind this skeleton is to provide a workflow for SpineJS, similar to the one provided when working with Hem by Alex MacCaw.

Thanks to Brunch, this Skeleton will build one JS file to be included in your HTML, wrapping jQuery, SpineJS modules and your CoffeeScript/JavaScript code into CommonJS modules in the correct order. This way you can use require() in your Coffee/JS/HTML files just like we used to do in Hem.

Additionally, it will compile your SASS file(s) into one compressed CSS file.

Languages used:

Getting Started:

Requirements:

Clone the repository and run:

  • npm install which will install the required plugins. You need to have Node installed first
  • brunch build which will build the following files:
    • public/css/style.css (compressed)
    • public/application.js wrapping all the Coffee/JS files saved recursively in the app/ directory into CommonJS modules
  • Brunch provides a brunch watch --server command as well wich will serve your app and rebuild everything whenever a file is saved.

Project Structure:

--app/
  -controllers/
  -models/
  -views/
  -styles/
   -style.sass
  -lib/ (if you need to include additional JS libraries)
  -index.coffee (your main application file)
  
--public/
  -index.html
  -application.js (generated)
  -css/
   -style.css (generated)

--config.coffee
--package.json
	

Requiring files:

All modules are relative to the app/ directory. Examples:

# to require spine.js
Spine = require('lib/spine') # which is located in app/lib/spine.js

# if you have a user.coffee file in the app/models and
# you need to require it somewhere else:
User = require('models/user') # which is located in app/models/user.coffee

Make sure to add:

module.exports = [your_module_identifier]

before the end of every file. Check Spine's documentation for more about CommonJS.

Todo:

  • Add testing support
  • Add other CSS preprocessors support
  • Add Handlebars Support (probabily will be the first update)

Other:

  • SpineJS 1.2.2
  • jQueryify 2.0.3 (jQuery npm module for the browser)
  • Reach out for help or questions