Skip to content

Commit 5f98dc2

Browse files
committed
chore(modules): Organize barrels for tree-shaking
1 parent 4a5f098 commit 5f98dc2

16 files changed

+44
-30
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1"
2121
},
2222
"keywords": [
23-
"angular2",
2423
"angular",
25-
"firebase"
24+
"firebase",
25+
"rxjs"
2626
],
2727
"repository": {
2828
"type": "git",

src/auth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './auth/auth';
2+
export * from './auth/auth.module';

src/auth/auth.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as firebase from 'firebase/app';
33
import 'firebase/auth';
44
import { FirebaseApp } from '../app/index';
55
import { AngularFireModule } from '../angularfire2';
6-
import { AngularFireAuth } from './index';
6+
import { AngularFireAuth } from './auth';
77

88
export function _getAngularFireAuth(app: FirebaseApp) {
99
return new AngularFireAuth(app);

src/auth/auth.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { _do } from 'rxjs/operator/do';
88
import { take } from 'rxjs/operator/take';
99
import { skip } from 'rxjs/operator/skip';
1010
import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from '../angularfire2';
11-
import { AngularFireAuth, AngularFireAuthModule } from './index';
11+
import { AngularFireAuth } from './auth';
12+
import { AngularFireAuthModule } from './auth.module';
1213
import { COMMON_CONFIG } from '../test-config';
1314

1415
function authTake(auth: Observable<any>, count: number): Observable<any> {
@@ -45,7 +46,7 @@ describe('AngularFireAuth', () => {
4546
app = app_;
4647
afAuth = _auth;
4748
authData = null;
48-
authCb = null;
49+
authCb = null;
4950
})();
5051

5152
mockAuthState = new Subject<firebase.User>();

src/auth/index.ts

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

src/database.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export * from './database/database';
2+
export * from './database/firebase_list_factory';
3+
export * from './database/firebase_list_observable';
4+
export * from './database/firebase_object_factory';
5+
export * from './database/firebase_object_observable';
6+
export * from './database/query_observable';
7+
export * from './database/database.module';

src/database/database.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import * as firebase from 'firebase/app';
22
import 'firebase/database';
33
import { Inject, Injectable } from '@angular/core';
44
import { FirebaseAppConfigToken, FirebaseAppConfig, FirebaseApp } from '../angularfire2';
5-
import { FirebaseListFactory } from './index';
5+
import { FirebaseListFactory } from './firebase_list_factory';
6+
import { FirebaseListObservable } from './firebase_list_observable';
67
import { FirebaseListFactoryOpts, FirebaseObjectFactoryOpts, PathReference } from '../interfaces';
8+
import { FirebaseObjectFactory } from './firebase_object_factory';
9+
import { FirebaseObjectObservable } from './firebase_object_observable';
710
import * as utils from '../utils';
8-
import { FirebaseListObservable, FirebaseObjectObservable, FirebaseObjectFactory } from './index';
911

1012
@Injectable()
1113
export class AngularFireDatabase {
12-
14+
1315
constructor(public app: FirebaseApp) {}
14-
16+
1517
list(pathOrRef: PathReference, opts?:FirebaseListFactoryOpts):FirebaseListObservable<any[]> {
1618
const ref = utils.getRef(this.app, pathOrRef);
1719
return FirebaseListFactory(utils.getRef(this.app, ref), opts);
@@ -25,4 +27,3 @@ export class AngularFireDatabase {
2527
}
2628

2729
}
28-

src/database/firebase_list_factory.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import * as firebase from 'firebase/app';
2-
import { FirebaseListFactory, FirebaseListObservable, FirebaseObjectFactory, onChildAdded, onChildChanged, onChildRemoved, onChildUpdated, AngularFireDatabase, AngularFireDatabaseModule } from './index';
2+
import { AngularFireDatabase } from './database';
3+
import { AngularFireDatabaseModule } from './database.module';
4+
import { FirebaseListObservable } from './firebase_list_observable';
5+
import { FirebaseListFactory, onChildAdded, onChildChanged, onChildRemoved, onChildUpdated } from './firebase_list_factory';
6+
import { FirebaseObjectFactory } from './firebase_object_factory';
37
import { FirebaseApp, FirebaseAppConfig, AngularFireModule} from '../angularfire2';
48
import { TestBed, inject } from '@angular/core/testing';
59
import * as utils from '../utils';

src/database/firebase_list_observable.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { FirebaseListObservable, AngularFireDatabase, AngularFireDatabaseModule } from './index';
1+
import { AngularFireDatabase } from './database';
2+
import { AngularFireDatabaseModule } from './database.module';
3+
import { FirebaseListObservable } from './firebase_list_observable';
4+
import { FirebaseObjectFactory } from './firebase_object_factory';
25
import { Observer } from 'rxjs/Observer';
36
import { map } from 'rxjs/operator/map';
47
import * as firebase from 'firebase/app';

src/database/firebase_object_factory.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import * as firebase from 'firebase/app';
22
import { Subscription } from 'rxjs';
3-
import { FirebaseObjectFactory, FirebaseObjectObservable, AngularFireDatabaseModule, AngularFireDatabase } from './index';
3+
import { AngularFireDatabase } from './database';
4+
import { AngularFireDatabaseModule } from './database.module';
5+
import { FirebaseObjectObservable } from './firebase_object_observable';
6+
import { FirebaseObjectFactory } from './firebase_object_factory';
47
import { TestBed, inject } from '@angular/core/testing';
58
import { FirebaseApp, FirebaseAppConfig, AngularFireModule } from '../angularfire2';
69
import { COMMON_CONFIG } from '../test-config';

0 commit comments

Comments
 (0)