@@ -102,16 +102,30 @@ export async function updateWorkspace(rootPath: string): Promise<boolean> {
102102 // Use glob to expand the workspace pattern
103103 const expandedWorkspaces = fs . glob ( rootPath , w ) ;
104104 expandedWorkspaces . forEach ( expandedWorkspace => {
105- // Only add if it's a directory and contains source files
105+ // Only add if it's a directory
106106 if ( fs . directoryExists ( expandedWorkspace ) ) {
107- workspaces . push ( expandedWorkspace ) ;
107+ // For React/Webcomponents, look for src directory within workspace
108+ const srcPath = path . join ( expandedWorkspace , "src" ) ;
109+ if ( fs . directoryExists ( srcPath ) ) {
110+ workspaces . push ( srcPath ) ;
111+ } else {
112+ // Fallback to workspace root if no src directory
113+ workspaces . push ( expandedWorkspace ) ;
114+ }
108115 }
109116 } ) ;
110117 } else {
111118 // Direct workspace path
112119 const workspacePath = path . join ( rootPath , w ) ;
113120 if ( fs . directoryExists ( workspacePath ) ) {
114- workspaces . push ( workspacePath ) ;
121+ // For React/Webcomponents, look for src directory within workspace
122+ const srcPath = path . join ( workspacePath , "src" ) ;
123+ if ( fs . directoryExists ( srcPath ) ) {
124+ workspaces . push ( srcPath ) ;
125+ } else {
126+ // Fallback to workspace root if no src directory
127+ workspaces . push ( workspacePath ) ;
128+ }
115129 }
116130 }
117131 } ) ;
0 commit comments