license import { ProjectDefinition , WorkspaceDefinition } from '@angular-devkit/core/src/workspace' ; import { SchematicsException } from '@angular-devkit/schematics' ; /**
 * Finds the specified project configuration in the workspace. Throws an error if the project
 * couldn't be found.
 */ export function getProjectFromWorkspace ( workspace , projectName = workspace . extensions . defaultProject as string ) { const project = workspace . projects . get ( projectName || ( workspace . extensions . defaultProject as string ) ) ; if ( ! project ) { throw new SchematicsException ( `Could not find project in workspace: ${ projectName }` ) ; } return project ; }