Chapless Brunch is a skeleton for building web applications, specifically single-page applications. It is a modification of Brunch with Chaplin. While Brunch can be used to run commands, tasks are also supplied via cake.
- node.js (mandatory)
- CoffeeScript (recommended via npm)
- Install node.js.
- While not mandatory, it is recommended to install CoffeeScript.
- Download this skeleton.
- Open a Terminal / Command Prompt and navigate to this directory where you downloaded the skeleton.
- Execute the command
npm installto install all package dependencies.
While Brunch commands can be used, cake commands are provided for this skeleton. These tasks can be executed using cake if it is installed. (cake [command]) If cake is not installed these commands can also be executed using npm. (npm run-script [command]) These are the following commands (this list is accessible using either the command cake or npm start):
These commands add additional features/items to the project that are not included by default. It is recommended to add these features in the beginning when setting up the project as they overwrite certain files.
Add Twitter Bootstrap and Font Awesome to the project. LESS-based files are provided for full customization. It is recommended that you add @import "vendor/styles/bootstrap/variables"; to base.less.
Add Backbone.stickit to the project.
These commands allow one to generate and destroy Chaplin components.
- Test files are automatically generated for each of these items.
- For views, a template and stylesheet is also provided in addition to the code file.
Generate/destroy a Chaplin model.
Generate/destroy a Chaplin collection. Generating a Chaplin collection will also generate its corresponding model. Specify the name in singular form, as collection will automatically be pluralized.
Generate/destroy a Chaplin view.
Generate/destroy a Chaplin collection view. Generating a Chaplin collection view will also generate the individual model item view.
Generate/destroy a Chaplin controller.
These commands are used to assemble the application, generating the necessary JS/CSS and adding assets. Use dev mode to keep readable JS/CSS and include tests under the test/ folder. Use prod mode to minify/uglify JS/CSS and omit tests.
Assemble the application once.
Assemble the application and continue to watch for changes. Rebuild every time a change is detected.
Assemble the application and continue to watch for changes. Rebuild every time a change is detected. Also, the application is served locally to open with a browser. This build uses the web environment.
Use the test command to execute tests in the terminal using jsdom.
- Brunch 1.5.3
- CoffeeScript (includes CoffeeLint)
- Eco
- LESS
- jQuery 1.9.1
- Underscore 1.4.4
- Underscore.string 2.3.0
- Backbone.stickit 0.6.3
- Modernizr 2.6.2 (in test)
- Clearless
- Bootstrap 2.3.1
- Font Awesome 3.0.2