Skip to content

Commit b9839b0

Browse files
committed
Bumping Firebase CLI version
1 parent 01dce70 commit b9839b0

File tree

6 files changed

+515
-177
lines changed

6 files changed

+515
-177
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"firebase": "^7.0 || ^8.0",
5353
"firebase-admin": "^8.10.0",
5454
"firebase-functions": "^3.6.0",
55-
"firebase-tools": "^8.0.0",
55+
"firebase-tools": "^8.0.0 || ^9.0.0",
5656
"fs-extra": "^8.0.1",
5757
"fuzzy": "^0.1.3",
5858
"husky": "^4.2.5",

src/schematics/deploy/actions.ts

+14-10
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,20 @@ export default async function deploy(
254254
const winston = require('winston');
255255
const tripleBeam = require('triple-beam');
256256

257-
firebaseTools.logger.add(
258-
new winston.transports.Console({
259-
level: 'info',
260-
format: winston.format.printf((info) =>
261-
[info.message, ...(info[tripleBeam.SPLAT] || [])]
262-
.filter((chunk) => typeof chunk === 'string')
263-
.join(' ')
264-
)
265-
})
266-
);
257+
const logger = new winston.transports.Console({
258+
level: 'info',
259+
format: winston.format.printf((info) =>
260+
[info.message, ...(info[tripleBeam.SPLAT] || [])]
261+
.filter((chunk) => typeof chunk === 'string')
262+
.join(' ')
263+
)
264+
});
265+
266+
if (parseInt(firebaseTools.cli.version(), 10) >= 9) {
267+
firebaseTools.logger.logger.add(logger);
268+
} else {
269+
firebaseTools.logger.add(logger);
270+
}
267271

268272
if (serverBuildTarget) {
269273
await deployToFunction(

src/schematics/deploy/builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import deploy, { DeployBuilderOptions } from './actions';
33
import { BuildTarget } from '../interfaces';
44
import { getFirebaseProjectName } from '../utils';
55

6-
76
// Call the createBuilder() function to create a builder. This mirrors
87
// createJobHandler() but add typings specific to Architect Builders.
98
export default createBuilder(
@@ -31,6 +30,7 @@ export default createBuilder(
3130
}
3231

3332
try {
33+
process.env.FIREBASE_DEPLOY_AGENT = 'angularfire';
3434
await deploy(
3535
require('firebase-tools'),
3636
context,

src/schematics/deploy/schema.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema",
33
"$id": "FirebaseDeploySchema",
4-
// Include id field to remain compatible with older Angular
54
"id": "FirebaseDeploySchema",
65
"title": "Firebase Deploy",
76
"description": "Ng Deploy target options for Firebase.",

src/schematics/interfaces.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ export interface FirebaseTools {
2020
};
2121

2222
logger: {
23-
add(...args: any[]): any
23+
// firebase-tools v8
24+
add: (...args: any[]) => any
25+
} & {
26+
// firebase-tools v9
27+
logger: {
28+
add: (...args: any[]) => any;
29+
}
30+
};
31+
32+
cli: {
33+
version(): string;
2434
};
2535

2636
login(): Promise<void>;

0 commit comments

Comments
 (0)