Sails + CoffeeScript + Jade + Sass + Zurb Foundation.
Sails Starter Kit is an optimized configuration of Sails.js with Rails-like asset pipeline. It should save a couple hours of configuration at a hackathon but has not yet been audited for production use.
- Configuration: good — optimized gruntfile with better asset handling
- Development: good — intuitive code layout and automatic loading
- Test: see Sails.js
- Production: see Sails.js
The default sails new project
creates skeleton projects with ejs and less support.
Sails Starter Kit is a lovingly tweaked version of the default skeleton.
- Sails 0.9.8+
- Optimized Gruntfile for jade + sass + coffee
- Vendor directory for clean separation of app and vendor code
- Modified Gruntfile to automatically compile and copy vendor files
- Automatic inclusion of js and template files
assets/templates/*
assets/js/*.(js|coffee|)
- Manual inclusion of vendor files
vendor/*
- Allows for better control over vendor bloat
- Manual inclusion of stylesheets via sass @import
assets/styles/app.scss
- Allows for more intuitive development and control than automatic inclusion
- Automatic support for common client-side templates: jade, ejs, dust, etc.
- Files in assets/templates are compiled and combined into jst.js
- See consolidate.js for list of supported templates
- Automatic support for JS and CoffeeScript
git clone https://github.com/starterkits/sails-starterkit.git
cd sails-starterkit
npm install
sails lift
sails new starterkit --template=jade
npm install then-jade --save-dev
npm install grunt-contrib-sass --save-dev
Bump versions in package.json then update.
"dependencies": {
"sails": "0.9.8",
"grunt": "~0.4.2",
"sails-disk": "~0.9.0",
"optimist": "~0.6.0"
}
npm update
Create config/jade.js
// config/jade.js
module.exports.config = function () {
if (sails.config.environment === 'development') {
// Pretty print output
sails.express.app.locals.pretty = true;
}
};
Load config/jade.js in config/bootstrap.js
// Configure jade settings
require('./jade').config();
Add grunt-contrib-sass to Gruntfile.js
// Gruntfile.js
// ...
grunt.loadTasks(depsPath + '/grunt-contrib-coffee/tasks');
grunt.loadNpmTasks('grunt-contrib-sass');
Modify Gruntfile to support vendor dir, linking, etc. See commit.