Skip to content

Sails.js Starter Kit: Sails + CoffeeScript + Jade + Sass + Zurb Foundation

Notifications You must be signed in to change notification settings

starterkits/sails-starterkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sails Starter Kit

Sails + CoffeeScript + Jade + Sass + Zurb Foundation.

Status

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

Overview

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.

Features

  • 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

Setup

git clone https://github.com/starterkits/sails-starterkit.git
cd sails-starterkit
npm install
sails lift

Recreating from Sails.js Sekelton

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.

About

Sails.js Starter Kit: Sails + CoffeeScript + Jade + Sass + Zurb Foundation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published