Skip to content

Commit 5bb40f0

Browse files
committed
Merge remote-tracking branch 'origin/feat/pipelines' into new-types
2 parents cbba951 + 41bde42 commit 5bb40f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+21405
-385
lines changed

common/api-review/firestore-lite-pipelines.api.md

Lines changed: 1315 additions & 0 deletions
Large diffs are not rendered by default.

common/api-review/firestore-pipelines.api.md

Lines changed: 1299 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
"postinstall-postinstall": "2.1.0",
144144
"prettier": "2.8.8",
145145
"protractor": "5.4.2",
146+
"protobufjs-cli": "^1.1.3",
146147
"request": "2.88.2",
147148
"semver": "7.7.1",
148149
"simple-git": "3.27.0",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright 2024 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+
export * from '@firebase/firestore/pipelines';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "firebase/firestore/pipelines",
3+
"main": "dist/pipelines.cjs.js",
4+
"browser": "dist/esm/pipelines.esm.js",
5+
"module": "dist/esm/pipelines.esm.js",
6+
"typings": "dist/firestore/lite/pipelines.d.ts"
7+
}

packages/firebase/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@
131131
},
132132
"default": "./firestore/dist/esm/index.esm.js"
133133
},
134+
"./firestore/pipelines": {
135+
"types": "./firestore/dist/firestore/pipelines.d.ts",
136+
"node": {
137+
"require": "./firestore/dist/pipelines.cjs.js",
138+
"import": "./firestore/dist/pipelines.mjs"
139+
},
140+
"browser": {
141+
"require": "./firestore/dist/pipelines.cjs.js",
142+
"import": "./firestore/dist/esm/pipelines.esm.js"
143+
},
144+
"default": "./firestore/dist/esm/pipelines.esm.js"
145+
},
134146
"./firestore/lite": {
135147
"types": "./firestore/lite/dist/firestore/lite/index.d.ts",
136148
"node": {

packages/firestore/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
tsconfigRootDir: __dirname
2525
},
2626
plugins: ['import'],
27-
ignorePatterns: ['compat/*'],
27+
ignorePatterns: ['compat/*', 'pipelines.d.ts'],
2828
rules: {
2929
'no-console': ['error', { allow: ['warn', 'error'] }],
3030
'@typescript-eslint/no-unused-vars': [

packages/firestore/externs.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"packages/app-check-interop-types/index.d.ts",
1818
"packages/auth-interop-types/index.d.ts",
1919
"packages/firestore/dist/lite/internal.d.ts",
20+
"packages/firestore/dist/lite/internal.pipelines.d.ts",
2021
"packages/firestore/dist/internal.d.ts",
22+
"packages/firestore/dist/internal.pipelines.d.ts",
2123
"packages/firestore-types/index.d.ts",
2224
"packages/firebase/compat/index.d.ts",
2325
"packages/component/dist/src/component.d.ts",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@firebase/firestore-lite-pipelines",
3+
"description": "Pipelines for the lite Firestore SDK",
4+
"main": "../../dist/lite/pipelines.node.cjs.js",
5+
"main-esm": "../../dist/lite/pipelines.node.mjs",
6+
"module": "../../dist/lite/pipelines.browser.esm2017.js",
7+
"browser": "../../dist/lite/pipelines.browser.esm2017.js",
8+
"react-native": "../../dist/lite/pipelines.rn.esm2017.js",
9+
"typings": "./pipelines.d.ts",
10+
"private": true,
11+
"engines": {
12+
"node": ">=18.0.0"
13+
}
14+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @license
3+
* Copyright 2024 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+
import { PipelineSource, Pipeline } from '../../dist/lite/pipelines';
18+
19+
// Augument the Firestore class with the pipeline() method.
20+
// This is stripped from dist/lite/pipelines.d.ts during the build
21+
// so it needs to be re-added here.
22+
declare module '@firebase/firestore/lite' {
23+
interface Firestore {
24+
pipeline(): PipelineSource<Pipeline>;
25+
}
26+
}
27+
28+
export * from '../../dist/lite/pipelines';
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/**
2+
* Firestore Lite Pipelines
3+
*
4+
* @remarks Firestore Lite is a small online-only SDK that allows read
5+
* and write access to your Firestore database. All operations connect
6+
* directly to the backend, and `onSnapshot()` APIs are not supported.
7+
* @packageDocumentation
8+
*/
9+
/**
10+
* @license
11+
* Copyright 2024 Google LLC
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*/
25+
26+
// External exports: ./index
27+
// These external exports will be stripped from the dist/pipelines.d.ts file
28+
// by the prune-dts script, in order to reduce type duplication. However, these
29+
// types need to be exported here to ensure that api-extractor behaves
30+
// correctly. If a type from api.ts is missing from this export, then
31+
// api-extractor may rename it with a suffix `_#`, e.g. `YourType_2`.
32+
export type {
33+
Timestamp,
34+
DocumentReference,
35+
VectorValue,
36+
GeoPoint,
37+
FieldPath,
38+
DocumentData,
39+
Query,
40+
Firestore,
41+
FirestoreDataConverter,
42+
WithFieldValue,
43+
PartialWithFieldValue,
44+
SetOptions,
45+
QueryDocumentSnapshot,
46+
Primitive,
47+
FieldValue,
48+
Bytes
49+
} from '../index';
50+
51+
export { PipelineSource } from '../../src/lite-api/pipeline-source';
52+
53+
export {
54+
PipelineResult,
55+
PipelineSnapshot
56+
} from '../../src/lite-api/pipeline-result';
57+
58+
export { Pipeline } from '../../src/lite-api/pipeline';
59+
60+
export { execute } from '../../src/lite-api/pipeline_impl';
61+
62+
export {
63+
Stage,
64+
FindNearestOptions,
65+
AddFields,
66+
Aggregate,
67+
Distinct,
68+
CollectionSource,
69+
CollectionGroupSource,
70+
DatabaseSource,
71+
DocumentsSource,
72+
Where,
73+
FindNearest,
74+
Limit,
75+
Offset,
76+
Select,
77+
Sort,
78+
GenericStage
79+
} from '../../src/lite-api/stage';
80+
81+
export {
82+
Expr,
83+
field,
84+
and,
85+
array,
86+
arrayOffset,
87+
constant,
88+
add,
89+
subtract,
90+
multiply,
91+
avg,
92+
bitAnd,
93+
substr,
94+
constantVector,
95+
bitLeftShift,
96+
bitNot,
97+
count,
98+
mapMerge,
99+
mapRemove,
100+
bitOr,
101+
ifError,
102+
isAbsent,
103+
isError,
104+
or,
105+
rand,
106+
bitRightShift,
107+
bitXor,
108+
divide,
109+
isNotNan,
110+
map,
111+
isNotNull,
112+
isNull,
113+
mod,
114+
documentId,
115+
eq,
116+
neq,
117+
lt,
118+
countIf,
119+
lte,
120+
gt,
121+
gte,
122+
arrayConcat,
123+
arrayContains,
124+
arrayContainsAny,
125+
arrayContainsAll,
126+
arrayLength,
127+
eqAny,
128+
notEqAny,
129+
xor,
130+
cond,
131+
not,
132+
logicalMaximum,
133+
logicalMinimum,
134+
exists,
135+
isNan,
136+
reverse,
137+
replaceFirst,
138+
replaceAll,
139+
byteLength,
140+
charLength,
141+
like,
142+
regexContains,
143+
regexMatch,
144+
strContains,
145+
startsWith,
146+
endsWith,
147+
toLower,
148+
toUpper,
149+
trim,
150+
strConcat,
151+
mapGet,
152+
countAll,
153+
minimum,
154+
maximum,
155+
cosineDistance,
156+
dotProduct,
157+
euclideanDistance,
158+
vectorLength,
159+
unixMicrosToTimestamp,
160+
timestampToUnixMicros,
161+
unixMillisToTimestamp,
162+
timestampToUnixMillis,
163+
unixSecondsToTimestamp,
164+
timestampToUnixSeconds,
165+
timestampAdd,
166+
timestampSub,
167+
ascending,
168+
descending,
169+
ExprWithAlias,
170+
Field,
171+
Constant,
172+
FunctionExpr,
173+
Ordering,
174+
ExprType,
175+
AggregateWithAlias,
176+
Selectable,
177+
BooleanExpr,
178+
AggregateFunction
179+
} from '../../src/lite-api/expressions';

packages/firestore/package.json

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@
4848
"test:minified": "(cd ../../integration/firestore ; yarn test)",
4949
"trusted-type-check": "tsec -p tsconfig.json --noEmit",
5050
"api-report:main": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore --packageRoot . --typescriptDts ./dist/firestore/src/index.d.ts --rollupDts ./dist/private.d.ts --untrimmedRollupDts ./dist/internal.d.ts --publicDts ./dist/index.d.ts",
51+
"api-report:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-pipelines --packageRoot . --typescriptDts ./dist/firestore/pipelines/pipelines.d.ts --rollupDts ./dist/private.pipelines.d.ts --untrimmedRollupDts ./dist/internal.pipelines.d.ts --publicDts ./dist/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/index.d.ts",
5152
"api-report:lite": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite --packageRoot . --typescriptDts ./dist/firestore/lite/index.d.ts --rollupDts ./dist/lite/private.d.ts --untrimmedRollupDts ./dist/lite/internal.d.ts --publicDts ./dist/lite/index.d.ts",
53+
"api-report:lite:pipelines": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node ../../repo-scripts/prune-dts/extract-public-api.ts --package firestore-lite-pipelines --packageRoot . --typescriptDts ./dist/firestore/lite/pipelines/pipelines.d.ts --rollupDts ./dist/lite/private.pipelines.d.ts --untrimmedRollupDts ./dist/lite/internal.pipelines.d.ts --publicDts ./dist/lite/pipelines.d.ts --otherExportsPublicDtsFiles ./dist/lite/index.d.ts",
5254
"api-report:api-json": "rm -rf temp && api-extractor run --local --verbose",
53-
"api-report": "run-s --npm-path npm api-report:main api-report:lite && yarn api-report:api-json",
55+
"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",
5456
"doc": "api-documenter markdown --input temp --output docs",
55-
"typings:public": "node ../../scripts/build/use_typings.js ./dist/index.d.ts",
57+
"typings:public": "node ../../scripts/build/use_typings.js ./dist/all-packages.d.ts",
5658
"assertion-id:check": "ts-node scripts/assertion-id-tool.ts --dir=src --check",
5759
"assertion-id:new": "ts-node scripts/assertion-id-tool.ts --dir=src --new",
5860
"assertion-id:list": "ts-node scripts/assertion-id-tool.ts --dir=src --list",
@@ -80,18 +82,44 @@
8082
},
8183
"react-native": "./dist/lite/index.rn.esm2017.js",
8284
"browser": {
83-
"require": "./dist/lite/index.cjs.js",
85+
"require": "./dist/lite/index.browser.cjs.js",
8486
"import": "./dist/lite/index.browser.esm2017.js"
8587
},
8688
"default": "./dist/lite/index.browser.esm2017.js"
8789
},
90+
"./lite/pipelines": {
91+
"types": "./dist/lite/pipelines.d.ts",
92+
"node": {
93+
"require": "./dist/lite/pipelines.node.cjs.js",
94+
"import": "./dist/lite/pipelines.node.mjs"
95+
},
96+
"react-native": "./dist/lite/pipelines.rn.esm2017.js",
97+
"browser": {
98+
"require": "./dist/lite/pipelines.browser.cjs.js",
99+
"import": "./dist/lite/pipelines.browser.esm2017.js"
100+
},
101+
"default": "./dist/lite/pipelines.browser.esm2017.js"
102+
},
103+
"./pipelines": {
104+
"types": "./pipelines/pipelines.d.ts",
105+
"node": {
106+
"require": "./dist/pipelines.node.cjs.js",
107+
"import": "./dist/pipelines.node.mjs"
108+
},
109+
"react-native": "./dist/index.rn.esm2017.js",
110+
"browser": {
111+
"require": "./dist/pipelines.cjs.js",
112+
"import": "./dist/pipelines.esm2017.js"
113+
},
114+
"default": "./dist/pipelines.esm2017.js"
115+
},
88116
"./package.json": "./package.json"
89117
},
90-
"main": "dist/index.node.cjs.js",
91-
"main-esm": "dist/index.node.mjs",
118+
"main": "dist/node-cjs/index.node.cjs.js",
119+
"main-esm": "dist/node-esm/index.node.mjs",
92120
"react-native": "dist/index.rn.js",
93-
"browser": "dist/index.esm2017.js",
94-
"module": "dist/index.esm2017.js",
121+
"browser": "dist/browser-esm2017/index.esm2017.js",
122+
"module": "dist/browser-esm2017/index.esm2017.js",
95123
"license": "Apache-2.0",
96124
"files": [
97125
"dist",
@@ -138,7 +166,7 @@
138166
"bugs": {
139167
"url": "https://github.com/firebase/firebase-js-sdk/issues"
140168
},
141-
"typings": "dist/firestore/src/index.d.ts",
169+
"types": "dist/index.d.ts",
142170
"nyc": {
143171
"extension": [
144172
".ts"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@firebase/firestore/pipelines",
3+
"description": "pipelines",
4+
"main": "../dist/pipelines.node.cjs.js",
5+
"main-esm": "../dist/pipelines.node.mjs",
6+
"module": "../dist/pipelines.browser.esm2017.js",
7+
"browser": "../dist/pipelines.browser.esm2017.js",
8+
"react-native": "../dist/pipelines.rn.esm2017.js",
9+
"typings": "./pipelines.d.ts",
10+
"private": true,
11+
"engines": {
12+
"node": ">=18.0.0"
13+
}
14+
}

0 commit comments

Comments
 (0)