Skip to content

Commit

Permalink
Merge branch 'release/v1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Nov 12, 2015
2 parents a470fca + af9de8f commit ca00925
Show file tree
Hide file tree
Showing 44 changed files with 109 additions and 125 deletions.
4 changes: 2 additions & 2 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
"main-bower-files": "^2.5.0",
"wiredep": "^2.2.2"<% if (prompts.useTypescript) { %>,
"tsd": "^0.6.0",
"typescript": "~1.4.0",
"typescript": "~1.6.0",
"gulp-typescript": "^2.7.5",
"gulp-tslint": "^2.0.0"<% } %>
"gulp-tslint": "^3.0.0"<% } %>
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../typings/tsd.d.ts"/>

module <%= prompts.prefix %> {
namespace <%= prompts.prefix %> {
'use strict';

angular
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/common/util/lazy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.common.util {
namespace <%= prompts.prefix %>.common.util {
'use strict';

export class Lazy<T> {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/config/angular.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Defines the AngularJS Modules and configures them
*/
module <%= prompts.prefix %>.core.config {
namespace <%= prompts.prefix %>.core.config {
'use strict';

/**
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/config/config.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.config {
namespace <%= prompts.prefix %>.core.config {
'use strict';

export var Namespace = '<%= prompts.prefix %>.core.config';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/config/thirdParty.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.config {
namespace <%= prompts.prefix %>.core.config {
'use strict';

var translateConfig = ($translateProvider: ng.translate.ITranslateProvider) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.constants {
namespace <%= prompts.prefix %>.core.constants {
'use strict';

export var Namespace = '<%= prompts.prefix %>.core.constants';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.constants {
namespace <%= prompts.prefix %>.core.constants {
'use strict';

angular
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core {
namespace <%= prompts.prefix %>.core {
'use strict';

export var Namespace = '<%= prompts.prefix %>.core';
Expand Down
4 changes: 2 additions & 2 deletions app/templates/src/app-ts/core/router/router.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/**
* Extension for 3rd party type definition file.
*/
declare module angular.ui {
declare namespace angular.ui {
interface IState {
includes?(name: string): void;
}
}

module <%= prompts.prefix %>.core.router {
namespace <%= prompts.prefix %>.core.router {

// this variable is to prevent an issue with the default routes;
// if the initial request to the application is for an invalid route
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.router {
namespace <%= prompts.prefix %>.core.router {
'use strict';

var run = (logger: util.ILoggerFactory, $timeout: ng.ITimeoutService, routerService: IRouterService) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.router {
namespace <%= prompts.prefix %>.core.router {
'use strict';

var run = ($q: ng.IQService, routerService: IRouterService, logger: util.ILoggerFactory) => {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/router/router.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.core.router {
namespace <%= prompts.prefix %>.core.router {
'use strict';

export var Namespace = '<%= prompts.prefix %>.core.router';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/router/router.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.router {
namespace <%= prompts.prefix %>.core.router {

export interface IRouterService {
/**
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/util/backend.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.util {
namespace <%= prompts.prefix %>.core.util {
'use strict';

export interface IBackend {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/util/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Event bus. Use this class to register events and trigger them from anywhere.
*/
module <%= prompts.prefix %>.core.util {
namespace <%= prompts.prefix %>.core.util {
'use strict';

export interface IAppEvents {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/util/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Function {
name?: string;
}

module <%= prompts.prefix %>.core.util {
namespace <%= prompts.prefix %>.core.util {
'use strict';

export interface ILoggerFactory {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/core/util/util.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.core.util {
namespace <%= prompts.prefix %>.core.util {
'use strict';

export var Namespace = '<%= prompts.prefix %>.core.util';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/home/home.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.home {
namespace <%= prompts.prefix %>.home {
'use strict';

export var Namespace = '<%= prompts.prefix %>.home';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/home/views/home.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.home.views {
namespace <%= prompts.prefix %>.home.views {
'use strict';

var stateConfig = ($stateProvider: ng.ui.IStateProvider) => {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/home/views/views.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.home.views {
namespace <%= prompts.prefix %>.home.views {
'use strict';

export var Namespace = '<%= prompts.prefix %>.home.views';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.layout.directives {
namespace <%= prompts.prefix %>.layout.directives {
'use strict';

export var Namespace = '<%= prompts.prefix %>.layout.directives';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.layout.directives {
namespace <%= prompts.prefix %>.layout.directives {
'use strict';

/**
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/layout/layout.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../typings/tsd.d.ts" />

module <%= prompts.prefix %>.layout {
namespace <%= prompts.prefix %>.layout {
'use strict';

export var Namespace = '<%= prompts.prefix %>.layout';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/layout/views/admin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.layout.views {
namespace <%= prompts.prefix %>.layout.views {
'use strict';

var stateConfig = ($stateProvider: ng.ui.IStateProvider) => {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/layout/views/public.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.layout.views {
namespace <%= prompts.prefix %>.layout.views {
'use strict';

var stateConfig = ($stateProvider: ng.ui.IStateProvider) => {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/app-ts/layout/views/views.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.layout.views {
namespace <%= prompts.prefix %>.layout.views {
'use strict';

export var Namespace = '<%= prompts.prefix %>.layout.views';
Expand Down
2 changes: 1 addition & 1 deletion app/templates/src/assets/config/_config.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
/// <reference path="../../../../typings/tsd.d.ts" />

module my.core.constants {
namespace my.core.constants {
'use strict';

export interface IAppConfig {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/test-ts/midway/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference path="../../typings/tsd.d.ts"/>

module <%= prompts.prefix %>.test {
namespace <%= prompts.prefix %>.test {
'use strict';

describe('Midway: Testing Modules', () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generator-hirsch",
"version": "1.0.1",
"version": "1.0.2",
"description": "Yeoman generator for large module-based AngularJS applications with the option to use typescript",
"license": "MIT",
"main": "app/index.js",
Expand Down
27 changes: 14 additions & 13 deletions templates/typescript/directive.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
/// <reference path="../../../../<%= typingNesting %>typings/tsd.d.ts" />

module <%= prefix %>.<%= module %>.<%= $namespace %> {
'use strict';
namespace <%= prefix %>.<%= module %>.<%= $namespace %> {
'use strict';<% if (hasTemplate) { %>

const templateUrl = '<%= templateUrl %>';<% } %>

class <%= classedName %>Directive implements angular.IDirective {
export class <%= classedName %>Directive implements angular.IDirective {
restrict = '<%= restrict %>';<% if (hasTemplate) { %>
templateUrl = '<%= templateUrl %>';<% } %><% if (hasController) { %>
templateUrl = templateUrl;<% } %><% if (hasController) { %>
controller = ID.<%= classedName %>Controller;
controllerAs = '<%= cameledName %>';
controllerAs = 'vm';
bindToController = true;<% } %><% if (hasLinkFnc) { %>

link = (scope: angular.IScope,
instanceElement: angular.IAugmentedJQuery,
instanceAttributes: angular.IAttributes<% if (hasController) { %>,
link = (scope: ng.IScope,
instanceElement: ng.IAugmentedJQuery,
instanceAttributes: ng.IAttributes<% if (hasController) { %>,
controller: <%= classedName %>Controller<% } %>) => {
// TODO: link logic
};<% } %>
}<% if (hasController) { %>
};<% } %><% if (hasTemplate) { %>

export interface I<%= classedName %>Controller {
}
static getTemplateUrl = () => templateUrl;<% } %>
}<% if (hasController) { %>

class <%= classedName %>Controller implements I<%= classedName %>Controller {
export class <%= classedName %>Controller {
static $inject = [];
constructor() {
// TODO
Expand Down
16 changes: 6 additions & 10 deletions templates/typescript/directive.unit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
/// <reference path="../../../../<%= typingNesting %>typings/tsd.d.ts" />

module <%= prefix %>.<%= module %>.<%= $namespace %>.test {
namespace <%= prefix %>.<%= module %>.<%= $namespace %>.test {
'use strict';

describe(`Unit: ${Namespace}.<%= classedName %>Directive`, () => {
var $compile, $rootScope;
let $compile: ng.ICompileService, $rootScope: ng.IRootScopeService;

beforeEach(module(Namespace));
beforeEach(angular.mock.module(`${Namespace}.<%= classedName %>`));

beforeEach(angular.mock.inject(
['$compile', '$rootScope', ($c, $r) => {
$compile = $c;
$rootScope = $r;
}]
));<% if (hasController) { %>
beforeEach(angular.mock.inject(_$compile_ => $compile = _$compile_));
beforeEach(angular.mock.inject(_$rootScope_ => $rootScope = _$rootScope_));<% if (hasController) { %>

var controller: I<%= classedName %>Controller;
let controller: <%= classedName %>Controller;
beforeEach(inject($controller => controller = $controller(ID.<%= classedName %>Controller)));

it('should contain a <%= classedName %> controller', () => should.exist(controller));<% } %>
Expand Down
6 changes: 3 additions & 3 deletions templates/typescript/directives.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/// <reference path="../../../../<%= typingNesting %>typings/tsd.d.ts" />

module <%= prefix %>.<%= module %>.<%= $namespace %> {
namespace <%= prefix %>.<%= module %>.<%= $namespace %> {
'use strict';

export var Namespace = '<%= prefix %>.<%= module %>.<%= $namespace %>';
export const Namespace = '<%= prefix %>.<%= module %>.<%= $namespace %>';

angular
.module(Namespace, [<% for (var i = 0, l = components.length; i < l; i++) { %>
`${Namespace}.<%= components[i] %>`,<% } %>
`${Namespace}.<%= classedName %>`
]);

export var ID = {<% for (var i = 0, l = components.length; i < l; i++) { %>
export const ID = {<% for (var i = 0, l = components.length; i < l; i++) { %>
<%= components[i] %>Controller: `${Namespace}.<%= components[i] %>Controller`, <% } %>
<%= classedName %>Controller: `${Namespace}.<%= classedName %>Controller`
};
Expand Down
12 changes: 6 additions & 6 deletions templates/typescript/filter.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/// <reference path="../../../../<%= typingNesting %>typings/tsd.d.ts"/>

module <%= prefix %>.<%= module %>.<%= $namespace %> {
namespace <%= prefix %>.<%= module %>.<%= $namespace %> {
'use strict';

export interface I<%= classedName %>Filter {
export interface I<%= classedName %> {
(input: string): string;
}

var <%= cameledName %> = (): I<%= classedName %>Filter => {
export const <%= cameledName %>Filter = (): I<%= classedName %> => {
return input => {
input = input || '';

Expand All @@ -17,9 +17,9 @@ module <%= prefix %>.<%= module %>.<%= $namespace %> {
};
};

<%= cameledName %>.$inject = [];
<%= cameledName %>Filter.$inject = [];

angular
.module(`${Namespace}.<%= classedName %>Filter`, [])
.filter(ID.<%= classedName %>Filter, <%= cameledName %>);
.module(`${Namespace}.<%= classedName %>`, [])
.filter(ID.<%= classedName %>, <%= cameledName %>Filter);
}
12 changes: 6 additions & 6 deletions templates/typescript/filter.unit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/// <reference path="../../../../<%= typingNesting %>typings/tsd.d.ts" />

module <%= prefix %>.<%= module %>.<%= $namespace %>.test {
namespace <%= prefix %>.<%= module %>.<%= $namespace %>.test {
'use strict';

describe(`Unit: ${Namespace}.<%= classedName %>Filter`, () => {
describe(`Unit: ${Namespace}.<%= classedName %>`, () => {

beforeEach(module(Namespace));
beforeEach(angular.mock.module(`${Namespace}.<%= classedName %>`));

var <%= cameledName %>: I<%= classedName %>Filter;
beforeEach(inject($filter => <%= cameledName %> = $filter(ID.<%= classedName %>Filter)));
let <%= cameledName %>Filter: I<%= classedName %>;
beforeEach(inject($filter => <%= cameledName %>Filter = $filter(ID.<%= classedName %>)));

it('should contain a <%= cameledName %> filter', () => should.exist(<%= cameledName %>));
it('should contain a <%= cameledName %> filter', () => should.exist(<%= cameledName %>Filter));
});
}
Loading

0 comments on commit ca00925

Please sign in to comment.