better-codex 0.2.3 → 0.2.4
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.
- package/bin/better-codex.cjs +10 -3
- package/package.json +1 -1
package/bin/better-codex.cjs
CHANGED
|
@@ -162,8 +162,14 @@ const findRoot = (explicit) => {
|
|
|
162
162
|
throw new Error(`Specified root does not contain apps/: ${explicit}`);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
//
|
|
166
|
-
|
|
165
|
+
// First, check if apps/ exists relative to this script (npm global install).
|
|
166
|
+
const scriptDir = __dirname;
|
|
167
|
+
const packageRoot = dirname(scriptDir);
|
|
168
|
+
if (isRoot(packageRoot)) {
|
|
169
|
+
return packageRoot;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Fall back to searching from cwd (for development).
|
|
167
173
|
let current = resolve(process.cwd());
|
|
168
174
|
for (let depth = 0; depth < 8; depth += 1) {
|
|
169
175
|
if (isRoot(current)) {
|
|
@@ -230,7 +236,8 @@ const runWeb = (options) => {
|
|
|
230
236
|
log.success(`Bun ${c.dim}v${bunVersion}${c.reset}`);
|
|
231
237
|
|
|
232
238
|
const root = findRoot(options.root);
|
|
233
|
-
|
|
239
|
+
const workspaceDir = resolve(process.cwd());
|
|
240
|
+
log.success(`Workspace: ${c.dim}${workspaceDir}${c.reset}`);
|
|
234
241
|
|
|
235
242
|
const backendDir = join(root, 'apps', 'backend');
|
|
236
243
|
const webDir = join(root, 'apps', 'web');
|