Skip to content

Commit

Permalink
chore!: drop support for node.js 8
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Mar 25, 2020
1 parent 3d86a5a commit b3191d1
Show file tree
Hide file tree
Showing 22 changed files with 300 additions and 296 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**/node_modules
src/**/doc/*
**/.coverage
build/
docs/
protos/
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

1 change: 1 addition & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// 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.

const config = {
"enable-source-maps": true,
"throw-deprecation": true,
Expand Down
8 changes: 5 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/*
samples/node_modules/*
src/**/doc/*
**/node_modules
**/.coverage
build/
docs/
protos/
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
//
// http://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')
}
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
"node": ">=8.10.0"
"node": ">=10"
},
"repository": "googleapis/nodejs-common",
"main": "./build/src/index.js",
Expand All @@ -31,41 +31,41 @@
"predocs-test": "npm run docs"
},
"dependencies": {
"@google-cloud/projectify": "^1.0.0",
"@google-cloud/promisify": "^1.0.0",
"arrify": "^2.0.0",
"duplexify": "^3.6.0",
"@google-cloud/projectify": "^2.0.0",
"@google-cloud/promisify": "^2.0.0",
"arrify": "^2.0.1",
"duplexify": "^4.1.1",
"ent": "^2.2.0",
"extend": "^3.0.2",
"google-auth-library": "^5.5.0",
"retry-request": "^4.0.0",
"teeny-request": "^6.0.0"
"google-auth-library": "^5.10.1",
"retry-request": "^4.1.1",
"teeny-request": "^6.0.3"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.9",
"@compodoc/compodoc": "^1.1.11",
"@types/ent": "^2.2.1",
"@types/extend": "^3.0.1",
"@types/mocha": "^7.0.0",
"@types/mocha": "^7.0.2",
"@types/mv": "^2.1.0",
"@types/ncp": "^2.0.1",
"@types/node": "^11.13.0",
"@types/ncp": "^2.0.3",
"@types/node": "^12.12.31",
"@types/proxyquire": "^1.3.28",
"@types/request": "^2.48.1",
"@types/sinon": "^7.0.10",
"@types/request": "^2.48.4",
"@types/sinon": "^7.5.2",
"@types/tmp": "0.1.0",
"codecov": "^3.2.0",
"gts": "^1.0.0",
"c8": "^7.1.0",
"codecov": "^3.6.5",
"gts": "^2.0.0-alpha.6",
"ink-docstrap": "^1.3.2",
"js-green-licenses": "^1.0.0",
"linkinator": "^2.0.0",
"mocha": "^7.0.0",
"js-green-licenses": "^1.1.0",
"linkinator": "^2.0.4",
"mocha": "^7.1.1",
"mv": "^2.1.1",
"ncp": "^2.0.0",
"nock": "^12.0.0",
"c8": "^7.0.0",
"proxyquire": "^2.1.0",
"sinon": "^9.0.0",
"nock": "^12.0.3",
"proxyquire": "^2.1.3",
"sinon": "^9.0.1",
"tmp": "0.1.0",
"typescript": "3.6.4"
"typescript": "~3.8.3"
}
}
28 changes: 13 additions & 15 deletions samples/quickstart.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/*!
* Copyright 2018 Google LCC. All Rights Reserved.
*
* 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
*
* http://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.
*/
// Copyright 2018 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
//
// http://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.

console.warn(`no samples available 👎`);
28 changes: 13 additions & 15 deletions samples/system-test/test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/*!
* Copyright 2018 Google LCC. All Rights Reserved.
*
* 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
*
* http://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.
*/
// Copyright 2018 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
//
// http://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.

console.warn(`no sample tests available 👎`);
28 changes: 13 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*!
* Copyright 2016 Google Inc. All Rights Reserved.
*
* 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
*
* http://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.
*/
// Copyright 2016 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
//
// http://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.

export {GoogleAuthOptions} from 'google-auth-library';
/**
Expand Down
32 changes: 15 additions & 17 deletions src/operation.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*!
* Copyright 2016 Google Inc. All Rights Reserved.
*
* 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
*
* http://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.
*/
// Copyright 2016 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
//
// http://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 common/operation
Expand All @@ -27,7 +25,7 @@ import {
import {ApiError} from './util';
import {promisify} from 'util';

// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class Operation<T = any> extends ServiceObject<T> {
completeListeners: number;
hasActiveListeners: boolean;
Expand Down Expand Up @@ -71,7 +69,7 @@ export class Operation<T = any> extends ServiceObject<T> {
config
);

// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
config.methods = (config.methods || methods) as any;
super(config);
this.completeListeners = 0;
Expand Down
46 changes: 24 additions & 22 deletions src/service-object.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*!
* Copyright 2015 Google Inc. All Rights Reserved.
*
* 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
*
* http://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.
*/
// Copyright 2015 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
//
// http://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 common/service-object
Expand Down Expand Up @@ -49,7 +47,7 @@ export interface Interceptor {

export type GetMetadataOptions = object;

// tslint:disable-next-line:no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Metadata = any;
export type MetadataResponse = [Metadata, r.Response];
export type MetadataCallback = (
Expand Down Expand Up @@ -106,11 +104,12 @@ export interface InstanceResponseCallback<T> {
(err: ApiError | null, instance?: T | null, apiResponse?: r.Response): void;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface CreateOptions {}
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type CreateResponse<T> = any[];
export interface CreateCallback<T> {
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(err: ApiError | null, instance?: T | null, ...args: any[]): void;
}

Expand Down Expand Up @@ -146,7 +145,7 @@ export type SetMetadataOptions = object;
* shared behaviors. Note that any method can be overridden when the service
* object requires specific behavior.
*/
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
class ServiceObject<T = any> extends EventEmitter {
metadata: Metadata;
baseUrl?: string;
Expand Down Expand Up @@ -195,16 +194,16 @@ class ServiceObject<T = any> extends EventEmitter {
!/^request/.test(methodName) &&
// clang-format on
// The ServiceObject didn't redefine the method.
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this as any)[methodName] ===
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(ServiceObject.prototype as any)[methodName] &&
// This method isn't wanted.
!config.methods![methodName]
);
})
.forEach(methodName => {
// tslint:disable-next-line no-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this as any)[methodName] = undefined;
});
}
Expand All @@ -226,6 +225,7 @@ class ServiceObject<T = any> extends EventEmitter {
optionsOrCallback?: CreateOptions | CreateCallback<T>,
callback?: CreateCallback<T>
): void | Promise<CreateResponse<T>> {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
const args = [this.id] as Array<{}>;

Expand All @@ -249,6 +249,7 @@ class ServiceObject<T = any> extends EventEmitter {
callback!(...((args as {}) as [Error, T]));
}
args.push(onCreate);
// eslint-disable-next-line prefer-spread
this.createMethod!.apply(null, args);
}

Expand Down Expand Up @@ -342,6 +343,7 @@ class ServiceObject<T = any> extends EventEmitter {
optionsOrCallback?: GetOrCreateOptions | InstanceResponseCallback<T>,
cb?: InstanceResponseCallback<T>
): Promise<GetResponse<T>> | void {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;

const [opts, callback] = util.maybeOptionsOrCallback<
Expand Down
Loading

0 comments on commit b3191d1

Please sign in to comment.