Skip to content

Commit

Permalink
feat(generators/app/templates): add automatic engagement of the Backb…
Browse files Browse the repository at this point in the history
…one-Debugger browser plugin when available

Include automatically with debugging builds.
  • Loading branch information
cueedee committed Feb 8, 2017
1 parent 91bad5e commit 2b27dea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ The main app generator will provide you with the following out of the box:
- [Grunt](http://gruntjs.com), or rather, a complete and annotated `Gruntfile.coffee`, set up for [Browserify](https://github.com/jmreidy/grunt-browserify#readme), [Compass](https://github.com/gruntjs/grunt-contrib-compass#readme), code [linting](https://github.com/vojtajina/grunt-coffeelint#readme), [-testing](https://github.com/pghalliday/grunt-mocha-test#readme), [-minification](https://github.com/gruntjs/grunt-contrib-uglify#readme) and [-documentation generation](https://github.com/gruntjs/grunt-contrib-yuidoc#readme);
- [Browserify](http://browserify.org/), bundling modular code for the browser, supporting [CoffeeScript](https://github.com/jnordberg/coffeeify#readme), [Handlebars](https://github.com/epeli/node-hbsfy#readme) and [browserify shims](https://github.com/thlorenz/browserify-shim#readme);
- [Backbone.js](http://backbonejs.org/) MV*x* foundation, including a main [router](http://backbonejs.org/#Router) implementation;
- [Backbone-Debugger](https://github.com/Maluen/Backbone-Debugger) browser plugin engagement (when available), automatically included with debugging builds;
- [CoffeeScript](http://coffeescript.org/) coding;
- [Compass](http://compass-style.org/) SASS styling;
- [Handlebars](http://handlebarsjs.com/) HTML templating;
Expand Down
1 change: 1 addition & 0 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ var AppGenerator = generators.Base.extend(

// App source for debug builds

, 'src/debug.backbone-debugger.coffee'
, 'src/views/debug.environment-ribbon.coffee'
, 'src/views/debug.environment-ribbon.hbs'

Expand Down
31 changes: 31 additions & 0 deletions generators/app/templates/src/debug.backbone-debugger.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
( ( factory ) ->
if typeof exports is 'object'
module.exports = factory(
require( 'backbone' )
)
else if typeof define is 'function' and define.amd
define( [
'backbone'
], factory )
return
)((
Backbone
) ->

###*
# @author David Bouman
# @module App
###

'use strict'


##
## Engage the [Backbone debugger browser plugin](https://github.com/Maluen/Backbone-Debugger#install-from-chrome-web-store) if present.
##

window.__backboneAgent?.handleBackbone( Backbone )

return

)

0 comments on commit 2b27dea

Please sign in to comment.