Skip to content
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

feat!: Drop Node 8 support #1006

Merged
merged 38 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ae1cc08
fix!: mark v1beta1 client as deprecated (#937)
schmidt-sebastian Apr 9, 2020
04bf403
feat!: use QueryDocumentSnapshot in FirestoreDataConverter (#965)
Apr 9, 2020
5fbc6e6
deps: update to gts 2.x (#1013)
schmidt-sebastian Apr 14, 2020
7d6888d
chore!: update settings for Node 10 (#1019)
schmidt-sebastian Apr 15, 2020
36a1683
deps: drop through2 (#1014)
schmidt-sebastian Apr 17, 2020
6f9a30c
feat: support BigInt (#1016)
schmidt-sebastian Apr 18, 2020
9459fec
fix: make update.sh work on Linux (#1043)
schmidt-sebastian Apr 24, 2020
2ea3040
fix: only use BigInt in BigInt system test (#1044)
schmidt-sebastian Apr 24, 2020
c7d9c54
fix: make pbjs compile admin proto again (#1045)
schmidt-sebastian Apr 24, 2020
6fc9fa1
Merge
schmidt-sebastian Apr 24, 2020
0b2ea39
Merge branch 'master' into node10
schmidt-sebastian Apr 25, 2020
955f858
Add BulkWriter (#1055)
Apr 29, 2020
6aae79d
docs: Add documentation for FirestoreDataConverter (#1059)
Apr 30, 2020
92870d3
chore: enforce return types (#1065)
schmidt-sebastian May 1, 2020
ec10a19
fix: add generic to Firestore.getAll() (#1066)
May 1, 2020
35ef4a9
chore: remove internal WriteOp (#1067)
schmidt-sebastian May 1, 2020
880d5a9
chore: add linter checks for it|describe.only (#1068)
May 5, 2020
a595192
fix: handle terminate in BulkWriter (#1070)
May 6, 2020
27b6fe2
chore: run template copying last in synthtool (#1071)
May 7, 2020
19b8922
feat: Firestore Bundles implementation (#1078)
wu-hui May 13, 2020
2254650
feat: add support for set() with SetOptions when using FirestoreDataC…
May 21, 2020
01dcab7
feat: Add totalDocuments and totalBytes to bundle metadata. (#1085)
wu-hui May 26, 2020
54bd08c
fix: incomplete expect in rate-limiter test (#1092)
May 27, 2020
33d77b2
Merge
schmidt-sebastian May 31, 2020
1298c60
Remove BatchWrite proto, fix conformance tests
schmidt-sebastian May 31, 2020
632f0a8
chore: use public API types internally (#1100)
schmidt-sebastian Jun 3, 2020
01b665f
feat: add Partition and BatchWrite protos (#1110)
schmidt-sebastian Jun 3, 2020
9fd64ba
fix: remove GCF transaction fallback (#1112)
schmidt-sebastian Jun 5, 2020
9224c0f
fix: add BulkWriter integration tests, java backport changes, delete …
Jun 10, 2020
5698bb5
chore: merge master (#1218)
Jun 11, 2020
13871d9
chore: add eslint check for console.log statements (#1229)
Jun 18, 2020
2f417f7
fix: another attempt at fixing the flaky BulkWriter test (#1228)
Jun 19, 2020
02a0d6c
Merge
schmidt-sebastian Jun 23, 2020
f291522
Merge
schmidt-sebastian Jun 23, 2020
b6eb86d
Fix comment
schmidt-sebastian Jun 23, 2020
037aa92
Renames
schmidt-sebastian Jun 23, 2020
d5901be
Test fix
schmidt-sebastian Jun 23, 2020
97fdb5f
Fix unit tests
schmidt-sebastian Jun 24, 2020
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
41 changes: 41 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"extends": "./node_modules/gts",
"overrides": [
{
"files": [
"dev/src/*.ts"
],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
],
"no-console": ["error", {"allow": ["error"]}]
}
},
{
"files": [
"dev/test/*.ts",
"dev/system-test/*.ts"
],
"parser": "@typescript-eslint/parser",
"rules": {
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
]
}
}
]
}
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

22 changes: 11 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 10, 12, 13]
node: [10, 12, 13]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand All @@ -18,6 +18,11 @@ jobs:
- run: node --version
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions ${{ matrix.node }}
fail_ci_if_error: false
windows:
runs-on: windows-latest
steps:
Expand All @@ -27,6 +32,11 @@ jobs:
node-version: 12
- run: npm install
- run: npm test
- name: coverage
uses: codecov/codecov-action@v1
with:
name: actions windows
fail_ci_if_error: false
lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -45,13 +55,3 @@ jobs:
node-version: 12
- run: npm install
- run: npm run docs-test
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 13
- run: npm install
- run: npm test
- run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecovorg -a ${{ secrets.CODECOV_API_KEY }} -r $GITHUB_REPOSITORY --pipe
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
**/*.log
**/node_modules
.coverage
coverage
.nyc_output
docs/
out/
build/
system-test/secrets.js
system-test/*key.json
*.lock
build/
package-lock.json
.DS_Store
package-lock.json
__pycache__
9 changes: 5 additions & 4 deletions .jsdoc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,18 +34,19 @@ module.exports = {
source: {
excludePattern: '(^|\\/|\\\\)[._]',
include: [
'build/src'
'build/src',
'build/protos'
],
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2019 Google, LLC.',
copyright: 'Copyright 2020 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/firestore',
theme: 'lumen',
default: {
"outputSourceFiles": false
outputSourceFiles: false
}
},
markdown: {
Expand Down
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

module.exports = {
...require('gts/.prettierrc.json')
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function quickstart() {
console.log('Updated an existing document');

// Read the document.
let doc = await document.get();
const doc = await document.get();
console.log('Read the document');

// Delete the document.
Expand Down
14 changes: 0 additions & 14 deletions dev/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions dev/.mocharc.json

This file was deleted.

3 changes: 0 additions & 3 deletions dev/conformance/.eslintrc.yml

This file was deleted.

26 changes: 11 additions & 15 deletions dev/conformance/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const duplexify = require('duplexify');
const mkdirp = require('mkdirp');
import {DocumentData} from '@google-cloud/firestore';

import * as duplexify from 'duplexify';

import {it, xit, describe} from 'mocha';
import {expect} from 'chai';
import * as path from 'path';
import * as fs from 'fs';
import * as protobufjs from 'protobufjs';
import * as through2 from 'through2';
import * as proto from '../protos/firestore_v1_proto_api';

import {
DocumentChange,
DocumentData,
DocumentSnapshot,
FieldPath,
FieldValue,
Expand All @@ -47,7 +49,8 @@ import {
import api = proto.google.firestore.v1;

// TODO(mrschmidt): Create Protobuf .d.ts file for the conformance proto
type ConformanceProto = any; // tslint:disable-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ConformanceProto = any;

/** List of test cases that are ignored. */
const ignoredRe: RegExp[] = [];
Expand Down Expand Up @@ -328,21 +331,15 @@ function runTest(spec: ConformanceProto) {
}

const document = docRef(spec.docRefPath);
// TODO(mrschmidt): Remove 'any' and invoke by calling update() directly
// for each individual case.
// tslint:disable-next-line:no-any
return document.update.apply(document, varargs as any);
return document.update(varargs[0] as string, ...varargs.slice(1));
});
};

const queryTest = (spec: ConformanceProto) => {
const overrides = {runQuery: queryHandler(spec)};
const applyClause = (query: Query, clause: ConformanceProto) => {
if (clause.select) {
query = query.select.apply(
query,
convertInput.paths(clause.select.fields)
);
query = query.select(...convertInput.paths(clause.select.fields));
} else if (clause.where) {
const fieldPath = convertInput.path(clause.where.path);
const value = convertInput.argument(clause.where.jsonValue);
Expand Down Expand Up @@ -582,15 +579,14 @@ function normalizeInt32Value(obj: {[key: string]: {}}, parent = '') {

describe('Conformance Tests', () => {
const loadTestCases = () => {
// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let testDataJson: any[] = [];
const fs = require('fs');

const testPath = path.join(__dirname, 'conformance-tests');
const fileNames = fs.readdirSync(testPath);
for (const fileName of fileNames) {
const testFilePath = path.join(__dirname, 'conformance-tests', fileName);
const singleTest = JSON.parse(fs.readFileSync(testFilePath));
const singleTest = JSON.parse(fs.readFileSync(testFilePath, 'utf-8'));

// Convert Timestamp string representation to protobuf object.
normalizeTimestamp(singleTest);
Expand Down
Loading