roku-deploy
Advanced tools
Comparing version
@@ -9,2 +9,9 @@ # Changelog | ||
## [3.10.5](https://github.com/rokucommunity/roku-deploy/compare/v3.10.4...v3.10.5) - 2023-11-14 | ||
### Changed | ||
- better device-info docs ([#128](https://github.com/rokucommunity/roku-deploy/pull/128)) | ||
- Better deploy error detection ([#127](https://github.com/rokucommunity/roku-deploy/pull/127)) | ||
## [3.10.4](https://github.com/rokucommunity/roku-deploy/compare/v3.10.3...v3.10.4) - 2023-11-03 | ||
@@ -11,0 +18,0 @@ ### Changed |
@@ -271,4 +271,13 @@ /// <reference types="node" /> | ||
export interface GetDeviceInfoOptions { | ||
/** | ||
* The hostname or IP address to use for the device-info URL | ||
*/ | ||
host: string; | ||
/** | ||
* The port to use to send the device-info request (defaults to the standard 8060 ECP port) | ||
*/ | ||
remotePort?: number; | ||
/** | ||
* The number of milliseconds at which point this request should timeout and return a rejected promise | ||
*/ | ||
timeout?: number; | ||
@@ -275,0 +284,0 @@ /** |
@@ -607,14 +607,19 @@ "use strict"; | ||
let match; | ||
// eslint-disable-next-line no-cond-assign | ||
while (match = errorRegex.exec(body)) { | ||
while ((match = errorRegex.exec(body))) { | ||
let [, messageType, message] = match; | ||
switch (messageType.toLowerCase()) { | ||
case 'error': | ||
result.errors.push(message); | ||
case RokuMessageType.error: | ||
if (!result.errors.includes(message)) { | ||
result.errors.push(message); | ||
} | ||
break; | ||
case 'info': | ||
result.infos.push(message); | ||
case RokuMessageType.info: | ||
if (!result.infos.includes(message)) { | ||
result.infos.push(message); | ||
} | ||
break; | ||
case 'success': | ||
result.successes.push(message); | ||
case RokuMessageType.success: | ||
if (!result.successes.includes(message)) { | ||
result.successes.push(message); | ||
} | ||
break; | ||
@@ -625,2 +630,40 @@ default: | ||
} | ||
let jsonParseRegex = /JSON\.parse\(('.+')\);/igm; | ||
let jsonMatch; | ||
while ((jsonMatch = jsonParseRegex.exec(body))) { | ||
let [, jsonString] = jsonMatch; | ||
let jsonObject = (0, jsonc_parser_1.parse)(jsonString); | ||
if (typeof jsonObject === 'object' && !Array.isArray(jsonObject) && jsonObject !== null) { | ||
let messages = jsonObject.messages; | ||
if (!Array.isArray(messages)) { | ||
continue; | ||
} | ||
for (let messageObject of messages) { | ||
// Try to duck type the object to make sure it is some form of message to be displayed | ||
if (typeof messageObject.type === 'string' && messageObject.text_type === 'text' && typeof messageObject.text === 'string') { | ||
const messageType = messageObject.type; | ||
const text = messageObject.text; | ||
switch (messageType.toLowerCase()) { | ||
case RokuMessageType.error: | ||
if (!result.errors.includes(text)) { | ||
result.errors.push(text); | ||
} | ||
break; | ||
case RokuMessageType.info: | ||
if (!result.infos.includes(text)) { | ||
result.infos.push(text); | ||
} | ||
break; | ||
case RokuMessageType.success: | ||
if (!result.successes.includes(text)) { | ||
result.successes.push(text); | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return result; | ||
@@ -955,2 +998,8 @@ } | ||
exports.RokuDeploy = RokuDeploy; | ||
var RokuMessageType; | ||
(function (RokuMessageType) { | ||
RokuMessageType["success"] = "success"; | ||
RokuMessageType["info"] = "info"; | ||
RokuMessageType["error"] = "error"; | ||
})(RokuMessageType || (RokuMessageType = {})); | ||
exports.DefaultFiles = [ | ||
@@ -957,0 +1006,0 @@ 'source/**/*.*', |
{ | ||
"name": "roku-deploy", | ||
"version": "3.10.4", | ||
"version": "3.10.5", | ||
"description": "Package and publish a Roku application using Node.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
180791
2.62%2351
2.53%