@@ -54,6 +54,13 @@ export async function libraryGenerator(tree: Tree, schema: Schema) {
5454
5555export async function libraryGeneratorInternal ( tree : Tree , schema : Schema ) {
5656 const options = await normalizeOptions ( tree , schema ) ;
57+
58+ // If we are using the new TS solution
59+ // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
60+ if ( options . isUsingTsSolutionConfig ) {
61+ addProjectToTsSolutionWorkspace ( tree , options . projectRoot ) ;
62+ }
63+
5764 const tasks : GeneratorCallback [ ] = [ ] ;
5865
5966 if ( options . publishable === true && ! schema . importPath ) {
@@ -112,12 +119,6 @@ export async function libraryGeneratorInternal(tree: Tree, schema: Schema) {
112119 tasks . push ( ( ) => installPackagesTask ( tree , true ) ) ;
113120 }
114121
115- // If we are using the new TS solution
116- // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
117- if ( options . isUsingTsSolutionConfig ) {
118- addProjectToTsSolutionWorkspace ( tree , options . projectRoot ) ;
119- }
120-
121122 sortPackageJsonFields ( tree , options . projectRoot ) ;
122123
123124 if ( ! schema . skipFormat ) {
@@ -163,14 +164,17 @@ async function normalizeOptions(
163164 ? options . tags . split ( ',' ) . map ( ( s ) => s . trim ( ) )
164165 : [ ] ;
165166
167+ const isUsingTsSolutionConfig = isUsingTsSolutionSetup ( tree ) ;
166168 return {
167169 ...options ,
168170 fileName,
169- projectName,
171+ projectName : isUsingTsSolutionConfig
172+ ? getImportPath ( tree , projectName )
173+ : projectName ,
170174 projectRoot,
171175 parsedTags,
172176 importPath,
173- isUsingTsSolutionConfig : isUsingTsSolutionSetup ( tree ) ,
177+ isUsingTsSolutionConfig,
174178 } ;
175179}
176180
0 commit comments