Skip to content

Commit 5508c90

Browse files
committed
feat(package): added NgbAuthFirebaseUIModule
1 parent 500f530 commit 5508c90

File tree

5 files changed

+131
-0
lines changed

5 files changed

+131
-0
lines changed

Diff for: src/auth/module/ngb-auth-firebase-u-i.module.ts

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import {CommonModule} from '@angular/common';
2+
import {NgModule, ModuleWithProviders, InjectionToken} from '@angular/core';
3+
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
4+
5+
import {AuthProcessService} from './services/auth-process.service';
6+
import {FirestoreSyncService} from './services/firestore-sync.service';
7+
import {FirebaseAppConfig, FirebaseOptionsToken, FirebaseNameOrConfigToken} from 'angularfire2';
8+
import {AngularFirestoreModule} from 'angularfire2/firestore';
9+
import {defaultAuthFirebaseUIConfig, NgBootstrapAuthFirebaseUIConfig} from './interfaces/config.interface';
10+
import {AuthComponent} from './components/auth/auth.component';
11+
import {HttpClientModule} from '@angular/common/http';
12+
import {AngularFireAuthModule} from 'angularfire2/auth';
13+
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
14+
15+
// Export module's public API
16+
// components
17+
export {AuthComponent} from './components/auth/auth.component';
18+
19+
// services
20+
export {AuthProcessService, AuthProvider} from './services/auth-process.service';
21+
export {FirestoreSyncService} from './services/firestore-sync.service';
22+
23+
// interfaces
24+
export {NgBootstrapAuthFirebaseUIConfig} from './interfaces/config.interface';
25+
26+
export const NgBootstrapAuthFirebaseUIConfigToken = new InjectionToken<NgBootstrapAuthFirebaseUIConfig>('NgBootstrapAuthFirebaseUIConfig');
27+
28+
@NgModule({
29+
imports: [
30+
CommonModule,
31+
NgbModule.forRoot(),
32+
HttpClientModule,
33+
FormsModule,
34+
ReactiveFormsModule,
35+
AngularFireAuthModule,
36+
AngularFirestoreModule
37+
],
38+
exports:
39+
[
40+
AuthComponent,
41+
AngularFireAuthModule,
42+
AngularFirestoreModule
43+
],
44+
declarations:
45+
[
46+
AuthComponent
47+
]
48+
})
49+
export class NgbAuthFirebaseUIModule {
50+
static forRoot(configFactory: FirebaseAppConfig,
51+
appNameFactory?: () => string,
52+
config: NgBootstrapAuthFirebaseUIConfig = defaultAuthFirebaseUIConfig): ModuleWithProviders {
53+
return {
54+
ngModule: NgbAuthFirebaseUIModule,
55+
providers:
56+
[
57+
{
58+
provide: FirebaseOptionsToken,
59+
useValue: configFactory
60+
},
61+
{
62+
provide: FirebaseNameOrConfigToken,
63+
useFactory: appNameFactory
64+
},
65+
{
66+
provide: NgBootstrapAuthFirebaseUIConfigToken,
67+
useValue: config
68+
},
69+
AuthProcessService,
70+
FirestoreSyncService
71+
],
72+
};
73+
}
74+
}

Diff for: src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './auth/module/ngb-auth-firebase-u-i.module';

Diff for: src/tsconfig.lib.es5.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": "./tsconfig.lib.json",
3+
"compilerOptions": {
4+
"target": "es5",
5+
"outDir": "../tmp/lib-es5/",
6+
"baseUrl": "",
7+
"types": []
8+
},
9+
"files": [
10+
"./index.ts"
11+
],
12+
"angularCompilerOptions": {
13+
"strictMetadataEmit": true,
14+
"skipTemplateCodegen": true,
15+
"genDir": "../tmp/lib-gen-dir/",
16+
"flatModuleOutFile": "ng-bootstrap.js",
17+
"flatModuleId": "@firebaseui/ng-bootstrap",
18+
"annotateForClosureCompiler": true
19+
}
20+
}

Diff for: src/tsconfig.lib.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../tmp/lib-es2015/",
5+
"target": "es2015",
6+
"rootDir": "./",
7+
"baseUrl": "",
8+
"types": [ "node"]
9+
},
10+
"files": [
11+
"./index.ts"
12+
],
13+
"angularCompilerOptions": {
14+
"strictMetadataEmit": true,
15+
"skipTemplateCodegen": true,
16+
"genDir": "../tmp/lib-gen-dir/",
17+
"flatModuleOutFile": "ng-bootstrap.js",
18+
"flatModuleId": "@firebaseui/ng-bootstrap",
19+
"annotateForClosureCompiler": true
20+
}
21+
}

Diff for: src/tsconfig.spec.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": "",
5+
"module": "commonjs",
6+
"declaration": false,
7+
"emitDecoratorMetadata": true,
8+
"typeRoots": [
9+
"../node_modules/@types"
10+
]
11+
},
12+
"awesomeTypescriptLoaderOptions": {
13+
"useWebpackText": true
14+
}
15+
}

0 commit comments

Comments
 (0)