-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gen): allow app names to have custom suffix
Allow app names to have a custom suffix with app-suffix option. By default, it uses 'App' Breaks existing app names that began with a capital letter
- Loading branch information
1 parent
889befb
commit 09f0f7b
Showing
63 changed files
with
194 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict' | ||
|
||
angular.module("<%= _.camelize(appname) %>App").config ["$provide", ($provide) -> | ||
$provide.decorator "<%= _.camelize(name) %>", ($delegate) -> | ||
angular.module("<%= scriptAppName").config ["$provide", ($provide) -> | ||
$provide.decorator "<%= cameledName %>", ($delegate) -> | ||
# decorate the $delegate | ||
$delegate | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.directive '<%= _.camelize(name) %>', [-> | ||
angular.module('<%= scriptAppName %>') | ||
.directive '<%= cameledName %>', [-> | ||
template: '<div></div>' | ||
restrict: 'E' | ||
link: (scope, element, attrs) -> | ||
element.text 'this is the <%= _.camelize(name) %> directive' | ||
element.text 'this is the <%= cameledName %> directive' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.filter '<%= _.camelize(name) %>', [() -> | ||
angular.module('<%= scriptAppName %>') | ||
.filter '<%= cameledName %>', [() -> | ||
(input) -> | ||
'<%= _.camelize(name) %> filter: ' + input | ||
'<%= cameledName %> filter: ' + input | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.constant '<%= _.camelize(name) %>', 42 | ||
angular.module('<%= scriptAppName %>') | ||
.constant '<%= cameledName %>', 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.service '<%= _.classify(name) %>', () -> | ||
angular.module('<%= scriptAppName %>') | ||
.service '<%= classedName %>', () -> | ||
# AngularJS will instantiate a singleton by calling "new" on this function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.value '<%= _.camelize(name) %>', 42 | ||
angular.module('<%= scriptAppName %>') | ||
.value '<%= cameledName %>', 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
'use strict' | ||
|
||
describe 'Filter: <%= _.camelize(name) %>', () -> | ||
describe 'Filter: <%= cameledName %>', () -> | ||
|
||
# load the filter's module | ||
beforeEach module '<%= _.camelize(appname) %>App' | ||
beforeEach module '<%= scriptAppName %>' | ||
|
||
# initialize a new instance of the filter before each test | ||
<%= _.camelize(name) %> = {} | ||
<%= cameledName %> = {} | ||
beforeEach inject ($filter) -> | ||
<%= _.camelize(name) %> = $filter '<%= _.camelize(name) %>' | ||
<%= cameledName %> = $filter '<%= cameledName %>' | ||
|
||
it 'should return the input prefixed with "<%= _.camelize(name) %> filter:"', () -> | ||
it 'should return the input prefixed with "<%= cameledName %> filter:"', () -> | ||
text = 'angularjs' | ||
expect(<%= _.camelize(name) %> text).toBe ('<%= _.camelize(name) %> filter: ' + text) | ||
expect(<%= cameledName %> text).toBe ('<%= cameledName %> filter: ' + text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
'use strict' | ||
|
||
describe 'Service: <%= _.classify(name) %>', () -> | ||
describe 'Service: <%= classedName %>', () -> | ||
|
||
# load the service's module | ||
beforeEach module '<%= _.classify(appname) %>App' | ||
beforeEach module '<%= scriptAppName %>App' | ||
|
||
# instantiate service | ||
<%= _.classify(name) %> = {} | ||
beforeEach inject (_<%= _.classify(name) %>_) -> | ||
<%= _.classify(name) %> = _<%= _.classify(name) %>_ | ||
<%= classedName %> = {} | ||
beforeEach inject (_<%= classedName %>_) -> | ||
<%= classedName %> = _<%= classedName %>_ | ||
|
||
it 'should do something', () -> | ||
expect(!!<%= _.classify(name) %>).toBe true | ||
expect(!!<%= classedName %>).toBe true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
|
||
angular.module("<%= _.camelize(appname) %>App").config ($provide) -> | ||
$provide.decorator "<%= _.camelize(name) %>", ($delegate) -> | ||
angular.module("<%= scriptAppName").config ($provide) -> | ||
$provide.decorator "<%= cameledName %>", ($delegate) -> | ||
# decorate the $delegate | ||
$delegate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.directive('<%= _.camelize(name) %>', () -> | ||
angular.module('<%= scriptAppName %>') | ||
.directive('<%= cameledName %>', () -> | ||
template: '<div></div>' | ||
restrict: 'E' | ||
link: (scope, element, attrs) -> | ||
element.text 'this is the <%= _.camelize(name) %> directive' | ||
element.text 'this is the <%= cameledName %> directive' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.filter '<%= _.camelize(name) %>', () -> | ||
angular.module('<%= scriptAppName %>') | ||
.filter '<%= cameledName %>', () -> | ||
(input) -> | ||
'<%= _.camelize(name) %> filter: ' + input | ||
'<%= cameledName %> filter: ' + input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.constant '<%= _.camelize(name) %>', 42 | ||
angular.module('<%= scriptAppName %>') | ||
.constant '<%= cameledName %>', 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.service '<%= _.classify(name) %>', () -> | ||
angular.module('<%= scriptAppName %>') | ||
.service '<%= classedName %>', () -> | ||
# AngularJS will instantiate a singleton by calling "new" on this function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict' | ||
|
||
angular.module('<%= _.camelize(appname) %>App') | ||
.value '<%= _.camelize(name) %>', 42 | ||
angular.module('<%= scriptAppName %>') | ||
.value '<%= cameledName %>', 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
'use strict' | ||
|
||
describe 'Filter: <%= _.camelize(name) %>', () -> | ||
describe 'Filter: <%= cameledName %>', () -> | ||
|
||
# load the filter's module | ||
beforeEach module '<%= _.camelize(appname) %>App' | ||
beforeEach module '<%= scriptAppName %>' | ||
|
||
# initialize a new instance of the filter before each test | ||
<%= _.camelize(name) %> = {} | ||
<%= cameledName %> = {} | ||
beforeEach inject ($filter) -> | ||
<%= _.camelize(name) %> = $filter '<%= _.camelize(name) %>' | ||
<%= cameledName %> = $filter '<%= cameledName %>' | ||
|
||
it 'should return the input prefixed with "<%= _.camelize(name) %> filter:"', () -> | ||
it 'should return the input prefixed with "<%= cameledName %> filter:"', () -> | ||
text = 'angularjs' | ||
expect(<%= _.camelize(name) %> text).toBe ('<%= _.camelize(name) %> filter: ' + text) | ||
expect(<%= cameledName %> text).toBe ('<%= cameledName %> filter: ' + text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
'use strict' | ||
|
||
describe 'Service: <%= _.classify(name) %>', () -> | ||
describe 'Service: <%= classedName %>', () -> | ||
|
||
# load the service's module | ||
beforeEach module '<%= _.classify(appname) %>App' | ||
beforeEach module '<%= scriptAppName %>App' | ||
|
||
# instantiate service | ||
<%= _.classify(name) %> = {} | ||
beforeEach inject (_<%= _.classify(name) %>_) -> | ||
<%= _.classify(name) %> = _<%= _.classify(name) %>_ | ||
<%= classedName %> = {} | ||
beforeEach inject (_<%= classedName %>_) -> | ||
<%= classedName %> = _<%= classedName %>_ | ||
|
||
it 'should do something', () -> | ||
expect(!!<%= _.classify(name) %>).toBe true | ||
expect(!!<%= classedName %>).toBe true |
Oops, something went wrong.