Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

build!: update to latest version of gts and typescript #433

Merged
merged 10 commits into from
Apr 15, 2020
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

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/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a newline at the end to get rid of the squiggle

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

9 changes: 6 additions & 3 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-compute",
"main": "./src/index.js",
Expand Down Expand Up @@ -54,14 +54,17 @@
"eslint-config-prettier": "^6.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete all the eslint- packages, and the prettier package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JustinBeckwith! Just want to make sure I'm understanding correctly. Did you want me to delete .eslintignore, .eslintrc.json, .prettierignore and .prettierrc.js? I was using this PR as reference, I know Ben left those there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh noes! Leave those files. I'm saying the package references in the devDependencies section of package.json. Those are transitive dependencies of gts, so we can delete em from here.

Keep all the files!

"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prettier": "^3.0.0",
"gts": "^2.0.0-alpha.5",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can drop the -alpha.5 part here since 2.0 is out

"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",
"c8": "^7.0.0",
"chai": "^4.2.0",
sofisl marked this conversation as resolved.
Show resolved Hide resolved
"prettier": "^1.13.5",
"proxyquire": "^2.0.1",
"uuid": "^7.0.0"
"uuid": "^7.0.0",
"typescript": "^3.8.3"
}
}
2 changes: 1 addition & 1 deletion samples/deleteVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function main(
const vm = zone.vm(name);
const [operation] = await vm.delete();
await operation.promise();
console.log(`VM deleted!`);
console.log('VM deleted!');
}
deleteVM();
// [END gce_delete_vm]
Expand Down
3 changes: 2 additions & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "Google Inc.",
"repository": "googleapis/nodejs-compute",
"files": [
"*.js"
"*.js",
"!test/"
],
"engines": {
"node": ">=8"
Expand Down
28 changes: 14 additions & 14 deletions samples/test/mailjet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,41 @@

'use strict';

const proxyquire = require(`proxyquire`).noPreserveCache();
const proxyquire = require('proxyquire').noPreserveCache();
const assert = require('assert');

process.env.MAILJET_API_KEY = `foo`;
process.env.MAILJET_API_SECRET = `bar`;
process.env.MAILJET_API_KEY = 'foo';
process.env.MAILJET_API_SECRET = 'bar';

describe('mailjet', () => {
it('should send an email', () => {
proxyquire(`../mailjet`, {
proxyquire('../mailjet', {
nodemailer: {
createTransport: arg => {
assert.strictEqual(arg, `test`);
assert.strictEqual(arg, 'test');
return {
sendMail: payload => {
assert.deepStrictEqual(payload, {
from: `ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM`,
to: `EMAIL@EXAMPLE.COM`,
subject: `test email from Node.js on Google Cloud Platform`,
text: `Hello!\n\nThis a test email from Node.js.`,
from: 'ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM',
to: 'EMAIL@EXAMPLE.COM',
subject: 'test email from Node.js on Google Cloud Platform',
text: 'Hello!\n\nThis a test email from Node.js.',
});
return `done`;
return 'done';
},
};
},
},
'nodemailer-smtp-transport': options => {
assert.deepStrictEqual(options, {
host: `in.mailjet.com`,
host: 'in.mailjet.com',
port: 2525,
auth: {
user: `foo`,
pass: `bar`,
user: 'foo',
pass: 'bar',
},
});
return `test`;
return 'test';
},
});
});
Expand Down
6 changes: 3 additions & 3 deletions samples/test/sendgrid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
const proxyquire = require('proxyquire');
const {assert} = require('chai');

process.env.SENDGRID_API_KEY = `foo`;
process.env.SENDGRID_API_KEY = 'foo';

describe('sendgrid', () => {
it('should send an email', () => {
proxyquire(`../sendgrid`, {
proxyquire('../sendgrid', {
'@sendgrid/mail': {
setApiKey: key => {
assert.strictEqual(key, `foo`);
assert.strictEqual(key, 'foo');
},
send: msg => {
assert.deepStrictEqual(msg, {
Expand Down
2 changes: 1 addition & 1 deletion src/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Address extends common.ServiceObject {
method: 'DELETE',
uri: '',
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/autoscaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class Autoscaler extends common.ServiceObject {
delete(callback) {
callback = callback || common.util.noop;
const zone = this.zone;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -285,7 +285,7 @@ class Autoscaler extends common.ServiceObject {
},
json: metadata,
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/disk.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Disk extends common.ServiceObject {
name: name,
}),
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, null, resp);
return;
Expand Down Expand Up @@ -293,7 +293,7 @@ class Disk extends common.ServiceObject {
delete(callback) {
const zone = this.zone;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/firewall.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class Firewall extends common.ServiceObject {
delete(callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -273,7 +273,7 @@ class Firewall extends common.ServiceObject {
uri: '',
json: metadata,
},
function(err, resp) {
(err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/health-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class HealthCheck extends common.ServiceObject {
delete(callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down Expand Up @@ -273,7 +273,7 @@ class HealthCheck extends common.ServiceObject {
setMetadata(metadata, callback) {
const compute = this.compute;
callback = callback || common.util.noop;
super.setMetadata(metadata, function(err, resp) {
super.setMetadata(metadata, (err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class Image extends common.ServiceObject {
delete(callback) {
const compute = this.parent;
callback = callback || common.util.noop;
super.delete(function(err, resp) {
super.delete((err, resp) => {
if (err) {
callback(err, null, resp);
return;
Expand Down
Loading