firebase-tools
Version:
Command-Line Interface for Firebase
45 lines (44 loc) • 1.67 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.claude = void 0;
const promptUpdater_1 = require("./promptUpdater");
const CLAUDE_SETTINGS_PATH = ".claude/settings.local.json";
const CLAUDE_PROMPT_PATH = "CLAUDE.local.md";
exports.claude = {
name: "claude",
displayName: "Claude Code",
async configure(config, projectPath, enabledFeatures) {
var _a;
const files = [];
let existingConfig = {};
let settingsUpdated = false;
try {
const existingContent = config.readProjectFile(CLAUDE_SETTINGS_PATH);
if (existingContent) {
existingConfig = JSON.parse(existingContent);
}
}
catch (e) {
}
if (!((_a = existingConfig.mcpServers) === null || _a === void 0 ? void 0 : _a.firebase)) {
if (!existingConfig.mcpServers) {
existingConfig.mcpServers = {};
}
existingConfig.mcpServers.firebase = {
command: "npx",
args: ["-y", "firebase-tools", "experimental:mcp", "--dir", projectPath],
};
config.writeProjectFile(CLAUDE_SETTINGS_PATH, JSON.stringify(existingConfig, null, 2));
settingsUpdated = true;
}
files.push({ path: CLAUDE_SETTINGS_PATH, updated: settingsUpdated });
const { updated } = await (0, promptUpdater_1.updateFirebaseSection)(config, CLAUDE_PROMPT_PATH, enabledFeatures, {
interactive: true,
});
files.push({
path: CLAUDE_PROMPT_PATH,
updated,
});
return { files };
},
};