@react-native-oh/react-native-harmony-cli 0.77.50 → 0.77.64

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.
Files changed (197) hide show
  1. package/dist/assetResolver.js +31 -3
  2. package/dist/autolinking/Autolinking.js +8 -1
  3. package/dist/autolinking/JSON5Writer.js +61 -0
  4. package/dist/autolinking/index.js +6 -0
  5. package/dist/commands/bundle-harmony.js +15 -0
  6. package/harmony/{rnoh-hvigor-plugin-0.77.50.tgz → rnoh-hvigor-plugin-0.77.64.tgz} +0 -0
  7. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/00a68392 +0 -0
  8. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0544a6cc +0 -0
  9. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0f36b2db +0 -0
  10. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12f23f1e +0 -0
  11. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/13d95d98 +0 -0
  12. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1629e86b +0 -0
  13. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/180c8379 +0 -0
  14. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a697147 +0 -0
  15. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a8271b1 +0 -0
  16. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1b7fa689 +0 -0
  17. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/255a9f13 +0 -0
  18. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/268d155b +0 -0
  19. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/27db9aa4 +0 -0
  20. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/28db79ed +0 -0
  21. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2dc2bbcb +0 -0
  22. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2df5f8c5 +0 -0
  23. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2f88aedb +0 -0
  24. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/31b3a7ea +0 -0
  25. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/36335b1c +0 -0
  26. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/38fca641 +0 -0
  27. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/397722eb +0 -0
  28. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{d64bff57 → 397b6432} +0 -0
  29. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b17421f +0 -0
  30. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/454f5e18 +0 -0
  31. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/45ec6cce +0 -0
  32. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/482d51b1 +0 -0
  33. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4ac5cd67 +0 -0
  34. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4d40499a +0 -0
  35. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4dcad919 +0 -0
  36. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4fc31929 +0 -0
  37. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/54edc8f5 +0 -0
  38. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/558a5405 +0 -0
  39. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/58d2b670 +0 -0
  40. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5ec7feca +0 -0
  41. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62180f3e +0 -0
  42. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/63981360 +0 -0
  43. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64096c89 +0 -0
  44. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64af560b +0 -0
  45. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6585e783 +0 -0
  46. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{8e83cbe1 → 6954304f} +0 -0
  47. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{1184678c → 69fd6235} +0 -0
  48. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6d3a0478 +0 -0
  49. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6e131db7 +0 -0
  50. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/778cd8f1 +0 -0
  51. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/788206b6 +0 -0
  52. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7882dc26 +0 -0
  53. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7b3c14f7 +0 -0
  54. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7cdfe667 +0 -0
  55. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8048c487 +0 -0
  56. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8332d9a3 +0 -0
  57. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84e5b603 +0 -0
  58. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/854d8127 +0 -0
  59. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88c97376 +0 -0
  60. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/90d5f644 +0 -0
  61. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/967e25ac +0 -0
  62. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/969896c2 +0 -0
  63. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9790193e +0 -0
  64. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{c342b18e → 97ae40c5} +0 -0
  65. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9a5bf482 +0 -0
  66. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a07adeb9 +0 -0
  67. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a427f355 +0 -0
  68. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{cf039161 → a9dd7eb7} +0 -0
  69. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a9e9d79e +0 -0
  70. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab920855 +0 -0
  71. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab9e3038 +0 -0
  72. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/af054988 +0 -0
  73. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/afe03e51 +0 -0
  74. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b3b83913 +0 -0
  75. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b4db7b4d +0 -0
  76. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b5225355 +0 -0
  77. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b8c00f06 +0 -0
  78. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b917a081 +0 -0
  79. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b9e2f3bd +0 -0
  80. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{5c2aafe7 → bd70db0e} +0 -0
  81. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bdbda648 +0 -0
  82. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be1e5469 +0 -0
  83. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/{333648cc → c9462295} +0 -0
  84. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ca6e5efa +0 -0
  85. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caf52beb +0 -0
  86. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cb268960 +0 -0
  87. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cca16b15 +0 -0
  88. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cfc1c937 +0 -0
  89. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d10e6e05 +0 -0
  90. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d172fc04 +0 -0
  91. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d4e94e50 +0 -0
  92. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d59f8d2c +0 -0
  93. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/da964053 +0 -0
  94. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0bb712a +0 -0
  95. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e3e6ca34 +0 -0
  96. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e50f7385 +0 -0
  97. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f1a1d282 +0 -0
  98. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f2514c3c +0 -0
  99. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f66207cf +0 -0
  100. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f8d129ce +0 -0
  101. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fb1e9558 +0 -0
  102. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ff7e3608 +0 -0
  103. package/package.json +5 -4
  104. package/src/assetResolver.ts +37 -3
  105. package/src/autolinking/Autolinking.test.ts +70 -17
  106. package/src/autolinking/Autolinking.ts +14 -9
  107. package/src/autolinking/JSON5Writer.ts +70 -0
  108. package/src/autolinking/index.ts +7 -0
  109. package/src/commands/bundle-harmony.ts +17 -0
  110. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0271b9dd +0 -0
  111. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/07ba0208 +0 -0
  112. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/082dd09d +0 -0
  113. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0a9e1b0b +0 -0
  114. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0c3d528a +0 -0
  115. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1014d3ff +0 -0
  116. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12621366 +0 -0
  117. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/126d3e66 +0 -0
  118. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/19262852 +0 -0
  119. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/203fac53 +0 -0
  120. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/237b660a +0 -0
  121. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2528002d +0 -0
  122. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2587d041 +0 -0
  123. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2893bd11 +0 -0
  124. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2af6ff9d +0 -0
  125. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2bf31f33 +0 -0
  126. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/386f6df0 +0 -0
  127. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b8c270e +0 -0
  128. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3bcc34ba +0 -0
  129. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/444808bd +0 -0
  130. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/44a775e2 +0 -0
  131. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/46da3ccd +0 -0
  132. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/51f80e35 +0 -0
  133. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5203a2ca +0 -0
  134. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/52795646 +0 -0
  135. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/577f8208 +0 -0
  136. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5c69bcfe +0 -0
  137. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62695b92 +0 -0
  138. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62698102 +0 -0
  139. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6411ab00 +0 -0
  140. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6569ba92 +0 -0
  141. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/65e5133c +0 -0
  142. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/66029655 +0 -0
  143. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/69e85d0d +0 -0
  144. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6afcb99e +0 -0
  145. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6de07367 +0 -0
  146. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/72498307 +0 -0
  147. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7babd1de +0 -0
  148. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7fe56d21 +0 -0
  149. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/810cbd72 +0 -0
  150. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/812386d2 +0 -0
  151. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8448897d +0 -0
  152. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84ab0a41 +0 -0
  153. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/853825e2 +0 -0
  154. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/862ad93a +0 -0
  155. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/86b14da6 +0 -0
  156. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/87f0fe62 +0 -0
  157. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88ee8f74 +0 -0
  158. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c5237c9 +0 -0
  159. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8c725800 +0 -0
  160. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8f4085b9 +0 -0
  161. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/931f0b2e +0 -0
  162. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/940c8f92 +0 -0
  163. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/968191a3 +0 -0
  164. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/970780c0 +0 -0
  165. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/98bc4394 +0 -0
  166. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/99a3b0b0 +0 -0
  167. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9c0ffa6b +0 -0
  168. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9d9b42c2 +0 -0
  169. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a04266ef +0 -0
  170. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a18f78c5 +0 -0
  171. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a642fb0e +0 -0
  172. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a97edf40 +0 -0
  173. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/aa672a20 +0 -0
  174. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ae25c61a +0 -0
  175. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b2bebae6 +0 -0
  176. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ba492422 +0 -0
  177. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bd3e6c21 +0 -0
  178. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be9e564e +0 -0
  179. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c3993e7e +0 -0
  180. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c52ffd54 +0 -0
  181. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c7079ad4 +0 -0
  182. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c8eb01c1 +0 -0
  183. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caee5d30 +0 -0
  184. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d0377c40 +0 -0
  185. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d262bc85 +0 -0
  186. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d287cb5c +0 -0
  187. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d716a608 +0 -0
  188. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d751012b +0 -0
  189. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0873711 +0 -0
  190. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e1fcf77b +0 -0
  191. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e8548d8a +0 -0
  192. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eaedd71d +0 -0
  193. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/eca0019e +0 -0
  194. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f7189953 +0 -0
  195. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f75cb201 +0 -0
  196. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f888164b +0 -0
  197. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fdb9eb5a +0 -0
@@ -21,6 +21,13 @@ exports.copyAssets = copyAssets;
21
21
  */
22
22
  const fs_1 = __importDefault(require("fs"));
23
23
  const path_1 = __importDefault(require("path"));
24
+ const ENABLE_DEBUG_LOG = process.env.RNOH_BUNDLE_DEBUG === 'true';
25
+ function debugLog(message) {
26
+ if (ENABLE_DEBUG_LOG) {
27
+ const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 23);
28
+ console.log(`[${timestamp}] ${message}`);
29
+ }
30
+ }
24
31
  const ALLOWED_SCALES = [1, 2, 3, 4];
25
32
  function filterAssetScales(scales) {
26
33
  const result = scales.filter(scale => ALLOWED_SCALES.includes(scale));
@@ -94,7 +101,9 @@ function copyFiles(logger, fileDestBySrc) {
94
101
  }
95
102
  if (fileSources.length === 0) {
96
103
  logger.info(() => `Copied ${assetFilesCount} ${assetFilesCount === 1 ? 'asset' : 'assets'}`);
104
+ debugLog('All assets copied, resolving promise...');
97
105
  resolve();
106
+ debugLog('Assets copy promise resolved');
98
107
  }
99
108
  else {
100
109
  // fileSources.length === 0 is checked in previous branch, so this is string
@@ -113,8 +122,27 @@ function copyFile(src, dest, onFinished) {
113
122
  onFinished(err);
114
123
  return;
115
124
  }
116
- fs_1.default.createReadStream(src)
117
- .pipe(fs_1.default.createWriteStream(dest))
118
- .on('finish', onFinished);
125
+ const readStream = fs_1.default.createReadStream(src);
126
+ const writeStream = fs_1.default.createWriteStream(dest);
127
+ let finished = false;
128
+ const handleError = (err) => {
129
+ if (!finished) {
130
+ finished = true;
131
+ console.error(`[Asset Copy Error] ${src} -> ${dest}:`, err.message);
132
+ readStream.destroy();
133
+ writeStream.destroy();
134
+ onFinished(err);
135
+ }
136
+ };
137
+ const handleFinish = () => {
138
+ if (!finished) {
139
+ finished = true;
140
+ onFinished();
141
+ }
142
+ };
143
+ readStream.on('error', handleError);
144
+ writeStream.on('error', handleError);
145
+ writeStream.on('finish', handleFinish);
146
+ readStream.pipe(writeStream);
119
147
  });
120
148
  }
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE-MIT file in the root directory of this source tree.
7
+ */
2
8
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
9
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
10
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -18,6 +24,7 @@ const core_1 = require("../core");
18
24
  const mustache_1 = __importDefault(require("mustache"));
19
25
  const case_1 = __importDefault(require("case"));
20
26
  const node_path_1 = __importDefault(require("node:path"));
27
+ const JSON5Writer_1 = require("./JSON5Writer");
21
28
  const ETS_RNOH_PACKAGES_FACTORY_TEMPLATE = `
22
29
  /*
23
30
  * This file was generated by RNOH autolinking.
@@ -209,7 +216,7 @@ class Autolinking {
209
216
  ],
210
217
  ohPackagePathAndContent: [
211
218
  input.ohPackagePathAndContent[0],
212
- json5_1.default.stringify(Object.assign(Object.assign({}, ohPackage), { dependencies: Object.assign(Object.assign({}, unmanagedNativeDependencySpecifierByName), managedNativeDependencySpecifierByName) }), { space: 2, quote: '"' }) + '\n',
219
+ JSON5Writer_1.JSON5Writer.updateDependenciesWithFallback(input.ohPackagePathAndContent[1], Object.assign(Object.assign({}, unmanagedNativeDependencySpecifierByName), managedNativeDependencySpecifierByName)),
213
220
  ],
214
221
  };
215
222
  }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE-MIT file in the root directory of this source tree.
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.JSON5Writer = void 0;
13
+ const json5_1 = __importDefault(require("json5"));
14
+ /**
15
+ * A utility class for modifying JSON5 content while preserving comments and formatting.
16
+ * Uses json5-writer's AST-based transformation to maintain the original structure.
17
+ */
18
+ class JSON5Writer {
19
+ /**
20
+ * Updates the dependencies in a JSON5 string while preserving comments and formatting.
21
+ *
22
+ * @param content - The original JSON5 content
23
+ * @param newDependencies - The new dependencies object to set
24
+ * @returns The modified JSON5 content with preserved comments
25
+ */
26
+ static updateDependencies(content, newDependencies) {
27
+ const json5Writer = require('json5-writer');
28
+ // Parse the original content to get all fields
29
+ const parsed = json5_1.default.parse(content);
30
+ // Create the new object with updated dependencies
31
+ const newObject = Object.assign(Object.assign({}, parsed), { dependencies: newDependencies });
32
+ // Load the original content into json5-writer to preserve comments
33
+ const writer = json5Writer.load(content);
34
+ // Write the new object, which will preserve comments
35
+ writer.write(newObject);
36
+ // Return the modified source with JSON5-style formatting
37
+ // Use double quotes for both keys and values, and trailing commas
38
+ // quoteKeys: true ensures keys with special characters (like @, /, -) are properly quoted
39
+ return writer.toSource({ quote: 'double', quoteKeys: true, trailingComma: true }) + '\n';
40
+ }
41
+ /**
42
+ * Updates dependencies with fallback to standard JSON5 stringify if preservation fails.
43
+ * This ensures backward compatibility.
44
+ *
45
+ * @param content - The original JSON5 content
46
+ * @param newDependencies - The new dependencies object to set
47
+ * @returns The modified JSON5 content
48
+ */
49
+ static updateDependenciesWithFallback(content, newDependencies) {
50
+ try {
51
+ return this.updateDependencies(content, newDependencies);
52
+ }
53
+ catch (error) {
54
+ // Fallback to JSON5 stringify if AST transformation fails
55
+ const parsed = json5_1.default.parse(content);
56
+ const result = Object.assign(Object.assign({}, parsed), { dependencies: newDependencies });
57
+ return json5_1.default.stringify(result, { space: 2, quote: '"' }) + '\n';
58
+ }
59
+ }
60
+ }
61
+ exports.JSON5Writer = JSON5Writer;
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE-MIT file in the root directory of this source tree.
7
+ */
2
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
9
  if (k2 === undefined) k2 = k;
4
10
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -24,6 +24,13 @@ const child_process_1 = require("child_process");
24
24
  const io_1 = require("../io");
25
25
  const core_1 = require("../core");
26
26
  const node_crypto_1 = require("node:crypto");
27
+ const ENABLE_DEBUG_LOG = process.env.RNOH_BUNDLE_DEBUG === 'true';
28
+ function debugLog(message) {
29
+ if (ENABLE_DEBUG_LOG) {
30
+ const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 23);
31
+ console.log(`[${timestamp}] ${message}`);
32
+ }
33
+ }
27
34
  const HERMESC_BIN_PATH = {
28
35
  darwin: path_1.default.normalize('osx-bin/hermesc'),
29
36
  linux: path_1.default.normalize('linux64-bin/hermesc'),
@@ -129,13 +136,17 @@ exports.commandBundleHarmony = {
129
136
  const bundle = yield createBundle(metroConfig, buildOptions);
130
137
  const assets = yield retrieveAssetsData(metroConfig, buildOptions);
131
138
  if (shouldGenerateHbcBundle) {
139
+ debugLog('Starting Hermes bytecode compilation...');
132
140
  yield saveHbcBundle(logger, bundle.code, bundleOutput, args.hermescDir, args.hermescOptions);
141
+ debugLog('Hermes bytecode compilation finished');
133
142
  }
134
143
  else {
135
144
  yield saveJSBundle(logger, bundle, bundleOutput);
136
145
  }
137
146
  maybeSaveSourceMap(logger, bundle, args.sourcemapOutput);
138
147
  yield (0, assetResolver_1.copyAssets)(logger, assets, assetsDest);
148
+ debugLog('Assets copy completed, cleaning up...');
149
+ debugLog('Bundle process finished, exiting');
139
150
  }
140
151
  catch (err) {
141
152
  if (err instanceof core_1.DescriptiveError) {
@@ -180,15 +191,19 @@ function saveHbcBundle(logger, bundleCode, bundleOutput, hermescPath, hermescOpt
180
191
  });
181
192
  }
182
193
  const tmpBundlePath = `${os_1.default.tmpdir()}${path_1.default.sep}b-${(0, node_crypto_1.randomUUID)()}.harmony.js`;
194
+ debugLog('Writing temporary JS bundle...');
183
195
  yield fs_extra_1.default.writeFile(tmpBundlePath, bundleCode);
184
196
  const hbcFilePath = bundleOutput.endsWith('.hbc')
185
197
  ? bundleOutput
186
198
  : path_1.default.join(path_1.default.dirname(bundleOutput), 'hermes_bundle.hbc');
187
199
  const hermescOptionsString = (hermescOptions === null || hermescOptions === void 0 ? void 0 : hermescOptions.map((e) => `-${e}`).join(' ')) || '';
200
+ debugLog(`Executing hermesc compiler: ${resolvedHermescPath}`);
188
201
  (0, child_process_1.execSync)(`${resolvedHermescPath} ${hermescOptionsString} --emit-binary -out ${hbcFilePath} ${tmpBundlePath}`, {
189
202
  stdio: 'inherit',
190
203
  });
204
+ debugLog('Hermesc execution completed, cleaning up temp file...');
191
205
  node_fs_1.default.unlinkSync(tmpBundlePath);
206
+ debugLog('Temp file deleted');
192
207
  logger.info((s) => `Created ${hbcFilePath}`);
193
208
  });
194
209
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@react-native-oh/react-native-harmony-cli",
3
- "version": "0.77.50",
3
+ "version": "0.77.64",
4
4
  "description": "",
5
5
  "publishConfig": {
6
- "registry": "https://registry.npmjs.org/",
7
- "access": "public"
8
- },
6
+ "registry": "https://registry.npmjs.org/",
7
+ "access": "public"
8
+ },
9
9
  "scripts": {
10
10
  "build": "tsc --outDir dist -p tsconfig.build.json && node ./scripts/copy-template.js",
11
11
  "prepack": "npm run build && npm run _recreate-hvigor-plugin",
@@ -54,6 +54,7 @@
54
54
  "fs-extra": "^11.1.1",
55
55
  "inquirer": "^12.6.3",
56
56
  "json5": "^2.2.3",
57
+ "json5-writer": "^0.2.0",
57
58
  "memfs": "4.12.0",
58
59
  "mustache": "^4.2.0",
59
60
  "tar": "^6.1.15",
@@ -9,6 +9,15 @@ import pathUtils from 'path';
9
9
  import type { AssetData } from 'metro';
10
10
  import { Logger } from './io';
11
11
 
12
+ const ENABLE_DEBUG_LOG = process.env.RNOH_BUNDLE_DEBUG === 'true';
13
+
14
+ function debugLog(message: string) {
15
+ if (ENABLE_DEBUG_LOG) {
16
+ const timestamp = new Date().toISOString().replace('T', ' ').substring(0, 23);
17
+ console.log(`[${timestamp}] ${message}`);
18
+ }
19
+ }
20
+
12
21
  type Path = string;
13
22
  type CopiedFiles = Record<Path, Path>;
14
23
 
@@ -104,7 +113,9 @@ function copyFiles(logger: Logger, fileDestBySrc: CopiedFiles) {
104
113
  assetFilesCount === 1 ? 'asset' : 'assets'
105
114
  }`
106
115
  );
116
+ debugLog('All assets copied, resolving promise...');
107
117
  resolve();
118
+ debugLog('Assets copy promise resolved');
108
119
  } else {
109
120
  // fileSources.length === 0 is checked in previous branch, so this is string
110
121
  const src = fileSources.shift()!;
@@ -127,8 +138,31 @@ function copyFile(
127
138
  onFinished(err);
128
139
  return;
129
140
  }
130
- fs.createReadStream(src)
131
- .pipe(fs.createWriteStream(dest))
132
- .on('finish', onFinished);
141
+ const readStream = fs.createReadStream(src);
142
+ const writeStream = fs.createWriteStream(dest);
143
+
144
+ let finished = false;
145
+ const handleError = (err: Error) => {
146
+ if (!finished) {
147
+ finished = true;
148
+ console.error(`[Asset Copy Error] ${src} -> ${dest}:`, err.message);
149
+ readStream.destroy();
150
+ writeStream.destroy();
151
+ onFinished(err);
152
+ }
153
+ };
154
+
155
+ const handleFinish = () => {
156
+ if (!finished) {
157
+ finished = true;
158
+ onFinished();
159
+ }
160
+ };
161
+
162
+ readStream.on('error', handleError);
163
+ writeStream.on('error', handleError);
164
+ writeStream.on('finish', handleFinish);
165
+
166
+ readStream.pipe(writeStream);
133
167
  });
134
168
  }