Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit a530d1c

Browse files
greenkeeper[bot]DominicKramer
authored andcommitted
Update dependencies to enable Greenkeeper 🌴 (#348)
1 parent cdee56f commit a530d1c

File tree

11 files changed

+93
-88
lines changed

11 files changed

+93
-88
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Stackdriver Debugger agent for Node.js
22

3+
[![Greenkeeper badge](https://badges.greenkeeper.io/GoogleCloudPlatform/cloud-debug-nodejs.svg)](https://greenkeeper.io/)
4+
35
[![NPM Version][npm-image]][npm-url]
46
[![Build Status][travis-image]][travis-url]
57
[![Test Coverage][coveralls-image]][coveralls-url]

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"devDependencies": {
2525
"@types/acorn": "^4.0.2",
2626
"@types/async": "^2.0.40",
27-
"@types/estree": "0.0.35",
28-
"@types/extend": "^2.0.30",
27+
"@types/estree": "0.0.38",
28+
"@types/extend": "^3.0.0",
2929
"@types/lodash": "^4.14.69",
3030
"@types/mkdirp": "^0.5.1",
3131
"@types/mocha": "^2.2.41",
@@ -38,16 +38,16 @@
3838
"@types/source-map": "^0.5.0",
3939
"changelog-maker": "^2.2.2",
4040
"closure-npc": "*",
41-
"coveralls": "^2.11.2",
41+
"coveralls": "^3.0.0",
4242
"gts": "latest",
4343
"istanbul": "^0.4.1",
44-
"mocha": "^3.5.3",
4544
"mkdirp": "^0.5.1",
45+
"mocha": "^4.0.1",
4646
"ncp": "^2.0.0",
4747
"nock": "^9.0.0",
4848
"pify": "^3.0.0",
4949
"request": "^2.81.0",
50-
"source-map-support": "^0.4.15",
50+
"source-map-support": "^0.5.0",
5151
"tslint": "^5.4.3",
5252
"typescript": "~2.6.1"
5353
},
@@ -61,7 +61,7 @@
6161
"gcp-metadata": "^0.4.0",
6262
"lodash": "^4.12.0",
6363
"semver": "^5.1.0",
64-
"source-map": "^0.5.1",
64+
"source-map": "^0.6.1",
6565
"split": "^1.0.0",
6666
"util.promisify": "^1.0.0"
6767
},

src/agent/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import * as common from '../types/common';
1818

1919
export interface DebugAgentConfig extends common.AuthenticationConfig {
20-
workingDirectory?: string;
20+
workingDirectory: string;
2121

2222
/**
2323
* A user specified way of identifying the service

src/agent/debuglet.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,20 +423,17 @@ export class Debuglet extends EventEmitter {
423423

424424
static getProjectIdFromMetadata() {
425425
return new Promise<string>((resolve, reject) => {
426-
metadata.project(
427-
'project-id', (err, res, projectId) => {
428-
err ? reject(err) : resolve(projectId);
429-
});
426+
metadata.project('project-id', (err, res, projectId) => {
427+
err ? reject(err) : resolve(projectId);
428+
});
430429
});
431430
}
432431

433432
static getClusterNameFromMetadata() {
434433
return new Promise<string>((resolve, reject) => {
435-
metadata.instance(
436-
'attributes/cluster-name',
437-
(err, res, clusterName) => {
438-
err ? reject(err) : resolve(clusterName);
439-
});
434+
metadata.instance('attributes/cluster-name', (err, res, clusterName) => {
435+
err ? reject(err) : resolve(clusterName);
436+
});
440437
});
441438
}
442439

src/agent/io/scanner.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ function computeStats(
150150
const statistics: ScanStats = {};
151151
fileList.forEach(function(filename) {
152152
statsForFile(
153-
filename, shouldHash,
154-
function(err: Error|null, fileStats?: FileStats) {
153+
filename, shouldHash, function(err: Error|null, fileStats?: FileStats) {
155154
if (err) {
156155
callback(err);
157156
return;

src/agent/io/sourcemapper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ function processSourcemap(
6666
// TODO: Determine how to reconsile the type conflict where `consumer`
6767
// is constructed as a SourceMapConsumer but is used as a
6868
// RawSourceMap.
69-
consumer = new sourceMap.SourceMapConsumer(data) as any as
69+
// TODO: Resolve the cast of `data as any` (This is needed because the
70+
// type is expected to be of `RawSourceMap` but the existing
71+
// working code uses a string.)
72+
consumer = new sourceMap.SourceMapConsumer(data as any) as any as
7073
sourceMap.RawSourceMap;
7174
} catch (e) {
7275
return callback(new Error(

src/agent/state/legacy-state.ts

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -397,26 +397,27 @@ class StateResolver {
397397
scopes = allScopes.slice(0, -2);
398398
}
399399

400-
const fromScopes: stackdriver.Variable[][] = scopes.map(function(scope: v8.ScopeMirror) {
401-
return transform(
402-
// TODO: Update this so that `locals` is not of type `any[]`.
403-
scope.details().object(),
404-
function(locals: stackdriver.Variable[], value, name: string) {
405-
const trg = makeMirror(value);
406-
if (!usedNames[name]) {
407-
// It's a valid variable that belongs in the locals list
408-
// and wasn't discovered at a lower-scope
409-
usedNames[name] = true;
410-
// TODO: Determine how to not have an explicit down cast to
411-
// ValueMirror
412-
locals.push(self.resolveVariable_(
413-
name, trg as v8.ValueMirror, false));
414-
} // otherwise another same-named variable occured at a
415-
// lower scope
416-
return locals;
417-
},
418-
[]);
419-
});
400+
const fromScopes: stackdriver.Variable[][] =
401+
scopes.map(function(scope: v8.ScopeMirror) {
402+
return transform(
403+
// TODO: Update this so that `locals` is not of type `any[]`.
404+
scope.details().object(),
405+
function(locals: stackdriver.Variable[], value, name: string) {
406+
const trg = makeMirror(value);
407+
if (!usedNames[name]) {
408+
// It's a valid variable that belongs in the locals list
409+
// and wasn't discovered at a lower-scope
410+
usedNames[name] = true;
411+
// TODO: Determine how to not have an explicit down cast to
412+
// ValueMirror
413+
locals.push(self.resolveVariable_(
414+
name, trg as v8.ValueMirror, false));
415+
} // otherwise another same-named variable occured at a
416+
// lower scope
417+
return locals;
418+
},
419+
[]);
420+
});
420421

421422
function resolveFromReceiver(): stackdriver.Variable[] {
422423
// The frame receiver is the 'this' context that is present during

src/types/common.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ export interface AuthenticationConfig {
4747
/**
4848
* Instead of a keyFilename, credentials can also be provided inline.
4949
*/
50-
credentials?: {client_email?: string; private_key?: string;};
50+
credentials?: {
51+
client_email?: string;
52+
private_key?: string;
53+
client_id?: string;
54+
client_secret?: string;
55+
refresh_token?: string;
56+
type?: string;
57+
};
5158
}
5259

5360
export interface ServiceConfig {

test/test-controller.ts

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,13 @@ describe('Controller API', function() {
5656
});
5757
const controller = new Controller(fakeDebug);
5858
// TODO: Determine if this type signature is correct.
59-
controller.register(
60-
debuggee, function(err, result) {
61-
assert(!err, 'not expecting an error');
62-
assert.ok(result);
63-
assert.equal(result!.debuggee.id, 'fake-debuggee');
64-
scope.done();
65-
done();
66-
});
59+
controller.register(debuggee, function(err, result) {
60+
assert(!err, 'not expecting an error');
61+
assert.ok(result);
62+
assert.equal(result!.debuggee.id, 'fake-debuggee');
63+
scope.done();
64+
done();
65+
});
6766
});
6867

6968
it('should not return an error when the debuggee isDisabled',
@@ -79,16 +78,15 @@ describe('Controller API', function() {
7978
agentVersion: agentVersion
8079
});
8180
const controller = new Controller(fakeDebug);
82-
controller.register(
83-
debuggee, function(err, result) {
84-
// TODO: Fix this incorrect method signature.
85-
(assert as any).ifError(err, 'not expecting an error');
86-
assert.ok(result);
87-
assert.equal(result!.debuggee.id, 'fake-debuggee');
88-
assert.ok(result!.debuggee.isDisabled);
89-
scope.done();
90-
done();
91-
});
81+
controller.register(debuggee, function(err, result) {
82+
// TODO: Fix this incorrect method signature.
83+
(assert as any).ifError(err, 'not expecting an error');
84+
assert.ok(result);
85+
assert.equal(result!.debuggee.id, 'fake-debuggee');
86+
assert.ok(result!.debuggee.isDisabled);
87+
scope.done();
88+
done();
89+
});
9290
});
9391

9492
});
@@ -231,17 +229,15 @@ describe('Controller API', function() {
231229
const debuggee: Debuggee = {id: 'fake-debuggee'} as Debuggee;
232230
const controller = new Controller(fakeDebug);
233231
// TODO: Determine if the response parameter should be used.
234-
controller.listBreakpoints(
235-
debuggee,
236-
function(err, response, result) {
237-
assert(!err, 'not expecting an error');
238-
assert.ok(result);
239-
assert(result!.breakpoints, 'should have a breakpoints property');
240-
const bps = result!.breakpoints;
241-
assert.deepEqual(bps, breakpoints, 'breakpoints mismatch');
242-
scope.done();
243-
done();
244-
});
232+
controller.listBreakpoints(debuggee, function(err, response, result) {
233+
assert(!err, 'not expecting an error');
234+
assert.ok(result);
235+
assert(result!.breakpoints, 'should have a breakpoints property');
236+
const bps = result!.breakpoints;
237+
assert.deepEqual(bps, breakpoints, 'breakpoints mismatch');
238+
scope.done();
239+
done();
240+
});
245241
});
246242
});
247243
});

test/test-debuglet.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -354,23 +354,23 @@ describe('Debuglet', function() {
354354
debuggee: {id: DEBUGGEE_ID}
355355
});
356356

357-
debuglet.once('registered', function(id: string) {
358-
assert.equal(id, DEBUGGEE_ID);
359-
// TODO: Handle the case where debuglet.debuggee is undefined
360-
assert.equal((debuglet.debuggee as Debuggee).project, projectId);
361-
const arch = process.arch;
362-
if (semver.satisfies(process.version, '>=8.5.0') &&
363-
semver.satisfies(process.version, '<8.9.0') &&
364-
(arch === 'ia32' || arch === 'x86') &&
365-
process.env.GCLOUD_USE_INSPECTOR) {
366-
assert(logText.includes(utils.messages.ASYNC_TRACES_WARNING));
367-
} else {
368-
assert(!logText.includes(utils.messages.ASYNC_TRACES_WARNING));
369-
}
370-
debuglet.stop();
371-
scope.done();
372-
done();
373-
});
357+
debuglet.once('registered', function(id: string) {
358+
assert.equal(id, DEBUGGEE_ID);
359+
// TODO: Handle the case where debuglet.debuggee is undefined
360+
assert.equal((debuglet.debuggee as Debuggee).project, projectId);
361+
const arch = process.arch;
362+
if (semver.satisfies(process.version, '>=8.5.0') &&
363+
semver.satisfies(process.version, '<8.9.0') &&
364+
(arch === 'ia32' || arch === 'x86') &&
365+
process.env.GCLOUD_USE_INSPECTOR) {
366+
assert(logText.includes(utils.messages.ASYNC_TRACES_WARNING));
367+
} else {
368+
assert(!logText.includes(utils.messages.ASYNC_TRACES_WARNING));
369+
}
370+
debuglet.stop();
371+
scope.done();
372+
done();
373+
});
374374

375375
debuglet.start();
376376
});
@@ -441,7 +441,7 @@ describe('Debuglet', function() {
441441
});
442442

443443
describe('environment variables', function() {
444-
let env: {[key: string]: string};
444+
let env: NodeJS.ProcessEnv;
445445
beforeEach(function() {
446446
env = extend({}, process.env);
447447
});

0 commit comments

Comments
 (0)