GithubHelp home page GithubHelp logo

informaticacba / generator-backbone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yeoman/generator-backbone

1.0 0.0 0.0 602 KB

Scaffold out a Backbone.js project

Home Page: http://yeoman.io

JavaScript 83.37% CoffeeScript 3.74% HTML 10.59% CSS 2.29%

generator-backbone's Introduction

Backbone.js generator Build Status Coverage Status

A Backbone generator for Yeoman that provides a functional boilerplate Backbone app out of the box. You also get access to a number of sub-generators which can be used to easily create individual models, views, collections and so on.

Optional RequireJS (AMD) support has recently been added as a prompt when using the generator on new projects.

Usage

Install: npm install -g generator-backbone

Make a new directory and cd into it:

mkdir my-new-project && cd $_

Run yo backbone, optionally passing an app name:

yo backbone [app-name]

Generators

Available generators:

  • backbone:model
  • backbone:view
  • backbone:collection
  • backbone:router
  • backbone:all

Typical workflow

yo backbone # generates your application base and build workflow
yo backbone:model blog
yo backbone:collection blog
yo backbone:router blog
yo backbone:view blog
grunt serve

Also checkout this NetTuts write-up for a guide to building Backbone.js apps using this generator.

Options

  • --appPath

    Generate scaffold into a custom directory.

  • --coffee

    Generate scaffolds in CoffeeScript. By default check if project uses CoffeeScript.

  • --requirejs

    Generate scaffolds using RequireJS (AMD) Loader. By default check if project uses RequireJS.

  • --skip-install

    Skips the automatic execution of bower and npm after scaffolding has finished.

  • --test-framework=[framework]

    Defaults to mocha. Can be switched for another supported testing framework like jasmine.

  • --template-framework=[framework]

    Defaults to lodash templating with grunt-contrib-jst. handlebars and mustache are also supported.

A note regarding JST templates and strict mode

If you use strict mode in your app and JST templates the default grunt-jst implementation will cause your app to error out as the templates will be precompiled using a 'with' statement.

This can be addressed by changing the jst grunt task as follows:

jst: {
    compile: {
        options:
        {
            templateSettings:
            {
                variable: 'data'
            }
        },
        files: {
            '.tmp/scripts/templates.js': ['<%= yeoman.app %>/scripts/templates/*.ejs']
        }
    }
},

A result of this change is that your template variable definitions must also be updated from <%= templateVariable %> to <%= data.templateVariable %>. More information on this can be found in the Underscore documentation.

Contribute

See the contributing docs

When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.

When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.

When submitting a new feature, add tests that cover the feature.

License

BSD license

generator-backbone's People

Contributors

adampetrie avatar addyosmani avatar akleiman avatar alefteris avatar alrra avatar appleboy avatar arthurvr avatar asapach avatar bernhardbehrendt avatar blakeblackshear avatar chrisantaki avatar cvrebert avatar gaboesquivel avatar gilbarbara avatar jaseemabid avatar kevva avatar marian-r avatar mklabs avatar mteodori avatar passy avatar revathskumar avatar robertd avatar ruyadorno avatar sindresorhus avatar slara avatar sleeper avatar stephanebachelier avatar thelonelyghost avatar tomfuertes avatar zeripath avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.