Generator-Stamp
Stamp Generator
Note – Be sure to use the latest version of Yeoman (1.0). Migration instructions.
A Yeoman generator for scaffolding out scalable web apps. Featuring:
- A flyweight node.js server
- Foundation CSS framework
- Sane & scalable javascript architecture (AMD modules optional)
- Backbone.js
- Handlebars templates
- Image optimization
Requirements
- Node.js
- Compass
- zurb-foundation gem
- grunt-cli
npm install -g grunt-cli
- yo
npm install -g yo
Getting started
- Install the generator globally:
npm install -g generator-stamp
- Run:
yo stamp
(make sure to cd into the directory where you wish to run your app) - Finally, run:
grunt go
and start coding!
Grunt Tasks
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins.
grunt go
- This will fire up a node.js server, setup watch tasks, and open your browser pointed at your app.grunt server
– This will spin up the node.js server ( note , you may also fire up the node server vianode server
)grunt compileTemplates
– Will compile all.hbs
files withinpublic/templates
intotemplates.js
and will be accessible via
// If using AMD;/* OR */// If not using AMDwindowJST'template_name';
grunt restart
– Restart all tasks intiated viagrunt go
except browser will not auto-opengrunt imagemin
– Optimize all images in/public/img
.- This task is autorun in the
build
sequence. - Optimized images will be saved to
build/img
- Optional output for
:dev
&:dist
- This task is autorun in the
grunt build
– This will concatinaterequire.js
and your build application (if using AMD)
Your App
Stamp will scaffold out you project with the following structure:
.├── Gruntfile.js├── config.rb├── package.json├── node_modules│ ├── ...├── public│ ├── css│ │ ├── app│ │ │ └── app.css│ │ └── scss│ │ ├── _settings.scss│ │ └── app.scss│ ├── img│ ├── index.html│ ├── js│ │ ├── lib│ │ │ ├── jquery.1.10.2.min.js│ │ │ ├── backbone.js│ │ │ ├── handlebars.js│ │ │ ├── lodash.compat.min.js│ │ │ ├── modernizr.min.js│ │ │ ├── require.js│ │ ├── config.js│ │ ├── main.js│ │ └── templates│ │ └── templates.js│ └── templates└── server.js