Skip to content

Commit

Permalink
feat!: Drop Node 8 support (#1006)
Browse files Browse the repository at this point in the history
* fix!: mark v1beta1 client as deprecated (#937)

* feat!: use QueryDocumentSnapshot in FirestoreDataConverter (#965)

* deps: update to gts 2.x (#1013)

* chore!: update settings for Node 10 (#1019)

* deps: drop through2 (#1014)

* feat: support BigInt (#1016)

* fix: make update.sh work on Linux (#1043)

* fix: only use BigInt in BigInt system test (#1044)

* fix: make pbjs compile admin proto again (#1045)

* Add BulkWriter (#1055)

* docs: Add documentation for FirestoreDataConverter (#1059)

* chore: enforce return types (#1065)

* fix: add generic to Firestore.getAll() (#1066)

* chore: remove internal WriteOp (#1067)

* chore: add linter checks for it|describe.only (#1068)

* fix: handle terminate in BulkWriter (#1070)

* chore: run template copying last in synthtool (#1071)

* feat: Firestore Bundles implementation (#1078)

* feat: add support for set() with SetOptions when using FirestoreDataConverter (#1087)

* feat: Add totalDocuments and totalBytes to bundle metadata. (#1085)

* feat: Add totalDocuments and totalBytes to bundle metadata.

* fix: Better comment

* fix: Better testing.

* fix: Improve metadata testing.

* fix: incomplete expect in rate-limiter test (#1092)

* Remove BatchWrite proto, fix conformance tests

* chore: use public API types internally (#1100)

* feat: add Partition and BatchWrite protos (#1110)

* fix: remove GCF transaction fallback (#1112)

* fix: add BulkWriter integration tests, java backport changes, delete fix (#1117)

* chore: merge master (#1218)

* chore: add eslint check for console.log statements (#1229)

* fix: another attempt at fixing the flaky BulkWriter test (#1228)

* Fix comment

* Renames

* Test fix

* Fix unit tests

Co-authored-by: Brian Chen <chenbrian@google.com>
Co-authored-by: wu-hui <53845758+wu-hui@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 24, 2020
1 parent 48ca412 commit 56355f1
Show file tree
Hide file tree
Showing 94 changed files with 60,937 additions and 24,421 deletions.
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

0 comments on commit 56355f1

Please sign in to comment.