![](http://prototype-generator.com/img/logo-pg.png)
Visit the PG-website to learn how to use PG: http://prototype-generator.com
Yeoman generator for Prototype.
![NPM](https://nodei.co/npm/generator-prototype.png?downloads=true&stars=true)
Getting started
Requirements
- Node.js & Node Package Manager
- Grunt Command Line Interface – npm install -g grunt-cli
Optional Use of Ruby (SASS & Compass)
- SASS 3.4 (only when you do not want to use node-sass) – gem install sass
- Compass 1 (because of Source Maps) – gem install compass --pre
Installation
Update
- Update the Generator-Prototype via:
npm update -g generator-prototype
Usage
Scaffold your new prototype project.
mkdir project && cd project
yo prototype
Options
Quick Start
You can scaffold your project in an instance. The first question is:
"Choose your installation routine"
If you choose "Minimal installation" you skip the rest of the questions and get the default values with:
- Libsass (grunt-sass)
- Grunt Modules: grunt-grunticon, grunt-data-separator
- Assemble as Template Engine
Structure
├───helpers
│ ├───configs
│ ├───templates
│ │ ├───grunticon-template
│ │ └───styleguide-template
│ └───_grunt
├───resources
│ ├───ajax
│ ├───assets
│ │ ├───fonts
│ │ ├───img
│ │ │ ├───svg
│ │ │ │ └───icons
│ │ └───media
│ ├───bower-components
│ ├───data
│ ├───js
│ ├───scss
│ │ ├───global
│ │ ├───icons
│ │ └───utils
│ │ ├───extends
│ │ └───mixins
│ └───templates
│ ├───helpers
│ ├───layouts
│ ├───pages
│ └───partials
├───_dist
└───_output
Plugins and Modules
There are standard grunt modules I use. These are:
But you can also apply additional addons and grunt modules to your project. Just choose specific ones:
Grunt modules
Assemble
We use Assemble as template engine. Assemble is a component and static site generator that makes it dead simple to build modular sites, documentation and components from reusable templates and data.
You want to know more? Here you go: assemble.io
In your installation routine you can choose specific modules for Assemble:
- assemble-contrib-permalinks
- assemble-contrib-sitemap
- assemble-related-pages
Gruntfile
For our Gruntfile we use the grunt module load-grunt-configs to split the file up in multiple files.
These files/tasks you can find in this directory:
Features
The Generator-Prototype supports different features. Just check/uncheck them in the custom installation routine:
- You want to add a separate distribution folder? - Check!
- You want to add a CSS Styleguide and Assemble Development Documenation? - Check! (See "Developer Documentation")
- You want to use Libsass instead of Ruby to compile SASS files? - Check!
- You want to use PG Methodology? - Check!
- You begin your project with mobile first but need to support desktop styles in IE8? - Check!
JS Libraries and CSS Frameworks
You can choose JS Libraries like:
- jQuery
- BackboneJS
- RequireJS
- AngularJS
And you can also choose SCSS Frameworks like:
- Foundation
- Bourbon Neat
- SASS Bootstrap
All files will be included and configured. Have fun!
Sub Generators
We integrated some sub generators for you:
BackboneJS:
- Create a Backbone Model: yo prototype:bm
- Create a Backbone View: yo prototype:bv
- Create a Backbone Collection: yo prototype:bc
Grunt Modules:
You forgot a grunt module?
- Install your grunt modules: yo prototype:gm
Frontend Components:
You want to install all base templates, a form template or other modules? (work in progress)
- Here you go: yo prototype:components
Others will follow.
Developer Documentation
Generator-Prototype provides a way to document your assemble modules via markdown and a separate docs folder.
Just use the custom installation route and check:
- Create Developer Documentation
For further informations and instructions see:
Alternative
License
MIT License
Release History
v0.4.67
- Added grunt-comment-toggler for RequireJS
- Changed components/c-article.hbs
v0.4.65
General
- Refactored Gruntfile.js
- Added loadCSS.js to load CSS Styles asynchronous
Assemble
- Added custom helper-partial.js
- Added support for assemble factories
- Added Regions Readme.md
SASS
- Added custom breakpoint mixin
v0.4.64
- Fixed bug with version block
- Fixed async task
- Added c-form.scss
v0.4.63
- Added
Regions
for PG Frontend Methodology - Modified form component
- Deleted batch files
- Refactored bower directory in demo files
- Added almond and grunt-contrib-requirejs
v0.4.62
- Optimized package.json
- Integrated git submodule for components
- Integrated {{#ifBlock}} helper
v0.4.61
- Minor change in svg-sprites task
- Bugfix with version.js
- Mixin: spriteicon() added
- Updated prototype:gm to support automated download of grunt-text-replace
- Changed path for prototype:plugin
v0.4.60
- Updated grunt-photobox to support grunt-browser-sync or grunt-contrib-connect
- Changed output of photobox to Dev folder
v0.4.59
- Changed Standard Installation to Minimal Installation
- Optimized svg-sprites and svgmin workflow
- Changed classes fo PG Frontend Methodology
v0.4.58
- Added fork of grunt-dr-svg-sprites and dr-svg-sprites to support placeholders in scss files
- Changed replace.js to change file path
- Added PG Frontend Methodology
TODO:
- Tests
- Integrate Broccoli.js as option