diff --git a/app/index.js b/app/index.js index 25db4cc..38cffb3 100644 --- a/app/index.js +++ b/app/index.js @@ -29,6 +29,21 @@ var AppGenerator = module.exports = function AppGenerator(args, options, config) } }; this.config.set('inject', inject); + var defaultModules = [ + { + "name": "home", + "file": path.join('app/home', 'home.js') + }, + { + "name": "help", + "file": path.join('app/help', 'help.js') + }, + { + "name": "common", + "file": path.join('app/common', 'common.js') + } + ]; + this.config.set('modules', defaultModules); this.config.save(); this.installDependencies({ skipInstall: options['skip-install'] }); }); @@ -60,12 +75,12 @@ AppGenerator.prototype.askForUiRouter = function askFor() { name: 'router', type:'list', message: 'Which router would you like to use?', - default: 0, - choices: ['Standard Angular Router','Angular UI Router'] + default: 1, + choices: ['Standard Angular Router(ngRoute)', 'Angular UI Router(ui.router)'] }]; this.prompt(prompts, function (props) { - if (props.router === 'Angular UI Router') { + if (props.router === 'Angular UI Router(ui.router)') { this.uirouter = true; this.routerJs = 'bower_components/angular-ui-router/release/angular-ui-router.js'; this.routerModuleName = 'ui.router'; diff --git a/app/templates/skeleton/Gruntfile.js b/app/templates/skeleton/Gruntfile.js index 290a00f..4c60182 100644 --- a/app/templates/skeleton/Gruntfile.js +++ b/app/templates/skeleton/Gruntfile.js @@ -231,7 +231,7 @@ module.exports = function (grunt) { //if index.html changed, we need to reread the - + @@ -23,17 +24,28 @@ + + + + + + + + + + +
-
> +
>
diff --git a/app/templates/skeleton/bower.json b/app/templates/skeleton/bower.json index 7778779..b29d1b0 100644 --- a/app/templates/skeleton/bower.json +++ b/app/templates/skeleton/bower.json @@ -8,20 +8,22 @@ "bower_components" ], "dependencies": { - "jquery": "~2.0", - "underscore": "~1.5", - "bootstrap": "~3.1", - "angular": "~1.3.0", - <% if(uirouter) { print('"angular-ui-router": "~0.2",'); } else { print('"angular-route": "~1.2",'); } %> - "angular-animate": "~1.3.0", - "angular-resource": "~1.3.0", - "angular-cookies": "~1.3.0", - "angular-mocks": "~1.3.0", + "jquery": "~2.1.1", + "underscore": "~1.7.0", + "bootstrap": "~3.3.0", + "angular": "~1.3.2", + <% if(uirouter) { print('"angular-ui-router": "~0.2.11",'); } else { print('"angular-route": "~1.3.2",'); } %> + "angular-animate": "~1.3.2", + "angular-resource": "~1.3.2", + "angular-cookies": "~1.3.2", + "angular-mocks": "~1.3.2", "angular-ui-utils": "~0.1.1", "angular-bootstrap": "~0.11.2", "restangular": "~1.0.11", "moment": "~2.5", - "less.js": "~1.6", - "font-awesome": "~4.0" + "less.js": "~1.7.5", + "font-awesome": "~4.2.0", + "angular-loading-bar": "~0.6.0" } + } diff --git a/app/templates/skeleton/data/help.json b/app/templates/skeleton/data/help.json new file mode 100644 index 0000000..4629b73 --- /dev/null +++ b/app/templates/skeleton/data/help.json @@ -0,0 +1,18 @@ +[ + { + "title": "Technical Help", + "content": "Contact us at tech@anitechcs.com" + }, + { + "title" : "Billing Help", + "content" : "Contact us at billing@anitechcs.com" + }, + { + "title" : "Enquiry Help", + "content" : "Contact us at info@anitechcs.com" + }, + { + "title" : "Sales Help", + "content" : "Contact us at sales@anitechcs.com" + } +] diff --git a/app/templates/skeleton/package.json b/app/templates/skeleton/package.json index d4cab9f..b8db72c 100644 --- a/app/templates/skeleton/package.json +++ b/app/templates/skeleton/package.json @@ -1,30 +1,36 @@ { - "name": "<%= _.slugify(appname) %>", - "version": "0.0.1", - "devDependencies": { - "grunt": "~0.4", - "grunt-dom-munger": "~3.4", - "grunt-angular-templates": "~0.5", - "grunt-ngmin": "0.0.3", - "grunt-contrib-connect": "~0.6", - "grunt-contrib-copy": "~0.5", - "grunt-contrib-clean": "~0.5", - "grunt-contrib-concat": "~0.3", - "grunt-contrib-cssmin": "~0.7", - "grunt-contrib-uglify": "~0.2", - "grunt-contrib-jshint": "~0.9", - "grunt-contrib-htmlmin": "~0.1", - "grunt-contrib-imagemin": "~0.4", - "grunt-contrib-less": "~0.8", - "grunt-contrib-watch": "~0.6", - "grunt-browser-output": "0.1.0", - "load-grunt-tasks": "~0.2", - "karma": "~0.12.6", - "grunt-karma": "~0.8.3", - "karma-jasmine": "~0.1.5", - "karma-phantomjs-launcher": "~0.1.4", - "karma-chrome-launcher": "~0.1.3", - "karma-mocha-reporter": "~0.2.5", - "karma-firefox-launcher": "~0.1.3" - } + "name": "<%= _.slugify(appname) %>", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "https://github.com/<%= _.slugify(appname).git" + }, + "devDependencies": { + "grunt": "~0.4.5", + "grunt-dom-munger": "~3.4", + "grunt-angular-templates": "~0.5.7", + "grunt-ngmin": "0.0.3", + "grunt-contrib-connect": "~0.9.0", + "grunt-contrib-copy": "~0.7.0", + "grunt-contrib-clean": "~0.6.0", + "grunt-contrib-concat": "~0.5.0", + "grunt-contrib-cssmin": "~0.10.0", + "grunt-contrib-uglify": "~0.6.0", + "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-htmlmin": "~0.3.0", + "grunt-contrib-imagemin": "~0.9.1", + "grunt-contrib-less": "~0.12.0", + "grunt-contrib-watch": "~0.6.1", + "grunt-browser-output": "1.0.3", + "load-grunt-tasks": "~1.0.0", + "karma": "~0.12.24", + "grunt-karma": "~0.9.0", + "karma-jasmine": "~0.2.3", + "karma-phantomjs-launcher": "~0.1.4", + "karma-chrome-launcher": "~0.1.5", + "karma-mocha-reporter": "~0.3.1", + "karma-firefox-launcher": "~0.1.3", + "protractor": "1.4.0", + "webdriver-manager": "1.0.0" + } } diff --git a/app/templates/skeleton/test/karma.conf.js b/app/templates/skeleton/test/karma.conf.js new file mode 100644 index 0000000..bc45452 --- /dev/null +++ b/app/templates/skeleton/test/karma.conf.js @@ -0,0 +1,72 @@ +module.exports = function(config){ + + config.set({ + + /** + * From where to look for files, starting with the location of this file. + */ + basePath : './', + + /** + * This is the list of file patterns to load into the browser during testing. + */ + files : [ + '../bower_components/angular/angular.js', + '../bower_components/angular-route/angular-route.js', + '../bower_components/angular-mocks/angular-mocks.js', + '../tests/**/**/*.js' + ], + + /** + * Exclude karma and protractor conf files + */ + exclude: [ + '../tests/karma-conf.js', + '../tests/protractor-conf.js' + ], + + /** + * Automatically runs tests when you save any test file + */ + autoWatch : true, + + /** + * Frameworks to use for unit testing + */ + frameworks: ['jasmine'], + + /** + * Browser to use for running unit tests + * values: Chrome, Firefox, Opera, Safari, PhantomJS etc. + */ + browsers : ['Chrome'], + + /** + * Plugins required to run karma + */ + plugins : [ + 'karma-chrome-launcher', + 'karma-firefox-launcher', + 'karma-jasmine', + 'karma-junit-reporter', + 'karma-phantomjs-launcher' + ], + + /** + * How to report, by default. + */ + junitReporter : { + outputFile: 'test_out/unit.xml', + suite: 'unit' + }, + + /** + * On which port should the browser connect, on which port is the test runner + * operating, and what is the URL path for the browser to use. + */ + port: 9000, + runnerPort: 9001, + urlRoot: '/app' + + }); +}; diff --git a/controller/templates/controller-spec.js b/controller/templates/controller-spec.js index fc5eec1..e521a33 100644 --- a/controller/templates/controller-spec.js +++ b/controller/templates/controller-spec.js @@ -3,7 +3,7 @@ /** * This is a sample controller spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/controller/templates/controller.js b/controller/templates/controller.js index 2bdc134..50b14af 100644 --- a/controller/templates/controller.js +++ b/controller/templates/controller.js @@ -3,7 +3,7 @@ /** * This is a sample controller - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. @@ -11,7 +11,6 @@ angular.module('<%= appname %>').controller('<%= _.camelize(name) %>', ['$scope', function($scope) { //TODO: Implement your controller logic here - $scope.message = 'Bang Bang! Your application is up and running.'; }]); diff --git a/directive/templates/complex/directive-spec.js b/directive/templates/complex/directive-spec.js index 4e1ce7e..3908eed 100644 --- a/directive/templates/complex/directive-spec.js +++ b/directive/templates/complex/directive-spec.js @@ -3,7 +3,7 @@ /** * This is a sample directive spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/directive/templates/complex/directive.js b/directive/templates/complex/directive.js index 5fca0a9..112a5b3 100644 --- a/directive/templates/complex/directive.js +++ b/directive/templates/complex/directive.js @@ -3,7 +3,7 @@ /** * This is a sample directive - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/directive/templates/simple/directive-spec.js b/directive/templates/simple/directive-spec.js index 7801b8e..11e8f59 100644 --- a/directive/templates/simple/directive-spec.js +++ b/directive/templates/simple/directive-spec.js @@ -3,7 +3,7 @@ /** * This is a sample directive spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/directive/templates/simple/directive.js b/directive/templates/simple/directive.js index 772f781..46f03b0 100644 --- a/directive/templates/simple/directive.js +++ b/directive/templates/simple/directive.js @@ -3,7 +3,7 @@ /** * This is a sample directive - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/filter/templates/filter-spec.js b/filter/templates/filter-spec.js index a5ce23f..033a8fa 100644 --- a/filter/templates/filter-spec.js +++ b/filter/templates/filter-spec.js @@ -3,7 +3,7 @@ /** * This is a sample filter spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/filter/templates/filter.js b/filter/templates/filter.js index 88e29c9..50984d6 100644 --- a/filter/templates/filter.js +++ b/filter/templates/filter.js @@ -3,7 +3,7 @@ /** * This is a sample filter - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/modal/templates/modal-spec.js b/modal/templates/modal-spec.js index bd5a7ac..6515065 100644 --- a/modal/templates/modal-spec.js +++ b/modal/templates/modal-spec.js @@ -3,7 +3,7 @@ /** * This is a sample modal spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/modal/templates/modal.js b/modal/templates/modal.js index ebf44b6..ee73af6 100644 --- a/modal/templates/modal.js +++ b/modal/templates/modal.js @@ -3,7 +3,7 @@ /** * This is a sample modal - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/module/templates/module.js b/module/templates/module.js index d447702..418f7ba 100644 --- a/module/templates/module.js +++ b/module/templates/module.js @@ -3,12 +3,12 @@ /** * This is a sample module - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. */ - angular.module('<%= _.camelize(name) %>', ['ui.bootstrap','ui.utils','<%= routerModuleName %>','ngAnimate']); + angular.module('<%= _.camelize(name) %>', ['ui.bootstrap', 'ui.utils', '<%= routerModuleName %>', 'ngAnimate', 'restangular']); <% if (!uirouter) { %> angular.module('<%= _.camelize(name) %>').config(function($routeProvider) { diff --git a/package.json b/package.json index 25b00e8..726a954 100644 --- a/package.json +++ b/package.json @@ -24,24 +24,19 @@ "test": "mocha" }, "dependencies": { - "underscore": "~1.5", - "underscore.string": "~2.3", - "yeoman-generator": "~0.16", - "chalk": "~0.4.0", + "underscore": "~1.7.0", + "underscore.string": "~2.3.3", + "yeoman-generator": "~0.17.7", + "chalk": "~0.5.1", "ng-parse-module": "~0.1.0" }, "devDependencies": { - "mocha": "~1.10.0" + "mocha": "~2.0.1" }, "engines": { - "node": ">=0.8.0" + "node": ">=0.10.32" }, "license": "Apache License 2.0", - "gitHead": "b914a9ee640da4a50a62261965a2a338799256cd", - "_id": "generator-ng-appgen@1.0.0", - "_shasum": "fea9925b26b050e35855a5b0fea5b8237d1e5a7a", - "_from": "generator-ng-appgen@", - "_npmVersion": "1.5.0-alpha-1", "_npmUser": { "name": "tapas4java", "email": "tapas.friends@gmail.com" @@ -51,12 +46,5 @@ "name": "Tapas Jena", "email": "tapas.friends@gmail.com" } - ], - "dist": { - "shasum": "fea9925b26b050e35855a5b0fea5b8237d1e5a7a", - "tarball": "http://registry.npmjs.org/generator-ngappgen/-/generator-ng-appgen-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "http://registry.npmjs.org/generator-ngappgen/-/generator-ng-appgen-1.0.0.tgz", - "readme": "ERROR: No README data found!" + ] } diff --git a/service/templates/service-spec.js b/service/templates/service-spec.js index c88ca4f..af621ee 100644 --- a/service/templates/service-spec.js +++ b/service/templates/service-spec.js @@ -3,7 +3,7 @@ /** * This is a sample service spec - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. diff --git a/service/templates/service.js b/service/templates/service.js index 928f468..4158bcc 100644 --- a/service/templates/service.js +++ b/service/templates/service.js @@ -3,17 +3,14 @@ /** * This is a sample service - * Generated by ngappgen Yeomen/Angular generator. + * Generated by ng-appgen Yeomen/Angular generator. * * @author: Tapas Jena * @copyright: Anitech Consulting Services Pvt Ltd. */ - angular.module('<%= appname %>').service('<%= _.camelize(name) %>', ['$http', function($http) { + angular.module('<%= appname %>').service('<%= _.camelize(name) %>', ['$http', '$q', function($http, $q) { //TODO: Implement your service logic here - this.getMessage = function(){ - return 'Bang Bang! Your application is up and running.'; - }; }]); diff --git a/test/test-creation.js b/test/test-creation.js index 843f60a..38a17ad 100644 --- a/test/test-creation.js +++ b/test/test-creation.js @@ -5,14 +5,14 @@ var helpers = require('yeoman-generator').test; - describe('ngappgen generator', function () { + describe('ng-appgen generator', function () { beforeEach(function (done) { helpers.testDirectory(path.join(__dirname, 'temp'), function (err) { if (err) { return done(err); } - this.app = helpers.createGenerator('ngappgen:app', [ + this.app = helpers.createGenerator('ng-appgen:app', [ '../../app' ]); done(); diff --git a/test/test-load.js b/test/test-load.js index 4898c1a..8c5a79e 100644 --- a/test/test-load.js +++ b/test/test-load.js @@ -3,7 +3,7 @@ var assert = require('assert'); - describe('ngappgen generator', function () { + describe('ng-appgen generator', function () { it('can be imported without blowing up', function () { var app = require('../app'); assert(app !== undefined);