.NET backbone.js setup procedure - simnova/webdevdocs GitHub Wiki
- Install NuGet
- Install ASP.NET MVC 4 using web platform installer
- Install Git : follow instructions here MachineSetup
- Install node (even if you already have it installed, install again to ensure it is current).
- Clear your NPM cache (this may save some headaches):
npm cache clean
- If behind a firewall, configure node to speak to the firewall by issueing the following commands:
npm config set proxy http://domain%5Cusername:password@ipaddress:port
npm config set https-proxy http://domain%5Cusername:password@ipaddress:port
- Install the following by typing the commands in a command prompt:
- Install yeoman (includes bower and grunt) :
npm install -gq yo
- Install backbone generator :
npm install -g yo grunt-cli bower karma
- Install styledocco :
npm install -g styledocco
- Install yuidocs :
npm -g install yuidocjs
- Install yeoman (includes bower and grunt) :
- Ensure node is updated
- Update Node:
npm update -g n
- Update Global Packages:
npm update -g
- Update Node:
- Clear your NPM cache (this may save some headaches):
- Install ruby
- Select all of the following:
- Install Tcl/Tk supprt
- Add Ruby executables to your PATH
- Associate .rb and .rbw with this Ruby installation
- Install the following by typing the commands in a command prompt:
- Ensure Ruby is up to date: gem update --system
- Install Compass: gem install compass
- Select all of the following:
- Create New MVC4 Project
- Update all defalut libraries (EF/jquery/Modernizr/etc..)
- Make a catchall root, this will allow your app to accept pushstate.
routes.MapRoute( name: "CatchAll", url: "{*url}", defaults: new { controller = "Home", action = "Index" }
- Navigate to Content Folder
- (see steps in common below)
- Copy content from index.html to /home/index.cshtml
- put
@{Layout = null;}
at top of page - prefix all references marked with 'target dummy' in document with /content/
- prefix all references marked with 'target release' in document with /content/dist/release/
- prefix all references marked with 'target debug' in document with /content/dist/debug/
- put
- Copy /content/app/config.js to /content/test/jasmine/config.js
- remove dependency on "main"
- update path to require.config to
/content/vendor/jam/require.config.js
- Modify /content/test/jasmine/index.html
- remove Application Libs comment and references to jquery/lodash/backbone
- update require src path to
/content/vendor/js/libs/require.js
- update require data-main to
./config
- modify require path for spec to
../jasmine/spec
- Browse to content/test/jasmine/ to confirm tests work
- See COMMON section below:
(note this area is a work in progress)
- Create Area
- Create folder in area, Content
- edit content/app/app.js change
root: "/"
to include path to the directory
- edit content/app/app.js change
- See COMMON section below:
- open folder in windows explorer
- navigate to folder in the command prompt
- issue command: yo bbb:app
- give your project a name (i.e: bbb)
- choose your test framework (i prefer Jasmine, but any will do)
- choose your spacing preference: (i prefer Spaces(2))
- issue command: bower install layoutmanager
- this may prompt you to chose between backbone 1.0.0 and 1.1, choose 1.1 and prefix selection with an exclamation mark '!'
- issue command: bbb debug
- issue command: bbb release
- issue command: yo bbb:app
- Create file called "create_css_docs.bat" in the Content directory
- Add the following line in the batch file:
styledocco -n "projectStyles" -o css_docs app\styles\
- Add the following line in the batch file:
- Create file called "create_js_docs.bat" in the Content directory
- Add the following line in the batch file:
yuidoc --outdir js_docs .
- Add the following line in the batch file:
- navigate to root directory of solution, create file called "watch_sass_template.bat"
- Add the following lines in the batch file:
cd %CD%\msbbb\Areas\Template\Content
compass watch - Copy the batch file and rename "Template" to match the area of the website you are working with.
- Add the following lines in the batch file:
- CSS Editing
- Use StyleDocco for to create examples for styles
- Generate docs by clicking on CreateDocs.bat in the assets directory.
- Use SCSS / Compass where makes sense (currently used for sprites)
- Run ms-bbb\msbbb\watch_sass_msbbb.bat to watch for changes in SCSS files to automatically generate CSS
- When using bbb templates to edit styl css files, associate css syntax to styl files by : View -> Syntax -> Open all with current extension as --> CSS
- Build Procedure
- Grunt is used for a handful of build activities: to run these, first open a node command prompt (start-->
- run BBB release or BBB debug from the Content folder and change references to output of those directories to have site reference compiled output.
- Grunt is used for a handful of build activities: to run these, first open a node command prompt (start-->
-
backbone.js - What we build our apps on
- grunt-bbb - Build tasks for Backbone
- backbone boilerplate - Nice framework for setting up backbone
- underscore.js - Handy utility
- compass - CSS Generation +++
- sass - CSS Generation
- styledocco - Stylesheet Documentation
- yuidocs - Javascript Documentation
- require.js - How we load scripts
- jasmine - How we test Javascript
- Backbone.JS Training in Chennai - Backbone.JS Training
- .Net Training in Chennai - .Net Training