Skip to content

Commit

Permalink
build!: update to latest version of gts and typescript (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl authored Apr 13, 2020
1 parent b2ffd1f commit 6f9709d
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 49 deletions.
15 changes: 0 additions & 15 deletions packages/google-cloud-dns/.eslintrc.yml

This file was deleted.

8 changes: 5 additions & 3 deletions packages/google-cloud-dns/.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 packages/google-cloud-dns/.prettierrc

This file was deleted.

7 changes: 4 additions & 3 deletions packages/google-cloud-dns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,22 @@
"@types/tmp": "0.1.0",
"@types/uuid": "^7.0.2",
"c8": "^7.0.0",
"chai": "^4.2.0",
"codecov": "^3.0.2",
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^1.0.0",
"gts": "^2.0.0-alpha.9",
"jsdoc": "^3.6.2",
"jsdoc-fresh": "^1.0.1",
"jsdoc-region-tag": "^1.0.2",
"linkinator": "^2.0.0",
"mocha": "^7.0.0",
"mocha": "^7.1.1",
"prettier": "^1.13.5",
"proxyquire": "^2.0.1",
"tmp": "^0.1.0",
"typescript": "3.6.4",
"typescript": "^3.8.3",
"uuid": "^7.0.2"
}
}
3 changes: 2 additions & 1 deletion packages/google-cloud-dns/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"node": ">=8"
},
"files": [
"*.js"
"*.js",
"!test/"
],
"scripts": {
"test": "mocha --timeout 600000"
Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-dns/src/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {Change, CreateChangeCallback} from './change';
import {Zone} from './zone';
import {Metadata} from '@google-cloud/common';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const format = require('string-format-obj');

export interface RecordObject {
Expand Down
8 changes: 5 additions & 3 deletions packages/google-cloud-dns/src/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ import arrify = require('arrify');
import * as fs from 'fs';

import groupBy = require('lodash.groupby');

// eslint-disable-next-line @typescript-eslint/no-var-requires
const zonefile = require('dns-zonefile');

import {Change, CreateChangeCallback, CreateChangeRequest} from './change';
import {Change} from './change';
import {Record, RecordMetadata, RecordObject} from './record';
import {
DNS,
Expand Down Expand Up @@ -83,7 +85,7 @@ export type DeleteZoneResponse = [Metadata];
* @param {?Error} err Request error, if any.
* @param {object} apiResponse The full API response.
*/
export interface DeleteZoneCallback extends DeleteCallback {}
export type DeleteZoneCallback = DeleteCallback;

export interface DeleteZoneConfig {
force?: boolean;
Expand Down Expand Up @@ -541,7 +543,7 @@ class Zone extends ZoneServiceObject {
},
(err, resp) => {
if (err) {
callback!(err, null, resp);
callback!(err, undefined, resp);
return;
}
const change = this.change(resp.id);
Expand Down
3 changes: 2 additions & 1 deletion packages/google-cloud-dns/system-test/dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
// limitations under the License.

import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describe, it, before, after} from 'mocha';
import * as fs from 'fs';
import * as tmp from 'tmp';
import * as util from 'util';
import * as uuid from 'uuid';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const format = require('string-format-obj');

import {DNS, Record} from '../src';
Expand Down
3 changes: 2 additions & 1 deletion packages/google-cloud-dns/test/change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@google-cloud/common';
import * as promisify from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describe, it, before, beforeEach} from 'mocha';
import * as proxyquire from 'proxyquire';

import {Change} from '../src/change';
Expand All @@ -37,6 +37,7 @@ class FakeServiceObject extends ServiceObject {
calledWith_: IArguments;
constructor(config: ServiceObjectConfig) {
super(config);
// eslint-disable-next-line prefer-rest-params
this.calledWith_ = arguments;
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/google-cloud-dns/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import * as promisify from '@google-cloud/promisify';
import arrify = require('arrify');
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describe, it, before, beforeEach} from 'mocha';
import * as proxyquire from 'proxyquire';
import {CoreOptions, OptionsWithUri, Response} from 'request';

Expand Down Expand Up @@ -49,6 +49,7 @@ class FakeService extends Service {
calledWith_: IArguments;
constructor(config: ServiceConfig, options?: ServiceOptions) {
super(config, options);
// eslint-disable-next-line prefer-rest-params
this.calledWith_ = arguments;
}
}
Expand All @@ -73,6 +74,7 @@ const fakePromisify = Object.assign({}, promisify, {
class FakeZone {
calledWith_: IArguments;
constructor() {
// eslint-disable-next-line prefer-rest-params
this.calledWith_ = arguments;
}
}
Expand Down Expand Up @@ -131,6 +133,7 @@ describe('DNS', () => {
]);
assert.deepStrictEqual(
calledWith.packageJson,
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('../../package.json')
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-dns/test/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import * as promisify from '@google-cloud/promisify';
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describe, it, before, beforeEach} from 'mocha';
import * as proxyquire from 'proxyquire';

import {Record} from '../src';
Expand Down
27 changes: 15 additions & 12 deletions packages/google-cloud-dns/test/zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {ServiceObject, ServiceObjectConfig} from '@google-cloud/common';
import * as promisify from '@google-cloud/promisify';
import arrify = require('arrify');
import * as assert from 'assert';
import {describe, it} from 'mocha';
import {describe, it, before, beforeEach} from 'mocha';
import * as proxyquire from 'proxyquire';
import {CoreOptions, OptionsWithUri, Response} from 'request';
import * as uuid from 'uuid';
Expand All @@ -38,6 +38,7 @@ const fakePromisify = Object.assign({}, promisify, {
let parseOverride: Function | null;
const fakeDnsZonefile = {
parse() {
// eslint-disable-next-line prefer-spread, prefer-rest-params
return (parseOverride || (() => {})).apply(null, arguments);
},
};
Expand All @@ -46,37 +47,39 @@ let writeFileOverride: Function | null;
let readFileOverride: Function | null;
const fakeFs = {
readFile() {
// eslint-disable-next-line prefer-spread, prefer-rest-params
return (readFileOverride || (() => {})).apply(null, arguments);
},
writeFile() {
// eslint-disable-next-line prefer-spread, prefer-rest-params
return (writeFileOverride || (() => {})).apply(null, arguments);
},
};

class FakeChange {
calledWith_: IArguments;
constructor() {
this.calledWith_ = arguments;
calledWith_: any[];
constructor(...args: any[]) {
this.calledWith_ = args;
}
}

class FakeRecord {
calledWith_: IArguments;
constructor() {
this.calledWith_ = arguments;
calledWith_: any[];
constructor(...args: any[]) {
this.calledWith_ = args;
}
static fromZoneRecord_() {
static fromZoneRecord_(...args: any[]) {
const record = new FakeRecord();
record.calledWith_ = arguments;
record.calledWith_ = args;
return record;
}
}

class FakeServiceObject extends ServiceObject {
calledWith_: IArguments;
constructor(config: ServiceObjectConfig) {
calledWith_: any[];
constructor(config: ServiceObjectConfig, ...args: any[]) {
super(config);
this.calledWith_ = arguments;
this.calledWith_ = args;
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/google-cloud-dns/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"lib": ["es2018", "dom"],
"rootDir": ".",
"outDir": "build"
},
Expand Down

0 comments on commit 6f9709d

Please sign in to comment.