fix: build web bundles with new file extension includsion

This commit is contained in:
Brian Madison
2025-07-06 19:39:34 -05:00
parent 97590e5e1d
commit 92201ae7ed
30 changed files with 32656 additions and 29677 deletions

View File

@@ -116,31 +116,20 @@ class DependencyResolver {
}
try {
const extensions = ['.md', '.yaml'];
let content = null;
let filePath = null;
// First try bmad-core
for (const ext of extensions) {
try {
filePath = path.join(this.bmadCore, type, id);
content = await fs.readFile(filePath, 'utf8');
} catch (e) {
// If not found in bmad-core, try common folder
try {
filePath = path.join(this.bmadCore, type, `${id}${ext}`);
filePath = path.join(this.common, type, id);
content = await fs.readFile(filePath, 'utf8');
break;
} catch (e) {
// Try next extension
}
}
// If not found in bmad-core, try common folder
if (!content) {
for (const ext of extensions) {
try {
filePath = path.join(this.common, type, `${id}${ext}`);
content = await fs.readFile(filePath, 'utf8');
break;
} catch (e) {
// Try next extension
}
} catch (e2) {
// File not found in either location
}
}