Battle the web with Backbone, Handlebars, Babel (Harmony) and Sass!
It also uses RequireJS (AMD style), but that is build into ECMAScript Harmony.
Fouraxes comes with some grunt tasks preinstalled.
These can be executed using
grunt-cli, by typing
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.
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.
When you want to test the production version of the app, you can use
This will compile the project, as described in
grunt compile, and start a production server.
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
Note, the app/templates folder is not copied into the .tmp folder.
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.
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.
The model generator will create a model, within app/scripts/models.
|url||String||The model's (root) URL.|
|withCollection||Boolean||Create a collection, with the name of the model, too.|
The view generator will create a view, within app/scripts/views.
Note, the template option is ignored when using withTemplate.
|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.|
The collection generator will create a collection, within app/scripts/collections.
Note, the model option is ignored when using withModel.
|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.|
The template generator will create a template, within app/scripts/templates.
|withView||Boolean||Create a view, with the name of the template, too.|
The router generator will create a router, within app/scripts/routers.
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.