Skip to content

Commit fdcc318

Browse files
committed
More type fixes
1 parent b793573 commit fdcc318

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
- `firebase_update_environment` MCP tool supports accepting Gemini in Firebase Terms of Service.
44
- Fixed a bug when `firebase init dataconnect` failed to create a React app when launched from VS Code extension (#9171).
55
- Improved the clarity of the `firebase apptesting:execute` command when you have zero or multiple apps.
6+
- Added 'emulators' to `firebase_init` MCP tool.

src/init/features/emulators.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { AdditionalInitFns } from "../../emulator/initEmulators";
99
import { Config } from "../../config";
1010
import { EmulatorsConfig } from "../../firebaseConfig";
1111

12-
export interface EmulatorsInfo {
12+
export interface RequiredInfo {
1313
emulators: Emulators[];
1414
download: boolean;
1515
config: EmulatorsConfig;
1616
}
1717

18-
export async function emulatorsAskQuestions(setup: Setup, config: Config): Promise<void> {
18+
export async function askQuestions(setup: Setup, config: Config): Promise<void> {
1919
const choices = ALL_SERVICE_EMULATORS.map((e) => {
2020
return {
2121
value: e,
@@ -36,7 +36,7 @@ export async function emulatorsAskQuestions(setup: Setup, config: Config): Promi
3636
}
3737

3838
setup.featureInfo = setup.featureInfo || {};
39-
const emulatorsInfo: EmulatorsInfo = {
39+
const emulatorsInfo: RequiredInfo = {
4040
emulators: selectedEmulators,
4141
config: {},
4242
download: false,
@@ -106,7 +106,7 @@ export async function emulatorsAskQuestions(setup: Setup, config: Config): Promi
106106
}
107107
}
108108

109-
export async function emulatorsActuate(setup: Setup): Promise<void> {
109+
export async function actuate(setup: Setup): Promise<void> {
110110
const emulatorsInfo = setup.featureInfo?.emulators;
111111
if (!emulatorsInfo) {
112112
return;

src/init/features/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export {
1616
RequiredInfo as StorageInfo,
1717
actuate as storageActuate,
1818
} from "./storage";
19-
export { doSetup as emulators } from "./emulators";
19+
export {
20+
askQuestions as emulatorsAskQuestions,
21+
RequiredInfo as EmulatorsInfo,
22+
actuate as emulatorsActuate,
23+
} from "./emulators";
2024
export { doSetup as extensions } from "./extensions";
2125
// always runs, sets up .firebaserc
2226
export { doSetup as project } from "./project";

src/mcp/tools/core/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export const init = tool(
140140
.object({
141141
enabled: z.boolean().optional(),
142142
host: z.string().optional(),
143-
port: z.union([z.string(), z.number()]).optional(),
143+
port: z.number().optional(),
144144
})
145145
.optional(),
146146
singleProjectMode: z
@@ -209,7 +209,7 @@ export const init = tool(
209209
apps: [],
210210
};
211211
}
212-
if (features.storage) {
212+
if (features.storage?.rules) {
213213
featuresList.push("storage");
214214
featureInfo.storage = {
215215
rulesFilename: features.storage.rules_filename,

0 commit comments

Comments
 (0)