Skip to content

Use pruned DTS file for API report #4207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1e507ed
Use pruned DTS file for API report
schmidt-sebastian Dec 14, 2020
595f108
Fix eslint
schmidt-sebastian Dec 14, 2020
298ae16
Use tsnode
schmidt-sebastian Dec 14, 2020
620bb85
Merge
schmidt-sebastian Feb 10, 2021
f7b6c3b
Fix run tests
schmidt-sebastian Feb 10, 2021
6595773
Don't rewrite DOM types
schmidt-sebastian Feb 11, 2021
db96c5e
Comment
schmidt-sebastian Feb 11, 2021
8dff58a
Merge branch 'master' into mrschmidt/apiextractor
schmidt-sebastian Feb 12, 2021
7d23395
Rebuild all
schmidt-sebastian Feb 12, 2021
8e43826
Add Copyright
schmidt-sebastian Feb 12, 2021
5005476
Add comment
schmidt-sebastian Feb 12, 2021
591fd74
More comments
schmidt-sebastian Feb 12, 2021
1dd62e1
downlevelIteration
schmidt-sebastian Feb 12, 2021
bac0a1d
Publish firebase@exp 0.900.13
Feiyang1 Feb 12, 2021
6c99bde
Update Yarn lock
schmidt-sebastian Feb 16, 2021
7019268
Fix build
schmidt-sebastian Feb 16, 2021
a34c978
Undo unrelated diff
schmidt-sebastian Feb 16, 2021
0741cf5
Fix formatting
schmidt-sebastian Feb 16, 2021
3cac57e
Update packages/firestore/package.json
schmidt-sebastian Feb 16, 2021
e31f08b
Update packages/firestore/package.json
schmidt-sebastian Feb 16, 2021
d7a6574
Update packages/firestore/scripts/api-report.ts
schmidt-sebastian Feb 16, 2021
86cd798
Use TS file
schmidt-sebastian Feb 16, 2021
290a317
Update packages/firestore/scripts/api-report.ts
schmidt-sebastian Feb 16, 2021
51795fc
Merge
schmidt-sebastian Feb 16, 2021
063c803
Merge branch 'mrschmidt/apiextractor' of github.com:firebase/firebase…
schmidt-sebastian Feb 16, 2021
c006e4b
Undo yarn update
schmidt-sebastian Feb 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 47 additions & 110 deletions common/api-review/firestore-exp.api.md

Large diffs are not rendered by default.

109 changes: 6 additions & 103 deletions common/api-review/firestore-lite.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@

```ts

import { DocumentData as DocumentData_2 } from '@firebase/firestore-types';
import { FirebaseApp } from '@firebase/app-types-exp';
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
import { _FirebaseService } from '@firebase/app-types-exp';
import { LogLevelString as LogLevel } from '@firebase/logger';
import { Provider } from '@firebase/component';
import { SetOptions as SetOptions_2 } from '@firebase/firestore-types';

// @public
export function addDoc<T>(reference: CollectionReference<T>, data: T): Promise<DocumentReference<T>>;
Expand All @@ -23,11 +18,6 @@ export function arrayUnion(...elements: unknown[]): FieldValue;

// @public
export class Bytes {
constructor(byteString: ByteString);
// Warning: (ae-forgotten-export) The symbol "ByteString" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_byteString: ByteString;
static fromBase64String(base64: string): Bytes;
static fromUint8Array(array: Uint8Array): Bytes;
isEqual(other: Bytes): boolean;
Expand All @@ -50,16 +40,11 @@ export function collectionGroup(firestore: FirebaseFirestore, collectionId: stri

// @public
export class CollectionReference<T = DocumentData> extends Query<T> {
constructor(firestore: FirebaseFirestore, converter: FirestoreDataConverter<T> | null, _path: ResourcePath);
// (undocumented)
readonly firestore: FirebaseFirestore;
get id(): string;
get parent(): DocumentReference<DocumentData> | null;
get path(): string;
// Warning: (ae-forgotten-export) The symbol "ResourcePath" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly _path: ResourcePath;
// (undocumented)
readonly type = "collection";
withConverter<U>(converter: FirestoreDataConverter<U>): CollectionReference<U>;
Expand Down Expand Up @@ -91,47 +76,22 @@ export function documentId(): FieldPath;

// @public
export class DocumentReference<T = DocumentData> {
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _key: DocumentKey);
// (undocumented)
readonly _converter: FirestoreDataConverter<T> | null;
readonly firestore: FirebaseFirestore;
get id(): string;
// Warning: (ae-forgotten-export) The symbol "DocumentKey" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly _key: DocumentKey;
get parent(): CollectionReference<T>;
get path(): string;
// (undocumented)
get _path(): ResourcePath;
readonly type = "document";
withConverter<U>(converter: FirestoreDataConverter<U>): DocumentReference<U>;
}

// @public
export class DocumentSnapshot<T = DocumentData> {
constructor(_firestore: FirebaseFirestore, _userDataWriter: AbstractUserDataWriter, _key: DocumentKey, _document: Document_2 | null, _converter: UntypedFirestoreDataConverter<T> | null);
// Warning: (ae-forgotten-export) The symbol "UntypedFirestoreDataConverter" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_converter: UntypedFirestoreDataConverter<T> | null;
protected constructor();
data(): T | undefined;
// Warning: (ae-forgotten-export) The symbol "Document" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_document: Document_2 | null;
exists(): this is QueryDocumentSnapshot<T>;
// (undocumented)
_firestore: FirebaseFirestore;
get(fieldPath: string | FieldPath): any;
get id(): string;
// (undocumented)
_key: DocumentKey;
get ref(): DocumentReference<T>;
// Warning: (ae-forgotten-export) The symbol "AbstractUserDataWriter" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_userDataWriter: AbstractUserDataWriter;
}

// @public
Expand All @@ -149,8 +109,6 @@ export function endBefore(...fieldValues: unknown[]): QueryConstraint;
// @public
export class FieldPath {
constructor(...fieldNames: string[]);
// Warning: (ae-forgotten-export) The symbol "FieldPath" needs to be exported by the entry point index.d.ts
readonly _internalPath: FieldPath_2;
isEqual(other: FieldPath): boolean;
}

Expand All @@ -159,49 +117,14 @@ export abstract class FieldValue {
constructor(_methodName: string);
// (undocumented)
abstract isEqual(other: FieldValue): boolean;
// (undocumented)
_methodName: string;
// Warning: (ae-forgotten-export) The symbol "ParseContext" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FieldTransform" needs to be exported by the entry point index.d.ts
//
// (undocumented)
abstract _toFieldTransform(context: ParseContext): FieldTransform | null;
}

// Warning: (ae-forgotten-export) The symbol "FirestoreService" needs to be exported by the entry point index.d.ts
//
// @public
export class FirebaseFirestore implements FirestoreService {
constructor(databaseIdOrApp: DatabaseId | FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>);
export class FirebaseFirestore {
get app(): FirebaseApp;
// Warning: (ae-forgotten-export) The symbol "CredentialsProvider" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_credentials: CredentialsProvider;
// Warning: (ae-forgotten-export) The symbol "DatabaseId" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly _databaseId: DatabaseId;
// (undocumented)
_delete(): Promise<void>;
// (undocumented)
_freezeSettings(): FirestoreSettings;
// Warning: (ae-forgotten-export) The symbol "FirestoreSettings" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_getSettings(): FirestoreSettings;
// (undocumented)
get _initialized(): boolean;
// (undocumented)
readonly _persistenceKey: string;
// Warning: (ae-forgotten-export) The symbol "PrivateSettings" needs to be exported by the entry point index.d.ts
//
// (undocumented)
_setSettings(settings: PrivateSettings): void;
protected _terminate(): Promise<void>;
// (undocumented)
get _terminated(): boolean;
}
toJSON(): object;
}

// @public
export interface FirestoreDataConverter<T> {
Expand All @@ -212,7 +135,6 @@ export interface FirestoreDataConverter<T> {

// @public
export class FirestoreError extends Error {
constructor(code: FirestoreErrorCode, message: string);
// (undocumented)
readonly code: FirestoreErrorCode;
// (undocumented)
Expand All @@ -229,7 +151,6 @@ export type FirestoreErrorCode = 'cancelled' | 'unknown' | 'invalid-argument' |
// @public
export class GeoPoint {
constructor(latitude: number, longitude: number);
_compareTo(other: GeoPoint): number;
isEqual(other: GeoPoint): boolean;
get latitude(): number;
get longitude(): number;
Expand Down Expand Up @@ -271,14 +192,8 @@ export type OrderByDirection = 'desc' | 'asc';

// @public
export class Query<T = DocumentData> {
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _query: Query_2);
// (undocumented)
readonly _converter: FirestoreDataConverter<T> | null;
protected constructor();
readonly firestore: FirebaseFirestore;
// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
//
// (undocumented)
readonly _query: Query_2;
readonly type: 'query' | 'collection';
withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
}
Expand All @@ -288,7 +203,6 @@ export function query<T>(query: Query<T>, ...queryConstraints: QueryConstraint[]

// @public
export abstract class QueryConstraint {
abstract _apply<T>(query: Query<T>): Query<T>;
abstract readonly type: QueryConstraintType;
}

Expand All @@ -306,10 +220,7 @@ export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;

// @public
export class QuerySnapshot<T = DocumentData> {
constructor(_query: Query<T>, _docs: Array<QueryDocumentSnapshot<T>>);
get docs(): Array<QueryDocumentSnapshot<T>>;
// (undocumented)
readonly _docs: Array<QueryDocumentSnapshot<T>>;
get empty(): boolean;
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
readonly query: Query<T>;
Expand Down Expand Up @@ -378,8 +289,6 @@ export function terminate(firestore: FirebaseFirestore): Promise<void>;
// @public
export class Timestamp {
constructor(seconds: number, nanoseconds: number);
// (undocumented)
_compareTo(other: Timestamp): number;
static fromDate(date: Date): Timestamp;
static fromMillis(milliseconds: number): Timestamp;
isEqual(other: Timestamp): boolean;
Expand All @@ -402,11 +311,7 @@ export class Timestamp {

// @public
export class Transaction {
// Warning: (ae-forgotten-export) The symbol "Transaction" needs to be exported by the entry point index.d.ts
constructor(_firestore: FirebaseFirestore, _transaction: Transaction_2);
delete(documentRef: DocumentReference<unknown>): this;
// (undocumented)
protected readonly _firestore: FirebaseFirestore;
get<T>(documentRef: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
set<T>(documentRef: DocumentReference<T>, data: T): this;
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: SetOptions): this;
Expand Down Expand Up @@ -437,15 +342,13 @@ export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-conta

// @public
export class WriteBatch {
// Warning: (ae-forgotten-export) The symbol "Mutation" needs to be exported by the entry point index.d.ts
constructor(_firestore: FirebaseFirestore, _commitHandler: (m: Mutation[]) => Promise<void>);
commit(): Promise<void>;
delete(documentRef: DocumentReference<unknown>): WriteBatch;
set<T>(documentRef: DocumentReference<T>, data: T): WriteBatch;
set<T>(documentRef: DocumentReference<T>, data: Partial<T>, options: SetOptions): WriteBatch;
update(documentRef: DocumentReference<unknown>, data: UpdateData): WriteBatch;
update(documentRef: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): WriteBatch;
}
}

// @public
export function writeBatch(firestore: FirebaseFirestore): WriteBatch;
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.900.12",
"version": "0.900.13",
"private": true,
"description": "Firebase JavaScript library for web and Node.js",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
module.exports = {
extends: '../../config/.eslintrc.js',
parserOptions: {
project: 'tsconfig.json',
project: 'tsconfig.eslint.json',
// to make vscode-eslint work with monorepo
// https://github.com/typescript-eslint/typescript-eslint/issues/251#issuecomment-463943250
tsconfigRootDir: __dirname
Expand Down
23 changes: 0 additions & 23 deletions packages/firestore/exp/api-extractor.json

This file was deleted.

23 changes: 0 additions & 23 deletions packages/firestore/lite/api-extractor.json

This file was deleted.

10 changes: 4 additions & 6 deletions packages/firestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"description": "The Cloud Firestore component of the Firebase JS SDK.",
"author": "Firebase <[email protected]> (https://firebase.google.com/)",
"scripts": {
"api-report:exp": "(cd exp; api-extractor run --local --verbose) && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/exp/private.d.ts --output dist/exp/index.d.ts",
"api-report:lite": "(cd lite; api-extractor run --local --verbose) && ts-node-script ../../repo-scripts/prune-dts/prune-dts.ts --input dist/lite/private.d.ts --output dist/lite/index.d.ts",
"bundle": "rollup -c",
"prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json; run-p api-report:exp api-report:lite",
"prebuild": "tsc --emitDeclarationOnly --declaration -p tsconfig.json && yarn api-report",
"build": "run-p 'bundle rollup.config.browser.js' 'bundle rollup.config.node.js' 'bundle rollup.config.rn.js' build:lite build:exp",
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
"prebuild:release": "yarn prebuild",
Expand All @@ -27,9 +25,9 @@
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
"prettier": "prettier --write '*.js' '*.ts' '@(lite|exp|src|test)/**/*.ts'",
"pregendeps:exp": "yarn api-report:exp && node scripts/build-bundle.js --input ./exp/index.ts --output ./dist/exp/tmp.js",
"pregendeps:exp": "yarn api-report && node scripts/build-bundle.js --input ./exp/index.ts --output ./dist/exp/tmp.js",
"gendeps:exp": "../../scripts/exp/extract-deps.sh --types ./dist/exp/index.d.ts --bundle ./dist/exp/tmp.js --output ./dist/exp/dependencies.json",
"pregendeps:lite": "yarn api-report:lite && node scripts/build-bundle.js --input ./lite/index.ts --output ./dist/lite/tmp.js",
"pregendeps:lite": "yarn api-report && node scripts/build-bundle.js --input ./lite/index.ts --output ./dist/lite/tmp.js",
"gendeps:lite": "../../scripts/exp/extract-deps.sh --types ./dist/lite/index.d.ts --bundle ./dist/lite/tmp.js --output ./dist/lite/dependencies.json",
"test:lite": "node ./scripts/run-tests.js --emulator --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
"test:lite:prod": "node ./scripts/run-tests.js --platform node_lite --main=lite/index.ts 'test/lite/**/*.test.ts'",
Expand All @@ -46,7 +44,7 @@
"test:node:persistence:prod": "node ./scripts/run-tests.js --main=index.node.ts --persistence 'test/{,!(browser|lite)/**/}*.test.ts'",
"test:travis": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/firestore-test-runner.ts",
"test:minified": "(cd ../../integration/firestore ; yarn test)",
"api-report": "rm -rf temp && api-extractor run --local --verbose",
"api-report": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ./scripts/api-report.ts",
"predoc": "node ../../scripts/exp/remove-exp.js temp",
"doc": "api-documenter markdown --input temp --output docs"
},
Expand Down
Loading