@react-native-oh/react-native-harmony-cli 0.82.30 → 0.82.32

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 (264) hide show
  1. package/README.md +4 -4
  2. package/dist/codegen/core/CodeGenerator.js +6 -0
  3. package/dist/codegen/core/CodegenError.js +6 -0
  4. package/dist/codegen/core/EventUtils.js +6 -0
  5. package/dist/codegen/core/TypeAnnotationToTS.js +6 -0
  6. package/dist/codegen/core/UberSchema.js +6 -0
  7. package/dist/codegen/core/index.js +6 -0
  8. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +6 -0
  9. package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +6 -0
  10. package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +6 -0
  11. package/dist/codegen/generators/CppComponentCodeGenerator.js +6 -0
  12. package/dist/codegen/generators/LibGlueCodeGenerator.js +22 -6
  13. package/dist/codegen/generators/NativeModuleCodeGenerator.js +6 -0
  14. package/dist/codegen/generators/SharedComponentCodeGenerator.js +6 -0
  15. package/dist/codegen/generators/UberGeneratorV1.js +6 -0
  16. package/dist/codegen/generators/UberGeneratorV2.js +6 -0
  17. package/dist/codegen/generators/index.js +6 -0
  18. package/dist/codegen/index.js +6 -0
  19. package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +6 -0
  20. package/dist/codegen/templates/BasePackageHTemplate.js +6 -0
  21. package/dist/codegen/templates/ComponentDescriptorHTemplate.js +6 -0
  22. package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +6 -0
  23. package/dist/codegen/templates/ComponentUtilsTSTemplate.js +6 -0
  24. package/dist/codegen/templates/IndexTSTemplate.js +6 -0
  25. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +6 -0
  26. package/dist/codegen/templates/TurboModuleCppTemplate.js +6 -0
  27. package/dist/codegen/templates/TurboModuleHTemplate.js +6 -0
  28. package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +6 -0
  29. package/dist/codegen/templates/index.js +6 -0
  30. package/dist/commands/bundle-harmony.js +6 -0
  31. package/dist/commands/clean-harmony.js +6 -0
  32. package/dist/commands/codegen-harmony.js +6 -0
  33. package/dist/commands/codegen-lib-harmony.js +84 -40
  34. package/dist/commands/index.js +6 -0
  35. package/dist/commands/init-harmony.js +6 -0
  36. package/dist/commands/link-harmony.js +6 -0
  37. package/dist/commands/types.js +6 -0
  38. package/dist/commands/verify-package-harmony.js +6 -0
  39. package/dist/core/AbsolutePath.js +6 -0
  40. package/dist/core/CodegenConfig.js +6 -0
  41. package/dist/core/DescriptiveError.js +6 -0
  42. package/dist/core/FileSystem.js +6 -0
  43. package/dist/core/OHPackageJSON5.js +6 -0
  44. package/dist/core/ValidationError.js +6 -0
  45. package/dist/core/ValueObject.js +6 -0
  46. package/dist/core/fs.js +6 -0
  47. package/dist/core/index.js +6 -0
  48. package/dist/index.js +6 -0
  49. package/dist/init/templates/AppScopeAppJSON5Template.js +6 -0
  50. package/dist/init/templates/AppScopeStringVarTemplate.js +6 -0
  51. package/dist/init/templates/EntryIndexTemplate.js +6 -0
  52. package/dist/init/templates/EntryStringVarTemplate.js +6 -0
  53. package/dist/init/templates/HvigorConfigJson5Template.js +6 -0
  54. package/dist/init/templates/MetroConfigTemplate.js +6 -0
  55. package/dist/init/templates/OhPackageJson5Template.js +6 -0
  56. package/dist/init/templates/harmony/entry/gitignore +5 -0
  57. package/dist/init/templates/harmony/entry/src/main/cpp/gitignore +5 -0
  58. package/dist/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +7 -0
  59. package/dist/init/templates/harmony/entry/src/main/ets/codegen/gitignore +5 -0
  60. package/dist/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +7 -0
  61. package/dist/init/templates/harmony/entry/src/main/ets/gitignore +5 -0
  62. package/dist/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +7 -0
  63. package/dist/init/templates/harmony/entry/src/main/resources/gitignore +5 -0
  64. package/dist/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +7 -0
  65. package/dist/init/templates/harmony/gitignore +5 -0
  66. package/dist/init/templates/index.js +6 -0
  67. package/dist/io/CliExecutor.js +6 -0
  68. package/dist/io/Logger.js +6 -0
  69. package/dist/io/RealFS.js +6 -0
  70. package/dist/io/TarGz.js +6 -0
  71. package/dist/io/__fixtures__.js +6 -0
  72. package/dist/io/fsUtils.js +6 -0
  73. package/dist/io/index.js +6 -0
  74. package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +6 -0
  75. package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +6 -0
  76. package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +6 -0
  77. package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +6 -0
  78. package/dist/package-verifier/checks/index.js +6 -0
  79. package/dist/package-verifier/index.js +6 -0
  80. package/dist/package-verifier/types.js +6 -0
  81. package/dist/package-verifier/verify-package.js +6 -0
  82. package/harmony/rnoh-hvigor-plugin-0.82.32.tgz +0 -0
  83. package/jest.config.js +7 -0
  84. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/00a68392 +0 -0
  85. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0544a6cc +0 -0
  86. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0f36b2db +0 -0
  87. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12f23f1e +0 -0
  88. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/13d95d98 +0 -0
  89. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1629e86b +0 -0
  90. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/180c8379 +0 -0
  91. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a697147 +0 -0
  92. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1a8271b1 +0 -0
  93. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1b7fa689 +0 -0
  94. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/255a9f13 +0 -0
  95. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/268d155b +0 -0
  96. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/27db9aa4 +0 -0
  97. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/28db79ed +0 -0
  98. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2dc2bbcb +0 -0
  99. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2df5f8c5 +0 -0
  100. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2f88aedb +0 -0
  101. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/31b3a7ea +0 -0
  102. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/36335b1c +0 -0
  103. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/38fca641 +0 -0
  104. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/397722eb +0 -0
  105. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/397b6432 +0 -0
  106. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3b17421f +0 -0
  107. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/454f5e18 +0 -0
  108. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/45ec6cce +0 -0
  109. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/482d51b1 +0 -0
  110. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4ac5cd67 +0 -0
  111. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4d40499a +0 -0
  112. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4dcad919 +0 -0
  113. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4fc31929 +0 -0
  114. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/54edc8f5 +0 -0
  115. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/558a5405 +0 -0
  116. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/58d2b670 +0 -0
  117. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5ec7feca +0 -0
  118. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/62180f3e +0 -0
  119. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/63981360 +0 -0
  120. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64096c89 +0 -0
  121. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/64af560b +0 -0
  122. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6585e783 +0 -0
  123. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6954304f +0 -0
  124. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/69fd6235 +0 -0
  125. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6d3a0478 +0 -0
  126. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6e131db7 +0 -0
  127. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/778cd8f1 +0 -0
  128. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/788206b6 +0 -0
  129. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7882dc26 +0 -0
  130. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7b3c14f7 +0 -0
  131. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7cdfe667 +0 -0
  132. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8048c487 +0 -0
  133. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8332d9a3 +0 -0
  134. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/84e5b603 +0 -0
  135. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/854d8127 +0 -0
  136. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/88c97376 +0 -0
  137. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/90d5f644 +0 -0
  138. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/967e25ac +0 -0
  139. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/969896c2 +0 -0
  140. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9790193e +0 -0
  141. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/97ae40c5 +0 -0
  142. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/9a5bf482 +0 -0
  143. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a07adeb9 +0 -0
  144. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a427f355 +0 -0
  145. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a9dd7eb7 +0 -0
  146. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a9e9d79e +0 -0
  147. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab920855 +0 -0
  148. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ab9e3038 +0 -0
  149. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/af054988 +0 -0
  150. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/afe03e51 +0 -0
  151. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b3b83913 +0 -0
  152. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b4db7b4d +0 -0
  153. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b5225355 +0 -0
  154. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b8c00f06 +0 -0
  155. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b917a081 +0 -0
  156. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b9e2f3bd +0 -0
  157. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bd70db0e +0 -0
  158. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bdbda648 +0 -0
  159. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/be1e5469 +0 -0
  160. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c9462295 +0 -0
  161. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ca6e5efa +0 -0
  162. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/caf52beb +0 -0
  163. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cb268960 +0 -0
  164. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cca16b15 +0 -0
  165. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cfc1c937 +0 -0
  166. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d10e6e05 +0 -0
  167. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d172fc04 +0 -0
  168. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d4e94e50 +0 -0
  169. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d59f8d2c +0 -0
  170. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/da964053 +0 -0
  171. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e0bb712a +0 -0
  172. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e3e6ca34 +0 -0
  173. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e50f7385 +0 -0
  174. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f1a1d282 +0 -0
  175. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f2514c3c +0 -0
  176. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f66207cf +0 -0
  177. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f8d129ce +0 -0
  178. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fb1e9558 +0 -0
  179. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ff7e3608 +0 -0
  180. package/package.json +1 -1
  181. package/react-native.config.js +7 -0
  182. package/scripts/copy-template.js +7 -0
  183. package/src/codegen/core/CodeGenerator.ts +7 -0
  184. package/src/codegen/core/CodegenError.ts +7 -0
  185. package/src/codegen/core/EventUtils.ts +7 -0
  186. package/src/codegen/core/TypeAnnotationToTS.test.ts +7 -0
  187. package/src/codegen/core/TypeAnnotationToTS.ts +7 -0
  188. package/src/codegen/core/UberSchema.ts +7 -0
  189. package/src/codegen/core/index.ts +7 -0
  190. package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +7 -0
  191. package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +7 -0
  192. package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +7 -0
  193. package/src/codegen/generators/CppComponentCodeGenerator.ts +7 -0
  194. package/src/codegen/generators/LibGlueCodeGenerator.ts +30 -12
  195. package/src/codegen/generators/NativeModuleCodeGenerator.ts +7 -0
  196. package/src/codegen/generators/SharedComponentCodeGenerator.ts +7 -0
  197. package/src/codegen/generators/UberGeneratorV1.ts +7 -0
  198. package/src/codegen/generators/UberGeneratorV2.ts +7 -0
  199. package/src/codegen/generators/index.ts +7 -0
  200. package/src/codegen/index.ts +7 -0
  201. package/src/codegen/templates/BaseComponentInstanceHTemplate.ts +7 -0
  202. package/src/codegen/templates/BasePackageHTemplate.ts +7 -0
  203. package/src/codegen/templates/ComponentDescriptorHTemplate.ts +7 -0
  204. package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +7 -0
  205. package/src/codegen/templates/ComponentUtilsTSTemplate.ts +7 -0
  206. package/src/codegen/templates/IndexTSTemplate.ts +7 -0
  207. package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +7 -0
  208. package/src/codegen/templates/TurboModuleCppTemplate.ts +7 -0
  209. package/src/codegen/templates/TurboModuleHTemplate.ts +7 -0
  210. package/src/codegen/templates/TurboModuleSpecTSTemplate.ts +7 -0
  211. package/src/codegen/templates/index.ts +7 -0
  212. package/src/commands/bundle-harmony.ts +7 -0
  213. package/src/commands/clean-harmony.ts +7 -0
  214. package/src/commands/codegen-harmony.ts +7 -0
  215. package/src/commands/codegen-lib-harmony.ts +117 -56
  216. package/src/commands/index.ts +7 -0
  217. package/src/commands/init-harmony.ts +7 -0
  218. package/src/commands/link-harmony.ts +7 -0
  219. package/src/commands/types.ts +7 -0
  220. package/src/commands/verify-package-harmony.ts +7 -0
  221. package/src/core/AbsolutePath.ts +7 -0
  222. package/src/core/CodegenConfig.ts +7 -0
  223. package/src/core/DescriptiveError.ts +7 -0
  224. package/src/core/FileSystem.ts +7 -0
  225. package/src/core/OHPackageJSON5.ts +7 -0
  226. package/src/core/ValidationError.ts +7 -0
  227. package/src/core/ValueObject.ts +7 -0
  228. package/src/core/fs.ts +7 -0
  229. package/src/core/index.ts +7 -0
  230. package/src/index.ts +7 -0
  231. package/src/init/templates/AppScopeAppJSON5Template.ts +7 -0
  232. package/src/init/templates/AppScopeStringVarTemplate.ts +7 -0
  233. package/src/init/templates/EntryIndexTemplate.ts +7 -0
  234. package/src/init/templates/EntryStringVarTemplate.ts +7 -0
  235. package/src/init/templates/HvigorConfigJson5Template.ts +7 -0
  236. package/src/init/templates/MetroConfigTemplate.ts +7 -0
  237. package/src/init/templates/OhPackageJson5Template.ts +7 -0
  238. package/src/init/templates/harmony/entry/gitignore +5 -0
  239. package/src/init/templates/harmony/entry/src/main/cpp/gitignore +5 -0
  240. package/src/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +7 -0
  241. package/src/init/templates/harmony/entry/src/main/ets/codegen/gitignore +5 -0
  242. package/src/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +7 -0
  243. package/src/init/templates/harmony/entry/src/main/ets/gitignore +5 -0
  244. package/src/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +7 -0
  245. package/src/init/templates/harmony/entry/src/main/resources/gitignore +5 -0
  246. package/src/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +7 -0
  247. package/src/init/templates/harmony/gitignore +5 -0
  248. package/src/init/templates/index.ts +7 -0
  249. package/src/io/CliExecutor.ts +7 -0
  250. package/src/io/Logger.ts +7 -0
  251. package/src/io/RealFS.ts +7 -0
  252. package/src/io/TarGz.ts +7 -0
  253. package/src/io/__fixtures__.ts +7 -0
  254. package/src/io/fsUtils.ts +7 -0
  255. package/src/io/index.ts +7 -0
  256. package/src/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.ts +7 -0
  257. package/src/package-verifier/checks/HarmonyDirExistsCheck.ts +7 -0
  258. package/src/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.ts +7 -0
  259. package/src/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.ts +7 -0
  260. package/src/package-verifier/checks/index.ts +7 -0
  261. package/src/package-verifier/index.ts +7 -0
  262. package/src/package-verifier/types.ts +7 -0
  263. package/src/package-verifier/verify-package.ts +7 -0
  264. package/harmony/rnoh-hvigor-plugin-0.82.30.tgz +0 -0
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @react-native-oh/react-native-harmony-cli
2
2
 
3
- Please refer to: [RNOH repo](https://gitcode.com/openharmony-sig/ohos_react_native) for more detail.
3
+ Please refer to: [RNOH repo](https://gitcode.com/CPF-RN/ohos_react_native) for more detail.
4
4
 
5
5
  # Documentation
6
6
 
7
- - [中文](https://gitcode.com/openharmony-sig/ohos_react_native/blob/0.82/docs/zh-cn/README.md)
8
- - [English](https://gitcode.com/openharmony-sig/ohos_react_native/blob/0.82/docs/en/README.md)
7
+ - [中文](https://gitcode.com/CPF-RN/ohos_react_native/blob/0.82/docs/zh-cn/README.md)
8
+ - [English](https://gitcode.com/CPF-RN/ohos_react_native/blob/0.82/docs/en/README.md)
9
9
 
10
10
  # License
11
11
 
12
- This library is licensed under The [MIT License (MIT)](https://gitcode.com/openharmony-sig/ohos_react_native)
12
+ This library is licensed under The [MIT License (MIT)](https://gitcode.com/CPF-RN/ohos_react_native)
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.CodegenError = void 0;
4
10
  const core_1 = require("../../core");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.createEventNameFromEventHandlerName = createEventNameFromEventHandlerName;
4
10
  const CodegenError_1 = require("./CodegenError");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.TypeAnnotationToTS = void 0;
4
10
  exports.getStringifiedTSDefaultValueFromPropTypeAnnotation = getStringifiedTSDefaultValueFromPropTypeAnnotation;
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2024-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ArkTSComponentCodeGeneratorArkTS = void 0;
4
10
  const core_1 = require("../core");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ArkTSComponentCodeGeneratorCAPI = void 0;
4
10
  const core_1 = require("../core");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.CppComponentCodeGenerator = void 0;
4
10
  const templates_1 = require("../templates");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -36,12 +42,22 @@ class LibGlueCodeGenerator {
36
42
  basePackageTemplate.addComponent({ name: componentName, libraryCppName, isArkTSComponent: false });
37
43
  });
38
44
  fileContentByPath.set(this.cppOutputPath.copyWithNewSegment('RNOH', 'generated', `${basePackageClassName}.h`), basePackageTemplate.build());
39
- fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('components', 'ts.ts'), components_indexTS.build());
40
- fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('turboModules', 'ts.ts'), turboModules_indexTS.build());
41
- fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('ts.ts'), new templates_1.IndexTSTemplate(this.codegenNoticeLines)
42
- .addReexport({ from: './components/ts', as: 'RNC' })
43
- .addReexport({ from: './turboModules/ts', as: 'TM' })
44
- .build());
45
+ const hasFabricComponents = arkTSComponents.length > 0 || cppComponents.length > 0;
46
+ const hasTurboModules = turboModules.length > 0;
47
+ if (hasFabricComponents) {
48
+ fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('components', 'ts.ts'), components_indexTS.build());
49
+ }
50
+ if (hasTurboModules) {
51
+ fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('turboModules', 'ts.ts'), turboModules_indexTS.build());
52
+ }
53
+ const rootTS = new templates_1.IndexTSTemplate(this.codegenNoticeLines);
54
+ if (hasFabricComponents) {
55
+ rootTS.addReexport({ from: './components/ts', as: 'RNC' });
56
+ }
57
+ if (hasTurboModules) {
58
+ rootTS.addReexport({ from: './turboModules/ts', as: 'TM' });
59
+ }
60
+ fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('ts.ts'), rootTS.build());
45
61
  generated_indexETS.addReexport({ from: './ts' });
46
62
  fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('index.ets'), generated_indexETS.build());
47
63
  return fileContentByPath;
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.NativeModuleCodeGenerator = void 0;
4
10
  const templates_1 = require("../templates");
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2024-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2024-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2024-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {
@@ -20,6 +26,7 @@ const codegen_1 = require("../codegen");
20
26
  const case_1 = __importDefault(require("case"));
21
27
  const LibGlueCodeGenerator_1 = require("../codegen/generators/LibGlueCodeGenerator");
22
28
  const COMMAND_NAME = 'codegen-lib-harmony';
29
+ const VALID_GENERATE_TYPES = ['all', 'turbo-module', 'fabric'];
23
30
  exports.commandCodegenLibHarmony = {
24
31
  name: COMMAND_NAME,
25
32
  description: 'Generates boilerplate, types, and utilities from Turbo Module and Fabric Component specifications. Designed for library developers who want to include generated code in their libraries.',
@@ -55,6 +62,13 @@ exports.commandCodegenLibHarmony = {
55
62
  name: '--no-safety-check [boolean]',
56
63
  description: 'Skips the check that prevents file operations outside the current working directory. This command permanently deletes previously generated files. Files are generated in the path specified by cpp-output-path.',
57
64
  },
65
+ {
66
+ name: '--generate-type <string>',
67
+ description: 'Controls which type of code to generate. ' +
68
+ 'Possible values: "all" (default, generates both TurboModule and Fabric code), ' +
69
+ '"turbo-module" (generates only TurboModule code), ' +
70
+ '"fabric" (generates only Fabric component code).',
71
+ },
58
72
  ],
59
73
  func: (_argv, _config, rawArgs) => __awaiter(void 0, void 0, void 0, function* () {
60
74
  const logger = new io_1.Logger();
@@ -97,7 +111,7 @@ function validateArgsAndRetrieveUberSchemaByType(rawArgs) {
97
111
  };
98
112
  }
99
113
  function validateRawArgs(rawArgs) {
100
- var _a, _b, _c;
114
+ var _a, _b, _c, _d;
101
115
  if (!rawArgs.npmPackageName) {
102
116
  throw new core_1.DescriptiveError({
103
117
  whatHappened: '--npm-package-name is required',
@@ -116,14 +130,24 @@ function validateRawArgs(rawArgs) {
116
130
  whatCanUserDo: ['Please specify --ets-output-path'],
117
131
  });
118
132
  }
133
+ const generateType = ((_a = rawArgs.generateType) !== null && _a !== void 0 ? _a : 'all');
134
+ if (!VALID_GENERATE_TYPES.includes(generateType)) {
135
+ throw new core_1.DescriptiveError({
136
+ whatHappened: `Invalid --generate-type value: "${rawArgs.generateType}". Valid values are: ${VALID_GENERATE_TYPES.join(', ')}`,
137
+ whatCanUserDo: [
138
+ `Please specify one of: ${VALID_GENERATE_TYPES.join(', ')}`,
139
+ ],
140
+ });
141
+ }
119
142
  return {
120
143
  npmPackageName: rawArgs.npmPackageName,
121
- tmSpecPaths: ((_a = rawArgs.turboModulesSpecPaths) !== null && _a !== void 0 ? _a : []).map((path) => new core_1.AbsolutePath(path)),
122
- arkTSComponentsSpecPaths: ((_b = rawArgs.arktsComponentsSpecPaths) !== null && _b !== void 0 ? _b : []).map((path) => new core_1.AbsolutePath(path)),
123
- cppComponentsSpecPaths: ((_c = rawArgs.cppComponentsSpecPaths) !== null && _c !== void 0 ? _c : []).map((path) => new core_1.AbsolutePath(path)),
144
+ tmSpecPaths: ((_b = rawArgs.turboModulesSpecPaths) !== null && _b !== void 0 ? _b : []).map((path) => new core_1.AbsolutePath(path)),
145
+ arkTSComponentsSpecPaths: ((_c = rawArgs.arktsComponentsSpecPaths) !== null && _c !== void 0 ? _c : []).map((path) => new core_1.AbsolutePath(path)),
146
+ cppComponentsSpecPaths: ((_d = rawArgs.cppComponentsSpecPaths) !== null && _d !== void 0 ? _d : []).map((path) => new core_1.AbsolutePath(path)),
124
147
  etsOutputPath: new core_1.AbsolutePath(rawArgs.etsOutputPath),
125
148
  cppOutputPath: new core_1.AbsolutePath(rawArgs.cppOutputPath),
126
149
  safetyCheck: !!rawArgs.safetyCheck,
150
+ generateType,
127
151
  };
128
152
  }
129
153
  function specPathsToSpecFilePaths(specPaths) {
@@ -155,46 +179,60 @@ function generateCodeInMemory({ args, uberSchemaByType: { arkTSComponentsUberSch
155
179
  const appendToFileContentByPath = (fileContent, path) => {
156
180
  fileContentByPath.set(path, fileContent);
157
181
  };
158
- const turboModuleGlueCodeData = turboModulesUberSchema
159
- .findAllSpecSchemasByType('NativeModule')
160
- .map((specSchema) => {
161
- const nativeModuleCodeGenerator = new codegen_1.NativeModuleCodeGenerator(args.cppOutputPath.copyWithNewSegment('RNOH', 'generated', 'turbo_modules'), args.etsOutputPath.copyWithNewSegment('turboModules'), CODEGEN_NOTICE_LINES, '@rnoh/react-native-openharmony/ts');
162
- nativeModuleCodeGenerator
163
- .generate(specSchema)
164
- .forEach(appendToFileContentByPath);
165
- return nativeModuleCodeGenerator.getGlueCodeData();
166
- })
167
- .flat();
182
+ const { generateType } = args;
183
+ const shouldGenerateTurboModule = generateType === 'all' || generateType === 'turbo-module';
184
+ const shouldGenerateFabric = generateType === 'all' || generateType === 'fabric';
185
+ let turboModuleGlueCodeData = [];
186
+ if (shouldGenerateTurboModule) {
187
+ turboModuleGlueCodeData = turboModulesUberSchema
188
+ .findAllSpecSchemasByType('NativeModule')
189
+ .map((specSchema) => {
190
+ const nativeModuleCodeGenerator = new codegen_1.NativeModuleCodeGenerator(args.cppOutputPath.copyWithNewSegment('RNOH', 'generated', 'turbo_modules'), args.etsOutputPath.copyWithNewSegment('turboModules'), CODEGEN_NOTICE_LINES, '@rnoh/react-native-openharmony/ts');
191
+ nativeModuleCodeGenerator
192
+ .generate(specSchema)
193
+ .forEach(appendToFileContentByPath);
194
+ return nativeModuleCodeGenerator.getGlueCodeData();
195
+ })
196
+ .flat();
197
+ }
168
198
  const arkTSComponentCodeGeneratorCAPI = new codegen_1.ArkTSComponentCodeGeneratorCAPI(args.cppOutputPath.copyWithNewSegment('RNOH', 'generated', 'components'), args.etsOutputPath.copyWithNewSegment('components'), CODEGEN_NOTICE_LINES, '@rnoh/react-native-openharmony/ts');
169
- arkTSComponentCodeGeneratorCAPI
170
- .generate(arkTSComponentsUberSchema)
171
- .forEach(appendToFileContentByPath);
199
+ if (shouldGenerateFabric) {
200
+ arkTSComponentCodeGeneratorCAPI
201
+ .generate(arkTSComponentsUberSchema)
202
+ .forEach(appendToFileContentByPath);
203
+ }
172
204
  const libraryCppName = deriveLibraryCppNameFromNpmPackageName(args.npmPackageName);
173
205
  const cppComponentCodeGenerator = new codegen_1.CppComponentCodeGenerator((filename) => {
174
206
  return args.cppOutputPath.copyWithNewSegment('RNOH', 'generated', 'components', filename);
175
207
  }, CODEGEN_NOTICE_LINES);
176
- cppComponentCodeGenerator
177
- .generate({
178
- libraryCppName: libraryCppName,
179
- uberSchema: cppComponentsUberSchema,
180
- })
181
- .forEach(appendToFileContentByPath);
182
- new codegen_1.SharedComponentCodeGenerator((filename) => {
183
- return args.cppOutputPath.copyWithNewSegment('react', 'renderer', 'components', libraryCppName, filename);
184
- })
185
- .generate({
186
- libraryCppName: libraryCppName,
187
- uberSchema: componentsUberSchema,
188
- })
189
- .forEach(appendToFileContentByPath);
208
+ if (shouldGenerateFabric) {
209
+ cppComponentCodeGenerator
210
+ .generate({
211
+ libraryCppName: libraryCppName,
212
+ uberSchema: cppComponentsUberSchema,
213
+ })
214
+ .forEach(appendToFileContentByPath);
215
+ new codegen_1.SharedComponentCodeGenerator((filename) => {
216
+ return args.cppOutputPath.copyWithNewSegment('react', 'renderer', 'components', libraryCppName, filename);
217
+ })
218
+ .generate({
219
+ libraryCppName: libraryCppName,
220
+ uberSchema: componentsUberSchema,
221
+ })
222
+ .forEach(appendToFileContentByPath);
223
+ }
190
224
  new LibGlueCodeGenerator_1.LibGlueCodeGenerator(args.cppOutputPath, args.etsOutputPath, CODEGEN_NOTICE_LINES)
191
225
  .generate({
192
226
  libraryCppName,
193
- arkTSComponents: arkTSComponentCodeGeneratorCAPI.getLibGlueCodeData(),
194
- cppComponents: cppComponentCodeGenerator
195
- .getGlueCodeData()
196
- .map(({ name }) => ({ componentName: name })),
197
- turboModules: turboModuleGlueCodeData,
227
+ arkTSComponents: shouldGenerateFabric
228
+ ? arkTSComponentCodeGeneratorCAPI.getLibGlueCodeData()
229
+ : [],
230
+ cppComponents: shouldGenerateFabric
231
+ ? cppComponentCodeGenerator
232
+ .getGlueCodeData()
233
+ .map(({ name }) => ({ componentName: name }))
234
+ : [],
235
+ turboModules: shouldGenerateTurboModule ? turboModuleGlueCodeData : [],
198
236
  })
199
237
  .forEach(appendToFileContentByPath);
200
238
  return fileContentByPath;
@@ -209,14 +247,20 @@ function deriveLibraryCppNameFromNpmPackageName(npmPackageName) {
209
247
  return result;
210
248
  }
211
249
  function saveAndLogCodegenResult(args, logger, fileContentByPath) {
212
- saveCodegenResultToFileSystem(fileContentByPath, args.cppOutputPath, args.etsOutputPath, args.safetyCheck);
250
+ saveCodegenResultToFileSystem(fileContentByPath, args.cppOutputPath, args.etsOutputPath, args.safetyCheck, args.generateType);
213
251
  logCodegenResult(logger, fileContentByPath, new core_1.AbsolutePath(''));
214
252
  }
215
- function saveCodegenResultToFileSystem(fileContentByPath, cppOutputPath, etsOutputPath, enableSafetyCheck) {
253
+ function saveCodegenResultToFileSystem(fileContentByPath, cppOutputPath, etsOutputPath, enableSafetyCheck, generateType) {
254
+ const shouldGenerateTurboModule = generateType === 'all' || generateType === 'turbo-module';
255
+ const shouldGenerateFabric = generateType === 'all' || generateType === 'fabric';
216
256
  prepareDirectory(cppOutputPath, enableSafetyCheck);
217
257
  prepareDirectory(etsOutputPath, enableSafetyCheck);
218
- prepareDirectory(etsOutputPath.copyWithNewSegment('components'), enableSafetyCheck);
219
- prepareDirectory(etsOutputPath.copyWithNewSegment('turboModules'), enableSafetyCheck);
258
+ if (shouldGenerateFabric) {
259
+ prepareDirectory(etsOutputPath.copyWithNewSegment('components'), enableSafetyCheck);
260
+ }
261
+ if (shouldGenerateTurboModule) {
262
+ prepareDirectory(etsOutputPath.copyWithNewSegment('turboModules'), enableSafetyCheck);
263
+ }
220
264
  fileContentByPath.forEach((_fileContent, path) => {
221
265
  prepareDirectory(path.getDirectoryPath(), enableSafetyCheck);
222
266
  });
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2024-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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);
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * Copyright (c) 2025-2026 Huawei Technologies Co., Ltd.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE 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) {