@codexa/cli 9.0.13 → 9.0.14

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.
@@ -137,32 +137,38 @@ function detectCommand(candidates: string[]): string | null {
137
137
  }
138
138
 
139
139
  function findConfigFile(files: string[], pattern: string): string | null {
140
- // Buscar no cwd primeiro
141
- const cwdCandidate = resolve(process.cwd(), pattern.replace("*.", ""));
142
- if (!pattern.includes("*") && existsSync(cwdCandidate)) return cwdCandidate;
143
-
144
- // Buscar subindo diretorios a partir dos arquivos
145
140
  const existingFiles = files.filter(f => existsSync(f));
146
- if (existingFiles.length === 0) return null;
147
-
148
- let dir = dirname(resolve(existingFiles[0]));
149
141
  const root = resolve("/");
150
-
151
- while (dir !== root) {
152
- if (pattern.includes("*")) {
153
- // Glob simples: *.csproj
154
- try {
155
- const entries = require("fs").readdirSync(dir) as string[];
156
- const ext = pattern.replace("*", "");
157
- const match = entries.find((e: string) => e.endsWith(ext));
158
- if (match) return resolve(dir, match);
159
- } catch { /* continue */ }
160
- } else {
161
- const candidate = resolve(dir, pattern);
162
- if (existsSync(candidate)) return candidate;
142
+ const cwd = process.cwd();
143
+
144
+ // Monorepo-aware: buscar subindo a partir dos arquivos primeiro,
145
+ // parando no cwd (raiz do projeto). Isso encontra o tsconfig mais
146
+ // proximo (ex: apps/frontend/tsconfig.json) antes do tsconfig raiz.
147
+ if (existingFiles.length > 0) {
148
+ let dir = dirname(resolve(existingFiles[0]));
149
+
150
+ while (dir !== root) {
151
+ if (pattern.includes("*")) {
152
+ try {
153
+ const entries = require("fs").readdirSync(dir) as string[];
154
+ const ext = pattern.replace("*", "");
155
+ const match = entries.find((e: string) => e.endsWith(ext));
156
+ if (match) return resolve(dir, match);
157
+ } catch { /* continue */ }
158
+ } else {
159
+ const candidate = resolve(dir, pattern);
160
+ if (existsSync(candidate)) return candidate;
161
+ }
162
+ dir = dirname(dir);
163
163
  }
164
- dir = dirname(dir);
165
164
  }
165
+
166
+ // Fallback: cwd (so chega aqui se nenhum config foi encontrado subindo)
167
+ if (!pattern.includes("*")) {
168
+ const cwdCandidate = resolve(cwd, pattern.replace("*.", ""));
169
+ if (existsSync(cwdCandidate)) return cwdCandidate;
170
+ }
171
+
166
172
  return null;
167
173
  }
168
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codexa/cli",
3
- "version": "9.0.13",
3
+ "version": "9.0.14",
4
4
  "description": "Orchestrated workflow system for Claude Code - manages feature development through parallel subagents with structured phases, gates, and quality enforcement.",
5
5
  "type": "module",
6
6
  "bin": {