@@ -54,13 +54,13 @@ function convertToStandaloneApp(
5454export default async function ( tree : Tree , options : DomainOptions ) {
5555 const appName = strings . dasherize ( options . name ) ;
5656 const appNameAndDirectory = options . appDirectory
57- ? `${ options . appDirectory } /${ appName } `
58- : appName ;
59- const appNameAndDirectoryDasherized = strings
60- . dasherize ( appNameAndDirectory )
57+ ? `apps/ ${ options . appDirectory } /${ appName } `
58+ : `apps/ ${ appName } ` ;
59+ const appNameSlug = strings
60+ . dasherize ( appName )
6161 . split ( '/' )
6262 . join ( '-' ) ;
63- const appFolderPath = `apps/ ${ appNameAndDirectory } ` ;
63+ const appFolderPath = `${ appNameAndDirectory } ` ;
6464 const appSrcFolder = `${ appFolderPath } /src` ;
6565 const appModuleFolder = `${ appFolderPath } /src/app` ;
6666 const appModuleFilepath = `${ appModuleFolder } /app.module.ts` ;
@@ -69,23 +69,21 @@ export default async function (tree: Tree, options: DomainOptions) {
6969 const libNameAndDirectory = options . directory
7070 ? `${ options . directory } /${ libName } `
7171 : libName ;
72- const libNameAndDirectoryDasherized = strings
73- . dasherize ( libNameAndDirectory )
74- . split ( '/' )
75- . join ( '-' ) ;
76- const libFolderPath = `libs/${ libNameAndDirectory } ` ;
77- const libLibFolder = `${ libFolderPath } /domain/src/lib` ;
78- const libSrcFolder = `${ libFolderPath } /domain/src` ;
7972
80- // if (options.ngrx && !options.addApp) {
81- // throw new Error(
82- // `The 'ngrx' option may only be used when the 'addApp' option is used.`
83- // );
84- // }
73+ const libFolderPath = `libs/${ libNameAndDirectory } /domain` ;
74+ const libSrcFolder = `${ libFolderPath } /src` ;
75+ const libLibFolder = `${ libSrcFolder } /lib` ;
76+
77+ /*if (options.ngrx && !options.addApp) {
78+ throw new Error(
79+ `The 'ngrx' option may only be used when the 'addApp' option is used.`
80+ );
81+ }*/
8582
8683 await libraryGenerator ( tree , {
87- name : `libs/${ libNameAndDirectory } /domain` ,
88- // directory: libNameAndDirectory,
84+ // name: `libs/${libNameAndDirectory}/domain`,
85+ name : 'domain' ,
86+ directory : libFolderPath ,
8987 tags : `domain:${ libName } ,type:domain-logic` ,
9088 prefix : libName ,
9189 publishable : options . type === 'publishable' ,
@@ -114,8 +112,8 @@ export default async function (tree: Tree, options: DomainOptions) {
114112
115113 if ( options . addApp ) {
116114 await applicationGenerator ( tree , {
117- name : options . appDirectory ? `apps/ ${ options . appDirectory } / ${ appName } ` : `apps/ ${ appName } ` ,
118- // directory: options.appDirectory ,
115+ name : appNameAndDirectory ,
116+ directory : appNameAndDirectory ,
119117 tags : `domain:${ appName } ,type:app` ,
120118 style : 'scss' ,
121119 standalone : options . standalone
@@ -125,7 +123,7 @@ export default async function (tree: Tree, options: DomainOptions) {
125123 const wsConfig = readNxJson ( tree ) ;
126124 const npmScope = getNpmScope ( tree ) ;
127125 // const wsConfig = readWorkspaceConfiguration(tree);
128-
126+
129127 if ( options . addApp && options . standalone ) {
130128 convertToStandaloneApp ( tree , {
131129 name : options . name ,
@@ -146,7 +144,7 @@ export default async function (tree: Tree, options: DomainOptions) {
146144 ) ;
147145
148146 await generateStore ( tree , {
149- project : appNameAndDirectoryDasherized ,
147+ project : appNameSlug ,
150148 root : true ,
151149 minimal : true ,
152150 module : 'app.module.ts' ,
@@ -177,7 +175,7 @@ export default async function (tree: Tree, options: DomainOptions) {
177175 libName ,
178176 ! options . ngrx
179177 ) ;
180-
178+
181179 await formatFiles ( tree ) ;
182180 return ( ) => {
183181 installPackagesTask ( tree ) ;
0 commit comments