generator-fouraxes
v0.2.3
Published
Battle the web with Backbone, Handlebars, Babel (Harmony) and Sass!
Downloads
4
Maintainers
Readme
Fouraxes generator
Battle the web with Backbone, Handlebars, Babel (Harmony) and Sass!
Inside
It also uses RequireJS (AMD style), but that is build into ECMAScript Harmony.
Grunt tasks
Fouraxes comes with some grunt tasks preinstalled.
These can be executed using grunt-cli
, by typing grunt _task_
.
Default
The main development task is the grunt default
task.
It will build the app once, start a development server and watches for any changes.
Also livereload will be enabled, handled by watch.
Compile
When exporting the project to production environments, you probably want everything compiled into a single file.
This is done by the grunt compile
task.
It exportes everything to a single file, main.js and main.css, within the build folder.
Serve
When you want to test the production version of the app, you can use grunt serve
.
This will compile the project, as described in grunt compile
, and start a production server.
Build
The grunt build
task will convert the Harmony code to good ol' JS5 code.
This is stored in the .tmp folder.
Also, this command can be separated in grunt build:scripts
and grunt build:styles
.
Note, the app/templates folder is not copied into the .tmp folder.
Validate
When you only want to check your code for errors, using jshint and jscs, grunt validate
is your task.
Note, this will check the app folder NOT the .tmp folder.
Subgenerators
The Fouraxes generator contains the following subgenerators. Use it by typing yo fouraxes:_subgenerator_ _name_
.
Note, each subgenerator requires a name (primary argument). This name MAY be relative.
Model
The model generator will create a model, within app/scripts/models.
option | type | description --- | --- | --- url | String | The model's (root) URL. withCollection | Boolean | Create a collection, with the name of the model, too.
View
The view generator will create a view, within app/scripts/views.
Note, the template option is ignored when using withTemplate.
option | type | description --- | --- | --- className | String | The class of the view's root element. tagName | String | The tag of the view's root element. template | String | The view's template, relative to the app/scripts/templates folder. withTemplate | Boolean | Create a template, with the name of the view, too.
Collection
The collection generator will create a collection, within app/scripts/collections.
Note, the model option is ignored when using withModel.
option | type | description --- | --- | --- url | String | The collection's (root) URL. model | String | The collection's model, relative to the app/scripts/models folder. withModel | Boolean | Create a model, with the name of the collection, too.
Template
The template generator will create a template, within app/scripts/templates.
option | type | description --- | --- | --- withView | Boolean | Create a view, with the name of the template, too.
Router
The router generator will create a router, within app/scripts/routers.
License
The MIT License (MIT)
Copyright (c) 2015 Cedric van Putten
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.