Skip to content

Commit

Permalink
a handful of package and publish chores (angular#312)
Browse files Browse the repository at this point in the history
* chore(publish): make npm publish only run if build succeeded

* chore(package): support many versions of Angular RC

Fixes angular#272

* chore(package): make firebase a dependency instead of peerDep in published package

Fixes angular#311

* chore(package): write es modules to esm instead of es6 directory

BREAKING CHANGE:

Previously, es modules were published to the es6/ directory inside the npm
package. This change publishes them to the esm directory to be consistent
with other angular packages. Currently, the es6 directory is still published
in the npm package, but will be removed in a future release.

Fixes angular#310

* test: remove deprecated @angular/core/testing imports

* fix: inline sources in source maps included with npm distribution

Fixes angular#293

* docs(setup): add note about installing promise typings to guides

Closes angular#246
jeffbcross authored and davideast committed Jul 1, 2016
1 parent 1a1ceb9 commit ac8c6be
Showing 16 changed files with 195 additions and 195 deletions.
18 changes: 18 additions & 0 deletions docs/1-install-and-setup.md
Original file line number Diff line number Diff line change
@@ -40,6 +40,24 @@ In your `tsconfig.json` file include the following line in your `"files"` array:

This is a temporary step until the Firebase typings are published to npm.

Unless you're targeting ES6 output in tsconfig.json, you'll also need to install
typings for the global Promise constructor. Run this command:

`$ typings install --save --global es6-promise`

If you're using Angular CLI, the typings will automatically be added to your
tsconfig since there is already a reference to `"typings.d.ts"` which transitively
includes `es6-promise`. If you're using a different seed project, or managing your
build yourself, just add the reference to your tsconfig files array:

```json
"files": [
"node_modules/angularfire2/firebase3.d.ts",
"typings/main.d.ts"
]
```


### 4. Include AngularFire 2 and Firebase in the vendor files

Open `angular-cli-build.js`.
3 changes: 1 addition & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -36,8 +36,7 @@ module.exports = function(config) {

{pattern: 'node_modules/firebase/firebase.js', included: false, watched: false},
{pattern: 'dist/**/*.js', included: false, watched: true},
{pattern: 'dist/**/*.js.map', included: false, watched: false},
{pattern: 'src/**/*.ts', included: false, watched: false}
{pattern: 'dist/**/*.js.map', included: false, watched: false}
],

port: 9876,
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@
"version": "2.0.0-beta.2",
"description": "",
"main": "./dist/angularfire2.js",
"jsnext:main": "./dist/es6/angularfire2.js",
"jsnext:main": "./dist/esm/angularfire2.js",
"scripts": {
"test": "npm run build; karma start",
"docs": "typedoc --out docs/api/ --module commonjs --mode modules --name AngularFire2 src",
"build": "rm -rf dist; tsc",
"build_npm": "rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json",
"build_npm": "rm -rf dist && tsc -p tsconfig.publish.es5.json && tsc -p tsconfig.publish.es6.json && tsc -p tsconfig.publish.es6-deprecated.json",
"postbuild_npm": "cp manual_typings/firebase3/firebase3.d.ts package.json README.md .npmignore dist/ && npm run rewrite_npm_package",
"rewrite_npm_package": "node --harmony_destructuring tools/rewrite-published-package.js",
"build_bundle": "cp -r src angularfire2 && tsc typings/main.d.ts angularfire2.ts --rootDir . --module system -t es5 --outFile dist/bundles/angularfire2.js --moduleResolution node --emitDecoratorMetadata --experimentalDecorators",
@@ -32,11 +32,11 @@
},
"homepage": "https://github.com/angular/angularfire2#readme",
"dependencies": {
"@angular/core": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/common": "2.0.0-rc.2",
"@angular/compiler": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2 || 2.0.0-rc.3 || 2.0.0-rc.4 || 2.0.0-rc.5 || 2.0.0-rc.6 || 2.0.0-rc.7 || 2.0.0-rc.8 || 2.0.0-rc.9",
"@angular/platform-browser": "2.0.0-rc.2 || 2.0.0-rc.3 || 2.0.0-rc.4 || 2.0.0-rc.5 || 2.0.0-rc.6 || 2.0.0-rc.7 || 2.0.0-rc.8 || 2.0.0-rc.9",
"@angular/common": "2.0.0-rc.2 || 2.0.0-rc.3 || 2.0.0-rc.4 || 2.0.0-rc.5 || 2.0.0-rc.6 || 2.0.0-rc.7 || 2.0.0-rc.8 || 2.0.0-rc.9",
"@angular/compiler": "2.0.0-rc.2 || 2.0.0-rc.3 || 2.0.0-rc.4 || 2.0.0-rc.5 || 2.0.0-rc.6 || 2.0.0-rc.7 || 2.0.0-rc.8 || 2.0.0-rc.9",
"@angular/platform-browser-dynamic": "2.0.0-rc.2 || 2.0.0-rc.3 || 2.0.0-rc.4 || 2.0.0-rc.5 || 2.0.0-rc.6 || 2.0.0-rc.7 || 2.0.0-rc.8 || 2.0.0-rc.9",
"firebase": "^3.0.3",
"rxjs": "5.0.0-beta.6"
},
3 changes: 1 addition & 2 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
npm run build_npm
npm publish dist
npm run build_npm && npm publish dist
42 changes: 16 additions & 26 deletions src/angularfire2.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import {
describe,
ddescribe,
it,
iit,
beforeEach,
beforeEachProviders,
expect,
inject,
injectAsync,
async
addProviders,
inject
} from '@angular/core/testing';
import {ReflectiveInjector, provide, Provider} from '@angular/core';
import {
@@ -43,18 +35,16 @@ describe('angularfire', () => {
var listOfQuestionsRef: firebase.database.Reference;
var angularFire2: AngularFire;

beforeEachProviders(() => [FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);

describe('things', () => {

})
beforeEach(inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
angularFire2 = _af;
app = firebaseApp;
rootRef = app.database().ref();
questionsRef = rootRef.child('questions');
listOfQuestionsRef = rootRef.child('list-of-questions');
}));
beforeEach(() => {
addProviders([FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);
inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
angularFire2 = _af;
app = firebaseApp;
rootRef = app.database().ref();
questionsRef = rootRef.child('questions');
listOfQuestionsRef = rootRef.child('list-of-questions');
})();
});

afterEach((done) => {
rootRef.remove()
@@ -66,19 +56,19 @@ describe('angularfire', () => {


it('should be injectable via FIREBASE_PROVIDERS', () => {
expect(angularFire2).toBeAnInstanceOf(AngularFire);
expect(angularFire2 instanceof AngularFire).toBe(true);
});

describe('.auth', () => {
it('should be an instance of AuthService', inject([AngularFire], (af:AngularFire) => {
expect(af.auth).toBeAnInstanceOf(AngularFireAuth);
expect(af.auth instanceof AngularFireAuth).toBe(true);
}));
});


describe('.database', () => {
it('should be an instance of Database', inject([AngularFire], (af:AngularFire) => {
expect(af.database).toBeAnInstanceOf(AngularFireDatabase);
expect(af.database instanceof AngularFireDatabase).toBe(true);
}));
});

@@ -91,7 +81,7 @@ describe('angularfire', () => {
describe('defaultFirebase', () => {
it('should create a provider', () => {
const provider = defaultFirebase(firebaseConfig);
expect(provider).toBeAnInstanceOf(Provider);
expect(provider instanceof Provider).toBe(true);
});
});
});
22 changes: 7 additions & 15 deletions src/auth/auth.spec.ts
Original file line number Diff line number Diff line change
@@ -3,14 +3,8 @@ import {ReflectiveInjector, provide, Provider} from '@angular/core';
import { Observable } from 'rxjs/Observable'
import { Observer } from 'rxjs/Observer';
import {
beforeEachProviders,
expect,
ddescribe,
describe,
inject,
it,
iit,
beforeEach
addProviders,
inject
} from '@angular/core/testing';
import 'rxjs/add/operator/do';

@@ -103,7 +97,7 @@ describe('FirebaseAuth', () => {
let fbAuthObserver: Observer<firebase.User>;
let windowLocation: any;

beforeEachProviders(() => {
beforeEach(() => {
windowLocation = {
hash: '',
search: '',
@@ -115,7 +109,7 @@ describe('FirebaseAuth', () => {
origin:'localhost',
href:'https://localhost/'
};
return [
addProviders([
FIREBASE_PROVIDERS,
defaultFirebase(COMMON_CONFIG),
provide(FirebaseApp, {
@@ -129,10 +123,8 @@ describe('FirebaseAuth', () => {
provide(WindowLocation, {
useValue: windowLocation
})
]
});
]);

beforeEach(() => {
authSpy = jasmine.createSpyObj('auth', authMethods);
authSpy['createUserWithEmailAndPassword'].and.returnValue(Promise.resolve(firebaseUser));
authSpy['signInWithPopup'].and.returnValue(Promise.resolve(googleCredential));
@@ -162,7 +154,7 @@ describe('FirebaseAuth', () => {


it('should be an observable', () => {
expect(afAuth).toBeAnInstanceOf(Observable);
expect(afAuth instanceof Observable).toBe(true);
});


@@ -213,7 +205,7 @@ describe('FirebaseAuth', () => {

describe('firebaseAuthConfig', () => {
it('should return a provider', () => {
expect(firebaseAuthConfig({ method: AuthMethods.Password })).toBeAnInstanceOf(Provider);
expect(firebaseAuthConfig({ method: AuthMethods.Password }) instanceof Provider).toBe(true);
});

it('should use config in login', () => {
9 changes: 0 additions & 9 deletions src/auth/auth_backend.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import {
expect,
ddescribe,
describe,
it,
iit,
beforeEach
} from '@angular/core/testing';

import {
authDataToAuthState,
AuthProviders,
23 changes: 9 additions & 14 deletions src/database/firebase_list_factory.spec.ts
Original file line number Diff line number Diff line change
@@ -16,13 +16,7 @@ import {
AngularFire
} from '../angularfire2';
import {
beforeEach,
it,
iit,
ddescribe,
describe,
expect,
beforeEachProviders,
addProviders,
inject
} from '@angular/core/testing';
import * as utils from '../utils';
@@ -69,11 +63,12 @@ describe('FirebaseListFactory', () => {
var val3: any;
var app: firebase.app.App;

beforeEachProviders(() => [FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);

beforeEach(inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
}));
beforeEach(() => {
addProviders([FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);
inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
})();
});

afterEach(done => {
app.delete().then(done, done.fail);
@@ -83,12 +78,12 @@ describe('FirebaseListFactory', () => {

it('should accept a Firebase db url in the constructor', () => {
const list = FirebaseListFactory(`${rootFirebase}/questions`);
expect(list).toBeAnInstanceOf(FirebaseListObservable);
expect(list instanceof FirebaseListObservable).toBe(true);
});

it('should accept a Firebase db ref in the constructor', () => {
const list = FirebaseListFactory(firebase.database().refFromURL(`${rootFirebase}/questions`));
expect(list).toBeAnInstanceOf(FirebaseListObservable);
expect(list instanceof FirebaseListObservable).toBe(true);
});

});
26 changes: 11 additions & 15 deletions src/database/firebase_list_observable.spec.ts
Original file line number Diff line number Diff line change
@@ -11,13 +11,8 @@ import {
FirebaseAppConfig,
AngularFire
} from '../angularfire2';
import {
describe,
ddescribe,
it,
iit,
beforeEach,
beforeEachProviders,
import {
addProviders,
inject
} from '@angular/core/testing';

@@ -34,14 +29,15 @@ describe('FirebaseObservable', () => {
var ref:firebase.database.Reference;
var app: firebase.app.App;

beforeEachProviders(() => [FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);

beforeEach(inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
ref = database().ref();
O = new FirebaseListObservable(ref, (observer:Observer<any>) => {
});
}));
beforeEach(() => {
addProviders([FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);
inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
ref = database().ref();
O = new FirebaseListObservable(ref, (observer:Observer<any>) => {
});
})();
});

afterEach(done => {
app.delete().then(done, done.fail);
23 changes: 9 additions & 14 deletions src/database/firebase_object_factory.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { Subscription } from 'rxjs';
import { FirebaseObjectFactory, FirebaseObjectObservable } from './index';
import {
beforeEach,
it,
iit,
ddescribe,
describe,
expect,
beforeEachProviders,
addProviders,
inject
} from '@angular/core/testing';
import {
@@ -34,11 +28,12 @@ describe('FirebaseObjectFactory', () => {
var nextSpy: jasmine.Spy;
var app: firebase.app.App;

beforeEachProviders(() => [FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);

beforeEach(inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
}));
beforeEach(() => {
addProviders([FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);
inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
})();
});

afterEach(done => {
app.delete().then(done, done.fail);
@@ -48,12 +43,12 @@ describe('FirebaseObjectFactory', () => {

it('should accept a Firebase db url in the constructor', () => {
const object = FirebaseObjectFactory(`${rootFirebase}/questions`);
expect(object).toBeAnInstanceOf(FirebaseObjectObservable);
expect(object instanceof FirebaseObjectObservable).toBe(true);
});

it('should accept a Firebase db ref in the constructor', () => {
const object = FirebaseObjectFactory(firebase.database().ref().child(`questions`));
expect(object).toBeAnInstanceOf(FirebaseObjectObservable);
expect(object instanceof FirebaseObjectObservable).toBe(true);
});

});
25 changes: 10 additions & 15 deletions src/database/firebase_object_observable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import {
beforeEach,
it,
iit,
ddescribe,
describe,
expect,
beforeEachProviders,
addProviders,
inject
} from '@angular/core/testing';
import {
@@ -34,14 +28,15 @@ describe('FirebaseObjectObservable', () => {
var ref: firebase.database.Reference;
var app: firebase.app.App;

beforeEachProviders(() => [FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);

beforeEach(inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
ref = database().ref()
O = new FirebaseObjectObservable((observer:Observer<any>) => {
}, ref);
}));
beforeEach(() => {
addProviders([FIREBASE_PROVIDERS, defaultFirebase(firebaseConfig)]);
inject([FirebaseApp, AngularFire], (firebaseApp: firebase.app.App, _af: AngularFire) => {
app = firebaseApp;
ref = database().ref()
O = new FirebaseObjectObservable((observer:Observer<any>) => {
}, ref);
})();
});

afterEach(done => {
ref.off();
141 changes: 70 additions & 71 deletions src/database/query_observable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { describe, expect, it, iit } from '@angular/core/testing';
import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Subject } from 'rxjs/Subject';
@@ -21,27 +20,27 @@ function observableQueryTest(query: Query, nextProp: any, done: any) {
Object.keys(nextProp).forEach(prop => {
query[prop].next(nextProp[prop]);
toMerge[prop] = nextProp[prop];
})
})
const merged = Object.assign(query, toMerge);
expect(nextSpy).toHaveBeenCalledWith(merged);
done();
}

describe('observeQuery', () => {
const resultQuery = { orderByKey: true, startAt: <any>null, endAt: <any>null, equalTo: <any>null };

it('should return an observable', () => {
expect(observeQuery({})).toBeAnInstanceOf(Observable);
expect(observeQuery({}) instanceof Observable).toBe(true);
});

it('should immediately emit a query object if passed a plain JS object with only scalar values', () => {
var nextSpy = jasmine.createSpy('next');
var completeSpy = jasmine.createSpy('complete');
var query = { orderByChild: 'height', equalTo: 10 };
var obs = observeQuery(query);
obs.subscribe(nextSpy, null, completeSpy);
expect(nextSpy).toHaveBeenCalledWith({
orderByChild: 'height',
orderByChild: 'height',
equalTo: 10
});
});
@@ -129,7 +128,7 @@ describe('getOrderObservables', () => {
});

describe('query combinations', () => {

describe('orderByChild', () => {
/*
orderByChild combinations
@@ -138,71 +137,71 @@ describe('query combinations', () => {
orderByChild("").startAt()
orderByChild("").startAt().endAt();
orderByChild("").endAt();
*/
*/
it('should build an equalTo query with scalar values', (done: any) => {
scalarQueryTest({
orderByChild: 'height',
equalTo: 94
}, done);
});
});

it('should build an equalTo query with an observable', (done: any) => {
const query = {
orderByChild: 'height',
equalTo: new Subject()
};
observableQueryTest(query, { equalTo: 92 }, done);
});
});

it('should build a startAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByChild: 'height',
startAt: 94
}, done);
});
});

it('should build a startAt query with an observable', (done: any) => {
const query = {
orderByChild: 'height',
startAt: new Subject()
};
observableQueryTest(query, { startAt: 92 }, done);
});

it('should build a endAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByChild: 'height',
endAt: 94
}, done);
});
});

it('should build a endAt query with an observable', (done: any) => {
const query = {
orderByChild: 'height',
endAt: new Subject()
};
observableQueryTest(query, { endAt: 92 }, done);
});

it('should build a startAt().endAt() query with scalar values', (done: any) => {
scalarQueryTest({
orderByChild: 'height',
startAt: 32,
endAt: 94
}, done);
});
});

it('should build a startAt().endAt() query with an observable', (done: any) => {
const query = {
orderByChild: 'height',
endAt: new Subject(),
startAt: new Subject()
};
observableQueryTest(query, { startAt: 32, endAt: 92 }, done);
});
});

})

describe('orderByKey', () => {
/*
orderByKey combinations
@@ -211,71 +210,71 @@ describe('query combinations', () => {
orderByKey("").startAt()
orderByKey("").startAt().endAt();
orderByKey("").endAt();
*/
*/
it('should build an equalTo query with scalar values', (done: any) => {
scalarQueryTest({
orderByKey: true,
equalTo: 94
}, done);
});
});

it('should build an equalTo query with an observable', (done: any) => {
const query = {
orderByKey: true,
equalTo: new Subject()
};
observableQueryTest(query, { equalTo: 92 }, done);
});
});

it('should build a startAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByKey: true,
startAt: 94
}, done);
});
});

it('should build a startAt query with an observable', (done: any) => {
const query = {
orderByKey: true,
startAt: new Subject()
};
observableQueryTest(query, { startAt: 92 }, done);
});

it('should build a endAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByKey: true,
endAt: 94
}, done);
});
});

it('should build a endAt query with an observable', (done: any) => {
const query = {
orderByKey: true,
endAt: new Subject()
};
observableQueryTest(query, { endAt: 92 }, done);
});

it('should build a startAt().endAt() query with scalar values', (done: any) => {
scalarQueryTest({
orderByKey: true,
startAt: 32,
endAt: 94
}, done);
});
});

it('should build a startAt().endAt() query with an observable', (done: any) => {
const query = {
orderByKey: true,
endAt: new Subject(),
startAt: new Subject()
};
observableQueryTest(query, { startAt: 32, endAt: 92 }, done);
});
});

});

describe('orderByValue', () => {
/*
orderByValue combinations
@@ -284,71 +283,71 @@ describe('query combinations', () => {
orderByValue("").startAt()
orderByValue("").startAt().endAt();
orderByValue("").endAt();
*/
*/
it('should build an equalTo query with scalar values', (done: any) => {
scalarQueryTest({
orderByValue: true,
equalTo: 21
}, done);
});
});

it('should build an equalTo query with an observable', (done: any) => {
const query = {
orderByValue: true,
equalTo: new Subject()
};
observableQueryTest(query, { equalTo: 43 }, done);
});
});

it('should build a startAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByValue: true,
startAt: 25
}, done);
});
});

it('should build a startAt query with an observable', (done: any) => {
const query = {
orderByValue: true,
startAt: new Subject()
};
observableQueryTest(query, { startAt: 11 }, done);
});

it('should build a endAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByValue: true,
endAt: 94
}, done);
});
});

it('should build a endAt query with an observable', (done: any) => {
const query = {
orderByValue: true,
endAt: new Subject()
};
observableQueryTest(query, { endAt: 43 }, done);
});

it('should build a startAt().endAt() query with scalar values', (done: any) => {
scalarQueryTest({
orderByValue: true,
startAt: 32,
endAt: 94
}, done);
});
});

it('should build a startAt().endAt() query with an observable', (done: any) => {
const query = {
orderByValue: true,
endAt: new Subject(),
startAt: new Subject()
};
observableQueryTest(query, { startAt: 7, endAt: 12 }, done);
});
});

});

describe('orderByPriority', () => {
/*
orderByPriority combinations
@@ -357,69 +356,69 @@ describe('query combinations', () => {
orderByPriority("").startAt()
orderByPriority("").startAt().endAt();
orderByPriority("").endAt();
*/
*/
it('should build an equalTo query with scalar values', (done: any) => {
scalarQueryTest({
orderByPriority: true,
equalTo: 21
}, done);
});
});

it('should build an equalTo query with an observable', (done: any) => {
const query = {
orderByPriority: true,
equalTo: new Subject()
};
observableQueryTest(query, { equalTo: 43 }, done);
});
});

it('should build a startAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByPriority: true,
startAt: 25
}, done);
});
});

it('should build a startAt query with an observable', (done: any) => {
const query = {
orderByPriority: true,
startAt: new Subject()
};
observableQueryTest(query, { startAt: 11 }, done);
});

it('should build a endAt query with scalar values', (done: any) => {
scalarQueryTest({
orderByPriority: true,
endAt: 94
}, done);
});
});

it('should build a endAt query with an observable', (done: any) => {
const query = {
orderByPriority: true,
endAt: new Subject()
};
observableQueryTest(query, { endAt: 43 }, done);
});

it('should build a startAt().endAt() query with scalar values', (done: any) => {
scalarQueryTest({
orderByPriority: true,
startAt: 32,
endAt: 94
}, done);
});
});

it('should build a startAt().endAt() query with an observable', (done: any) => {
const query = {
orderByPriority: true,
endAt: new Subject(),
startAt: new Subject()
};
observableQueryTest(query, { startAt: 7, endAt: 12 }, done);
});
});

});

});
16 changes: 14 additions & 2 deletions tools/rewrite-published-package.js
Original file line number Diff line number Diff line change
@@ -6,12 +6,24 @@
var fs = require('fs');
var srcPackage = require('../package.json');
var [MAIN, JSNEXT_MAIN] = ['main', 'jsnext:main'].map(k => srcPackage[k].replace('/dist/', '/'));

var peerDependencies = Object.assign({}, srcPackage.dependencies);
// See note about including firebase as dependency
delete peerDependencies.firebase;
var outPackage = Object.assign({}, srcPackage, {
peerDependencies: srcPackage.dependencies,
peerDependencies,
main: MAIN,
typings: "angularfire2.d.ts",
"jsnext:main": JSNEXT_MAIN,
dependencies: undefined
dependencies: {
/**
* Firebase SDK should be a dependency since it's not required that
* projects will install/use the SDK directly. And since Firebase uses
* semver, the version restriction is more permissive. This means if the user
* has installed Firebase already, npm is more likely to find a matching version.
**/
firebase: srcPackage.dependencies.firebase
}
});

fs.writeFileSync('./dist/package.json', JSON.stringify(outPackage, null, 2));
2 changes: 1 addition & 1 deletion tsconfig.publish.es5.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"outDir": "dist",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "./",
"inlineSources": true,
"declaration": true,
"removeComments": true
},
19 changes: 19 additions & 0 deletions tsconfig.publish.es6-deprecated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "es6",
"noImplicitAny": false,
"outDir": "dist/es6",
"rootDir": "src",
"sourceMap": true,
"inlineSources": true,
"declaration": true,
"removeComments": true,
"moduleResolution": "node"
},
"files": [
"src/angularfire2.ts",
"manual_typings/firebase3/firebase3.d.ts"
]
}
4 changes: 2 additions & 2 deletions tsconfig.publish.es6.json
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@
"emitDecoratorMetadata": true,
"target": "es6",
"noImplicitAny": false,
"outDir": "dist/es6",
"outDir": "dist/esm",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "./",
"inlineSources": true,
"declaration": true,
"removeComments": true,
"moduleResolution": "node"

0 comments on commit ac8c6be

Please sign in to comment.