From 0a223a4cca52a06a78948ff9f70be4c6e887c2cb Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Fri, 5 Jun 2015 07:07:12 +0200 Subject: [PATCH 1/4] feat(filter): new filter generator --- templates/javascript/filter.js | 4 ++-- templates/javascript/filter.unit.spec.js | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/templates/javascript/filter.js b/templates/javascript/filter.js index 8da41f2..4218929 100644 --- a/templates/javascript/filter.js +++ b/templates/javascript/filter.js @@ -2,7 +2,7 @@ 'use strict'; angular - .module('<%= appname %>.<%= module %>.filters.<%= classedName %>', []) + .module('<%= prefix %>.<%= module %>.filters.<%= classedName %>', []) .filter('<%= prefix %><%= classedName %>', <%= classedName %>Filter); function <%= classedName %>Filter() { @@ -15,7 +15,7 @@ // code goes here - return input; + return input + 'Filter'; } } diff --git a/templates/javascript/filter.unit.spec.js b/templates/javascript/filter.unit.spec.js index dee8ba9..03bb6be 100644 --- a/templates/javascript/filter.unit.spec.js +++ b/templates/javascript/filter.unit.spec.js @@ -2,13 +2,18 @@ describe('Unit: <%= prefix %>.<%= module %>.filters.<%= classedName %>', function () { - beforeEach(module('app')); + beforeEach(module('<%= prefix %>.<%= module %>.filters.<%= classedName %>')); - it('should contain an <%= prefix %>.<%= module %>.filters.<%= classedName %> filter', - inject(function (<%= prefix %><%= classedName %>) { - expect(<%= prefix %><%= classedName %>).not.to.equal(null); - }) - ); + it('should have a <%= prefix %><%= classedName %> filter', inject(function($filter) { + expect($filter('<%= prefix %><%= classedName %>')).not.to.equal(null); + })); + it('should have a <%= prefix %><%= classedName %> filter that produces an string', + inject(function($filter) { + + var filter = $filter('<%= prefix %><%= classedName %>')('bubu'); + expect(filter).to.be.a('string'); + expect(filter).to.equal('bubuFilter'); + })); }); From 74eee596512f40aa256db5e1880de46163c9b061 Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Fri, 5 Jun 2015 07:07:29 +0200 Subject: [PATCH 2/4] fix(templates): unit tests --- templates/javascript/directive.unit.spec.js | 2 +- templates/javascript/factory.unit.spec.js | 2 +- templates/javascript/service.unit.spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/javascript/directive.unit.spec.js b/templates/javascript/directive.unit.spec.js index 03e9e5c..1f9e24d 100644 --- a/templates/javascript/directive.unit.spec.js +++ b/templates/javascript/directive.unit.spec.js @@ -3,7 +3,7 @@ describe('Unit: <%= prefix %>.<%= module %>.directives.<%= classedName %>', function () { var $compile, $rootScope; - beforeEach(module('<%= prefix %>.<%= module %>.directives')); + beforeEach(module('<%= prefix %>.<%= module %>.directives.<%= classedName %>')); beforeEach(angular.mock.inject(['$compile', '$rootScope', function($c, $r){ $compile = $c; diff --git a/templates/javascript/factory.unit.spec.js b/templates/javascript/factory.unit.spec.js index 1db09df..9b8e954 100644 --- a/templates/javascript/factory.unit.spec.js +++ b/templates/javascript/factory.unit.spec.js @@ -3,7 +3,7 @@ describe('Unit: <%= prefix %>.<%= module %>.services.<%= classedName %>', function () { var <%= prefix %><%= classedName %>; - beforeEach(module('<%= prefix %>')); + beforeEach(module('<%= prefix %>.<%= module %>.services.<%= classedName %>')); beforeEach(inject(function (_<%= prefix %><%= classedName %>_) { <%= prefix %><%= classedName %> = _<%= prefix %><%= classedName %>_; })); diff --git a/templates/javascript/service.unit.spec.js b/templates/javascript/service.unit.spec.js index 33203dd..ea7a7ef 100644 --- a/templates/javascript/service.unit.spec.js +++ b/templates/javascript/service.unit.spec.js @@ -3,7 +3,7 @@ describe('Unit: <%= prefix %>.<%= module %>.services.<%= classedName %>', function () { var <%= prefix %><%= classedName %>; - beforeEach(module('<%= prefix %>')); + beforeEach(module('<%= prefix %>.<%= module %>.services.<%= classedName %>')); beforeEach(inject(function (_<%= prefix %><%= classedName %>_) { <%= prefix %><%= classedName %> = _<%= prefix %><%= classedName %>_; })); From 8da7e2aa3d61319834d504a595c30e5182697036 Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Fri, 5 Jun 2015 07:11:44 +0200 Subject: [PATCH 3/4] refactor(gulp tasks): removed not used dist-server: use serve-dist instead --- app/templates/tasks/dist-server.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 app/templates/tasks/dist-server.js diff --git a/app/templates/tasks/dist-server.js b/app/templates/tasks/dist-server.js deleted file mode 100644 index 45dcd5d..0000000 --- a/app/templates/tasks/dist-server.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var gulp = require('gulp'); -var projectConfig = require(process.cwd() + '/project.config.js')(); -var $ = require('gulp-load-plugins')({lazy: true}); -var path = require('path'); - -/** - * SERVER POINTS TO DIST FOLDER - */ -gulp.task('dist-server', function () { - - browserSync({ - server: { - baseDir: projectConfig.path.distDir, - index: projectConfig.path.main, - port: 4000, - browser: 'Google Chrome', - open: true - } - }); - -}); From 531bfdd2a228524a91921556e037692cb1d50f84 Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Fri, 5 Jun 2015 07:14:59 +0200 Subject: [PATCH 4/4] release(1.0.0-rc.16) --- CHANGELOG.md | 8 ++++++++ package.json | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1edb91..1be74e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +1.0.0-rc.16 / 2015-06-05 +================== + + * Release 1.0.0-rc.16 + * Added Pull-Request TypeScript support + * Added filter generator + * Fixed unit test templates + 1.0.0-rc.15 / 2015-06-04 ================== diff --git a/package.json b/package.json index aa64ebf..cc316f4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "generator-hirsch", - "version": "1.0.0-rc.15", - "description": "Yeoman generator for large module-based AngularJS applications", + "version": "1.0.0-rc.16", + "description": "Yeoman generator for large module-based AngularJS applications with the option to use typescript", "license": "MIT", "main": "app/index.js", "repository": "gery.hirschfeld@w3tec.ch/generator-hirsch",