1- import { ProjectConfiguration } from '@nx/devkit' ;
1+ import type { ProjectConfiguration } from '@nx/devkit' ;
22import { readFile } from 'node:fs/promises' ;
33import { dirname , join } from 'node:path' ;
44import { CP_TARGET_NAME } from './constants' ;
55import { createTargets } from './target/targets' ;
6- import { CreateNodesOptions , NormalizedCreateNodesOptions } from './types' ;
6+ import type { CreateNodesOptions , NormalizedCreateNodesOptions } from './types' ;
77
88export function normalizeCreateNodesOptions (
99 options : unknown = { } ,
@@ -18,10 +18,10 @@ export function normalizeCreateNodesOptions(
1818export async function loadProjectConfiguration (
1919 projectConfigurationFile : string ,
2020) : Promise < ProjectConfiguration > {
21- const projectConfiguration : ProjectConfiguration = await readFile (
21+ const projectConfiguration = ( await readFile (
2222 join ( process . cwd ( ) , projectConfigurationFile ) ,
2323 'utf8' ,
24- ) . then ( JSON . parse ) ;
24+ ) . then ( JSON . parse ) ) as Omit < ProjectConfiguration , 'root' > & { root ?: string } ;
2525 if (
2626 ! ( 'name' in projectConfiguration ) ||
2727 typeof projectConfiguration . name !== 'string'
@@ -30,7 +30,7 @@ export async function loadProjectConfiguration(
3030 }
3131 return {
3232 ...projectConfiguration ,
33- root : projectConfiguration ? .root ?? dirname ( projectConfigurationFile ) ,
33+ root : projectConfiguration . root ?? dirname ( projectConfigurationFile ) ,
3434 } ;
3535}
3636
0 commit comments