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

Commit a2b6aef

Browse files
JustinBeckwithBenjamin E. Coe
andauthored
build: simplify the build (#858)
Co-authored-by: Benjamin E. Coe <bencoe@google.com>
1 parent e6f76b0 commit a2b6aef

File tree

6 files changed

+54
-102
lines changed

6 files changed

+54
-102
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
"presystem-test": "npm run compile",
3131
"system-test": "mocha build/system-test --timeout 600000",
3232
"test": "cross-env CLOUD_DEBUG_ASSERTIONS=1 mocha build/test",
33-
"precompile": "npm run compile-scripts && node build/scripts/setup-build-dir.js",
3433
"compile": "tsc -p .",
35-
"compile-scripts": "tsc -p scripts-tsconfig.json",
34+
"postcompile": "cpy test/*.js test/**/*.js test/fixtures build --parents",
3635
"fix": "gts fix",
3736
"pretest": "npm run compile",
3837
"prepack": "npm run compile",
@@ -73,6 +72,7 @@
7372
"@types/tmp": "^0.1.0",
7473
"@types/uuid": "^7.0.0",
7574
"codecov": "^3.0.4",
75+
"cpy-cli": "^3.1.0",
7676
"cross-env": "^7.0.0",
7777
"execa": "^4.0.0",
7878
"gts": "^1.0.0",

scripts-tsconfig.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

scripts/setup-build-dir.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414

1515
export declare type Action = 'CAPTURE' | 'LOG';
1616

17-
export declare type Reference = 'UNSPECIFIED' | 'BREAKPOINT_SOURCE_LOCATION' |
18-
'BREAKPOINT_CONDITION' | 'BREAKPOINT_EXPRESSION' | 'BREAKPOINT_AGE' |
19-
'VARIABLE_NAME' | 'VARIABLE_VALUE';
17+
export declare type Reference =
18+
| 'UNSPECIFIED'
19+
| 'BREAKPOINT_SOURCE_LOCATION'
20+
| 'BREAKPOINT_CONDITION'
21+
| 'BREAKPOINT_EXPRESSION'
22+
| 'BREAKPOINT_AGE'
23+
| 'VARIABLE_NAME'
24+
| 'VARIABLE_VALUE';
2025

2126
export interface FormatMessage {
2227
format: string;
@@ -64,16 +69,16 @@ export interface StackFrame {
6469
// Determine if this is actually needed or if the create(d)Time attribute
6570
// should only be a string.
6671
export interface Timestamp {
67-
seconds: string; // int64
68-
nano: string; // int32
72+
seconds: string; // int64
73+
nano: string; // int32
6974
}
7075

7176
export interface Breakpoint {
7277
stackFrames: StackFrame[];
7378
// TODO: Update the code so that `|null` is not needed.
74-
evaluatedExpressions: Array<Variable|null>;
79+
evaluatedExpressions: Array<Variable | null>;
7580
// TODO: Update the code so that `|null` is not needed.
76-
variableTable: Array<Variable|null>;
81+
variableTable: Array<Variable | null>;
7782
id: BreakpointId;
7883
// TODO: The debug code assumes the rest of these members
7984
// are optional. Determine if this is correct.
@@ -96,7 +101,7 @@ export interface Breakpoint {
96101
userEmail?: string;
97102
status?: StatusMessage;
98103
labels?: {
99-
[key: string]: string,
104+
[key: string]: string;
100105
};
101106
}
102107

src/types/v8.d.ts renamed to src/types/v8.ts

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,30 @@
1717

1818
// See https://github.com/v8/v8/blob/master/src/debug/mirrors.js
1919

20-
export declare type MirrorType = 'undefined' | 'null' | 'boolean' | 'number' |
21-
'string' | 'symbol' | 'object' | 'function' | 'regexp' | 'error' |
22-
'property' | 'internalProperty' | 'frame' | 'script' | 'context' | 'scope' |
23-
'promise' | 'map' | 'set' | 'iterator' | 'generator';
20+
// tslint:disable:no-any
21+
22+
export declare type MirrorType =
23+
| 'undefined'
24+
| 'null'
25+
| 'boolean'
26+
| 'number'
27+
| 'string'
28+
| 'symbol'
29+
| 'object'
30+
| 'function'
31+
| 'regexp'
32+
| 'error'
33+
| 'property'
34+
| 'internalProperty'
35+
| 'frame'
36+
| 'script'
37+
| 'context'
38+
| 'scope'
39+
| 'promise'
40+
| 'map'
41+
| 'set'
42+
| 'iterator'
43+
| 'generator';
2444

2545
export interface Mirror {
2646
type: () => MirrorType;
@@ -117,16 +137,14 @@ export interface FrameDetails {
117137
// The code at https://github.com/v8/v8/blob/master/src/debug/mirrors.js
118138
// seems to suggest that these fields should exist. Make sure that is
119139
// the case.
120-
arguments: Array < {
140+
arguments: Array<{
121141
name: string;
122142
value: any;
123-
}
124-
> ;
125-
locals: Array < {
143+
}>;
144+
locals: Array<{
126145
name: string;
127146
value: any;
128-
}
129-
> ;
147+
}>;
130148
break_id_: number;
131149
// TODO: Determine the type of details_ and the methods in this interface
132150
details_: any;
@@ -282,7 +300,9 @@ export interface BreakPoint {
282300
}
283301

284302
// TODO: Add the rest of the methods in this interface
285-
export interface ScriptBreakPoint { number: () => number; }
303+
export interface ScriptBreakPoint {
304+
number: () => number;
305+
}
286306

287307
// TODO: Verify the return types of these methods
288308
export interface BreakEvent {
@@ -308,9 +328,13 @@ export interface Debug {
308328
DebugEvent: DebugEvent;
309329
setListener: (listener: any, opt_data?: any) => void;
310330
clearBreakPoint: (break_point_number: number) => void;
311-
setScriptBreakPointByRegExp:
312-
(script_regexp: RegExp, opt_line?: number, opt_column?: number,
313-
opt_condition?: any, opt_groupId?: number) => number;
331+
setScriptBreakPointByRegExp: (
332+
script_regexp: RegExp,
333+
opt_line?: number,
334+
opt_column?: number,
335+
opt_condition?: any,
336+
opt_groupId?: number
337+
) => number;
314338
findBreakPoint: (break_point_number: number, remove?: boolean) => BreakPoint;
315339
MakeMirror: (value: any) => Mirror;
316340
}

test/test-scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import * as path from 'path';
2020
import * as proxyquire from 'proxyquire';
2121
import * as stream from 'stream';
2222

23-
const fixtureDir = path.join(__dirname, './fixtures');
23+
const fixtureDir = './test/fixtures';
2424
const fixture = (file: string): string => {
2525
return path.join(fixtureDir, file);
2626
};

0 commit comments

Comments
 (0)