Giter Club home page Giter Club logo

generator-dojo's Introduction

Dojo generator Build Status

A Dojo application generator for Yeoman.

Getting started

  • Make sure you have yo and generator-dojo installed:

    npm install -g yo generator-dojo
  • Make a new directory and traverse into it:

    mkdir my-app && cd $_
  • Run yo dojo, optionally passing an application name (the application name and AMD package will default to the directory you are currently in):

    yo dojo [app-name]

Application layout

generator-dojo will scaffold out a Dojo application using best practices for web development. This means the directory structure for development will be in the same structure as it would be after building for production:

src/
    dojo/
    dijit/
    dgrid/
    ...
    my-app/
    index.html

Because of this structure, a Dojo application is completely agnostic to the server which delivers it in both development and production environments and requires little to no configuration of the server. It will work equally as well with nginx as it would with Apache Tomcat.

Generators

Dojo

Sets up a new Dojo application, generating all of the boilerplate to get started. The application generator also optionally installs Dijit, DojoX, dgrid, and Stylus.

Example:

yo dojo

Test

Generates a unit or functional test for Intern and places it in src/<appname>/tests/<test name>.{js,html}. Optionally receives a --functional flag. If the flag is passed, a functional test is generated, otherwise a unit test is generated.

Example:

yo dojo:test --functional widgets/functional/MyWidget

Produces src/<appname>/tests/widgets/functional/MyWidget.js and src/<appname>/tests/widgets/functional/MyWidget.html.

Example:

yo dojo:test widgets/MyWidget

Produces src/<appname>/tests/widgets/MyWidget.js.

Grunt tasks

The default Gruntfile.js defines some common tasks for your Dojo application:

default

Compiles and watches for changes to changes in stylus files, compiling them if necessary.

build

Compiles your application into the dist directory using the Dojo build tool. The dist directory can then be copied, zipped, tarred, warred, etc. to a production server without the need for complex configuration of the server: it's just a directory of static files!

server

Serves up the src directory as the root directory of localhost:8888 (this can be configured using the connect.options.port option in Gruntfile.js). This also watches for changes to stylus files, compiling them if necessary.

server also takes an optional target flag. If this flag is dist, a build will run and the dist directory will be served as the root directory of localhost:8888:

grunt server:dist

intern

Runs unit and functional tests using Intern. Intern allows web developers to run unit and functional tests in various versions of browsers from the command line.

This task takes an optional target flag. If this flag is local, only local non-browser tests will be run. If this flag is remote, only remote tests will be run using Selenium (via SauceLabs or your own Selenium server). If this flag is not passed, both non-browser and remote tests will be run.

clean

Removes the dist directory (if one exists) to clean up after a build.

License

generator-dojo is available under the terms of the New BSD License. All code, with the exception of portions generated from Yeoman's generator-generator, is developed under the terms of the Dojo Foundation CLA.

© 2013 Bryan Forbes http://www.reigndropsfall.net
All rights reserved.

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.