(
result: Extract<ToolDomainResult, { kind: 'project-list' }>,
)
| 970 | } |
| 971 | |
| 972 | function createProjectListItems( |
| 973 | result: Extract<ToolDomainResult, { kind: 'project-list' }>, |
| 974 | ): TextRenderableItem[] { |
| 975 | const items: TextRenderableItem[] = [ |
| 976 | createHeader('Discover Projects', [ |
| 977 | { label: 'Workspace root', value: displayPath(result.artifacts.workspaceRoot) }, |
| 978 | { label: 'Scan path', value: displayPath(result.artifacts.scanPath) }, |
| 979 | { label: 'Max depth', value: String(result.summary.maxDepth) }, |
| 980 | ]), |
| 981 | ]; |
| 982 | |
| 983 | if (result.didError) { |
| 984 | items.push(...createFailureStatusWithDiagnostics(result, 'Failed to discover projects.')); |
| 985 | return items; |
| 986 | } |
| 987 | |
| 988 | const projectCount = result.summary.projectCount ?? result.projects.length; |
| 989 | const workspaceCount = result.summary.workspaceCount ?? result.workspaces.length; |
| 990 | items.push( |
| 991 | createStatus( |
| 992 | 'success', |
| 993 | `Found ${pluralize(projectCount, 'project')} and ${pluralize(workspaceCount, 'workspace')}`, |
| 994 | ), |
| 995 | ); |
| 996 | items.push( |
| 997 | createSection( |
| 998 | 'Projects:', |
| 999 | result.projects.map((project) => displayPath(project.path)), |
| 1000 | ), |
| 1001 | ); |
| 1002 | items.push( |
| 1003 | createSection( |
| 1004 | 'Workspaces:', |
| 1005 | result.workspaces.map((workspace) => displayPath(workspace.path)), |
| 1006 | ), |
| 1007 | ); |
| 1008 | return items; |
| 1009 | } |
| 1010 | |
| 1011 | function createScaffoldResultItems( |
| 1012 | result: Extract<ToolDomainResult, { kind: 'scaffold-result' }>, |
no test coverage detected