Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions src/mcp/prompts/core/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
export const deploy = prompt(
{
name: "deploy",
omitPrefix: true,
description: "Use this command to deploy resources to Firebase.",
arguments: [
{
Expand Down Expand Up @@ -31,7 +30,7 @@
Contents of \`firebase.json\` config file:

\`\`\`json
${config.readProjectFile("firebase.json", { fallback: "<FILE DOES NOT EXIST>" })}

Check warning on line 33 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Invalid type "any" of template literal expression
\`\`\`

## User Instructions
Expand All @@ -43,7 +42,7 @@
Follow the steps below taking note of any user instructions provided above.

1. If there is no active user, prompt the user to run \`firebase login\` in an interactive terminal before continuing.
2. Analyze the source code in the current working directory to determine if this is a web app. If it isn't, end this process and tell the user "The /deploy command only works with web apps."
2. Analyze the source code in the current working directory to determine if this is a web app. If it isn't, end this process and tell the user "The /firebase:deploy command only works with web apps."
3. Analyze the source code in the current working directory to determine if the app requires a server for Server-Side Rendering (SSR). This will determine whether or not to use Firebase App Hosting. Here are instructions to determine if the app needs a server:
Objective: Analyze the provided codebase files to determine if the web application requires a backend for Server-Side Rendering (SSR). Your final output must be a clear "Yes" or "No" followed by a brief justification.
Primary Analysis: package.json
Expand Down Expand Up @@ -80,9 +79,9 @@
Example (No): "No, there are no dependencies or file structures that indicate the use of a server-side rendering framework."
4. If there is no \`firebase.json\` file, manually create one based on whether the app requires SSR:
4a. If the app requires SSR, configure Firebase App Hosting:
Create \`firebase.json\ with an "apphosting" configuration, setting backendId to the app's name in package.json: \`{"apphosting": {"backendId": "<backendId>"}}\

Check warning on line 82 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \ .

Check warning on line 82 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \ .
4b. If the app does NOT require SSR, configure Firebase Hosting:
Create \`firebase.json\ with a "hosting" configuration. Add a \`{"hosting": {"predeploy": "<build_script>"}}\` config to build before deploying.

Check warning on line 84 in src/mcp/prompts/core/deploy.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unnecessary escape character: \ .
5. Check if there is an active Firebase project for this environment (the \`firebase_get_environment\` tool may be helpful). If there is, provide the active project ID to the user and ask them if they want to proceed using that project. If there is not an active project, give the user two options: Provide an existing project ID or create a new project. Only use the list_projects tool on user request. Wait for their response before proceeding.
5a. If the user chooses to use an existing Firebase project, the \`firebase_list_projects\` tool may be helpful. Set the selected project as the active project (the \`firebase_update_environment\` tool may be helpful).
5b. If the user chooses to create a new project, use the \`firebase_create_project \` tool. Then set the new project as the active project (the \`firebase_update_environment\` tool may be helpful).
Expand Down
2 changes: 1 addition & 1 deletion src/mcp/resources/guides/init_hosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const init_hosting = resource(

**When to Deploy:**
- Introduce Firebase Hosting when developers are ready to deploy their application to production
- Alternative: Developers can deploy later using the \`/deploy\` command
- Alternative: Developers can deploy later using the \`/firebase:deploy\` command

**Deployment Process:**
- Request developer permission before implementing Firebase Hosting
Expand Down
Loading