@@ -23,7 +23,7 @@ import { DelegateContext } from "..";
2323import * as supported from "../supported" ;
2424import * as validate from "./validate" ;
2525import * as versioning from "./versioning" ;
26- import * as parseTriggers from "./parseTriggers" ;
26+
2727import { fileExistsSync } from "../../../../fsutils" ;
2828
2929// The versions of the Firebase Functions SDK that added support for the container contract.
@@ -292,27 +292,23 @@ export class Delegate {
292292 env : backend . EnvironmentVariables ,
293293 ) : Promise < build . Build > {
294294 if ( ! semver . valid ( this . sdkVersion ) ) {
295- logger . debug (
296- `Could not parse firebase-functions version '${ this . sdkVersion } ' into semver. Falling back to parseTriggers.` ,
297- ) ;
298- return parseTriggers . discoverBuild ( this . projectId , this . sourceDir , this . runtime , config , env ) ;
299- }
300- if ( semver . lt ( this . sdkVersion , MIN_FUNCTIONS_SDK_VERSION ) ) {
301- logLabeledWarning (
302- "functions" ,
303- `You are using an old version of firebase-functions SDK (${ this . sdkVersion } ). ` +
304- `Please update firebase-functions SDK to >=${ MIN_FUNCTIONS_SDK_VERSION } ` ,
305- ) ;
306- return parseTriggers . discoverBuild ( this . projectId , this . sourceDir , this . runtime , config , env ) ;
307- }
308- // Perform a check for the minimum SDK version that added annotation support for the `Build.extensions` property
309- // and log to the user explaining why they need to upgrade their version.
310- if ( semver . lt ( this . sdkVersion , MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES ) ) {
311- logLabeledBullet (
312- "functions" ,
313- `You are using a version of firebase-functions SDK (${ this . sdkVersion } ) that does not have support for the newest Firebase Extensions features. ` +
314- `Please update firebase-functions SDK to >=${ MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES } to use them correctly` ,
315- ) ;
295+ logger . debug ( `Could not parse firebase-functions version '${ this . sdkVersion } ' into semver.` ) ;
296+ } else {
297+ if ( semver . lt ( this . sdkVersion , MIN_FUNCTIONS_SDK_VERSION ) ) {
298+ throw new FirebaseError (
299+ `You are using an old version of firebase-functions SDK (${ this . sdkVersion } ). ` +
300+ `Please update firebase-functions SDK to >=${ MIN_FUNCTIONS_SDK_VERSION } ` ,
301+ ) ;
302+ }
303+ // Perform a check for the minimum SDK version that added annotation support for the `Build.extensions` property
304+ // and log to the user explaining why they need to upgrade their version.
305+ if ( semver . lt ( this . sdkVersion , MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES ) ) {
306+ logLabeledBullet (
307+ "functions" ,
308+ `You are using a version of firebase-functions SDK (${ this . sdkVersion } ) that does not have support for the newest Firebase Extensions features. ` +
309+ `Please update firebase-functions SDK to >=${ MIN_FUNCTIONS_SDK_VERSION_FOR_EXTENSIONS_FEATURES } to use them correctly` ,
310+ ) ;
311+ }
316312 }
317313 let discovered = await discovery . detectFromYaml ( this . sourceDir , this . projectId , this . runtime ) ;
318314 if ( ! discovered ) {
0 commit comments