Skip to content

Commit b569599

Browse files
authored
Merge pull request #4 from tfarras/2.0rc
2.0
2 parents 3a99c57 + dcd2fd3 commit b569599

8 files changed

+87
-79
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ lerna-debug.log*
3333
!.vscode/launch.json
3434
!.vscode/extensions.json
3535

36-
package-lock.json
36+
package-lock.json

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
RELEASE 1.0.0
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.0.0] - 2021-04-22
9+
10+
### Fixed
11+
12+
- Changed name of exported module. Now it's the same in documentation and module: `FirebaseAdminModule`
13+
14+
### Changed
15+
16+
- Updated NestJS dependencies
17+
- Updated `firebase-admin` dependecy
18+
- Updated scripts. Now it's using [Nest Cli](https://docs.nestjs.com/cli/overview)
19+
20+
[2.0.0]: https://github.com/tfarras/nestjs-firebase-admin/releases/tag/2.0.0

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## Code Style
1111

12-
We use [Prettier](https://prettier.io/) and tslint to maintain code style and best practices.
12+
We use [Prettier](https://prettier.io/) and eslint to maintain code style and best practices.
1313
Please make sure your PR adheres to the guides by running:
1414

1515
```bash

nest-cli.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tfarras/nestjs-firebase-admin",
3-
"version": "1.0.0",
3+
"version": "2.0.1-rc.2",
44
"description": "NestJS Module for Firebase Admin SDK",
55
"author": "Taimoor Farras <farrastaimoor@gmail.com>",
66
"readmeFilename": "README.md",
@@ -10,21 +10,15 @@
1010
"dist/**/*",
1111
"*.md"
1212
],
13-
"scripts": {
14-
"start:dev": "tsc -w",
15-
"build": "tsc",
16-
"prepare": "npm run build",
17-
"format": "prettier --write \"src/**/*.ts\"",
18-
"lint": "tslint -p tsconfig.json -c tslint.json",
19-
"test": "jest",
20-
"test:watch": "jest --watch",
21-
"test:cov": "jest --coverage",
22-
"test:e2e": "jest --config ./test/jest-e2e.json"
23-
},
13+
"homepage": "https://github.com/tfarras/nestjs-firebase-admin#readme",
2414
"keywords": [
15+
"node.js",
2516
"nestjs",
17+
"nest",
18+
"google",
2619
"firebase",
2720
"firebase-admin",
21+
"module",
2822
"sdk"
2923
],
3024
"publishConfig": {
@@ -37,33 +31,45 @@
3731
"bugs": {
3832
"url": "https://github.com/tfarras/nestjs-firebase-admin/issues"
3933
},
40-
"homepage": "https://github.com/tfarras/nestjs-firebase-admin#readme",
41-
"peerDependencies": {
42-
"@nestjs/common": "^6.0.0",
43-
"firebase-admin": "^8.10.0"
34+
"scripts": {
35+
"prebuild": "rimraf dist",
36+
"build": "nest build",
37+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
38+
"start": "nest start",
39+
"start:dev": "nest start --watch",
40+
"start:debug": "nest start --debug --watch",
41+
"start:prod": "node dist/main",
42+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
43+
"test": "jest",
44+
"test:watch": "jest --watch",
45+
"test:cov": "jest --coverage",
46+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
47+
"test:e2e": "jest --config ./test/jest-e2e.json"
4448
},
4549
"dependencies": {
46-
"firebase-admin": "^8.10.0"
50+
"firebase-admin": "^9.6.0"
4751
},
4852
"devDependencies": {
49-
"@nestjs/common": "^6.0.0",
50-
"@nestjs/core": "^6.0.0",
51-
"@nestjs/platform-express": "^6.0.0",
52-
"@nestjs/testing": "6.1.1",
53-
"@types/express": "4.16.1",
54-
"@types/jest": "24.0.11",
55-
"@types/node": "11.13.4",
56-
"@types/supertest": "2.0.7",
57-
"rxjs": "^6.5.4",
58-
"jest": "24.7.1",
59-
"prettier": "1.17.0",
60-
"supertest": "4.0.2",
61-
"ts-jest": "24.0.2",
62-
"ts-node": "8.1.0",
63-
"tsc-watch": "2.2.1",
64-
"tsconfig-paths": "3.8.0",
65-
"tslint": "5.16.0",
66-
"typescript": "3.7.2"
53+
"@nestjs/cli": "^7.6.0",
54+
"@nestjs/schematics": "^7.3.0",
55+
"@nestjs/testing": "^7.6.15",
56+
"@types/express": "^4.17.11",
57+
"@types/jest": "^26.0.22",
58+
"@types/node": "^14.14.36",
59+
"@types/supertest": "^2.0.10",
60+
"@typescript-eslint/eslint-plugin": "^4.19.0",
61+
"@typescript-eslint/parser": "^4.19.0",
62+
"eslint": "^7.22.0",
63+
"eslint-config-prettier": "^8.1.0",
64+
"eslint-plugin-prettier": "^3.3.1",
65+
"jest": "^26.6.3",
66+
"prettier": "^2.2.1",
67+
"supertest": "^6.1.3",
68+
"ts-jest": "^26.5.4",
69+
"ts-loader": "^8.0.18",
70+
"ts-node": "^9.1.1",
71+
"tsconfig-paths": "^3.9.0",
72+
"typescript": "^4.2.3"
6773
},
6874
"jest": {
6975
"moduleFileExtensions": [
@@ -72,11 +78,14 @@
7278
"ts"
7379
],
7480
"rootDir": "src",
75-
"testRegex": ".spec.ts$",
81+
"testRegex": ".*\\.spec\\.ts$",
7682
"transform": {
7783
"^.+\\.(t|j)s$": "ts-jest"
7884
},
85+
"collectCoverageFrom": [
86+
"**/*.(t|j)s"
87+
],
7988
"coverageDirectory": "../coverage",
8089
"testEnvironment": "node"
8190
}
82-
}
91+
}

src/firebase-admin.module.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
import { Global, Module, DynamicModule } from '@nestjs/common';
2-
import { FirebaseAdminModuleAsyncOptions } from './firebase-admin.interface';
3-
import { FIREBASE_ADMIN_MODULE_OPTIONS, FIREBASE_ADMIN_INJECT } from './firebase-admin.constant';
4-
import * as admin from 'firebase-admin';
1+
import { Global, Module, DynamicModule } from "@nestjs/common";
2+
import { FirebaseAdminModuleAsyncOptions } from "./firebase-admin.interface";
3+
import {
4+
FIREBASE_ADMIN_MODULE_OPTIONS,
5+
FIREBASE_ADMIN_INJECT,
6+
} from "./firebase-admin.constant";
7+
import * as admin from "firebase-admin";
58

69
@Global()
710
@Module({})
8-
export class FirebaseAdminCoreModule {
11+
export class FirebaseAdminModule {
912
static forRoot(options: admin.AppOptions): DynamicModule {
1013
const firebaseAdminModuleOptions = {
1114
provide: FIREBASE_ADMIN_MODULE_OPTIONS,
1215
useValue: options,
1316
};
1417

15-
const app = admin.apps.length === 0 ? admin.initializeApp(options) : admin.apps[0];
18+
const app =
19+
admin.apps.length === 0 ? admin.initializeApp(options) : admin.apps[0];
1620

1721
const firebaseAuthencationProvider = {
1822
provide: FIREBASE_ADMIN_INJECT,
1923
useValue: app,
2024
};
2125

2226
return {
23-
module: FirebaseAdminCoreModule,
27+
module: FirebaseAdminModule,
2428
providers: [firebaseAdminModuleOptions, firebaseAuthencationProvider],
2529
exports: [firebaseAdminModuleOptions, firebaseAuthencationProvider],
2630
};
@@ -36,15 +40,16 @@ export class FirebaseAdminCoreModule {
3640
const firebaseAuthencationProvider = {
3741
provide: FIREBASE_ADMIN_INJECT,
3842
useFactory: (opt: admin.AppOptions) => {
39-
const app = admin.apps.length === 0 ? admin.initializeApp(opt) : admin.apps[0];
43+
const app =
44+
admin.apps.length === 0 ? admin.initializeApp(opt) : admin.apps[0];
4045

4146
return app;
4247
},
4348
inject: [FIREBASE_ADMIN_MODULE_OPTIONS],
4449
};
4550

4651
return {
47-
module: FirebaseAdminCoreModule,
52+
module: FirebaseAdminModule,
4853
imports: options.imports,
4954
providers: [firebaseAdminModuleOptions, firebaseAuthencationProvider],
5055
exports: [firebaseAdminModuleOptions, firebaseAuthencationProvider],

tsconfig.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
"removeComments": true,
66
"emitDecoratorMetadata": true,
77
"experimentalDecorators": true,
8-
"target": "es6",
9-
"sourceMap": false,
8+
"allowSyntheticDefaultImports": true,
9+
"target": "es2017",
10+
"sourceMap": true,
1011
"outDir": "./dist",
11-
"rootDir": "./src",
1212
"baseUrl": "./",
13-
"noLib": false
14-
},
15-
"include": ["src/**/*.ts"],
16-
"exclude": ["node_modules"]
13+
"incremental": true
14+
}
1715
}

tslint.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)