From 27d60e98896e153549c7491354d55a6dc678a879 Mon Sep 17 00:00:00 2001 From: Jeroen Benckhuijsen Date: Fri, 15 Nov 2024 14:50:10 +0100 Subject: [PATCH 1/2] Change type from number to integer for the emulator ports. --- schema/firebase-config.json | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/schema/firebase-config.json b/schema/firebase-config.json index b49d18a61a5..cf143d011b9 100644 --- a/schema/firebase-config.json +++ b/schema/firebase-config.json @@ -364,7 +364,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" }, "startCommandOverride": { "type": "string" @@ -379,7 +379,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -391,7 +391,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -403,13 +403,13 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" }, "postgresHost": { "type": "string" }, "postgresPort": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -421,7 +421,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -438,10 +438,10 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" }, "websocketPort": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -453,7 +453,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -465,7 +465,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -477,7 +477,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -489,7 +489,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -501,7 +501,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -516,7 +516,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -528,7 +528,7 @@ "type": "string" }, "port": { - "type": "number" + "type": "integer" } }, "type": "object" @@ -545,7 +545,7 @@ "port": { "type": [ "string", - "number" + "integer" ] } }, @@ -2756,4 +2756,3 @@ }, "type": "object" } - From 3c45eba6bc7eeea47d6e564417bd81ba01ff0eb6 Mon Sep 17 00:00:00 2001 From: Jeroen Benckhuijsen Date: Fri, 22 Nov 2024 14:19:56 +0100 Subject: [PATCH 2/2] Specify TJS Schema types for numbers to be integers --- schema/firebase-config.json | 11 ++++++----- src/firebaseConfig.ts | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/schema/firebase-config.json b/schema/firebase-config.json index 46170829471..e5fe4315456 100644 --- a/schema/firebase-config.json +++ b/schema/firebase-config.json @@ -11,7 +11,7 @@ "properties": { "concurrency": { "description": "Number of requests a function can serve at once.", - "type": "number" + "type": "integer" }, "cors": { "description": "If true, allows CORS on requests to this function.\nIf this is a `string` or `RegExp`, allows requests from domains that match the provided value.\nIf this is an `Array`, allows requests from domains matching at least one entry of the array.\nDefaults to true for {@link https.CallableFunction} and false otherwise.", @@ -60,7 +60,7 @@ }, "maxInstances": { "description": "Max number of instances to be running in parallel.", - "type": "number" + "type": "integer" }, "memory": { "description": "Amount of memory to allocate to a function.", @@ -79,7 +79,7 @@ }, "minInstances": { "description": "Min number of actual instances to be running at a given time.", - "type": "number" + "type": "integer" }, "omit": { "description": "If true, do not deploy or emulate this function.", @@ -105,7 +105,7 @@ }, "timeoutSeconds": { "description": "Timeout for the function in seconds, possible values are 0 to 540.\nHTTPS functions can specify a higher timeout.", - "type": "number" + "type": "integer" }, "vpcConnector": { "description": "Connect cloud function to specified VPC connector.", @@ -551,7 +551,7 @@ "port": { "type": [ "string", - "integer" + "number" ] } }, @@ -2762,3 +2762,4 @@ }, "type": "object" } + diff --git a/src/firebaseConfig.ts b/src/firebaseConfig.ts index c8a9279c934..8e4cf17aa06 100644 --- a/src/firebaseConfig.ts +++ b/src/firebaseConfig.ts @@ -98,9 +98,13 @@ interface FrameworksBackendOptions extends HttpsOptions { omit?: boolean; cors?: string | boolean; memory?: MemoryOption; + /** @TJS-type integer */ timeoutSeconds?: number; + /** @TJS-type integer */ minInstances?: number; + /** @TJS-type integer */ maxInstances?: number; + /** @TJS-type integer */ concurrency?: number; vpcConnector?: string; vpcConnectorEgressSettings?: VpcEgressSetting; @@ -184,45 +188,56 @@ export type RemoteConfigConfig = { export type EmulatorsConfig = { auth?: { host?: string; + /** @TJS-type integer */ port?: number; }; database?: { host?: string; + /** @TJS-type integer */ port?: number; }; firestore?: { host?: string; + /** @TJS-type integer */ port?: number; + /** @TJS-type integer */ websocketPort?: number; }; functions?: { host?: string; + /** @TJS-type integer */ port?: number; }; hosting?: { host?: string; + /** @TJS-type integer */ port?: number; }; apphosting?: { host?: string; + /** @TJS-type integer */ port?: number; startCommandOverride?: string; rootDirectory?: string; }; pubsub?: { host?: string; + /** @TJS-type integer */ port?: number; }; storage?: { host?: string; + /** @TJS-type integer */ port?: number; }; logging?: { host?: string; + /** @TJS-type integer */ port?: number; }; hub?: { host?: string; + /** @TJS-type integer */ port?: number; }; ui?: { @@ -233,18 +248,22 @@ export type EmulatorsConfig = { extensions?: {}; eventarc?: { host?: string; + /** @TJS-type integer */ port?: number; }; singleProjectMode?: boolean; dataconnect?: { host?: string; + /** @TJS-type integer */ port?: number; postgresHost?: string; + /** @TJS-type integer */ postgresPort?: number; dataDir?: string; }; tasks?: { host?: string; + /** @TJS-type integer */ port?: number; }; };