Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/mcp/tools/core/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,27 @@
})
.optional()
.describe("Enable Firebase AI Logic feature for existing app"),
hosting: z
.object({
site: z

Check failure on line 145 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Replace `⏎··············.string()⏎··············.optional()⏎··············` with `.string().optional()`

Check failure on line 145 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Replace `⏎··············.string()⏎··············.optional()⏎··············` with `.string().optional()`

Check failure on line 145 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Replace `⏎··············.string()⏎··············.optional()⏎··············` with `.string().optional()`

Check failure on line 145 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Replace `⏎··············.string()⏎··············.optional()⏎··············` with `.string().optional()`

Check failure on line 145 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Replace `⏎··············.string()⏎··············.optional()⏎··············` with `.string().optional()`
.string()
.optional()
.describe("The ID of the hosting site to configure."),
public: z
.string()
.optional()
.default("public")
.describe("The directory to use as the public root."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

public is a reserved keyword in TypeScript. While it's valid to use it as a property name here, it can lead to issues, for example with object destructuring (const { public } = ... is invalid). It's better to use a non-reserved name like publicDirectory to improve code clarity and prevent potential errors. This change will also require an update on line 247.

Suggested change
public: z
.string()
.optional()
.default("public")
.describe("The directory to use as the public root."),
publicDirectory: z
.string()
.optional()
.default("public")
.describe("The directory to use as the public root."),

spa: z

Check failure on line 154 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Replace `⏎··············.boolean()⏎··············.optional()⏎··············.default(false)⏎··············` with `.boolean().optional().default(false)`

Check failure on line 154 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Replace `⏎··············.boolean()⏎··············.optional()⏎··············.default(false)⏎··············` with `.boolean().optional().default(false)`

Check failure on line 154 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Replace `⏎··············.boolean()⏎··············.optional()⏎··············.default(false)⏎··············` with `.boolean().optional().default(false)`

Check failure on line 154 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Replace `⏎··············.boolean()⏎··············.optional()⏎··············.default(false)⏎··············` with `.boolean().optional().default(false)`

Check failure on line 154 in src/mcp/tools/core/init.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Replace `⏎··············.boolean()⏎··············.optional()⏎··············.default(false)⏎··············` with `.boolean().optional().default(false)`
.boolean()
.optional()
.default(false)
.describe("Configure as a single-page app."),
})
.optional()
.describe(
"Provide this object to initialize Firebase Hosting in this project directory.",
),
}),
}),
annotations: {
Expand Down Expand Up @@ -219,6 +240,14 @@
displayName: appData.displayName,
};
}
if (features.hosting) {
featuresList.push("hosting");
featureInfo.hosting = {
newSiteId: features.hosting.site,
public: features.hosting.public,
spa: features.hosting.spa,
};
}
const setup: Setup = {
config: config?.src,
rcfile: rc?.data,
Expand Down
Loading