From 33fb50aaebf0b65f15114d0ee2632cd13f4bf766 Mon Sep 17 00:00:00 2001 From: Brian Li Date: Thu, 24 Oct 2024 15:55:02 -0400 Subject: [PATCH 1/2] check billing & move app hosting up in init list --- src/commands/init.ts | 12 ++++++------ src/init/features/apphosting.ts | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/commands/init.ts b/src/commands/init.ts index 8e58bbc8661..050fab4d3a1 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -45,6 +45,12 @@ let choices: { 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", @@ -87,12 +93,6 @@ let choices: { checked: false, hidden: true, }, - { - value: "apphosting", - name: "App Hosting: Configure an apphosting.yaml file for App Hosting", - checked: false, - hidden: false, - }, ]; if (isEnabled("genkit")) { diff --git a/src/init/features/apphosting.ts b/src/init/features/apphosting.ts index 9a39962f656..39ab29a11e8 100644 --- a/src/init/features/apphosting.ts +++ b/src/init/features/apphosting.ts @@ -2,6 +2,7 @@ import * as clc from "colorette"; 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"); @@ -9,6 +10,8 @@ const APPHOSTING_YAML_TEMPLATE = readTemplateSync("init/apphosting/apphosting.ya * Set up an apphosting.yaml file for a new App Hosting project. */ export async function doSetup(setup: any, config: Config): Promise { + await checkBillingEnabled(setup.projectId); 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`"); } From 76a20b7e1520c765afc37d5ed0da49c425433417 Mon Sep 17 00:00:00 2001 From: Brian Li Date: Thu, 24 Oct 2024 15:58:40 -0400 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..227418944e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1 @@ +- Check that billing is enabled and move App Hosting next to Hosting in init list (#7871).