Skip to content

Commit

Permalink
Merge branch 'master' into mrschmidt/fieldfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Jun 30, 2020
2 parents 526cddf + f54abc2 commit 9a26ff6
Show file tree
Hide file tree
Showing 29 changed files with 685 additions and 407 deletions.
3 changes: 3 additions & 0 deletions .changeset/chilled-beers-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

---
2 changes: 2 additions & 0 deletions .changeset/many-lamps-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/seven-crabs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/thin-hornets-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 2 additions & 0 deletions .changeset/thin-ligers-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/two-weeks-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

Update dependency eslint to v7
4 changes: 4 additions & 0 deletions .changeset/warm-suns-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Make exp release script work again
5 changes: 5 additions & 0 deletions .changeset/yellow-lamps-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

Update dependency firebase-tools to v8
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"build": "lerna run --scope @firebase/* --scope firebase --scope rxfire build",
"build:exp": "lerna run --scope @firebase/*-exp --scope firebase-exp build",
"build:release": "lerna run --scope @firebase/* --scope firebase --ignore @firebase/*-exp --ignore firebase-exp prepare",
"build:exp:release": "lerna run --scope @firebase/*-exp --scope firebase-exp prepare && yarn --cwd packages-exp/app-exp typings:public",
"build:exp:release": "yarn --cwd packages/app build:deps && lerna run --scope @firebase/*-exp --scope firebase-exp prepare && yarn --cwd packages-exp/app-exp typings:public",
"link:packages": "lerna exec --scope @firebase/* --scope firebase --scope rxfire -- yarn link",
"stage:packages": "./scripts/prepublish.sh",
"repl": "node tools/repl.js",
Expand Down Expand Up @@ -89,12 +89,12 @@
"coveralls": "3.1.0",
"del": "5.1.0",
"dependency-graph": "0.9.0",
"eslint": "6.8.0",
"eslint": "7.3.1",
"eslint-plugin-import": "2.20.2",
"express": "4.17.1",
"find-free-port": "2.0.0",
"firebase-functions": "3.6.1",
"firebase-tools": "7.16.2",
"firebase-tools": "8.4.3",
"git-rev-sync": "2.0.0",
"glob": "7.1.6",
"http-server": "0.12.3",
Expand Down
6 changes: 3 additions & 3 deletions packages-exp/app-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"test:browser": "karma start --single-run",
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.ts --config ../../config/mocharc.node.js",
"type-check": "tsc -p . --noEmit",
"prepare": "rollup -c rollup.config.release.js",
"prepare": "rollup -c rollup.config.release.js && yarn api-report",
"api-report": "api-extractor run --local --verbose",
"predoc": "node ../../scripts/exp/remove-exp.js temp",
"doc": "api-documenter markdown --input temp --output docs",
"build:doc": "yarn build && yarn doc",
"typings:public": "node ./use_public_typings.js --public",
"typings:internal": "node ./use_public_typings.js"
"typings:public": "node ./use_typings.js --public",
"typings:internal": "node ./use_typings.js"
},
"dependencies": {
"@firebase/app-types-exp": "0.0.800",
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/firebase-exp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebase-exp",
"version": "0.800.1",
"version": "0.800.2",
"private": true,
"description": "Firebase JavaScript library for web and Node.js",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/functions-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha 'src/{,!(browser)/**/}*.test.ts' --file src/index.node.ts --config ../../config/mocharc.node.js",
"test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p test:node",
"prepare": "yarn build",
"prepare": "rollup -c rollup.config.release.js && yarn api-report",
"api-report": "api-extractor run --local --verbose",
"predoc": "node ../../scripts/exp/remove-exp.js temp",
"doc": "api-documenter markdown --input temp --output docs",
Expand All @@ -49,7 +49,7 @@
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"typings": "dist/index.d.ts",
"typings": "dist/functions-exp-public.d.ts",
"dependencies": {
"@firebase/component": "0.1.15",
"@firebase/functions-types-exp": "0.0.800",
Expand Down
5 changes: 1 addition & 4 deletions packages-exp/functions-exp/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ const es5Builds = [
*/
{
input: 'src/index.ts',
output: [
{ file: pkg.browser, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'es', sourcemap: true }
],
output: [{ file: pkg.module, format: 'es', sourcemap: true }],
plugins: es5BuildPlugins,
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`))
},
Expand Down
107 changes: 107 additions & 0 deletions packages-exp/functions-exp/rollup.config.release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/**
* @license
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import typescriptPlugin from 'rollup-plugin-typescript2';
import typescript from 'typescript';
import json from 'rollup-plugin-json';
import pkg from './package.json';
import { importPathTransformer } from '../../scripts/exp/ts-transform-import-path';

const deps = Object.keys(
Object.assign({}, pkg.peerDependencies, pkg.dependencies)
);

/**
* ES5 Builds
*/
const es5BuildPlugins = [
typescriptPlugin({
typescript,
clean: true,
abortOnError: false,
transformers: [importPathTransformer]
}),
json()
];

const es5Builds = [
/**
* Browser Builds
*/
{
input: 'src/index.ts',
output: [{ file: pkg.browser, format: 'es', sourcemap: true }],
plugins: es5BuildPlugins,
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
treeshake: {
moduleSideEffects: false
}
},
/**
* Node.js Build
*/
{
input: 'src/index.ts',
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
plugins: es5BuildPlugins,
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
treeshake: {
moduleSideEffects: false
}
}
];

/**
* ES2017 Builds
*/
const es2017BuildPlugins = [
typescriptPlugin({
typescript,
tsconfigOverride: {
compilerOptions: {
target: 'es2017'
}
},
abortOnError: false,
clean: true,
transformers: [importPathTransformer]
}),
json({
preferConst: true
})
];

const es2017Builds = [
/**
* Browser Builds
*/
{
input: 'src/index.ts',
output: {
file: pkg.esm2017,
format: 'es',
sourcemap: true
},
plugins: es2017BuildPlugins,
external: id => deps.some(dep => id === dep || id.startsWith(`${dep}/`)),
treeshake: {
moduleSideEffects: false
}
}
];

export default [...es5Builds, ...es2017Builds];
2 changes: 1 addition & 1 deletion packages-exp/functions-exp/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const factory: InstanceFactory<'functions'> = (
region?: string
) => {
// Dependencies
const app = container.getProvider('app').getImmediate();
const app = container.getProvider('app-exp').getImmediate();
const authProvider = container.getProvider('auth-internal');
const messagingProvider = container.getProvider('messaging');

Expand Down
3 changes: 2 additions & 1 deletion packages-exp/functions-types-exp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"license": "Apache-2.0",
"scripts": {
"test": "tsc",
"test:ci": "node ../../scripts/run_tests_in_ci.js"
"test:ci": "node ../../scripts/run_tests_in_ci.js",
"prepare": "node ../../scripts/exp/remove-exp.js ./index.d.ts"
},
"files": [
"index.d.ts"
Expand Down
18 changes: 10 additions & 8 deletions packages/firestore/exp/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ export function updateDoc(
): Promise<void>;
export function deleteDoc(reference: DocumentReference<unknown>): Promise<void>;

// TODO(firestoreexp): Update API Proposal to use FirestoreError in these
// callbacks
export function onSnapshot<T>(
reference: DocumentReference<T>,
observer: {
Expand All @@ -375,28 +377,28 @@ export function onSnapshot<T>(
options: SnapshotListenOptions,
observer: {
next?: (snapshot: DocumentSnapshot<T>) => void;
error?: (error: Error) => void;
error?: (error: FirestoreError) => void;
complete?: () => void;
}
): () => void;
export function onSnapshot<T>(
reference: DocumentReference<T>,
onNext: (snapshot: DocumentSnapshot<T>) => void,
onError?: (error: Error) => void,
onError?: (error: FirestoreError) => void,
onCompletion?: () => void
): () => void;
export function onSnapshot<T>(
reference: DocumentReference<T>,
options: SnapshotListenOptions,
onNext: (snapshot: DocumentSnapshot<T>) => void,
onError?: (error: Error) => void,
onError?: (error: FirestoreError) => void,
onCompletion?: () => void
): () => void;
export function onSnapshot<T>(
query: Query<T>,
observer: {
next?: (snapshot: QuerySnapshot<T>) => void;
error?: (error: Error) => void;
error?: (error: FirestoreError) => void;
complete?: () => void;
}
): () => void;
Expand All @@ -405,28 +407,28 @@ export function onSnapshot<T>(
options: SnapshotListenOptions,
observer: {
next?: (snapshot: QuerySnapshot<T>) => void;
error?: (error: Error) => void;
error?: (error: FirestoreError) => void;
complete?: () => void;
}
): () => void;
export function onSnapshot<T>(
query: Query<T>,
onNext: (snapshot: QuerySnapshot<T>) => void,
onError?: (error: Error) => void,
onError?: (error: FirestoreError) => void,
onCompletion?: () => void
): () => void;
export function onSnapshot<T>(
query: Query<T>,
options: SnapshotListenOptions,
onNext: (snapshot: QuerySnapshot<T>) => void,
onError?: (error: Error) => void,
onError?: (error: FirestoreError) => void,
onCompletion?: () => void
): () => void;
export function onSnapshotsInSync(
firestore: FirebaseFirestore,
observer: {
next?: (value: void) => void;
error?: (error: Error) => void;
error?: (error: FirestoreError) => void;
complete?: () => void;
}
): () => void;
Expand Down
24 changes: 21 additions & 3 deletions packages/firestore/exp/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ export { FieldPath, documentId } from '../lite/src/api/field_path';
export {
Firestore,
initializeFirestore,
getFirestore
getFirestore,
terminate
} from './src/api/database';

export { DocumentSnapshot, QueryDocumentSnapshot } from './src/api/snapshot';
export {
DocumentSnapshot,
QueryDocumentSnapshot,
snapshotEqual
} from './src/api/snapshot';

export { SnapshotMetadata } from '../src/api/database';

Expand All @@ -44,7 +49,16 @@ export {

export { runTransaction, Transaction } from '../lite/src/api/transaction';

export { getDoc, getDocFromCache, getDocFromServer } from './src/api/reference';
export {
getDoc,
getDocFromCache,
getDocFromServer,
onSnapshot,
setDoc,
updateDoc,
deleteDoc,
addDoc
} from './src/api/reference';

export {
FieldValue,
Expand All @@ -59,6 +73,10 @@ export { setLogLevel } from '../src/util/log';

export { Blob } from '../src/api/blob';

export { writeBatch } from './src/api/write_batch';

export { WriteBatch } from '../lite/src/api/write_batch';

export { GeoPoint } from '../src/api/geo_point';

export { Timestamp } from '../src/api/timestamp';
Expand Down
Loading

0 comments on commit 9a26ff6

Please sign in to comment.