@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 CHANGED
@@ -1849,6 +1849,7 @@ var import_node_child_process4 = require("child_process");
1849
1849
 
1850
1850
  // src/hdc/exec.ts
1851
1851
  var fs15 = __toESM(require("fs"), 1);
1852
+ var import_node_string_decoder = require("string_decoder");
1852
1853
  function errorMessage(err) {
1853
1854
  return err instanceof Error ? err.message : String(err);
1854
1855
  }
@@ -1876,6 +1877,8 @@ function runProcess(opts) {
1876
1877
  let stderr = "";
1877
1878
  let settled = false;
1878
1879
  let timedOut = false;
1880
+ const stdoutDecoder = new import_node_string_decoder.StringDecoder("utf8");
1881
+ const stderrDecoder = new import_node_string_decoder.StringDecoder("utf8");
1879
1882
  const cleanup = () => {
1880
1883
  clearTimeout(timer);
1881
1884
  abortSignal?.removeEventListener("abort", onAbort);
@@ -1893,14 +1896,14 @@ function runProcess(opts) {
1893
1896
  }, timeoutMs);
1894
1897
  abortSignal?.addEventListener("abort", onAbort, { once: true });
1895
1898
  child.stdout?.on("data", (d) => {
1896
- const s = d.toString();
1899
+ const s = stdoutDecoder.write(d);
1897
1900
  stdout += s;
1898
- onOutput?.(s, "stdout");
1901
+ if (s) onOutput?.(s, "stdout");
1899
1902
  });
1900
1903
  child.stderr?.on("data", (d) => {
1901
- const s = d.toString();
1904
+ const s = stderrDecoder.write(d);
1902
1905
  stderr += s;
1903
- onOutput?.(s, "stderr");
1906
+ if (s) onOutput?.(s, "stderr");
1904
1907
  });
1905
1908
  child.on("error", (err) => {
1906
1909
  if (settled) return;
@@ -1912,6 +1915,12 @@ function runProcess(opts) {
1912
1915
  if (settled) return;
1913
1916
  settled = true;
1914
1917
  cleanup();
1918
+ const stdoutTail = stdoutDecoder.end();
1919
+ const stderrTail = stderrDecoder.end();
1920
+ stdout += stdoutTail;
1921
+ stderr += stderrTail;
1922
+ if (stdoutTail) onOutput?.(stdoutTail, "stdout");
1923
+ if (stderrTail) onOutput?.(stderrTail, "stderr");
1915
1924
  if (timedOut) {
1916
1925
  reject(
1917
1926
  new OniroError(
@@ -2199,6 +2208,7 @@ async function getEmulatorStatus(config, opts = {}) {
2199
2208
  // src/hdc/devices.ts
2200
2209
  var STATUS_TOKENS = /* @__PURE__ */ new Set([
2201
2210
  "Connected",
2211
+ "Ready",
2202
2212
  "Offline",
2203
2213
  "Unauthorized",
2204
2214
  "Authorizing",
@@ -5847,7 +5857,7 @@ async function harmonyOsAutoSign(opts) {
5847
5857
  }
5848
5858
 
5849
5859
  // src/index.ts
5850
- var VERSION = "0.14.0";
5860
+ var VERSION = "0.14.1";
5851
5861
  // Annotate the CommonJS export names for ESM import in node:
5852
5862
  0 && (module.exports = {
5853
5863
  ALL_SDKS,