Skip to content

Commit 846b768

Browse files
Add new build rule for gendeps script
This is required since the Node build now uses UMD and the Browser builds are mangled. I also removed the test files that verify the dependencies since I only ever looked at the JSON files itself.
1 parent 82e793f commit 846b768

File tree

9 files changed

+556
-209
lines changed

9 files changed

+556
-209
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
import * as firebase from 'firebase';
19+
20+
// This file replaces "packages/firestore/test/integration/util/firebase_export"
21+
// and depends on the minified sources.
22+
23+
let appCount = 0;
24+
25+
export function newTestFirestore(
26+
projectId: string,
27+
nameOrApp?: string | firebase.app.App,
28+
settings?: firebase.firestore.Settings
29+
): firebase.firestore.Firestore {
30+
if (nameOrApp === undefined) {
31+
nameOrApp = 'test-app-' + appCount++;
32+
}
33+
const app =
34+
typeof nameOrApp === 'string'
35+
? firebase.initializeApp({ apiKey: 'fake-api-key', projectId }, nameOrApp)
36+
: nameOrApp;
37+
38+
const firestore = firebase.firestore(app);
39+
if (settings) {
40+
firestore.settings(settings);
41+
}
42+
return firestore;
43+
}
44+
45+
export function usesFunctionalApi(): false {
46+
return false;
47+
}
48+
49+
const Firestore = firebase.firestore.Firestore;
50+
const FieldPath = firebase.firestore.FieldPath;
51+
const Timestamp = firebase.firestore.Timestamp;
52+
const GeoPoint = firebase.firestore.GeoPoint;
53+
const FieldValue = firebase.firestore.FieldValue;
54+
const Blob = firebase.firestore.Blob;
55+
56+
export { Firestore, FieldValue, FieldPath, Timestamp, Blob, GeoPoint };

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@
7171
"@types/child-process-promise": "2.2.1",
7272
"@types/clone": "0.1.30",
7373
"@types/inquirer": "6.5.0",
74+
"@types/listr": "0.14.2",
7475
"@types/long": "4.0.1",
7576
"@types/mocha": "7.0.2",
7677
"@types/node": "12.12.48",
78+
"@types/rollup-plugin-json": "3.0.2",
7779
"@types/sinon": "9.0.4",
7880
"@types/sinon-chai": "3.2.4",
7981
"@types/tmp": "0.2.0",
8082
"@types/yargs": "15.0.5",
81-
"@types/listr": "0.14.2",
8283
"@typescript-eslint/eslint-plugin": "2.34.0",
8384
"@typescript-eslint/eslint-plugin-tslint": "2.34.0",
8485
"@typescript-eslint/parser": "2.34.0",
@@ -111,11 +112,11 @@
111112
"karma-coverage-istanbul-reporter": "3.0.3",
112113
"karma-firefox-launcher": "1.3.0",
113114
"karma-mocha": "2.0.1",
115+
"karma-mocha-reporter": "2.2.5",
114116
"karma-safari-launcher": "1.0.0",
115117
"karma-sauce-launcher": "1.2.0",
116118
"karma-sourcemap-loader": "0.3.7",
117119
"karma-spec-reporter": "0.0.32",
118-
"karma-mocha-reporter": "2.2.5",
119120
"karma-summary-reporter": "1.8.0",
120121
"karma-webpack": "4.0.2",
121122
"lcov-result-merger": "3.1.0",

0 commit comments

Comments
 (0)