Skip to content

Commit 0b8d04c

Browse files
build!: upgrade to gts@2 (#2062)
1 parent 7ed5454 commit 0b8d04c

File tree

492 files changed

+2899
-3326
lines changed

Some content is hidden

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

492 files changed

+2899
-3326
lines changed

.eslintrc.yml

-15
This file was deleted.

.jsdoc.js

+8-13
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,13 @@ module.exports = {
2222
template: './node_modules/jsdoc-fresh',
2323
recurse: true,
2424
verbose: true,
25-
destination: './docs/'
25+
destination: './docs/',
2626
},
27-
plugins: [
28-
'plugins/markdown',
29-
'jsdoc-region-tag'
30-
],
27+
plugins: ['plugins/markdown', 'jsdoc-region-tag'],
3128
source: {
3229
excludePattern: '(^|\\/|\\\\)[._]',
33-
include: [
34-
'src',
35-
],
36-
includePattern: '\\.js$'
30+
include: ['src'],
31+
includePattern: '\\.js$',
3732
},
3833
templates: {
3934
copyright: 'Copyright 2019 Google, LLC.',
@@ -42,10 +37,10 @@ module.exports = {
4237
systemName: 'googleapis',
4338
theme: 'lumen',
4439
default: {
45-
outputSourceFiles: false
46-
}
40+
outputSourceFiles: false,
41+
},
4742
},
4843
markdown: {
49-
idInHeadings: true
50-
}
44+
idInHeadings: true,
45+
},
5146
};

.mocharc.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
const config = {
15-
"enable-source-maps": true,
16-
"throw-deprecation": true,
17-
"timeout": 10000
18-
}
15+
'enable-source-maps': true,
16+
'throw-deprecation': true,
17+
timeout: 10000,
18+
};
1919
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
2020
delete config['throw-deprecation'];
2121
}
@@ -25,4 +25,4 @@ if (process.env.MOCHA_REPORTER) {
2525
if (process.env.MOCHA_REPORTER_OUTPUT) {
2626
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`;
2727
}
28-
module.exports = config
28+
module.exports = config;

.prettierrc

-8
This file was deleted.

.prettierrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
// limitations under the License.
1414

1515
module.exports = {
16-
...require('gts/.prettierrc.json')
17-
}
16+
...require('gts/.prettierrc.json'),
17+
};

package.json

+16-22
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
{
2+
"name": "googleapis",
3+
"version": "49.0.0",
4+
"repository": "googleapis/google-api-nodejs-client",
25
"license": "Apache-2.0",
3-
"dependencies": {
4-
"google-auth-library": "^6.0.0",
5-
"googleapis-common": "^4.0.0"
6+
"description": "Google APIs Client Library for Node.js",
7+
"main": "./build/src/index.js",
8+
"types": "./build/src/index.d.ts",
9+
"engines": {
10+
"node": ">=10"
611
},
712
"files": [
813
"build/src",
914
"!build/src/**/*.map"
1015
],
11-
"repository": "googleapis/google-api-nodejs-client",
12-
"name": "googleapis",
13-
"version": "49.0.0",
1416
"scripts": {
1517
"pretest": "npm run compile",
1618
"prepare": "npm run compile",
@@ -19,11 +21,11 @@
1921
"docs": "node build/src/generator/docs",
2022
"system-test": "mocha build/system-test",
2123
"samples-test": "cd samples && npm link ../ && pwd && npm test",
22-
"lint": "gts check && eslint 'samples/**/*.js'",
24+
"lint": "gts check",
2325
"compile": "tsc -p .",
2426
"build-tools": "tsc -p tsconfig.tools.json",
2527
"clean": "gts clean",
26-
"fix": "eslint --fix '**/*.js' && gts fix",
28+
"fix": "gts fix",
2729
"pregenerate": "npm run build-tools",
2830
"generate": "node build/src/generator/generate.js",
2931
"postgenerate": "npm run fix",
@@ -40,15 +42,12 @@
4042
"client",
4143
"client library"
4244
],
43-
"description": "Google APIs Client Library for Node.js",
44-
"main": "./build/src/index.js",
45-
"types": "./build/src/index.d.ts",
46-
"engines": {
47-
"node": ">=10"
45+
"dependencies": {
46+
"google-auth-library": "^6.0.0",
47+
"googleapis-common": "^4.1.0"
4848
},
4949
"devDependencies": {
5050
"@compodoc/compodoc": "^1.1.10",
51-
"@types/chai": "^4.1.7",
5251
"@types/execa": "^0.9.0",
5352
"@types/minimist": "^1.2.0",
5453
"@types/mkdirp": "^1.0.0",
@@ -61,16 +60,11 @@
6160
"@types/rimraf": "^3.0.0",
6261
"@types/tmp": "^0.1.0",
6362
"@types/url-template": "^2.0.28",
64-
"assert-rejects": "^1.0.0",
6563
"c8": "^7.0.0",
66-
"chai": "^4.2.0",
6764
"codecov": "^3.4.0",
68-
"eslint": "^6.0.0",
69-
"eslint-config-prettier": "^6.0.0",
70-
"eslint-plugin-node": "^11.0.0",
71-
"eslint-plugin-prettier": "^3.1.0",
7265
"execa": "^4.0.0",
73-
"gts": "^1.1.0",
66+
"gaxios": "^3.0.3",
67+
"gts": "^2.0.0",
7468
"js-green-licenses": "^1.0.0",
7569
"linkinator": "^2.0.0",
7670
"minimist": "^1.2.5",
@@ -85,6 +79,6 @@
8579
"rimraf": "^3.0.0",
8680
"server-destroy": "^1.0.1",
8781
"tmp": "^0.2.0",
88-
"typescript": "3.6.4"
82+
"typescript": "^3.8.3"
8983
}
9084
}

samples/analyticsReporting/batchGet.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ async function runSample() {
5353
// if invoked directly (not tests), authenticate and run the samples
5454
if (module === require.main) {
5555
const scopes = ['https://www.googleapis.com/auth/analytics'];
56-
sampleClient
57-
.authenticate(scopes)
58-
.then(runSample)
59-
.catch(console.error);
56+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
6057
}
6158

6259
// export functions for testing purposes

samples/blogger/blogger.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ const nconf = require('nconf');
1919
const path = require('path');
2020

2121
// Ex: node blogger.js --api_key "YOUR API KEY"
22-
nconf
23-
.argv()
24-
.env()
25-
.file(path.join(__dirname, 'config.json'));
22+
nconf.argv().env().file(path.join(__dirname, 'config.json'));
2623

2724
blogger.blogs.get(
2825
{

samples/blogger/insert.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ async function runSample() {
3636

3737
if (module === require.main) {
3838
const scopes = ['https://www.googleapis.com/auth/blogger'];
39-
sampleClient
40-
.authenticate(scopes)
41-
.then(runSample)
42-
.catch(console.error);
39+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
4340
}
4441

4542
module.exports = {

samples/drive/export.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ async function runSample() {
4646
// if invoked directly (not tests), authenticate and run the samples
4747
if (module === require.main) {
4848
const scopes = ['https://www.googleapis.com/auth/drive.readonly'];
49-
sampleClient
50-
.authenticate(scopes)
51-
.then(runSample)
52-
.catch(console.error);
49+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
5350
}
5451

5552
// export functions for testing purposes

samples/drive/list.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ async function runSample(query) {
3131

3232
if (module === require.main) {
3333
const scopes = ['https://www.googleapis.com/auth/drive.metadata.readonly'];
34-
sampleClient
35-
.authenticate(scopes)
36-
.then(runSample)
37-
.catch(console.error);
34+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
3835
}
3936

4037
module.exports = {

samples/gmail/list.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ async function runSample() {
2929

3030
if (module === require.main) {
3131
const scopes = ['https://www.googleapis.com/auth/gmail.readonly'];
32-
sampleClient
33-
.authenticate(scopes)
34-
.then(runSample)
35-
.catch(console.error);
32+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
3633
}
3734

3835
module.exports = {

samples/gmail/send.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ const scopes = [
6363
];
6464

6565
if (module === require.main) {
66-
sampleClient
67-
.authenticate(scopes)
68-
.then(runSample)
69-
.catch(console.error);
66+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
7067
}
7168

7269
module.exports = {

samples/gmail/watch.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function runSample() {
3535
userId: 'me',
3636
requestBody: {
3737
// Replace with `projects/${PROJECT_ID}/topics/${TOPIC_NAME}`
38-
topicName: `projects/el-gato/topics/gmail`,
38+
topicName: 'projects/el-gato/topics/gmail',
3939
},
4040
});
4141
console.log(res.data);
@@ -50,10 +50,7 @@ const scopes = [
5050
];
5151

5252
if (module === require.main) {
53-
sampleClient
54-
.authenticate(scopes)
55-
.then(runSample)
56-
.catch(console.error);
53+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
5754
}
5855

5956
module.exports = {

samples/jobs/jobs.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ if (module === require.main) {
4141
'https://www.googleapis.com/auth/jobs',
4242
'https://www.googleapis.com/auth/cloud-platform',
4343
];
44-
sampleClient
45-
.authenticate(scopes)
46-
.then(runSample)
47-
.catch(console.error);
44+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
4845
}
4946

5047
module.exports = {

samples/mirror/mirror.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@ const scopes = [
3333
'https://www.googleapis.com/auth/glass.location',
3434
];
3535

36-
sampleClient
37-
.authenticate(scopes)
38-
.then(runSample)
39-
.catch(console.error);
36+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);

samples/multiple.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ const plus = google.plus('v1');
1919
const nconf = require('nconf');
2020
const path = require('path');
2121

22-
nconf
23-
.argv()
24-
.env()
25-
.file(path.join(__dirname, 'config.json'));
22+
nconf.argv().env().file(path.join(__dirname, 'config.json'));
2623

2724
// PUT your API key here or this example will return errors
2825
// To learn more about API keys, please see:

samples/people/contacts.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,5 @@ async function runSample() {
6161
const scopes = ['https://www.googleapis.com/auth/contacts'];
6262

6363
if (module === require.main) {
64-
sampleClient
65-
.authenticate(scopes)
66-
.then(runSample)
67-
.catch(console.error);
64+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
6865
}

samples/people/me.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,5 @@ const scopes = [
3737
];
3838

3939
if (module === require.main) {
40-
sampleClient
41-
.authenticate(scopes)
42-
.then(runSample)
43-
.catch(console.error);
40+
sampleClient.authenticate(scopes).then(runSample).catch(console.error);
4441
}

samples/test/test.compute.samples.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019, Google, LLC.
1+
// Copyright 2019 Google, LLC
22
// Licensed under the Apache License, Version 2.0 (the "License");
33
// you may not use this file except in compliance with the License.
44
// You may obtain a copy of the License at
@@ -13,13 +13,13 @@
1313

1414
'use strict';
1515

16-
const {assert} = require('chai');
16+
const assert = require('assert');
1717
const execa = require('execa');
1818
const {describe, it} = require('mocha');
1919

2020
describe('Compute samples', () => {
2121
it('should list all the VMs', async () => {
2222
const res = execa.sync('node compute/listVMs.js', {shell: true});
23-
assert.match(res.stdout, /VMs:/);
23+
assert.ok(/VMs:/.test(res.stdout));
2424
});
2525
});

samples/test/test.samples.analyticsReporting.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ describe('analyticsReporting samples', () => {
3737
});
3838

3939
it('should batchGet', async () => {
40-
const scope = nock(baseUrl)
41-
.post(`/v4/reports:batchGet`)
42-
.reply(200, {});
40+
const scope = nock(baseUrl).post('/v4/reports:batchGet').reply(200, {});
4341
const data = await samples.batchGet.runSample();
4442
assert(data);
4543
scope.done();

samples/test/test.samples.blog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('blogger samples', () => {
3838

3939
it('should insert a blog post', async () => {
4040
const scope = nock(baseUrl)
41-
.post(`/v3/blogs/4340475495955554224/posts`)
41+
.post('/v3/blogs/4340475495955554224/posts')
4242
.reply(200, {});
4343
const data = await samples.post.runSample();
4444
assert(data);

samples/test/test.samples.customsearch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('customsearch samples', () => {
3232

3333
it('should search', async () => {
3434
const scope = nock(baseUrl)
35-
.get(`/customsearch/v1?cx=cx&q=q`)
35+
.get('/customsearch/v1?cx=cx&q=q')
3636
.reply(200, {});
3737
const options = {cx: 'cx', q: 'q', auth: 'key'};
3838
const data = await samples.list.runSample(options);

0 commit comments

Comments
 (0)