File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,11 +112,21 @@ export default Mixin.create({
112112 //strip file extension if present
113113 path = path . replace ( / \. [ ^ / . ] + $ / , "" ) ;
114114
115+ let isGlimmer = false ; // TODO: decide how to let user choose
116+
115117 if ( this . isPathInvalid ( 'component' , path ) ) {
116118 return ;
117119 }
118120 [ 'js' , 'hbs' ] . forEach ( ( fileExt , i ) => {
119- let fileProperties = this . emberCli . buildProperties ( `component-${ fileExt } ` ) ;
121+ let replacements = { } ;
122+ if ( fileExt === 'js' ) {
123+ replacements . importComponent = isGlimmer ?
124+ `import Component from '@glimmer/component';` :
125+ `import Component from '@ember/component';` ;
126+ replacements . importTemplate = '' ;
127+ replacements . defaultExport = "class extends Component {\n}" ;
128+ }
129+ let fileProperties = this . emberCli . buildProperties ( `component-${ fileExt } ` , replacements ) ;
120130 let notPodPrefix = "components/" ;
121131 let filePath ;
122132 if ( path . substr ( 0 , notPodPrefix . length ) === notPodPrefix ) {
Original file line number Diff line number Diff line change @@ -8,13 +8,6 @@ function getEmberCLIBlueprints() {
88 let fileMap = { } ;
99
1010 let blueprintFiles = {
11- "cliBlueprintFiles" : {
12- "path" : "node_modules/ember-cli" ,
13- "files" : {
14- "app" : "app/files/app/app.js" ,
15- "router" : "app/files/app/router.js"
16- }
17- } ,
1811 "emberBlueprintFiles" : {
1912 "path" : "node_modules/ember-source" ,
2013 "files" : {
You can’t perform that action at this time.
0 commit comments