diff --git a/src/deploy/functions/prepare.ts b/src/deploy/functions/prepare.ts index 411a980dd5e..964c169de97 100644 --- a/src/deploy/functions/prepare.ts +++ b/src/deploy/functions/prepare.ts @@ -60,14 +60,20 @@ export async function prepare( return; } - // NOTE: this will eventually be enalbed for everyone once AR is enabled - // for GCFv1 + // Note: Some of these are premium APIs that require billing to be enabled. + // We'd eventually have to add special error handling for billing APIs, but + // enableCloudBuild is called above and has this special casing already. if (wantBackend.cloudFunctions.find((f) => f.platform === "gcfv2")) { - await ensureApiEnabled.ensure( - context.projectId, - "artifactregistry.googleapis.com", - "artifactregistry" - ); + const V2_APIS = { + artifactregistry: "artifactregistry.googleapis.com", + cloudrun: "run.googleapis.com", + eventarc: "eventarc.googleapis.com", + pubsub: "pubsub.googleapis.com", + }; + const enablements = Object.entries(V2_APIS).map(([tag, api]) => { + return ensureApiEnabled.ensure(context.projectId, api, tag); + }); + await Promise.all(enablements); } // Prepare the functions directory for upload, and set context.triggers. diff --git a/src/deploy/functions/validate.ts b/src/deploy/functions/validate.ts index c8b29cddfb6..ee4c8652baf 100644 --- a/src/deploy/functions/validate.ts +++ b/src/deploy/functions/validate.ts @@ -38,7 +38,7 @@ export function functionIdsAreValid(functions: { id: string; platform: string }[ }); if (invalidV1Ids.length !== 0) { const msg = - `${invalidV1Ids.join(", ")} function name(s) can only contain letters, ` + + `${invalidV1Ids.map((f) => f.id).join(", ")} function name(s) can only contain letters, ` + `numbers, hyphens, and not exceed 62 characters in length`; throw new FirebaseError(msg); } @@ -49,7 +49,7 @@ export function functionIdsAreValid(functions: { id: string; platform: string }[ }); if (invalidV2Ids.length !== 0) { const msg = - `${invalidV2Ids.join(", ")} v2 function name(s) can only contin lower ` + + `${invalidV2Ids.map((f) => f.id).join(", ")} v2 function name(s) can only contin lower ` + `case letters, numbers, hyphens, and not exceed 62 characters in length`; throw new FirebaseError(msg); } diff --git a/templates/init/functions/typescript/_eslintrc b/templates/init/functions/typescript/_eslintrc index 53b75230039..3cc63325d7c 100644 --- a/templates/init/functions/typescript/_eslintrc +++ b/templates/init/functions/typescript/_eslintrc @@ -22,7 +22,6 @@ module.exports = { ], plugins: [ "@typescript-eslint", - "import", ], rules: { quotes: ["error", "double"],