bmad-method 6.2.3-next.1 → 6.2.3-next.3
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/package.json
CHANGED
|
@@ -313,10 +313,41 @@ class ExternalModuleManager {
|
|
|
313
313
|
|
|
314
314
|
// The module-definition specifies the path to module.yaml relative to repo root
|
|
315
315
|
// We need to return the directory containing module.yaml
|
|
316
|
-
const moduleDefinitionPath = moduleInfo.moduleDefinition; // e.g., '
|
|
317
|
-
const
|
|
316
|
+
const moduleDefinitionPath = moduleInfo.moduleDefinition; // e.g., 'skills/module.yaml'
|
|
317
|
+
const configuredPath = path.join(cloneDir, moduleDefinitionPath);
|
|
318
318
|
|
|
319
|
-
|
|
319
|
+
if (await fs.pathExists(configuredPath)) {
|
|
320
|
+
return path.dirname(configuredPath);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Fallback: search skills/ and src/ (root level and one level deep for subfolders)
|
|
324
|
+
for (const dir of ['skills', 'src']) {
|
|
325
|
+
const rootCandidate = path.join(cloneDir, dir, 'module.yaml');
|
|
326
|
+
if (await fs.pathExists(rootCandidate)) {
|
|
327
|
+
return path.dirname(rootCandidate);
|
|
328
|
+
}
|
|
329
|
+
const dirPath = path.join(cloneDir, dir);
|
|
330
|
+
if (await fs.pathExists(dirPath)) {
|
|
331
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
332
|
+
for (const entry of entries) {
|
|
333
|
+
if (entry.isDirectory()) {
|
|
334
|
+
const subCandidate = path.join(dirPath, entry.name, 'module.yaml');
|
|
335
|
+
if (await fs.pathExists(subCandidate)) {
|
|
336
|
+
return path.dirname(subCandidate);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Check repo root as last fallback
|
|
344
|
+
const rootCandidate = path.join(cloneDir, 'module.yaml');
|
|
345
|
+
if (await fs.pathExists(rootCandidate)) {
|
|
346
|
+
return path.dirname(rootCandidate);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Nothing found: return configured path (preserves old behavior for error messaging)
|
|
350
|
+
return path.dirname(configuredPath);
|
|
320
351
|
}
|
|
321
352
|
}
|
|
322
353
|
|