File tree 4 files changed +65
-1
lines changed
4 files changed +65
-1
lines changed Original file line number Diff line number Diff line change
1
+ export interface < %= prefix % > < %= classifiedModuleName % > {
2
+ }
Original file line number Diff line number Diff line change
1
+ const stringUtils = require ( 'ember-cli-string-utils' ) ;
2
+ var dynamicPathParser = require ( '../../utilities/dynamic-path-parser' ) ;
3
+ var addBarrelRegistration = require ( '../../utilities/barrel-management' ) ;
4
+
5
+ module . exports = {
6
+ description : '' ,
7
+
8
+ anonymousOptions : [
9
+ '<interface-type>'
10
+ ] ,
11
+
12
+ normalizeEntityName : function ( entityName ) {
13
+ var parsedPath = dynamicPathParser ( this . project , entityName ) ;
14
+
15
+ this . dynamicPath = parsedPath ;
16
+ return parsedPath . name ;
17
+ } ,
18
+
19
+ locals : function ( options ) {
20
+ var interfaceType = options . args [ 2 ]
21
+ this . fileName = stringUtils . dasherize ( options . entity . name ) ;
22
+ if ( interfaceType ) {
23
+ this . fileName += '.' + interfaceType ;
24
+ }
25
+ var prefix = '' ;
26
+ if ( this . project . ngConfig &&
27
+ this . project . ngConfig . defaults &&
28
+ this . project . ngConfig . defaults . prefixInterfaces ) {
29
+ prefix = 'I' ;
30
+ }
31
+ return {
32
+ dynamicPath : this . dynamicPath . dir ,
33
+ flat : options . flat ,
34
+ fileName : this . fileName ,
35
+ prefix : prefix
36
+ } ;
37
+ } ,
38
+
39
+ fileMapTokens : function ( ) {
40
+ // Return custom template variables here.
41
+ return {
42
+ __path__ : ( ) => {
43
+ this . generatePath = this . dynamicPath . dir ;
44
+ return this . generatePath ;
45
+ } ,
46
+ __name__ : ( ) => {
47
+ return this . fileName ;
48
+ }
49
+ } ;
50
+ } ,
51
+
52
+ afterInstall : function ( ) {
53
+ return addBarrelRegistration (
54
+ this ,
55
+ this . generatePath ,
56
+ this . fileName ) ;
57
+ }
58
+ } ;
Original file line number Diff line number Diff line change 24
24
},
25
25
"defaults" : {
26
26
"prefix" : " <%= prefix %>" ,
27
- "sourceDir" : " <%= sourceDir %>"
27
+ "sourceDir" : " <%= sourceDir %>" ,
28
+ "prefixInterfaces" : false
28
29
}
29
30
}
Original file line number Diff line number Diff line change 86
86
},
87
87
"sourceDir" : {
88
88
"type" : " string"
89
+ },
90
+ "prefixInterfaces" : {
91
+ "type" : " boolean"
89
92
}
90
93
},
91
94
"additionalProperties" : false
You can’t perform that action at this time.
0 commit comments