Skip to content

Commit

Permalink
Fixing build and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDuckworth committed Oct 31, 2024
1 parent 4f9a5fc commit 6717ed4
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 70 deletions.
6 changes: 3 additions & 3 deletions common/api-review/firestore-lite.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2176,8 +2176,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor;

// Warnings were encountered during analysis:
//
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9259:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9288:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta

```
6 changes: 3 additions & 3 deletions common/api-review/firestore.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2464,8 +2464,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor;

// Warnings were encountered during analysis:
//
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
// /home/runner/work/firebase-js-sdk/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10108:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10109:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/index.d.ts:10138:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta

```
2 changes: 1 addition & 1 deletion packages/firestore/src/core/firestore_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export function firestoreClientRunAggregateQuery(

export function firestoreClientExecutePipeline(
client: FirestoreClient,
pipeline: Pipeline
pipeline: Pipeline<unknown>
): Promise<PipelineStreamElement[]> {
const deferred = new Deferred<PipelineStreamElement[]>();

Expand Down
7 changes: 5 additions & 2 deletions packages/firestore/src/lite-api/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import {
import { invokeExecutePipeline } from '../remote/datastore';
import {
getEncodedDatabaseId,
JsonProtoSerializer, ProtoSerializable
JsonProtoSerializer,
ProtoSerializable
} from '../remote/serializer';

import { getDatastore } from './components';
Expand Down Expand Up @@ -117,7 +118,9 @@ function isReadableUserData(value: any): value is ReadableUserData {
/**
* Base-class implementation
*/
export class Pipeline<AppModelType = DocumentData> implements ProtoSerializable<ExecutePipelineRequest>{
export class Pipeline<AppModelType = DocumentData>
implements ProtoSerializable<ExecutePipelineRequest>
{
/**
* @internal
* @private
Expand Down
5 changes: 3 additions & 2 deletions packages/firestore/src/lite-api/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
} from '../protos/firestore_proto_api';
import { toNumber } from '../remote/number_serializer';
import {
JsonProtoSerializer, ProtoSerializable,
JsonProtoSerializer,
ProtoSerializable,
toMapValue,
toStringValue
} from '../remote/serializer';
Expand All @@ -37,7 +38,7 @@ import { VectorValue } from './vector_value';
/**
* @beta
*/
export interface Stage extends ProtoSerializable<ProtoStage>{
export interface Stage extends ProtoSerializable<ProtoStage> {
name: string;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/src/remote/datastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export async function invokeBatchGetDocumentsRpc(

export async function invokeExecutePipeline(
datastore: Datastore,
pipeline: Pipeline
pipeline: Pipeline<unknown>
): Promise<PipelineStreamElement[]> {
const datastoreImpl = debugCast(datastore, DatastoreImpl);
const executePipelineRequest = pipeline._toProto(datastoreImpl.serializer);
Expand Down
115 changes: 57 additions & 58 deletions packages/firestore/test/integration/api/pipeline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ import {
regexMatch,
setDoc,
startsWith,
strConcat,
subtract
} from '../util/firebase_export';
import { apiDescribe, withTestCollection } from '../util/helpers';
Expand Down Expand Up @@ -304,18 +303,18 @@ apiDescribe.only('Pipelines', persistence => {
});

// skip: toLower not supported
it.skip('returns distinct values as expected', async () => {
const results = await randomCol
.pipeline()
.where(lt('published', 1900))
.distinct(Field.of('genre').toLower().as('lowerGenre'))
.execute();
expectResults(
results,
{ lowerGenre: 'romance' },
{ lowerGenre: 'psychological thriller' }
);
});
// it.skip('returns distinct values as expected', async () => {
// const results = await randomCol
// .pipeline()
// .where(lt('published', 1900))
// .distinct(Field.of('genre').toLower().as('lowerGenre'))
// .execute();
// expectResults(
// results,
// { lowerGenre: 'romance' },
// { lowerGenre: 'psychological thriller' }
// );
// });

it('returns group and accumulate results', async () => {
const results = await randomCol
Expand Down Expand Up @@ -460,18 +459,18 @@ apiDescribe.only('Pipelines', persistence => {
});

// skip: arrayConcat not supported
it.skip('arrayConcat works', async () => {
const results = await randomCol
.pipeline()
.select(
Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags')
)
.limit(1)
.execute();
expectResults(results, {
modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2']
});
});
// it.skip('arrayConcat works', async () => {
// const results = await randomCol
// .pipeline()
// .select(
// Field.of('tags').arrayConcat(['newTag1', 'newTag2']).as('modifiedTags')
// )
// .limit(1)
// .execute();
// expectResults(results, {
// modifiedTags: ['comedy', 'space', 'adventure', 'newTag1', 'newTag2']
// });
// });

it('testStrConcat', async () => {
const results = await randomCol
Expand Down Expand Up @@ -550,43 +549,43 @@ apiDescribe.only('Pipelines', persistence => {
});

// skip: toLower not supported
it.skip('testToLowercase', async () => {
const results = await randomCol
.pipeline()
.select(Field.of('title').toLower().as('lowercaseTitle'))
.limit(1)
.execute();
expectResults(results, {
lowercaseTitle: "the hitchhiker's guide to the galaxy"
});
});
// it.skip('testToLowercase', async () => {
// const results = await randomCol
// .pipeline()
// .select(Field.of('title').toLower().as('lowercaseTitle'))
// .limit(1)
// .execute();
// expectResults(results, {
// lowercaseTitle: "the hitchhiker's guide to the galaxy"
// });
// });

// skip: toUpper not supported
it.skip('testToUppercase', async () => {
const results = await randomCol
.pipeline()
.select(Field.of('author').toUpper().as('uppercaseAuthor'))
.limit(1)
.execute();
expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' });
});
// it.skip('testToUppercase', async () => {
// const results = await randomCol
// .pipeline()
// .select(Field.of('author').toUpper().as('uppercaseAuthor'))
// .limit(1)
// .execute();
// expectResults(results, { uppercaseAuthor: 'DOUGLAS ADAMS' });
// });

// skip: trim not supported
it.skip('testTrim', async () => {
const results = await randomCol
.pipeline()
.addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle'))
.select(
Field.of('spacedTitle').trim().as('trimmedTitle'),
Field.of('spacedTitle')
)
.limit(1)
.execute();
expectResults(results, {
spacedTitle: " The Hitchhiker's Guide to the Galaxy ",
trimmedTitle: "The Hitchhiker's Guide to the Galaxy"
});
});
// it.skip('testTrim', async () => {
// const results = await randomCol
// .pipeline()
// .addFields(strConcat(' ', Field.of('title'), ' ').as('spacedTitle'))
// .select(
// Field.of('spacedTitle').trim().as('trimmedTitle'),
// Field.of('spacedTitle')
// )
// .limit(1)
// .execute();
// expectResults(results, {
// spacedTitle: " The Hitchhiker's Guide to the Galaxy ",
// trimmedTitle: "The Hitchhiker's Guide to the Galaxy"
// });
// });

it('testLike', async () => {
const results = await randomCol
Expand Down

0 comments on commit 6717ed4

Please sign in to comment.