From 89812ec8466fa590869a243caf156e578a5ad8d3 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sat, 21 Mar 2026 04:01:22 -0600 Subject: [PATCH] refactor(installer): remove dead state from ModuleManager Remove setBmadFolderName (set to constant, never read), setCoreConfig (set, never read), dead listAvailable branch guarded by never-assigned this.bmadDir, and unused BMAD_FOLDER_NAME import. --- tools/cli/installers/lib/core/installer.js | 2 - tools/cli/installers/lib/modules/manager.js | 41 +-------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index bf2700152..0bb25f6c3 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -58,8 +58,6 @@ class Installer { const customModulePaths = await this._discoverCustomModulePaths(config, paths); // Wire configs into managers - this.moduleManager.setBmadFolderName(BMAD_FOLDER_NAME); - this.moduleManager.setCoreConfig(moduleConfigs.core || {}); this.moduleManager.setCustomModulePaths(customModulePaths); this.ideManager.setBmadFolderName(BMAD_FOLDER_NAME); diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index 17a320c44..a0e02e5b1 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -4,7 +4,6 @@ const yaml = require('yaml'); const prompts = require('../../../lib/prompts'); const { getProjectRoot, getSourcePath, getModulePath } = require('../../../lib/project-root'); const { ExternalModuleManager } = require('./external-manager'); -const { BMAD_FOLDER_NAME } = require('../ide/shared/path-utils'); /** * Manages the installation, updating, and removal of BMAD modules. @@ -22,25 +21,8 @@ const { BMAD_FOLDER_NAME } = require('../ide/shared/path-utils'); */ class ModuleManager { constructor(options = {}) { - this.bmadFolderName = BMAD_FOLDER_NAME; // Default, can be overridden - this.customModulePaths = new Map(); // Initialize custom module paths - this.externalModuleManager = new ExternalModuleManager(); // For external official modules - } - - /** - * Set the bmad folder name for placeholder replacement - * @param {string} bmadFolderName - The bmad folder name - */ - setBmadFolderName(bmadFolderName) { - this.bmadFolderName = bmadFolderName; - } - - /** - * Set the core configuration for access during module installation - * @param {Object} coreConfig - Core configuration object - */ - setCoreConfig(coreConfig) { - this.coreConfig = coreConfig; + this.customModulePaths = new Map(); + this.externalModuleManager = new ExternalModuleManager(); } /** @@ -102,25 +84,6 @@ class ModuleManager { } } - // Check for cached custom modules in _config/custom/ - if (this.bmadDir) { - const customCacheDir = path.join(this.bmadDir, '_config', 'custom'); - if (await fs.pathExists(customCacheDir)) { - const cacheEntries = await fs.readdir(customCacheDir, { withFileTypes: true }); - for (const entry of cacheEntries) { - if (entry.isDirectory()) { - const cachePath = path.join(customCacheDir, entry.name); - const moduleInfo = await this.getModuleInfo(cachePath, entry.name, '_config/custom'); - if (moduleInfo && !modules.some((m) => m.id === moduleInfo.id) && !customModules.some((m) => m.id === moduleInfo.id)) { - moduleInfo.isCustom = true; - moduleInfo.fromCache = true; - customModules.push(moduleInfo); - } - } - } - } - } - return { modules, customModules }; }