code-graph-context 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,7 +87,38 @@ export class WorkspaceDetector {
87
87
  */
88
88
  async getWorkspacePatterns(rootPath, type) {
89
89
  switch (type) {
90
- case 'turborepo':
90
+ case 'turborepo': {
91
+ // Turborepo uses the package manager's workspace config.
92
+ // Check pnpm-workspace.yaml first, then package.json workspaces, then defaults.
93
+ const turboPnpmPath = path.join(rootPath, 'pnpm-workspace.yaml');
94
+ if (await this.fileExists(turboPnpmPath)) {
95
+ try {
96
+ const content = await fs.readFile(turboPnpmPath, 'utf-8');
97
+ const config = YAML.parse(content);
98
+ if (config?.packages && Array.isArray(config.packages)) {
99
+ return config.packages;
100
+ }
101
+ }
102
+ catch {
103
+ // Fall through
104
+ }
105
+ }
106
+ // Turbo with Yarn/npm workspaces — read from package.json
107
+ const turboPackageJsonPath = path.join(rootPath, 'package.json');
108
+ try {
109
+ const packageJson = JSON.parse(await fs.readFile(turboPackageJsonPath, 'utf-8'));
110
+ if (Array.isArray(packageJson.workspaces)) {
111
+ return packageJson.workspaces;
112
+ }
113
+ if (packageJson.workspaces?.packages) {
114
+ return packageJson.workspaces.packages;
115
+ }
116
+ }
117
+ catch {
118
+ // Fall through to defaults
119
+ }
120
+ return ['apps/*', 'packages/*'];
121
+ }
91
122
  case 'pnpm': {
92
123
  // pnpm-workspace.yaml defines packages
93
124
  const pnpmWorkspacePath = path.join(rootPath, 'pnpm-workspace.yaml');
@@ -103,8 +134,7 @@ export class WorkspaceDetector {
103
134
  // Fall through to defaults
104
135
  }
105
136
  }
106
- // Turborepo default patterns
107
- return ['apps/*', 'packages/*'];
137
+ return ['packages/*'];
108
138
  }
109
139
  case 'nx': {
110
140
  // For Nx, scan for all project.json files to find all projects
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-graph-context",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "MCP server that builds code graphs to provide rich context to LLMs",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/andrew-hernandez-paragon/code-graph-context#readme",