The app is written in coffeescript, stylus, emblem, and statically compiled jade. It includes a testem driven testsuite running in qunit testrunner. The test suite was originally stolen from here -- however this project has been updated to the newest Ember.Testing conventions.
How to install
Install mimosa globally
npm install -g mimosa
Clone the mimosa-peepcode project from github or run:
mimosa skel:new ember-peepcode
Install the server dependencies
cd ember-peepcode npm install
How to Run
From within the root of the project directory:
mimosa watch --server
This runs mimosa in watch mode and starts up the project's nodejs server with live-reload support.
The contents of the ./assets directory are processed by mimosa -- compiled or otherwise processed representations of asset files are written to the ./public directory.
When started in watch mode the ./assets directory is watched for changes -- when a change is made to the contents of the assets directory, the relevant files are recompiled automatically.
How to run tests
Install testem globally
npm install -g testem phantomjs
mimosa build-- after project build, the testsuite will be run headlessly inside phantomjs
When in watch mode, the test suite is run after every file modification
mimosa watch --server
You can also run the tests via testem (launch/connect multiple browsers, run tests in them all as slaves -- its great, check out the testem project for more details!)
Finally, if you are just getting started with understanding the test suite and you want to run it directly you can start the project server and point your browser at http://localhost:3000/testrunner.html
All the included tests should pass after project checkout, please report an issue if you notice otherwise.
Overview of the file structure
- configuration file for mimosa
- documents all mimosa configuration options and their default values -- it doesn't control any behavior. This file is produced by running `mimosa config` -- running the command again will regenerate the file to reflect the current mimosa module versions.
- all files in this directory are processed by mimosa. each file will produce some kind of representation in the ./public directory depending on which preprocessor/compiler/mimosa module[s] is/are applied to the input file[s]
- the output produced by the mimosa build process. These are the artifacts that should get served to the browser
- starts a a basic expressjs server (note the default createServer method)
- express routes -- nothing happening in this app as this app doesn't do anything dynamically in the server
- any server side views would go here
- configuration file for bower frontend package manager
- Jade static html template which loads the application. This template is compiled by mimosa (via client-jade-static module) and then immediately executed to produce an html file. The html file it produces is written to public/index.html -- the entry point for the application.
- Jade html template which loads the test suite. This template is also statically compiled by mimosa-client-jade-static It produces the file at public/testrunner.html which runs the testsuite.
- Stylesheets (can be written in stylus, less, sass, or css)
- peepcode-ordr app rewritten in coffeescript
- ordr app models rewritten in coffeescript and using Ember-Model rather than Ember-Data
order app templates.
Files ending in .emblem or .hbs are precompiled with the appropriate compiler
based on the file extension.
They compile to public/app/compiled-handlebars.js and public/app/compiled-emblem.js.
The compiled files populate the Ember.TEMPLATES array in the manner expected by ember.
ex: the template at templates/foo/bar.emblem will be available within the ember app as the template with name 'foo/bar' (aka Ember.TEMPLATES['foo/bar'])
- Configure application for ember testing environment. Defined test helpers
- integration tests
- bower managed stylesheet dependencies