Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check billing during App Hosting init and move App Hosting option next to Hosting in init list #7871

Merged
merged 5 commits into from
Oct 30, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- Check that billing is enabled and move App Hosting next to Hosting in init list (#7871).
- Fix rollouts:create to handle backend regionality & other fixes. (#7862)
- Fixed Next.js issue with PPR routes not rendering correctly. (#7625)
12 changes: 6 additions & 6 deletions src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
name: "Functions: Configure a Cloud Functions directory and its files",
checked: false,
},
{
value: "apphosting",
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
checked: false,
hidden: false,
},
{
value: "hosting",
name: "Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys",
Expand Down Expand Up @@ -87,12 +93,6 @@
checked: false,
hidden: true,
},
{
value: "apphosting",
name: "App Hosting: Configure an apphosting.yaml file for App Hosting",
checked: false,
hidden: false,
},
];

if (isEnabled("genkit")) {
Expand Down Expand Up @@ -176,7 +176,7 @@

const setup: Setup = {
config: config.src,
rcfile: config.readProjectFile(".firebaserc", {

Check warning on line 179 in src/commands/init.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
json: true,
fallback: {},
}),
Expand Down
3 changes: 3 additions & 0 deletions src/init/features/apphosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
import * as utils from "../../utils";
import { Config } from "../../config";
import { readTemplateSync } from "../../templates";
import { checkBillingEnabled } from "../../gcp/cloudbilling";

const APPHOSTING_YAML_TEMPLATE = readTemplateSync("init/apphosting/apphosting.yaml");

/**
* Set up an apphosting.yaml file for a new App Hosting project.
*/
export async function doSetup(setup: any, config: Config): Promise<void> {

Check warning on line 12 in src/init/features/apphosting.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
await checkBillingEnabled(setup.projectId);

Check warning on line 13 in src/init/features/apphosting.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe argument of type `any` assigned to a parameter of type `string`

Check warning on line 13 in src/init/features/apphosting.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .projectId on an `any` value
utils.logBullet("Writing default settings to " + clc.bold("apphosting.yaml") + "...");
await config.askWriteProjectFile("apphosting.yaml", APPHOSTING_YAML_TEMPLATE);
utils.logSuccess("Create a new App Hosting backend with `firebase apphosting:backends:create`");
}
Loading