Skip to content

Commit 59ee6f8

Browse files
committed
Changed the typings in firestore's package.json so that it does not point to an internal build. This fixes issues with type mismatch between Pipelines and classic Firestore in the integration tests CI step.
1 parent 7eddfa3 commit 59ee6f8

File tree

10 files changed

+22
-3
lines changed

10 files changed

+22
-3
lines changed

packages/firestore/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"compile": "tsc --emitDeclarationOnly --declaration -p tsconfig.json",
1212
"prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json; yarn api-report",
1313
"build": "run-p --npm-path npm build:lite build:main",
14-
"build:release": "yarn build && yarn typings:public",
14+
"build:release": "yarn build",
1515
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
1616
"build:deps": "lerna run --scope @firebase/firestore --include-dependencies build",
1717
"build:main": "rollup -c rollup.config.js",
@@ -57,7 +57,6 @@
5757
"api-report:api-json": "rm -rf temp && api-extractor run --local --verbose",
5858
"api-report": "run-s --npm-path npm api-report:main api-report:pipelines api-report:lite api-report:lite:pipelines && yarn api-report:api-json",
5959
"doc": "api-documenter markdown --input temp --output docs",
60-
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts",
6160
"assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check",
6261
"assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new",
6362
"assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list",
@@ -173,7 +172,7 @@
173172
"bugs": {
174173
"url": "https://github.com/firebase/firebase-js-sdk/issues"
175174
},
176-
"typings": "dist/firestore/src/index.d.ts",
175+
"typings": "dist/index.d.ts",
177176
"nyc": {
178177
"extension": [
179178
".ts"

packages/firestore/test/integration/api/aggregation.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ apiDescribe('Count queries', persistence => {
161161
);
162162
// TODO(b/316359394) Remove the special logic for non-default databases
163163
// once cl/582465034 is rolled out to production.
164+
// @ts-ignore internal API usage
164165
if (coll.firestore._databaseId.isDefaultDatabase) {
165166
await expect(
166167
getCountFromServer(query_)
@@ -373,6 +374,7 @@ apiDescribe('Aggregation queries', persistence => {
373374
);
374375
// TODO(b/316359394) Remove the special logic for non-default databases
375376
// once cl/582465034 is rolled out to production.
377+
// @ts-ignore internal API usage
376378
if (coll.firestore._databaseId.isDefaultDatabase) {
377379
await expect(
378380
getAggregateFromServer(query_, {

packages/firestore/test/integration/api/bundle.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ apiDescribe('Bundles', persistence => {
8686

8787
// Extract elements from BUNDLE_TEMPLATE and replace the project ID.
8888
const elements = BUNDLE_TEMPLATE.map(e =>
89+
// @ts-ignore internal API usage
8990
e.replace('{0}', projectId).replace('(default)', db._databaseId.database)
9091
);
9192

packages/firestore/test/integration/api/database.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,7 @@ apiDescribe('Database', persistence => {
19011901
const firestore2 = newTestFirestore(
19021902
newTestApp(options.projectId!, name),
19031903
DEFAULT_SETTINGS,
1904+
// @ts-ignore internal API usage
19041905
firestore._databaseId.database
19051906
);
19061907
await enableIndexedDbPersistence(firestore2);
@@ -1946,6 +1947,7 @@ apiDescribe('Database', persistence => {
19461947
const firestore2 = newTestFirestore(
19471948
newTestApp(options.projectId!, name),
19481949
undefined,
1950+
// @ts-ignore internal API usage
19491951
docRef.firestore._databaseId.database
19501952
);
19511953
await enableIndexedDbPersistence(firestore2);
@@ -2110,6 +2112,7 @@ apiDescribe('Database', persistence => {
21102112
const deferred: Deferred<FirestoreError> = new Deferred();
21112113
const unsubscribe = onSnapshot(docRef, snapshot => {}, deferred.resolve);
21122114

2115+
// @ts-ignore internal API usage
21132116
await firestore._restart();
21142117

21152118
await expect(deferred.promise)

packages/firestore/test/integration/api/provider.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
setDoc,
3131
memoryLocalCache,
3232
getDocFromCache,
33+
// @ts-ignore internal API usage
3334
ensureFirestoreConfigured
3435
} from '../util/firebase_export';
3536
import { DEFAULT_SETTINGS } from '../util/settings';
@@ -68,10 +69,15 @@ describe('Firestore Provider', () => {
6869
const fs4 = getFirestore(app, 'name1');
6970
const fs5 = getFirestore(app, 'name2');
7071

72+
// @ts-ignore internal API usage
7173
expect(fs1._databaseId.database).to.be.equal('init1');
74+
// @ts-ignore internal API usage
7275
expect(fs2._databaseId.database).to.be.equal('init2');
76+
// @ts-ignore internal API usage
7377
expect(fs3._databaseId.database).to.be.equal('(default)');
78+
// @ts-ignore internal API usage
7479
expect(fs4._databaseId.database).to.be.equal('name1');
80+
// @ts-ignore internal API usage
7581
expect(fs5._databaseId.database).to.be.equal('name2');
7682

7783
expect(fs1).to.not.be.equal(fs2);
@@ -210,6 +216,7 @@ describe('Firestore Provider', () => {
210216
const fs = getFirestore(app);
211217
ensureFirestoreConfigured(fs);
212218

219+
// @ts-ignore internal API usage
213220
expect(fs._firestoreClient?._databaseInfo.apiKey).to.equal(
214221
'fake-api-key-x'
215222
);

packages/firestore/test/integration/api/query.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ apiDescribe('Queries', persistence => {
731731
err => {
732732
expect(err.code).to.equal('failed-precondition');
733733
expect(err.message).to.exist;
734+
// @ts-ignore internal API usage
734735
if (coll.firestore._databaseId.isDefaultDatabase) {
735736
expect(err.message).to.match(
736737
/index.*https:\/\/console\.firebase\.google\.com/

packages/firestore/test/integration/api/console.test.ts renamed to packages/firestore/test/integration/api_internal/console.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ apiDescribe('console support', persistence => {
5454
count: count(),
5555
avg: average('foo')
5656
});
57+
// @ts-ignore internal API usage
5758
expect(doc._fieldsProto()).to.deep.equal({
5859
'count': {
5960
'integerValue': '2'

packages/firestore/test/integration/util/composite_index_test_helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ import {
4040
deleteDoc as deleteDocument,
4141
doc,
4242
and,
43+
// @ts-ignore internal API usage
4344
_AutoId,
45+
// @ts-ignore internal API usage
4446
_FieldPath,
4547
newTestFirestore,
4648
newTestApp,

packages/firestore/test/integration/util/helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
Query,
4747
getDocsFromServer,
4848
getDocsFromCache,
49+
// @ts-ignore internal API usage
4950
_AutoId
5051
} from './firebase_export';
5152
import {

packages/firestore/test/integration/util/testing_hooks_util.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
import {
1919
DocumentReference,
20+
// @ts-ignore internal API usage
2021
_TestingHooks as TestingHooks,
22+
// @ts-ignore internal API usage
2123
_TestingHooksExistenceFilterMismatchInfo as ExistenceFilterMismatchInfoInternal
2224
} from './firebase_export';
2325

0 commit comments

Comments
 (0)