@@ -21,7 +21,7 @@ import {
21
21
SyntaxKind ,
22
22
} from 'ts-morph' ;
23
23
import { addMetadataJson } from '../../utils' ;
24
- import { NGXTENSION_VERSION , THREE_TYPE_VERSION , THREE_VERSION } from '../../versions' ;
24
+ import { ANGULAR_THREE_VERSION , NGXTENSION_VERSION , THREE_TYPE_VERSION , THREE_VERSION } from '../../versions' ;
25
25
import { finishSetup , handleAppConfig , stopSetup } from './utils' ;
26
26
27
27
export interface InitGeneratorSchema {
@@ -43,7 +43,7 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
43
43
44
44
addDependenciesToPackageJson (
45
45
tree ,
46
- { 'angular-three' : version , three : THREE_VERSION , ngxtension : NGXTENSION_VERSION } ,
46
+ { 'angular-three' : ANGULAR_THREE_VERSION , three : THREE_VERSION , ngxtension : NGXTENSION_VERSION } ,
47
47
{ '@types/three' : THREE_TYPE_VERSION } ,
48
48
) ;
49
49
@@ -69,9 +69,9 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
69
69
const projects = getProjects ( tree ) ;
70
70
const applications : Record < string , ProjectConfiguration > = { } ;
71
71
72
- for ( const project of projects . values ( ) ) {
72
+ for ( const [ projectName , project ] of projects . entries ( ) ) {
73
73
if ( ! project . sourceRoot || project . projectType !== 'application' ) continue ;
74
- applications [ project . name ] = project ;
74
+ applications [ project . name || projectName ] = project ;
75
75
}
76
76
77
77
const { appName } = await prompt < { appName : string } > ( {
@@ -177,13 +177,15 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
177
177
if ( endSetup ) {
178
178
return await endSetup ( ) ;
179
179
}
180
+ tree . write ( appConfigPath , appConfigSourceFile . print ( ) ) ;
180
181
}
181
182
182
183
if ( Node . isObjectLiteralExpression ( configArgument ) ) {
183
184
const endSetup = await handleAppConfig ( tree , configArgument , mainSourceFile ) ;
184
185
if ( endSetup ) {
185
186
return await endSetup ( ) ;
186
187
}
188
+ tree . write ( mainTsPath , mainSourceFile . print ( ) ) ;
187
189
}
188
190
189
191
if ( options . sceneGraph === 'none' ) {
@@ -311,6 +313,7 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
311
313
}
312
314
313
315
await componentSourceFile . save ( ) ;
316
+ tree . write ( componentPath , componentSourceFile . print ( ) ) ;
314
317
return await finishSetup ( tree ) ;
315
318
}
316
319
0 commit comments