@@ -21,7 +21,7 @@ import {
2121 SyntaxKind ,
2222} from 'ts-morph' ;
2323import { 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' ;
2525import { finishSetup , handleAppConfig , stopSetup } from './utils' ;
2626
2727export interface InitGeneratorSchema {
@@ -43,7 +43,7 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
4343
4444 addDependenciesToPackageJson (
4545 tree ,
46- { 'angular-three' : version , three : THREE_VERSION , ngxtension : NGXTENSION_VERSION } ,
46+ { 'angular-three' : ANGULAR_THREE_VERSION , three : THREE_VERSION , ngxtension : NGXTENSION_VERSION } ,
4747 { '@types/three' : THREE_TYPE_VERSION } ,
4848 ) ;
4949
@@ -69,9 +69,9 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
6969 const projects = getProjects ( tree ) ;
7070 const applications : Record < string , ProjectConfiguration > = { } ;
7171
72- for ( const project of projects . values ( ) ) {
72+ for ( const [ projectName , project ] of projects . entries ( ) ) {
7373 if ( ! project . sourceRoot || project . projectType !== 'application' ) continue ;
74- applications [ project . name ] = project ;
74+ applications [ project . name || projectName ] = project ;
7575 }
7676
7777 const { appName } = await prompt < { appName : string } > ( {
@@ -177,13 +177,15 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
177177 if ( endSetup ) {
178178 return await endSetup ( ) ;
179179 }
180+ tree . write ( appConfigPath , appConfigSourceFile . print ( ) ) ;
180181 }
181182
182183 if ( Node . isObjectLiteralExpression ( configArgument ) ) {
183184 const endSetup = await handleAppConfig ( tree , configArgument , mainSourceFile ) ;
184185 if ( endSetup ) {
185186 return await endSetup ( ) ;
186187 }
188+ tree . write ( mainTsPath , mainSourceFile . print ( ) ) ;
187189 }
188190
189191 if ( options . sceneGraph === 'none' ) {
@@ -311,6 +313,7 @@ export async function initGenerator(tree: Tree, options: InitGeneratorSchema) {
311313 }
312314
313315 await componentSourceFile . save ( ) ;
316+ tree . write ( componentPath , componentSourceFile . print ( ) ) ;
314317 return await finishSetup ( tree ) ;
315318}
316319
0 commit comments