{"_id":"generator-thorax","_rev":"28-ab3090dfb230f5200189d6377e6df9c0","name":"generator-thorax","description":"A Thorax generator for Yeoman","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.1":{"name":"generator-thorax","version":"0.0.1","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/eastridge/generator-thorax","bugs":{"url":"https://github.com/eastridge/generator-thorax/issues"},"author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"https://github.com/blakeembrey"},"main":"app/index.js","repository":{"type":"git","url":"git://github.com/eastridge/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.13.0"},"devDependencies":{"mocha":"~1.10.0","grunt":"~0.4.1","grunt-contrib-copy":"~0.4.1"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.1","dist":{"shasum":"f30ad9f3f7c2114bbd76fc2ec2a2db1dc9df283e","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.1.tgz","integrity":"sha512-ZhiviCKCvkZwzhIU3FvYY44XQIedKsBthom6gzT/uFAO/Sv3tEvj068jB9ZZF6BGeFIJdqjclTXOQWTg156zJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAz2adpwmjGMu9TL/qAX1YJc9+8rWf9pPxKw+/sujm8rAiAjeYQT+aXsI7PxuWOxg69GQomIERODVqY487t0nhv31Q=="}]},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}],"directories":{}},"0.0.0":{"name":"generator-thorax","version":"0.0.0","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/eastridge/generator-thorax","bugs":"https://github.com/eastridge/generator-thorax/issues","author":{"name":"Blake Embrey","email":"hello@blakeembrey.com","url":"https://github.com/blakeembrey"},"main":"app/index.js","repository":{"type":"git","url":"git://github.com/eastridge/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.12.0"},"devDependencies":{"mocha":"~1.10.0","requirejs":"~2.1.8","grunt":"~0.4.1","grunt-contrib-requirejs":"~0.4.1"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.0","dist":{"shasum":"0aba95b7843ca24b06feb6a9b9b6ac0444038703","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.0.tgz","integrity":"sha512-z/sFBK8e4lkjBhy2z1hEVT0ECqLD7+9oBvvKm4aOI5o2MxNgvus8WiD8u0QRuDRyvuE3xvJUhXwjZ1nI8ckdDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLmshODPyfzO+dZns/6U1Q6loPFqO+UeV7Tmv2nVDR+AiAlP6k11sGmsgOneyrCz83U0y+JzroSDOWO1D1XHevM0Q=="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}],"directories":{}},"0.0.2":{"name":"generator-thorax","version":"0.0.2","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":"https://github.com/walmartlabs/generator-thorax/issues","author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.13.0"},"devDependencies":{"mocha":"~1.10.0","grunt":"~0.4.1","grunt-contrib-copy":"~0.4.1"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.2","dist":{"shasum":"9422f112f9cbf24219e8286047471fcba41efe1d","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.2.tgz","integrity":"sha512-uA2bEk6VMDO8U/e7Fa92GjqoQ+W+7vvjvR2be/8fwm3yYdMwOItpH2Ldif7E1ZSnbnptfvvITl+y3uVj3PzOmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+VA40c5wvHvbMKMv6/hXBOj2CIYT2evC0kd/PjObFnwIhAKfqsAEEDaS2vpeTwOiyMSwmIIeIe4rByDnsYcyarZxB"}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}]},"0.0.3":{"name":"generator-thorax","version":"0.0.3","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":{"url":"https://github.com/walmartlabs/generator-thorax/issues"},"author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.13.0"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-mocha":"~0.4.0","grunt-contrib-copy":"~0.4.1","mocha":"~1.10.0","sinon":"~1.7.3"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.3","dist":{"shasum":"952eb761f77b84a769b803500e13e739ec44018b","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.3.tgz","integrity":"sha512-QpPykb9cTf3IaqeWrWkOBedRh+6fJ+BRAudoQ+VRpWhYP6byetb8P/inW3xXak/ST5sVMFIt2qEPAcmJK5Z9SA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDS+Jl/VPqtBvMf5Eq1McTIR/o2XGotG+ProJKYUNJw/QIgEeKt2q2BQ2gKAPqMNufYVmGcBFOHirTGR2UL+z/Aiqw="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}]},"0.0.5":{"name":"generator-thorax","version":"0.0.5","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":"https://github.com/walmartlabs/generator-thorax/issues","author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.13.0"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-mocha":"~0.4.0","grunt-contrib-copy":"~0.4.1","mocha":"~1.10.0","sinon":"~1.7.3","marked":"~0.2.10"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.5","dist":{"shasum":"36036ce37956285d4ef01cf6b5d64f5c8e81b6af","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.5.tgz","integrity":"sha512-/YBD/anZ4o+9KtO+KbhSSMOZ22pvaga4pcE5Vu0wx634OL3KOfYu3hfNSLoR3leVI0/058JEipzCcYrZ7kPe4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3No24Fk1yrfsm6Npr4CE6ZkPob0XLkd5lnjzprhtbCQIgLfe4qC6xmX+CdPqk/lzbuQgW0clvZv3n2qLwcHCDPUg="}]},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}]},"0.0.6":{"name":"generator-thorax","version":"0.0.6","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":{"url":"https://github.com/walmartlabs/generator-thorax/issues"},"author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"dependencies":{"yeoman-generator":"~0.13.0"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-mocha":"~0.4.0","grunt-contrib-copy":"~0.4.1","mocha":"~1.10.0","sinon":"~1.7.3","marked":"~0.2.10"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.6","dist":{"shasum":"6a5ba75969e5d55e8a2a7f87b953241272c79a09","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.6.tgz","integrity":"sha512-TzNXvI1XuJlh1oSnPINpMtZFxoP97sBu3xbFQGIdl/JdAUbgQZmHFf3tRXs2Se2F9B9eSBt7Uo35x1eTDMIqjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGr+WER0HfzQ5sCi3uZMHg/khc/vCxcrcJ2H7BIzReynAiEA0LZNPN7cXLQ/20LAPxgSMoZwroas1dinLmjIACaXNGk="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}]},"0.0.7":{"name":"generator-thorax","version":"0.0.7","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":{"url":"https://github.com/walmartlabs/generator-thorax/issues"},"author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"./node_modules/.bin/mocha"},"peerDependencies":{"yo":">=1.0.0-rc.1.1"},"dependencies":{"yeoman-generator":"~0.14.0","chalk":"~0.3.0","marked":"~0.2.10"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-mocha":"~0.4.0","grunt-contrib-copy":"~0.4.1","mocha":"~1.10.0","sinon":"~1.7.3"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.7","dist":{"shasum":"f83475f5e0f02522657bf8ea060483acc7f74b0d","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.7.tgz","integrity":"sha512-P5s+c5grIe1IvvIGl3kuwDtVisIx1hynzDjZO7bOEs9drhcaMy6xvEg9ke4rRsPLzG9J54LVRSgw6Gr7Sfg/yw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXpZ1DE+x6YZOAlJjPu609bd9U1LXUqoJG0TCclmV8OAiBpwshoR/GPl3htI2a2lELDFI9udzy8hHgjTeNfcwPkTQ=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}]},"0.0.8":{"name":"generator-thorax","version":"0.0.8","description":"A Thorax generator for Yeoman","keywords":["thorax","generator","yeoman-generator"],"homepage":"https://github.com/walmartlabs/generator-thorax","bugs":{"url":"https://github.com/walmartlabs/generator-thorax/issues"},"author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"main":"app/index.js","repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"scripts":{"test":"mocha"},"peerDependencies":{"yo":">=1.0.0-rc.1.1"},"dependencies":{"yeoman-generator":"~0.14.0","chalk":"~0.3.0","marked":"~0.2.10"},"devDependencies":{"chai":"~1.8.1","grunt":"~0.4.1","grunt-mocha":"~0.4.0","grunt-contrib-copy":"~0.4.1","mocha":"~1.10.0","sinon":"~1.7.3"},"engines":{"node":">=0.8.0"},"licenses":[{"type":"MIT"}],"_id":"generator-thorax@0.0.8","_shasum":"06ac05551be3abb2ac2d7509b44c526f2252154c","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"eastridge","email":"ryan@eastridge.me"},"maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}],"dist":{"shasum":"06ac05551be3abb2ac2d7509b44c526f2252154c","tarball":"https://registry.npmjs.org/generator-thorax/-/generator-thorax-0.0.8.tgz","integrity":"sha512-eGW5Dnl9iqK75wpSAg5AqtNez5+wFl9qJ/NOnbqYCClSqEFe1W8xDsi+Rx4dXN/12nUCEm+dLn9/cr0TUu3LqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA69qUKxMLhgsWaEciROdg6uXhQuTv5ipF1u59t4m6SdAiEAxfFfM3VHe/6KTNd5k+Le1nXCEOwmp3z2X/RQA3SWodE="}]}}},"readme":"# Thorax Generator\n\nGenerate a new [Thorax](http://thoraxjs.org/) application. Includes some configurable options and some opinions.\n\n```sh\n$ npm install -g yo generator-thorax\n$ yo thorax desired-application\n$ cd desired-application\n$ grunt\n```\n\nFor a snazzier development environment, it's recommended that you install the [Thorax Inspector Chrome Extension](https://chrome.google.com/webstore/detail/thorax-inspector/poioalbefcopgeaeaadelomciijaondk?hl=en-US) before getting started.\n\n## Stack\n\n- Thorax, a framework for building better Backbone applications\n- Handlebars, a framework that works out of the box with Thorax for writing dynamic JavaScript views in HTML, variables are inserted using the `{{ handlebars }}` syntax\n- Grunt, a framework for declaratively defining CLI tasks, e.g., for running tests, compiling stylesheets, creating a production build of your app.\n- Bower, a package manager for the browser making it easy to pull in 3rd party libraries\n- Your choice of LESS/Stylus/SASS for more productive stylesheets\n- Automated JavaScript testing stack:\n  - Mocha w/ Chai - for BDD style tests\n  - Karma, a framework for piping test results to the command line for a rapid testing feedback loop\n  - Built in support for Travis CI\n- Require JS, a framework for working with modules in the browser\n  - `hbs!` Require JS plugin for 'just in time' compiling of Handlebars templates for rapid feedback during development. Templates will be pre-compiled when creating a production build via the r.js optimizer provided as a grunt task\n  - `cs!` Require JS plugin for 'just in time' compiling of CoffeeScript files, allowing you to mix CoffeeScript and JavaScript files at will, enjoy rapid feedback during development, including fast tests. CoffeeScript will be pre-compiled to JavaScript when creating a production build via the r.js optimizer provided as a grunt task\n- Yoeman Generators\n  - generating a new application\n  - generate a new router, view, model, collection or helper with an example test written in Mocha + Chai\n- Live Reload, for automated browser reloading during development\n- Built in deployment strategies for Heroku and Nodejitsu, for quick and efficient deployment of your app to the cloud.\n\n## Directory Structure\n\n- `bower_components` Installed third party libraries. Managed by [Bower](http://bower.io/), do not modify directly.\n- `css` Regardless of whether you are using a CSS superset (LESS / Stylus / SASS) or plain CSS, this is where your CSS should live. This will get copied or compiled to `public/css` when running `grunt build`\n- `js`\n  - `collections`\n  - `models`\n  - `routers`\n  - `templates`\n  - `views`\n  - `collection-view.js`\n  - `collection.js`\n  - `layout-view.js`\n  - `require-config.js` **Require JS data-main entry point**\n  - `model.js`\n  - `view.js`\n- `node_modules`\n- `public` The connect server will serve this directory at `/public`\n  - `css` Generated or copied CSS from the `css` directory, do not modify.\n  - `fonts` Any web fonts for your application, safe to modify.\n  - `img` Any images, safe to modify\n  - `index.html` Do not modify, and add new libraries to `/require-config.js`\n- `tasks` Put your custom grunt tasks in here\n  - `options` Installed grunt options are looked up here, by file name\n- `bower.json` Third party library management via [Bower](http://bower.io/)\n- `Gruntfile.js` [Grunt](http://gruntjs.com/) build file. `grunt` will run the default task specified in this file.\n- `package.json` Any `npm` dependencies needed to build / compile your application.\n- `README.md` A copy of this very file!\n\n## Grunt Tasks\n\nEvery generated application comes fully loaded with an amazing development and testing environment. Furthermore, when you're ready to show the world what you've made, building a production version of your application and deploying it to the cloud is painless and even testable in multiple browsers.\n\n### Development\n\n** Run `grunt`**\n\nThe best way to get up and running in development is to run `grunt` from the command line. This will boot a connect server and open up a browser to `http://localhost:8000/`.\n\nConnect will also serve your tests at `http://localhost:8000/test`.\n\nLiveReload will reload both `/` and `/test` when changes are made to any file within your directory while `grunt` is running in the background.\n\n### Testing\n\n** Run `grunt autotest`**\n\nThe easiest way to run your tests is perhaps just to stick with the test runner page provided when running the default `grunt` task discussed above.\n\nHowever, every application also comes with [karma](https://github.com/karma-runner/karma) setup to run your mocha tests inside your terminal window out of the box.\n\nTo try this out run `grunt autotest` from the command line. By default karma is setup to run tests in Chrome which is the most reliable and fastest way to gain rapid feedback from a real browser during development.\n\n### Advanced Testing\n\n** Run `grunt` in one window and `karma start` in a second**\n\nAnother option for running your tests is to skip grunt altogether and simply run `karma start` from your terminal window. This option will provide the fastest feedback loop during development and is recommended once your comfortable running your tests completely on the command line.\n\nYou still may want to run `grunt` in a second terminal window to hook up livereload to your application when adjusting styles or manually clicking through your app, but running `karma start` will shave roughly a second off of each test run making for a very tight feedback loop.\n\n#### Debugging Karma\n\nTo gain access to the console and debugging tools provided by Chrome, click on the `Debug` button at the top of the window booted by karma. Within here you'll have full access to your Thorax application, even though the page itself is white.\n\n### Production\n\n** Run `grunt production`**\n\nWhen you're ready to build concatenated and minified versions of your css and JavaScript source run `grunt production`. The output can be found in `dist/` and a browser window will be booted so you can play with the production version of your application before deployment.\n\n#### Test Your Production Build in Multiple Browsers\n\n** Run `grunt deploy`**\n\nBefore deploying your application run `grunt deploy` to run your tests against the built version of your application inside the following browsers:\n\n- Chrome\n- Firefox\n- Safari\n- PhantomJS\n\nTo test your application in IE you'll need a Windows box. Run `npm install karma-ie-launcher --save-dev` and add `IE` to the array of browsers within the deploy task inside `tasks/options/karma.js`. However, using [Sauce Labs](https://saucelabs.com/) in conjunction with the [Karma Sauce Launcher](https://github.com/karma-runner/karma-sauce-launcher) is the recommended and effective solution to this common problem.\n\n#### Phantom JS with Karma or Mocha-PhantomJS\n\nIf you prefer to manually run your tests via the command line during development every generated app also provides to ways to accomplish this:\n\n- `grunt test` will run your tests with Phantom JS via karma\n- `grunt test-mocha-phantomjs` will run your tests with [Mocha PhantomJS](https://github.com/metaskills/mocha-phantomjs), which also outputs to your terminal but provides a nicer UI than Karma in a format that reads like documentation, similar to what you'll find in the browser window when running `grunt` or when running mocha tests in node js.\n\n#### Continuous Integration with Travis CI\n\n**Use github, flip on Travis CI switch**\n\nIf you host your application as a repo on github(public or private), you can optionally turn on Travis CI support. Every application is generated with a `.travis.yml` file, so once the switch has been turned on, it'll work out of the box.\n\n## Deployment\n\nEvery generated application comes setup ready to deploy to either Heroku and/or nodejitsu.\n\n**To deploy to heroku:**\n\n1. Make sure you have the [Heroku Toolbelt](https://toolbelt.heroku.com/) installed and you have logged into your account via `heroku login`.\n2. Build your app: `grunt production`. This will output a minified version of your app to `dist/` which heroku will serve up.\n3. Make sure you have committed your changes to git:\n    - `git add .`\n    - `git commit -m \"commit message here\"`\n4. Run `heroku create` from the command line.\n5. Run `git push heroku master`\n6. Run `heroku open` to see your app live on the web!\n\nNote: During deployment run `foreman start` to test your application. Open your browser to port `5000` to view your app.\n\n**To deploy to nodejitsu:**\n\n1. Install the tool: `npm install jitsu -g`\n2. Create an account: `jitsu signup`\n3. Login: `jitsu login`\n4. Build your application: `grunt production`\n5. Deploy: `jitsu deploy`\n\nThat's it. Your `package.json` file already has a `scripts` option named `start` that nodejitsu will use to boot the application.\n\n### CoffeeScript Support\n\nOut of the box all generators can optionally output CoffeeScript.\n\nWhen generating a new application, the generator will simply ask you if you want CoffeeScript or JavaScript and act accordingly by outputting the generated application with the files of the chosen format.\n\nRunning a sub generator, like `yo thorax:router`, will look for the presence of at least one `.coffee` file within `js/` and choose whether to output CoffeeScript or JavaScript accordingly.\n\nTo force CoffeeScript output, append `--coffee` to any of the following commands.\n\nTo force JavaScript output, append `--js` to any of the following commands.\n\n##### Requiring a CoffeeScript Module\n\nRegardless of what a generator outputs, `.coffee` files are always supported out of the box.\n\nTo require a CoffeeScript module instead of a JavaScript module simply prefix the module name with `cs!`. For example: (inside a JavaScript module or CoffeeScript module)\n\n```js\n  require(['cs!my-module'], function(myModule) { ... })\n```\n\nPrefixing a module name with `cs!` will compile the CoffeeScript file on the fly removing the need for pre-compilation during development.\n\nWhen creating a production build with `grunt production` however, the r.js optimizer will pre-compile the CoffeeScript files to JavaScript before doing concatenation and minification.\n\n### Handlebars Support\n\nSimilar to how CoffeeScript files are compiled on the fly using the `cs!` Require JS plugin, Handlebars files ending in `.hbs` also benefit from not having to run through a compile phase.\n\nTo require a handlebars template for use in a view, prefix the name of the module with `hbs!`. For example, inside a view or collection view:\n\n```js\n  require(['hbs!my-template'], function(template) { ... })\n```\n\nHandlebars files will be treated as JavaScript templates therefore leave off the trailing `.hbs` when requiring a template within a view or collection-view.\n\nOne current caveat with this approach is that the `template` option within a view or collection-view will always need to be manually set.\n\n## Generators\n\n### Application Generator:\n\nGenerate a new Thorax Application using the software stack mentioned above:\n\n```sh\n$ yo thorax app-name\n```\n\n### Sub Generators:\n\nUse these within an existing Thorax application:\n\n```sh\n$ yo thorax:router name\n$ yo thorax:view name\n$ yo thorax:model name\n$ yo thorax:collection name\n$ yo thorax:collection-view name\n```\n\nThe `name` argument may include a directory path, such as `todo-list/index`:\n\n```sh\n$ yo thorax:router todo-list\n$ yo thorax:view todo-list/index\n```\n\n## From Zero to Todos\n\n### Install the generator\n\n```sh\n$ npm install -g yo generator-thorax\n```\n\n### Generate your application\n\n```sh\n$ yo thorax todo-list\n[?] Would you like to generate the app in a new directory? Yes\n[?] Choose a css pre-processor: (Use arrow keys)\n    ❯ Less with bootstrap (default choice)\n      Sass\n      Stylus\n      Plain CSS\n[?] Would you like to use CoffeeScript? No\n[?] Would you like to use Zepto in place of jQuery (Zepto is best for mobile apps)\n[?] Would you like to setup your project with a sample application? (Use arrow keys)\n      Hello World\n      Todo List\n    ❯ None\n```\n\n...and then `$ cd todo-list`.\n\nNote that had you chosen `Todo List` for the sample application above, you would have generated the completed version of the app we're about to build. You may want to do this when we're finished to check your work.\n\n### Sub Generators\n\nA sub-generator is a generator that you use within your app, after it has been initially created.\n\nBoth application and test files are output from all sub-generators and CoffeeScript files will be output in place of JS files if one or more CoffeeScript files are present within your application. To override this settings pass `--js` or `--coffee` at the end any sub-generator command.\n\nIn the following section, we'll build a Todo App using sub-generators. Note that test files will be omitted for brevity.\n\n##### Generate a View:\n\n```sh\n$ yo thorax:view todo-list/index\n```\n\nThis generates two new files, a view and a matching template:\n\n```sh\ncreate js/views/todo-list/index.js\ncreate js/templates/todo-list/index.hbs\n```\n\n`views/todo-list/index.js` should contain the following code:\n\n```js\ndefine([\n 'view',\n 'hbs!templates/todo-list/index' // IMPORTANT, prefix with hbs! when requiring a template\n], function (View, template) {\n return View.extend({\n   name: 'todo-list/index',\n   template: template  // passed as `template` arg above, must be set\n  });\n});\n```\n\nHad we been using CoffeeScript in our application the output would instead look like:\n\n```cs\ndefine [\n  'cs!view', # IMPORTANT, prefix with cs! when requiring a module written in CS\n  'hbs!templates/todo-list/index'\n], (View, template) ->\n  View.extend\n    name: 'todo-list/index'\n    template: template\n```\n\nThose familiar with RequireJS will be thrilled to see the define() call above, and those who aren't should read the [section about require js](#require-js)for short summary.\n\n##### Generate a Router:\n\n```sh\n$ yo thorax:router todo-list\n```\n\nThis will generate one new file...\n\n```sh\ncreate js/routers/todo-list.js\n```\n\n...into which the following code will be inserted:\n\n```js\ndefine([\n  'backbone'\n  'views/root',\n], function (Backbone, RootView) {\n  return Backbone.Router.extend({  //plain Backbone. Thorax doesn't touch the router.\n    routes: {\n    }\n  });\n});\n```\n\nNow that we have our files, we can start editing them. Let's first get something up on the screen. We'll add our index route to `js/routers/todo-list.js`, and an `index` function Backbone will fire for us when that route is hit. Inside of that function we'll create an instance of our view, which we'll be able to access because we've passed it into scope by way of the dependencies array...\n\n```js\ndefine([\n  'backbone',  //included because we're calling the Backbone object below. While Backbone depends on Underscore, we wouldn't pass that in unless we were going to use \"_\" inside of our callback.\n  'views/root',  //this is what's going to get attached to the DOM. More on that soon.\n  'views/todo-list/index'  //this is the view class we're going to instantiate below...\n], function (Backbone, RootView, TodoListIndexView) {  //...but to make it available we're going to need to add it and pass it into our callback, here we've named it TodoListIndexView\n  return Backbone.Router.extend({\n    routes: {\n      \"\": \"index\" //add an index route\n    },\n    index: function(){\n      var view = new TodoListIndexView({});  //Hey! I'm a view getting instantiated! My template will be rendered\n      RootView.getInstance().setView(view);  //Nuke whatever was in the {{layout-element}} element in root.hbs (and do memory management), replace it with the template rendered by the line above.\n    }\n  });\n});\n```\n\n...and then give `templates/todo-list/index.handlebars` something to render:\n\n```html\n<p> Arrrr! I'm a pirate with a handlebar mustache. </p>\n```\n\nFinally, edit `js/main.js`. To the list of dependencies required by this module, add `'routers/todo-list'`. Add it before `'helpers'`. Also make sure to inject the dependency into the module as an argument to the factory function. Then instantiate the router inside the initialize function, before calling `next();`.\n\nThe final changes should look like:\n\n```javascript\n  require([\n    'jquery',\n    'backbone',\n    'views/root',\n    'routers/todo-list', // ADDED\n    'helpers',\n  ], function ($, Backbone, RootView, TodoListRouter) { // MODIFIED\n\n    // Initialize your routers here\n      new TodoListRouter(); // ADDED\n\n    ...snip...\n```\n\n##### Run `grunt` to build and view your application\n\nNow that we have something on screen, let's get some data on the screen and finish the rest of our todo list.\n\n##### Render a Collection\n\nTo implement a todo list, we need to create a collection and set it on the view. Unlike a `Backbone.View` instance, a `Thorax.View` instance does not have an `options` object. All properties passed to the constructor are set on the instance and also become available inside of the handlebars template. We'll now update `js/routers/todo-list.js`...\n\n```js\ndefine([\n  'backbone',\n  'collection',  // ADDED\n  'views/root',\n  'views/todo-list/index'\n], function(Backbone, Collection, RootView, TodoListIndexView) {  //and also add the 'Collection' arg here\n  return Backbone.Router.extend({\n    routes: {\n      \"\": \"index\"\n    },\n    index: function() {\n      var collection = new Collection([{  //here we instantiate the collection and populate it with a single model with two properties, 'title' and 'done'\n        title: 'First Todo',\n        done: true\n      }]);\n      var view = new TodoListIndexView({\n        collection: collection  //here we set the 'collection' property of our view to the collection we just instantiated\n      });\n      RootView.getInstance().setView(view);\n    }\n  });\n});\n```\n\nTo display the collection we will edit `templates/todo-list/index.hbs` and use the `collection` handlebars helper to loop through each model in the collection:\n\n```html\n{{#collection}}\n    render the code between the opening and\n    closing collection tags for each model\n    in the collection\n{{/collection}}\n```\n\nBeautifully, all of the properties of the associated model are available in the helpers (see `{{title}}` below).  A `tag` option may be specified to define what type of HTML tag will be used when creating the collection element:\n\n```html\n{{#collection tag=\"ul\"}}\n  <li>{{title}}</li>\n{{/collection}}\n```\n\nSince we want to be able to mark our todos as done and add new ones, we will add a checkbox to each item in the collection and a form to make new items at the bottom. Our `templates/todo-list/index.hbs` should now look like:\n\n```html\n{{#collection tag=\"ul\"}}\n  <li {{#done}}class=\"done\"{{/done}}>\n    <input type=\"checkbox\" {{#done}}checked{{/done}}>\n    {{title}}\n  </li>\n{{/collection}}\n<form>\n  <input name=\"title\">\n  <input type=\"submit\" value=\"Add\">\n</form>\n```\n\nWe'll also create a style sheet called `css/todo-list.css`, which will be automatically applied ONLY to the view with the same filename. Populate it with the following code:\n\n```css\n.done {\n  text-decoration: line-through;\n}\n\n```\n\nTo get our new css file to load we will add the link to our public/index.html file. It should look like this:\n\n```html\n<head>\n    <meta charset=\"utf-8\">\n    <title>Thorax-Todo</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/base.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/todo-list.css\"> <!-- Add this line to reference our custom stylesheet. -->\n  </head>\n  <body>\n```\n\nView Behaviors\n--------------\nIn order to add new items to the list we should listen to the `submit` event on `form` elements in our view. We can use the events hash in `js/views/todo-list/index.js`:\n\n```js\n    events: {\n        \"submit form\": function(event) {\n            event.preventDefault();\n            var attrs = this.serialize();\n            this.collection.add(attrs)\n            this.$('input[name=\"title\"]').val('');\n        },\n```\n\nThe `serialize` method will return key value pairs of all attributes in form elements on the page. Since we had an input with a name of `title` attrs will be set to: `{title: \"your todo\"}`. When using the `collection` helper or a `CollectionView`, Thorax adds, removes and updates views in the collection as appropriate. When we `add` a new model to the collection the view will automatically update.\n\n```js\n'change input[type=\"checkbox\"]': function(event) {\n  var model = $(event.target).model();\n  model.set({done: event.target.checked});\n}\n```\n\nWe also need to listen for a change in a checkbox so we can mark a model as done. Thorax extends the jQuery or Zepto `$` object with three methods: `$.view`, `$.model` and `$.collection`. They will retrieve closest bound object to an element. In this case, a model was automatically bound to the `li` tag passed into the `collection` helper in the template. Now that we have a reference to the `model` we can update it and the view will automatically update.\n\nOur finished `js/views/todo-list/index.js` file should look like:\n\n```js\ndefine([\n  'view',\n  'templates/todo-list/index'\n], function(View, template) {\n  return View.extend({\n    name: \"todo-list/index\",\n    template: template,\n    events: {\n      \"submit form\": function(event) {\n        event.preventDefault();\n        var attrs = this.serialize();\n        this.collection.add(attrs);\n        this.$('input[name=\"title\"]').val('');\n      },\n      'change input[type=\"checkbox\"]': function(event) {\n        var model = $(event.target).model();\n        model.set({done: event.target.checked});\n      }\n    }\n  });\n});\n```\n\nAnd that's a finished non-persistent todo list application! For more complex examples and tutorials using the thorax framework, see the [tutorials on the Thorax homepage](http://thoraxjs.org)\n\n## Require JS\n\nInstead of compiling requiring script tags in your HTML, Require JS is used to load AMD modules instead of plain JavaScript files.\n\n### Adding a New Dependency to Your App\n\nTo add a new library to your app. Here are the steps:\n\n1. Install the library via bower by running `bower install library-name --save-dev`. If the library is not updated regularly from bower try pointing the version to a github tag, for example: `\"library-name\": \"some-github-profile/library-name#v0.1\"` inside of your `bower.json` file.\n2. Open `require-config.js` at the root of your application and add a `path` that points the the AMD module version of the library installed by bower. If the library does not have an AMD module version(many don't) you'll need to setup a `shim` settings, which tells Require JS to wrap a normal JS file as a module you can require. Also make sure to set the `deps` array for any libraries the library depends on. For an example, take a look at how Thorax itself is setup within `require-config.js`.\n3. Inside an existing or new module, require the library by adding an item to the array of required modules - the name you'll use here is the name of the `path` you setup in step 2 above. Then, pass a new argument into the callback function, name the argument whatever you'd like, but remember that uppercase names should be reserved for modules that export constructor functions. When all the modules that this module depends on resolve, the callback function will be called and the argument representing the exported object from the module will be available for use inside.\n\nFor in depth information on Require JS make sure to check out [http://requirejs.org/](http://requirejs.org/).\n","maintainers":[{"name":"eastridge","email":"ryan@eastridge.me"}],"time":{"modified":"2022-06-18T07:10:25.647Z","created":"2013-08-10T02:39:37.917Z","0.0.0":"2013-09-12T20:45:50.143Z","0.0.1":"2013-09-09T00:31:48.698Z","0.0.2":"2013-09-12T20:47:54.032Z","0.0.3":"2013-11-03T05:51:07.343Z","0.0.5":"2013-11-21T19:46:40.966Z","0.0.6":"2013-11-25T21:35:50.714Z","0.0.7":"2013-12-09T01:12:01.789Z","0.0.8":"2014-09-24T23:49:01.946Z"},"author":{"name":"Ryan Eastridge","email":"ryan.eastridge@formidablelabs.com","url":"https://github.com/eastridge"},"repository":{"type":"git","url":"git://github.com/walmartlabs/generator-thorax.git"},"homepage":"https://github.com/walmartlabs/generator-thorax","keywords":["thorax","generator","yeoman-generator"],"contributors":[{"name":"Blake Embrey","email":"blake.embrey@formidablelabs.com","url":"https://github.com/blakeembrey"}],"bugs":{"url":"https://github.com/walmartlabs/generator-thorax/issues"},"readmeFilename":"README.md","users":{"oakley349":true}}