@oniroproject/core 0.14.0 → 0.14.1
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/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -874,7 +874,7 @@ declare function ensureRemoteOk(result: HdcExecResult, command: string): HdcExec
|
|
|
874
874
|
interface DeviceInfo {
|
|
875
875
|
/** Connect key — a USB serial or a `host:port` for a TCP target. */
|
|
876
876
|
serial: string;
|
|
877
|
-
/** 'Connected' | 'Offline' | 'Unauthorized' | … | 'Unknown' when not reported. */
|
|
877
|
+
/** 'Connected' | 'Ready' | 'Offline' | 'Unauthorized' | … | 'Unknown' when not reported. */
|
|
878
878
|
status: string;
|
|
879
879
|
/** 'USB' | 'TCP' | … when reported by `-v`. */
|
|
880
880
|
connection?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -874,7 +874,7 @@ declare function ensureRemoteOk(result: HdcExecResult, command: string): HdcExec
|
|
|
874
874
|
interface DeviceInfo {
|
|
875
875
|
/** Connect key — a USB serial or a `host:port` for a TCP target. */
|
|
876
876
|
serial: string;
|
|
877
|
-
/** 'Connected' | 'Offline' | 'Unauthorized' | … | 'Unknown' when not reported. */
|
|
877
|
+
/** 'Connected' | 'Ready' | 'Offline' | 'Unauthorized' | … | 'Unknown' when not reported. */
|
|
878
878
|
status: string;
|
|
879
879
|
/** 'USB' | 'TCP' | … when reported by `-v`. */
|
|
880
880
|
connection?: string;
|
package/dist/index.js
CHANGED
|
@@ -1605,6 +1605,7 @@ import { spawn as spawn2 } from "child_process";
|
|
|
1605
1605
|
|
|
1606
1606
|
// src/hdc/exec.ts
|
|
1607
1607
|
import * as fs15 from "fs";
|
|
1608
|
+
import { StringDecoder } from "string_decoder";
|
|
1608
1609
|
function errorMessage(err) {
|
|
1609
1610
|
return err instanceof Error ? err.message : String(err);
|
|
1610
1611
|
}
|
|
@@ -1632,6 +1633,8 @@ function runProcess(opts) {
|
|
|
1632
1633
|
let stderr = "";
|
|
1633
1634
|
let settled = false;
|
|
1634
1635
|
let timedOut = false;
|
|
1636
|
+
const stdoutDecoder = new StringDecoder("utf8");
|
|
1637
|
+
const stderrDecoder = new StringDecoder("utf8");
|
|
1635
1638
|
const cleanup = () => {
|
|
1636
1639
|
clearTimeout(timer);
|
|
1637
1640
|
abortSignal?.removeEventListener("abort", onAbort);
|
|
@@ -1649,14 +1652,14 @@ function runProcess(opts) {
|
|
|
1649
1652
|
}, timeoutMs);
|
|
1650
1653
|
abortSignal?.addEventListener("abort", onAbort, { once: true });
|
|
1651
1654
|
child.stdout?.on("data", (d) => {
|
|
1652
|
-
const s =
|
|
1655
|
+
const s = stdoutDecoder.write(d);
|
|
1653
1656
|
stdout += s;
|
|
1654
|
-
onOutput?.(s, "stdout");
|
|
1657
|
+
if (s) onOutput?.(s, "stdout");
|
|
1655
1658
|
});
|
|
1656
1659
|
child.stderr?.on("data", (d) => {
|
|
1657
|
-
const s =
|
|
1660
|
+
const s = stderrDecoder.write(d);
|
|
1658
1661
|
stderr += s;
|
|
1659
|
-
onOutput?.(s, "stderr");
|
|
1662
|
+
if (s) onOutput?.(s, "stderr");
|
|
1660
1663
|
});
|
|
1661
1664
|
child.on("error", (err) => {
|
|
1662
1665
|
if (settled) return;
|
|
@@ -1668,6 +1671,12 @@ function runProcess(opts) {
|
|
|
1668
1671
|
if (settled) return;
|
|
1669
1672
|
settled = true;
|
|
1670
1673
|
cleanup();
|
|
1674
|
+
const stdoutTail = stdoutDecoder.end();
|
|
1675
|
+
const stderrTail = stderrDecoder.end();
|
|
1676
|
+
stdout += stdoutTail;
|
|
1677
|
+
stderr += stderrTail;
|
|
1678
|
+
if (stdoutTail) onOutput?.(stdoutTail, "stdout");
|
|
1679
|
+
if (stderrTail) onOutput?.(stderrTail, "stderr");
|
|
1671
1680
|
if (timedOut) {
|
|
1672
1681
|
reject(
|
|
1673
1682
|
new OniroError(
|
|
@@ -1955,6 +1964,7 @@ async function getEmulatorStatus(config, opts = {}) {
|
|
|
1955
1964
|
// src/hdc/devices.ts
|
|
1956
1965
|
var STATUS_TOKENS = /* @__PURE__ */ new Set([
|
|
1957
1966
|
"Connected",
|
|
1967
|
+
"Ready",
|
|
1958
1968
|
"Offline",
|
|
1959
1969
|
"Unauthorized",
|
|
1960
1970
|
"Authorizing",
|
|
@@ -5603,7 +5613,7 @@ async function harmonyOsAutoSign(opts) {
|
|
|
5603
5613
|
}
|
|
5604
5614
|
|
|
5605
5615
|
// src/index.ts
|
|
5606
|
-
var VERSION = "0.14.
|
|
5616
|
+
var VERSION = "0.14.1";
|
|
5607
5617
|
export {
|
|
5608
5618
|
ALL_SDKS,
|
|
5609
5619
|
APL_VALUES,
|