roku-debug 0.8.4 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/ChanperfTracker.js +8 -10
- package/dist/ChanperfTracker.js.map +1 -1
- package/dist/CompileErrorProcessor.d.ts +2 -1
- package/dist/CompileErrorProcessor.js +7 -5
- package/dist/CompileErrorProcessor.js.map +1 -1
- package/dist/ComponentLibraryServer.js +1 -0
- package/dist/ComponentLibraryServer.js.map +1 -1
- package/dist/FileUtils.d.ts +2 -2
- package/dist/FileUtils.js +4 -4
- package/dist/FileUtils.js.map +1 -1
- package/dist/LaunchConfiguration.d.ts +5 -0
- package/dist/PrintedObjectParser.js +1 -0
- package/dist/PrintedObjectParser.js.map +1 -1
- package/dist/RendezvousTracker.js +6 -8
- package/dist/RendezvousTracker.js.map +1 -1
- package/dist/SceneGraphDebugCommandController.d.ts +1 -0
- package/dist/SceneGraphDebugCommandController.js +14 -7
- package/dist/SceneGraphDebugCommandController.js.map +1 -1
- package/dist/adapters/DebugProtocolAdapter.d.ts +7 -15
- package/dist/adapters/DebugProtocolAdapter.js +32 -30
- package/dist/adapters/DebugProtocolAdapter.js.map +1 -1
- package/dist/adapters/TelnetAdapter.d.ts +11 -58
- package/dist/adapters/TelnetAdapter.js +262 -382
- package/dist/adapters/TelnetAdapter.js.map +1 -1
- package/dist/adapters/TelnetRequestPipeline.d.ts +51 -0
- package/dist/adapters/TelnetRequestPipeline.js +229 -0
- package/dist/adapters/TelnetRequestPipeline.js.map +1 -0
- package/dist/debugProtocol/Constants.js +1 -0
- package/dist/debugProtocol/Constants.js.map +1 -1
- package/dist/debugProtocol/Debugger.d.ts +9 -8
- package/dist/debugProtocol/Debugger.js +33 -28
- package/dist/debugProtocol/Debugger.js.map +1 -1
- package/dist/debugProtocol/responses/ConnectIOPortResponse.js +1 -0
- package/dist/debugProtocol/responses/ConnectIOPortResponse.js.map +1 -1
- package/dist/debugProtocol/responses/HandshakeResponse.js +1 -0
- package/dist/debugProtocol/responses/HandshakeResponse.js.map +1 -1
- package/dist/debugProtocol/responses/Response.js +1 -0
- package/dist/debugProtocol/responses/Response.js.map +1 -1
- package/dist/debugProtocol/responses/StackTraceResponse.js +1 -0
- package/dist/debugProtocol/responses/StackTraceResponse.js.map +1 -1
- package/dist/debugProtocol/responses/ThreadsResponse.js +1 -0
- package/dist/debugProtocol/responses/ThreadsResponse.js.map +1 -1
- package/dist/debugProtocol/responses/UndefinedResponse.js +1 -0
- package/dist/debugProtocol/responses/UndefinedResponse.js.map +1 -1
- package/dist/debugProtocol/responses/UpdateThreadsResponse.js +1 -0
- package/dist/debugProtocol/responses/UpdateThreadsResponse.js.map +1 -1
- package/dist/debugProtocol/responses/VariableResponse.d.ts +1 -1
- package/dist/debugProtocol/responses/VariableResponse.js +1 -0
- package/dist/debugProtocol/responses/VariableResponse.js.map +1 -1
- package/dist/debugProtocol/responses/index.js +18 -11
- package/dist/debugProtocol/responses/index.js.map +1 -1
- package/dist/debugSession/BrightScriptDebugSession.d.ts +12 -9
- package/dist/debugSession/BrightScriptDebugSession.js +114 -92
- package/dist/debugSession/BrightScriptDebugSession.js.map +1 -1
- package/dist/debugSession/Events.js +1 -0
- package/dist/debugSession/Events.js.map +1 -1
- package/dist/index.js +26 -18
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +11 -0
- package/dist/interfaces.js +16 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/logging.d.ts +11 -0
- package/dist/logging.js +14 -0
- package/dist/logging.js.map +1 -0
- package/dist/managers/BreakpointManager.js +4 -4
- package/dist/managers/BreakpointManager.js.map +1 -1
- package/dist/managers/FileManager.d.ts +2 -1
- package/dist/managers/FileManager.js +9 -6
- package/dist/managers/FileManager.js.map +1 -1
- package/dist/managers/LocationManager.js +8 -7
- package/dist/managers/LocationManager.js.map +1 -1
- package/dist/managers/ProjectManager.d.ts +2 -0
- package/dist/managers/ProjectManager.js +14 -11
- package/dist/managers/ProjectManager.js.map +1 -1
- package/dist/managers/SourceMapManager.d.ts +1 -0
- package/dist/managers/SourceMapManager.js +9 -8
- package/dist/managers/SourceMapManager.js.map +1 -1
- package/dist/util.d.ts +50 -14
- package/dist/util.js +136 -75
- package/dist/util.js.map +1 -1
- package/package.json +52 -40
- package/roku-debug-0.9.0.tgz +0 -0
- package/roku-debug-0.8.4.tgz +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceMapManager = void 0;
|
|
3
4
|
const fsExtra = require("fs-extra");
|
|
4
|
-
const util_1 = require("../util");
|
|
5
5
|
const source_map_1 = require("source-map");
|
|
6
6
|
const FileUtils_1 = require("../FileUtils");
|
|
7
7
|
const path = require("path");
|
|
8
|
+
const logging_1 = require("../logging");
|
|
8
9
|
/**
|
|
9
10
|
* Unifies access to source files across the whole project
|
|
10
11
|
*/
|
|
11
12
|
class SourceMapManager {
|
|
12
13
|
constructor() {
|
|
14
|
+
this.logger = logging_1.logger.createLogger(`[${SourceMapManager.name}]`);
|
|
13
15
|
/**
|
|
14
16
|
* Store all paths in lower case since Roku is case-insensitive.
|
|
15
17
|
* If the file existed, but something failed during parsing, this will be set to null.
|
|
@@ -23,7 +25,7 @@ class SourceMapManager {
|
|
|
23
25
|
* then falls back to the file system if not in the cache
|
|
24
26
|
*/
|
|
25
27
|
sourceMapExists(sourceMapPath) {
|
|
26
|
-
let key = FileUtils_1.standardizePath `${sourceMapPath.toLowerCase()}`;
|
|
28
|
+
let key = (0, FileUtils_1.standardizePath) `${sourceMapPath.toLowerCase()}`;
|
|
27
29
|
let map = this.cache[key];
|
|
28
30
|
if (map !== undefined && map !== null) {
|
|
29
31
|
return true;
|
|
@@ -35,16 +37,15 @@ class SourceMapManager {
|
|
|
35
37
|
* Get a parsed source map, with all of its paths already resolved
|
|
36
38
|
*/
|
|
37
39
|
async getSourceMap(sourceMapPath) {
|
|
38
|
-
let key = FileUtils_1.standardizePath `${sourceMapPath.toLowerCase()}`;
|
|
40
|
+
let key = (0, FileUtils_1.standardizePath) `${sourceMapPath.toLowerCase()}`;
|
|
39
41
|
if (this.cache[key] === undefined) {
|
|
40
|
-
let parsedSourceMap;
|
|
41
42
|
if (await fsExtra.pathExists(sourceMapPath)) {
|
|
42
43
|
try {
|
|
43
44
|
let contents = (await fsExtra.readFile(sourceMapPath)).toString();
|
|
44
45
|
this.set(sourceMapPath, contents);
|
|
45
46
|
}
|
|
46
47
|
catch (e) {
|
|
47
|
-
|
|
48
|
+
this.logger.error(`Error loading or parsing source map for '${sourceMapPath}'`, e);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -55,7 +56,7 @@ class SourceMapManager {
|
|
|
55
56
|
* and resolve the sources list to absolute paths
|
|
56
57
|
*/
|
|
57
58
|
set(sourceMapPath, sourceMap) {
|
|
58
|
-
let key = FileUtils_1.standardizePath `${sourceMapPath.toLowerCase()}`;
|
|
59
|
+
let key = (0, FileUtils_1.standardizePath) `${sourceMapPath.toLowerCase()}`;
|
|
59
60
|
try {
|
|
60
61
|
let parsedSourceMap = JSON.parse(sourceMap);
|
|
61
62
|
//remove the file from cache
|
|
@@ -145,8 +146,8 @@ class SourceMapManager {
|
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
|
-
catch (
|
|
149
|
-
|
|
149
|
+
catch (error) {
|
|
150
|
+
this.logger.error('Error converting source location to staging location', { error });
|
|
150
151
|
}
|
|
151
152
|
}));
|
|
152
153
|
return locations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceMapManager.js","sourceRoot":"","sources":["../../src/managers/SourceMapManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SourceMapManager.js","sourceRoot":"","sources":["../../src/managers/SourceMapManager.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AAGpC,2CAA+C;AAC/C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/C,IAAI,QAAQ,GAAG,MAAM,8BAAiB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;wBAC5E,OAAO,QAAQ,CAAC,oBAAoB,CAAC;4BACjC,IAAI,EAAE,cAAc,CAAC,UAAU;4BAC/B,MAAM,EAAE,cAAc,CAAC,WAAW;4BAClC,MAAM,EAAE,qBAAS,CAAC,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;4BAC1D,kEAAkE;4BAClE,IAAI,EAAE,8BAAiB,CAAC,iBAAiB;yBAC5C,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;oBAEH,IAAI,QAAQ,EAAE;wBACV,SAAS,CAAC,IAAI,CAAC;4BACX,UAAU,EAAE,QAAQ,CAAC,IAAI;4BACzB,WAAW,EAAE,QAAQ,CAAC,MAAM;4BAC5B,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;yBACjD,CAAC,CAAC;qBACN;iBACJ;aACJ;YAAC,OAAO,KAAK,EAAE;gBACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sDAAsD,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;aACxF;QACL,CAAC,CAAC,CAAC,CAAC;QACJ,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAtJD,4CAsJC"}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SmartBuffer } from 'smart-buffer';
|
|
2
2
|
import type { BrightScriptDebugSession } from './debugSession/BrightScriptDebugSession';
|
|
3
|
-
import type { Position, Range } from '
|
|
3
|
+
import type { Position, Range } from 'brighterscript';
|
|
4
4
|
import type { BrightScriptDebugCompileError } from './CompileErrorProcessor';
|
|
5
5
|
declare class Util {
|
|
6
6
|
/**
|
|
@@ -42,13 +42,6 @@ declare class Util {
|
|
|
42
42
|
* @param port target port to check
|
|
43
43
|
*/
|
|
44
44
|
isPortInUse(port: number): Promise<boolean>;
|
|
45
|
-
/**
|
|
46
|
-
* With return the differences in two objects
|
|
47
|
-
* @param obj1 base target
|
|
48
|
-
* @param obj2 comparison target
|
|
49
|
-
* @param exclude fields to exclude in the comparison
|
|
50
|
-
*/
|
|
51
|
-
objectDiff(obj1: Record<string, any>, obj2: Record<string, any>, exclude?: string[]): {};
|
|
52
45
|
/**
|
|
53
46
|
* Tries to read a string from the buffer and will throw an error if there is no null terminator.
|
|
54
47
|
* @param {SmartBuffer} bufferReader
|
|
@@ -58,10 +51,6 @@ declare class Util {
|
|
|
58
51
|
* A reference to the current debug session. Used for logging, and set in the debug session constructor
|
|
59
52
|
*/
|
|
60
53
|
_debugSession: BrightScriptDebugSession;
|
|
61
|
-
/**
|
|
62
|
-
* Send debug server messages to the BrightScript Debug Log channel, as well as writing to console.debug
|
|
63
|
-
*/
|
|
64
|
-
logDebug(...args: any[]): void;
|
|
65
54
|
/**
|
|
66
55
|
* Write to the standard brightscript output log so users can see it. (This also writes to the debug server output channel, and the console)
|
|
67
56
|
* @param message
|
|
@@ -80,7 +69,54 @@ declare class Util {
|
|
|
80
69
|
* @param position
|
|
81
70
|
*/
|
|
82
71
|
rangeContains(range: Range, position: Position): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Ensures that all roku-emitted beacons are entirely on their own lines
|
|
74
|
+
*/
|
|
75
|
+
ensureDebugPromptOnOwnLine(text: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Does the string end with the "Brightscript Debugger>" prompt?
|
|
78
|
+
* @param responseText
|
|
79
|
+
*/
|
|
80
|
+
endsWithDebuggerPrompt(text: string): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Does the string end with the "thread attached......" text, ignoring trailing whitespace.
|
|
83
|
+
* explanation: https://regex101.com/r/pN6grB/1
|
|
84
|
+
*/
|
|
85
|
+
endsWithThreadAttachedText(text: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Remove those pesky "Thread attached" messages and the debugger prompt following them.
|
|
88
|
+
* explanation: https://regex101.com/r/OwAWdw/4
|
|
89
|
+
*/
|
|
90
|
+
removeThreadAttachedText(text: string): string;
|
|
83
91
|
filterGenericErrors(errors: BrightScriptDebugCompileError[]): BrightScriptDebugCompileError[];
|
|
92
|
+
/**
|
|
93
|
+
* Look up the ip address for a hostname. This is cached for the lifetime of the app, or bypassed with the `skipCache` parameter
|
|
94
|
+
* @param host
|
|
95
|
+
* @param skipCache
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
dnsLookup(host: string, skipCache?: boolean): Promise<string>;
|
|
99
|
+
private dnsCache;
|
|
100
|
+
/**
|
|
101
|
+
* Sleep for the given number of milliseconds
|
|
102
|
+
* @param milliseconds
|
|
103
|
+
* @returns
|
|
104
|
+
*/
|
|
105
|
+
sleep(milliseconds: number): Promise<unknown>;
|
|
106
|
+
fence(data: string): string;
|
|
107
|
+
}
|
|
108
|
+
export declare function defer<T>(): {
|
|
109
|
+
promise: Promise<T>;
|
|
110
|
+
resolve: (value?: PromiseLike<T> | T) => void;
|
|
111
|
+
reject: (reason?: any) => void;
|
|
112
|
+
isResolved: boolean;
|
|
113
|
+
isRejected: boolean;
|
|
114
|
+
readonly isCompleted: boolean;
|
|
115
|
+
};
|
|
116
|
+
export declare const util: Util;
|
|
117
|
+
export interface Deferred<T> {
|
|
118
|
+
promise: Promise<T>;
|
|
119
|
+
resolve(value?: T): any;
|
|
120
|
+
reject(error?: any): any;
|
|
84
121
|
}
|
|
85
|
-
|
|
86
|
-
export { util };
|
|
122
|
+
export {};
|
package/dist/util.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
exports.util = exports.defer = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const fsExtra = require("fs-extra");
|
|
6
6
|
const net = require("net");
|
|
7
7
|
const url = require("url");
|
|
8
8
|
const Events_1 = require("./debugSession/Events");
|
|
9
9
|
const CompileErrorProcessor_1 = require("./CompileErrorProcessor");
|
|
10
|
+
const serialize_error_1 = require("serialize-error");
|
|
11
|
+
const dns = require("dns");
|
|
10
12
|
class Util {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.dnsCache = new Map();
|
|
15
|
+
}
|
|
11
16
|
/**
|
|
12
17
|
* If the path does not have a trailing slash, one is appended to it
|
|
13
18
|
* @param dirPath
|
|
@@ -108,52 +113,6 @@ class Util {
|
|
|
108
113
|
.listen(port);
|
|
109
114
|
});
|
|
110
115
|
}
|
|
111
|
-
/**
|
|
112
|
-
* With return the differences in two objects
|
|
113
|
-
* @param obj1 base target
|
|
114
|
-
* @param obj2 comparison target
|
|
115
|
-
* @param exclude fields to exclude in the comparison
|
|
116
|
-
*/
|
|
117
|
-
objectDiff(obj1, obj2, exclude) {
|
|
118
|
-
let r = {};
|
|
119
|
-
if (!exclude) {
|
|
120
|
-
exclude = [];
|
|
121
|
-
}
|
|
122
|
-
for (let prop in obj1) {
|
|
123
|
-
if (obj1.hasOwnProperty(prop) && prop !== '__proto__') {
|
|
124
|
-
if (!exclude.includes(obj1[prop])) {
|
|
125
|
-
// check if obj2 has prop
|
|
126
|
-
if (!obj2.hasOwnProperty(prop)) {
|
|
127
|
-
r[prop] = obj1[prop];
|
|
128
|
-
}
|
|
129
|
-
else if (obj1[prop] === Object(obj1[prop])) {
|
|
130
|
-
let difference = this.objectDiff(obj1[prop], obj2[prop]);
|
|
131
|
-
if (Object.keys(difference).length > 0) {
|
|
132
|
-
r[prop] = difference;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else if (obj1[prop] !== obj2[prop]) {
|
|
136
|
-
if (obj1[prop] === undefined) {
|
|
137
|
-
r[prop] = 'undefined';
|
|
138
|
-
}
|
|
139
|
-
if (obj1[prop] === null) {
|
|
140
|
-
r[prop] = null;
|
|
141
|
-
}
|
|
142
|
-
else if (typeof obj1[prop] === 'function') {
|
|
143
|
-
r[prop] = 'function';
|
|
144
|
-
}
|
|
145
|
-
else if (typeof obj1[prop] === 'object') {
|
|
146
|
-
r[prop] = 'object';
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
r[prop] = obj1[prop];
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return r;
|
|
156
|
-
}
|
|
157
116
|
/**
|
|
158
117
|
* Tries to read a string from the buffer and will throw an error if there is no null terminator.
|
|
159
118
|
* @param {SmartBuffer} bufferReader
|
|
@@ -173,37 +132,11 @@ class Util {
|
|
|
173
132
|
}
|
|
174
133
|
return bufferReader.readStringNT();
|
|
175
134
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Send debug server messages to the BrightScript Debug Log channel, as well as writing to console.debug
|
|
178
|
-
*/
|
|
179
|
-
logDebug(...args) {
|
|
180
|
-
args = Array.isArray(args) ? args : [];
|
|
181
|
-
let timestamp = dateFormat(new Date(), 'HH:mm:ss.l ');
|
|
182
|
-
let messages = [];
|
|
183
|
-
for (let arg of args) {
|
|
184
|
-
if (arg instanceof Error) {
|
|
185
|
-
messages.push(JSON.stringify({
|
|
186
|
-
message: arg.message,
|
|
187
|
-
name: arg.name,
|
|
188
|
-
stack: arg.stack.toString()
|
|
189
|
-
}, null, 4));
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
messages.push(arg.toString());
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
let text = messages.join(', ');
|
|
196
|
-
if (this._debugSession) {
|
|
197
|
-
this._debugSession.sendEvent(new Events_1.DebugServerLogOutputEvent(`${timestamp}: ${text}`));
|
|
198
|
-
}
|
|
199
|
-
console.log(timestamp, ...args);
|
|
200
|
-
}
|
|
201
135
|
/**
|
|
202
136
|
* Write to the standard brightscript output log so users can see it. (This also writes to the debug server output channel, and the console)
|
|
203
137
|
* @param message
|
|
204
138
|
*/
|
|
205
139
|
log(message) {
|
|
206
|
-
this.logDebug(message);
|
|
207
140
|
if (this._debugSession) {
|
|
208
141
|
this._debugSession.sendEvent(new Events_1.LogOutputEvent(`DebugServer: ${message}`));
|
|
209
142
|
}
|
|
@@ -237,6 +170,68 @@ class Util {
|
|
|
237
170
|
}
|
|
238
171
|
return true;
|
|
239
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Ensures that all roku-emitted beacons are entirely on their own lines
|
|
175
|
+
*/
|
|
176
|
+
ensureDebugPromptOnOwnLine(text) {
|
|
177
|
+
const regexp = /^((.*?)Brightscript\s+Debugger>\s*)(.*?)$/gm;
|
|
178
|
+
let match;
|
|
179
|
+
const splitIndexes = [];
|
|
180
|
+
// eslint-disable-next-line no-cond-assign
|
|
181
|
+
while (match = regexp.exec(text)) {
|
|
182
|
+
const leadingAndBeaconText = match[1];
|
|
183
|
+
const leadingText = match[2];
|
|
184
|
+
const trailingText = match[3];
|
|
185
|
+
//if there is text before the beacon, split the line
|
|
186
|
+
if (leadingText.length > 0) {
|
|
187
|
+
splitIndexes.push(match.index + leadingText.length);
|
|
188
|
+
}
|
|
189
|
+
//if there is text after the beacon, split the line
|
|
190
|
+
if (trailingText.length > 0) {
|
|
191
|
+
splitIndexes.push(match.index + leadingAndBeaconText.length);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
let result = text;
|
|
195
|
+
//inject newlines between each split index
|
|
196
|
+
for (let i = splitIndexes.length - 1; i >= 0; i--) {
|
|
197
|
+
const index = splitIndexes[i];
|
|
198
|
+
result = result.substring(0, index) + '\n' + result.substring(index);
|
|
199
|
+
}
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Does the string end with the "Brightscript Debugger>" prompt?
|
|
204
|
+
* @param responseText
|
|
205
|
+
*/
|
|
206
|
+
endsWithDebuggerPrompt(text) {
|
|
207
|
+
let match = /Brightscript\s+Debugger>\s*$/im.exec(text.trim());
|
|
208
|
+
return !!match;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Does the string end with the "thread attached......" text, ignoring trailing whitespace.
|
|
212
|
+
* explanation: https://regex101.com/r/pN6grB/1
|
|
213
|
+
*/
|
|
214
|
+
endsWithThreadAttachedText(text) {
|
|
215
|
+
if (/thread\s+attached\s*:.*?\(\d*\).*?[\r\n\s]*$/i.exec(text)) {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Remove those pesky "Thread attached" messages and the debugger prompt following them.
|
|
224
|
+
* explanation: https://regex101.com/r/OwAWdw/4
|
|
225
|
+
*/
|
|
226
|
+
removeThreadAttachedText(text) {
|
|
227
|
+
const match = /^([\r\n\s]*thread\s+attached\s*:.*?\(\d*\).*?[\r\n\s]*brightscript\s*debugger>\s*)+/i.exec(text);
|
|
228
|
+
if (match) {
|
|
229
|
+
return text.substring(match[0].length);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
return text;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
240
235
|
filterGenericErrors(errors) {
|
|
241
236
|
const specificErrors = {};
|
|
242
237
|
//ignore generic errors when a specific error exists
|
|
@@ -253,7 +248,73 @@ class Util {
|
|
|
253
248
|
return true;
|
|
254
249
|
});
|
|
255
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Look up the ip address for a hostname. This is cached for the lifetime of the app, or bypassed with the `skipCache` parameter
|
|
253
|
+
* @param host
|
|
254
|
+
* @param skipCache
|
|
255
|
+
* @returns
|
|
256
|
+
*/
|
|
257
|
+
async dnsLookup(host, skipCache = false) {
|
|
258
|
+
var _a;
|
|
259
|
+
if (!this.dnsCache.has(host) || skipCache) {
|
|
260
|
+
const result = await dns.promises.lookup(host);
|
|
261
|
+
this.dnsCache.set(host, (_a = result.address) !== null && _a !== void 0 ? _a : host);
|
|
262
|
+
}
|
|
263
|
+
return this.dnsCache.get(host);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Sleep for the given number of milliseconds
|
|
267
|
+
* @param milliseconds
|
|
268
|
+
* @returns
|
|
269
|
+
*/
|
|
270
|
+
sleep(milliseconds) {
|
|
271
|
+
return new Promise(resolve => {
|
|
272
|
+
setTimeout(resolve, milliseconds);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
fence(data) {
|
|
276
|
+
const fence = '--------------------';
|
|
277
|
+
return `\n${fence}\n${data}\n${fence}\n`;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function defer() {
|
|
281
|
+
let _resolve;
|
|
282
|
+
let _reject;
|
|
283
|
+
let promise = new Promise((resolveValue, rejectValue) => {
|
|
284
|
+
_resolve = resolveValue;
|
|
285
|
+
_reject = rejectValue;
|
|
286
|
+
});
|
|
287
|
+
return {
|
|
288
|
+
promise: promise,
|
|
289
|
+
resolve: function resolve(value) {
|
|
290
|
+
if (!this.isResolved) {
|
|
291
|
+
this.isResolved = true;
|
|
292
|
+
_resolve(value);
|
|
293
|
+
_resolve = undefined;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
throw new Error(`Attempted to resolve a promise that was already ${this.isResolved ? 'resolved' : 'rejected'}.` +
|
|
297
|
+
`New value: ${JSON.stringify(value)}`);
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
reject: function reject(reason) {
|
|
301
|
+
if (!this.isCompleted) {
|
|
302
|
+
this.isRejected = true;
|
|
303
|
+
_reject(reason);
|
|
304
|
+
_reject = undefined;
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
throw new Error(`Attempted to reject a promise that was already ${this.isResolved ? 'resolved' : 'rejected'}.` +
|
|
308
|
+
`New error message: ${JSON.stringify((0, serialize_error_1.serializeError)(reason))}`);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
isResolved: false,
|
|
312
|
+
isRejected: false,
|
|
313
|
+
get isCompleted() {
|
|
314
|
+
return this.isResolved || this.isRejected;
|
|
315
|
+
}
|
|
316
|
+
};
|
|
256
317
|
}
|
|
257
|
-
|
|
258
|
-
exports.util =
|
|
318
|
+
exports.defer = defer;
|
|
319
|
+
exports.util = new Util();
|
|
259
320
|
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AACA,yBAAyB;AACzB,oCAAoC;AACpC,2BAA2B;AAC3B,2BAA2B;AAG3B,kDAAkF;AAGlF,mEAA4D;AAC5D,qDAAiD;AACjD,2BAA2B;AAE3B,MAAM,IAAI;IAAV;QA8QY,aAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAiBjD,CAAC;IA9RG;;;OAGG;IACI,mBAAmB,CAAC,OAAe;QACtC,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IAChF,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,QAAgB;QAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,MAAM,CAAC,gBAAwB;QACxC,IAAI;YACA,6GAA6G;YAC7G,IAAI,gBAAgB,GAAG,EAAE,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;YACzD,IAAI,IAAI,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YACjD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;SACxB;QAAC,OAAO,CAAC,EAAE;YACR,kDAAkD;YAClD,OAAO,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K;QACjB,IAAI,WAAW;YACX,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC;QAC9C,CAAC;KACJ,CAAC;AACN,CAAC;AAvCD,sBAuCC;AAEY,QAAA,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roku-debug",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Debug adapter for Roku application development using Node.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rimraf dist && tsc",
|
|
8
8
|
"preversion": "npm run build && npm run lint && npm run test",
|
|
9
9
|
"lint": "eslint \"src/**\"",
|
|
10
|
-
"
|
|
11
|
-
"test
|
|
10
|
+
"watch": "tsc --watch",
|
|
11
|
+
"test": "nyc mocha \"src/**/*spec.ts\"",
|
|
12
|
+
"test:nocover": "mocha \"src/**/*.spec.ts\"",
|
|
12
13
|
"publish-coverage": "nyc report --reporter=text-lcov | coveralls"
|
|
13
14
|
},
|
|
14
15
|
"typings": "dist/index.d.ts",
|
|
@@ -18,6 +19,16 @@
|
|
|
18
19
|
},
|
|
19
20
|
"author": "",
|
|
20
21
|
"license": "ISC",
|
|
22
|
+
"mocha": {
|
|
23
|
+
"require": [
|
|
24
|
+
"source-map-support/register",
|
|
25
|
+
"ts-node/register"
|
|
26
|
+
],
|
|
27
|
+
"fullTrace": true,
|
|
28
|
+
"watchExtensions": [
|
|
29
|
+
"ts"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
21
32
|
"nyc": {
|
|
22
33
|
"include": [
|
|
23
34
|
"src/**/!(*.spec).ts"
|
|
@@ -42,53 +53,54 @@
|
|
|
42
53
|
"branches": 100
|
|
43
54
|
},
|
|
44
55
|
"devDependencies": {
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/fs-extra": "^
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/
|
|
53
|
-
"@types/
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
56
|
+
"@types/chai": "^4.2.22",
|
|
57
|
+
"@types/dedent": "^0.7.0",
|
|
58
|
+
"@types/find-in-files": "^0.5.1",
|
|
59
|
+
"@types/fs-extra": "^9.0.13",
|
|
60
|
+
"@types/glob": "^7.2.0",
|
|
61
|
+
"@types/mocha": "^9.0.0",
|
|
62
|
+
"@types/node": "^16.11.6",
|
|
63
|
+
"@types/request": "^2.48.7",
|
|
64
|
+
"@types/sinon": "^10.0.6",
|
|
65
|
+
"@types/vscode": "^1.61.0",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^5.2.0",
|
|
67
|
+
"@typescript-eslint/parser": "^5.2.0",
|
|
68
|
+
"chai": "^4.3.4",
|
|
69
|
+
"coveralls": "^3.1.1",
|
|
70
|
+
"dedent": "^0.7.0",
|
|
71
|
+
"eslint": "^8.1.0",
|
|
72
|
+
"eslint-plugin-no-only-tests": "^2.6.0",
|
|
60
73
|
"get-port": "^5.1.1",
|
|
61
|
-
"mocha": "^
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"rimraf": "^2.6.2",
|
|
74
|
+
"mocha": "^9.1.3",
|
|
75
|
+
"nyc": "^15.1.0",
|
|
76
|
+
"p-defer": "^4.0.0",
|
|
77
|
+
"rimraf": "^3.0.2",
|
|
66
78
|
"rmfr": "^2.0.0",
|
|
67
|
-
"rxjs": "^
|
|
68
|
-
"sinon": "^
|
|
69
|
-
"source-map-support": "^0.5.
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"ts-node": "^8.4.1",
|
|
73
|
-
"typescript": "^3.7.2",
|
|
74
|
-
"vscode-debugadapter-testsupport": "1.33.0"
|
|
79
|
+
"rxjs": "^7.4.0",
|
|
80
|
+
"sinon": "^11.1.2",
|
|
81
|
+
"source-map-support": "^0.5.20",
|
|
82
|
+
"ts-node": "^10.4.0",
|
|
83
|
+
"typescript": "^4.4.4"
|
|
75
84
|
},
|
|
76
85
|
"dependencies": {
|
|
77
|
-
"
|
|
86
|
+
"@rokucommunity/logger": "^0.1.0",
|
|
87
|
+
"brighterscript": "^0.41.2",
|
|
88
|
+
"dateformat": "^4.6.3",
|
|
78
89
|
"eol": "^0.9.1",
|
|
90
|
+
"eventemitter3": "^4.0.7",
|
|
79
91
|
"find-in-files": "^0.5.0",
|
|
80
|
-
"fs-extra": "^
|
|
92
|
+
"fs-extra": "^10.0.0",
|
|
81
93
|
"natural-orderby": "^2.0.3",
|
|
82
|
-
"replace-in-file": "^
|
|
94
|
+
"replace-in-file": "^6.3.2",
|
|
83
95
|
"replace-last": "^1.2.6",
|
|
84
|
-
"roku-deploy": "^3.
|
|
85
|
-
"semver": "^7.
|
|
86
|
-
"serialize-error": "^
|
|
87
|
-
"smart-buffer": "^4.
|
|
96
|
+
"roku-deploy": "^3.5.2",
|
|
97
|
+
"semver": "^7.3.5",
|
|
98
|
+
"serialize-error": "^8.1.0",
|
|
99
|
+
"smart-buffer": "^4.2.0",
|
|
88
100
|
"source-map": "^0.7.3",
|
|
89
101
|
"telnet-client": "^1.4.9",
|
|
90
|
-
"vscode-debugadapter": "1.
|
|
91
|
-
"vscode-debugprotocol": "1.
|
|
102
|
+
"vscode-debugadapter": "^1.49.0",
|
|
103
|
+
"vscode-debugprotocol": "^1.49.0",
|
|
92
104
|
"vscode-languageserver": "^6.1.1"
|
|
93
105
|
}
|
|
94
106
|
}
|
|
Binary file
|
package/roku-debug-0.8.4.tgz
DELETED
|
Binary file
|