@react-native-oh/react-native-harmony-cli 0.0.30 → 0.77.18-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.
Files changed (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -4
  3. package/dist/assetResolver.js +105 -10
  4. package/dist/autolinking/Autolinking.js +21 -26
  5. package/dist/autolinking/index.js +0 -6
  6. package/dist/codegen/core/CodeGenerator.js +0 -6
  7. package/dist/codegen/core/CodegenError.js +0 -6
  8. package/dist/codegen/core/EventUtils.js +4 -13
  9. package/dist/codegen/core/TypeAnnotationToTS.js +3 -9
  10. package/dist/codegen/core/UberSchema.js +8 -21
  11. package/dist/codegen/core/index.js +0 -6
  12. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +2 -7
  13. package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +3 -6
  14. package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +3 -6
  15. package/dist/codegen/generators/CppComponentCodeGenerator.js +3 -6
  16. package/dist/codegen/generators/LibGlueCodeGenerator.js +2 -8
  17. package/dist/codegen/generators/NativeModuleCodeGenerator.js +1 -7
  18. package/dist/codegen/generators/SharedComponentCodeGenerator.js +0 -6
  19. package/dist/codegen/generators/UberGeneratorV1.js +0 -6
  20. package/dist/codegen/generators/UberGeneratorV2.js +0 -6
  21. package/dist/codegen/generators/index.js +0 -6
  22. package/dist/codegen/index.js +0 -6
  23. package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +0 -6
  24. package/dist/codegen/templates/BasePackageHTemplate.js +12 -7
  25. package/dist/codegen/templates/ComponentDescriptorHTemplate.js +1 -6
  26. package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +15 -6
  27. package/dist/codegen/templates/ComponentUtilsTSTemplate.js +0 -6
  28. package/dist/codegen/templates/IndexTSTemplate.js +0 -6
  29. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +12 -7
  30. package/dist/codegen/templates/TurboModuleCppTemplate.js +0 -6
  31. package/dist/codegen/templates/TurboModuleHTemplate.js +0 -6
  32. package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +0 -6
  33. package/dist/codegen/templates/index.js +0 -6
  34. package/dist/commands/bundle-harmony.js +133 -101
  35. package/dist/commands/clean-harmony.js +84 -0
  36. package/dist/commands/codegen-harmony.js +12 -22
  37. package/dist/commands/codegen-lib-harmony.js +15 -25
  38. package/dist/commands/index.js +3 -9
  39. package/dist/commands/init-harmony.js +226 -0
  40. package/dist/commands/init.js +703 -0
  41. package/dist/commands/link-harmony.js +12 -16
  42. package/dist/commands/run-harmony.js +438 -0
  43. package/dist/commands/types.js +2 -0
  44. package/dist/commands/verify-package-harmony.js +7 -11
  45. package/dist/core/AbsolutePath.js +3 -6
  46. package/dist/core/CodegenConfig.js +3 -11
  47. package/dist/core/DescriptiveError.js +7 -9
  48. package/dist/core/FileSystem.js +0 -6
  49. package/dist/core/OHPackageJSON5.js +0 -6
  50. package/dist/core/PackageJSON.js +4 -7
  51. package/dist/core/ProjectDependenciesManager.js +6 -14
  52. package/dist/core/ValidationError.js +0 -6
  53. package/dist/core/ValueObject.js +0 -6
  54. package/dist/core/fs.js +16 -10
  55. package/dist/core/index.js +0 -6
  56. package/dist/index.js +3 -9
  57. package/dist/init/templates/AppScopeAppJSON5Template.js +30 -0
  58. package/dist/init/templates/AppScopeStringVarTemplate.js +28 -0
  59. package/dist/init/templates/EntryIndexTemplate.js +65 -0
  60. package/dist/init/templates/EntryStringVarTemplate.js +38 -0
  61. package/dist/init/templates/HvigorConfigJson5Template.js +44 -0
  62. package/dist/init/templates/MetroConfigTemplate.js +47 -0
  63. package/dist/init/templates/OhPackageJson5Template.js +37 -0
  64. package/dist/init/templates/harmony/AppScope/app.json5 +10 -0
  65. package/dist/init/templates/harmony/AppScope/resources/base/element/string.json +8 -0
  66. package/dist/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
  67. package/dist/init/templates/harmony/build-profile.json5 +36 -0
  68. package/dist/init/templates/harmony/codelinter.json +32 -0
  69. package/dist/init/templates/harmony/entry/build-profile.json5 +18 -0
  70. package/dist/init/templates/harmony/entry/gitignore +7 -0
  71. package/dist/init/templates/harmony/entry/hvigorfile.ts +13 -0
  72. package/dist/init/templates/harmony/entry/oh-package.json5 +9 -0
  73. package/dist/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +27 -0
  74. package/dist/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +13 -0
  75. package/dist/init/templates/harmony/entry/src/main/cpp/gitignore +4 -0
  76. package/dist/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +8 -0
  77. package/dist/init/templates/harmony/entry/src/main/ets/codegen/gitignore +2 -0
  78. package/dist/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +11 -0
  79. package/dist/init/templates/harmony/entry/src/main/ets/gitignore +1 -0
  80. package/dist/init/templates/harmony/entry/src/main/ets/pages/.gitkeep +0 -0
  81. package/dist/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +16 -0
  82. package/dist/init/templates/harmony/entry/src/main/module.json5 +58 -0
  83. package/dist/init/templates/harmony/entry/src/main/resources/base/element/color.json +8 -0
  84. package/dist/init/templates/harmony/entry/src/main/resources/base/element/string.json +16 -0
  85. package/dist/init/templates/harmony/entry/src/main/resources/base/media/background.png +0 -0
  86. package/dist/init/templates/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
  87. package/dist/init/templates/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
  88. package/dist/init/templates/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
  89. package/dist/init/templates/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  90. package/dist/init/templates/harmony/entry/src/main/resources/gitignore +1 -0
  91. package/dist/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +2 -0
  92. package/dist/init/templates/harmony/entry/src/ohosTest/module.json5 +13 -0
  93. package/dist/init/templates/harmony/gitignore +16 -0
  94. package/dist/init/templates/harmony/hvigor/hvigor-config.json5 +22 -0
  95. package/dist/init/templates/harmony/hvigorfile.ts +7 -0
  96. package/dist/init/templates/index.js +21 -0
  97. package/dist/io/CliExecutor.js +56 -29
  98. package/dist/io/Logger.js +71 -47
  99. package/dist/io/RealFS.js +10 -6
  100. package/dist/io/TarGz.js +3 -10
  101. package/dist/io/__fixtures__.js +8 -8
  102. package/dist/io/fsUtils.js +1 -8
  103. package/dist/io/index.js +1 -6
  104. package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +1 -8
  105. package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +1 -8
  106. package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +1 -8
  107. package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +1 -8
  108. package/dist/package-verifier/checks/index.js +0 -6
  109. package/dist/package-verifier/index.js +0 -6
  110. package/dist/package-verifier/types.js +0 -6
  111. package/dist/package-verifier/verify-package.js +5 -14
  112. package/harmony/rnoh-hvigor-plugin-0.77.18.tgz +0 -0
  113. package/jest.config.js +0 -7
  114. package/package.json +20 -16
  115. package/react-native.config.js +0 -7
  116. package/scripts/copy-template.js +18 -0
  117. package/src/assetResolver.ts +117 -11
  118. package/src/autolinking/Autolinking.test.ts +54 -18
  119. package/src/autolinking/Autolinking.ts +32 -31
  120. package/src/autolinking/index.ts +1 -8
  121. package/src/codegen/core/CodeGenerator.ts +0 -7
  122. package/src/codegen/core/CodegenError.ts +0 -7
  123. package/src/codegen/core/EventUtils.ts +3 -12
  124. package/src/codegen/core/TypeAnnotationToTS.test.ts +0 -7
  125. package/src/codegen/core/TypeAnnotationToTS.ts +3 -8
  126. package/src/codegen/core/UberSchema.ts +9 -22
  127. package/src/codegen/core/index.ts +0 -7
  128. package/src/codegen/generators/AppBuildTimeGlueCodeGenerator.ts +5 -8
  129. package/src/codegen/generators/ArkTSComponentCodeGeneratorArkTS.ts +3 -7
  130. package/src/codegen/generators/ArkTSComponentCodeGeneratorCAPI.ts +3 -7
  131. package/src/codegen/generators/CppComponentCodeGenerator.ts +3 -7
  132. package/src/codegen/generators/LibGlueCodeGenerator.ts +2 -9
  133. package/src/codegen/generators/NativeModuleCodeGenerator.ts +1 -8
  134. package/src/codegen/generators/SharedComponentCodeGenerator.ts +0 -7
  135. package/src/codegen/generators/UberGeneratorV1.ts +0 -7
  136. package/src/codegen/generators/UberGeneratorV2.ts +0 -7
  137. package/src/codegen/generators/index.ts +0 -7
  138. package/src/codegen/index.ts +0 -7
  139. package/src/codegen/templates/BaseComponentInstanceHTemplate.ts +0 -7
  140. package/src/codegen/templates/BasePackageHTemplate.ts +13 -8
  141. package/src/codegen/templates/ComponentDescriptorHTemplate.ts +1 -7
  142. package/src/codegen/templates/ComponentJSIBinderHTemplate.ts +24 -8
  143. package/src/codegen/templates/ComponentUtilsTSTemplate.ts +0 -7
  144. package/src/codegen/templates/IndexTSTemplate.ts +0 -7
  145. package/src/codegen/templates/RNOHGeneratedPackageHTemplate.ts +13 -8
  146. package/src/codegen/templates/TurboModuleCppTemplate.ts +0 -7
  147. package/src/codegen/templates/TurboModuleHTemplate.ts +0 -7
  148. package/src/codegen/templates/TurboModuleSpecTSTemplate.ts +0 -7
  149. package/src/codegen/templates/index.ts +0 -7
  150. package/src/commands/bundle-harmony.ts +178 -118
  151. package/src/commands/clean-harmony.ts +54 -0
  152. package/src/commands/codegen-harmony.ts +13 -25
  153. package/src/commands/codegen-lib-harmony.ts +16 -28
  154. package/src/commands/index.ts +3 -10
  155. package/src/commands/init-harmony.ts +299 -0
  156. package/src/commands/init.ts +755 -0
  157. package/src/commands/link-harmony.ts +14 -19
  158. package/src/commands/run-harmony.ts +478 -0
  159. package/src/commands/types.ts +14 -0
  160. package/src/commands/verify-package-harmony.ts +9 -12
  161. package/src/core/AbsolutePath.ts +4 -7
  162. package/src/core/CodegenConfig.ts +3 -12
  163. package/src/core/DescriptiveError.ts +8 -15
  164. package/src/core/FileSystem.ts +5 -8
  165. package/src/core/OHPackageJSON5.ts +0 -7
  166. package/src/core/PackageJSON.ts +4 -13
  167. package/src/core/ProjectDependenciesManager.ts +14 -22
  168. package/src/core/ValidationError.ts +0 -7
  169. package/src/core/ValueObject.ts +0 -7
  170. package/src/core/fs.ts +14 -8
  171. package/src/core/index.ts +0 -7
  172. package/src/index.ts +8 -15
  173. package/src/init/templates/AppScopeAppJSON5Template.ts +24 -0
  174. package/src/init/templates/AppScopeStringVarTemplate.ts +22 -0
  175. package/src/init/templates/EntryIndexTemplate.ts +59 -0
  176. package/src/init/templates/EntryStringVarTemplate.ts +31 -0
  177. package/src/init/templates/HvigorConfigJson5Template.ts +40 -0
  178. package/src/init/templates/MetroConfigTemplate.ts +41 -0
  179. package/src/init/templates/OhPackageJson5Template.ts +31 -0
  180. package/src/init/templates/harmony/AppScope/app.json5 +10 -0
  181. package/src/init/templates/harmony/AppScope/resources/base/element/string.json +8 -0
  182. package/src/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
  183. package/src/init/templates/harmony/build-profile.json5 +36 -0
  184. package/src/init/templates/harmony/codelinter.json +32 -0
  185. package/src/init/templates/harmony/entry/build-profile.json5 +18 -0
  186. package/src/init/templates/harmony/entry/gitignore +7 -0
  187. package/src/init/templates/harmony/entry/hvigorfile.ts +13 -0
  188. package/src/init/templates/harmony/entry/oh-package.json5 +9 -0
  189. package/src/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +27 -0
  190. package/src/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +13 -0
  191. package/src/init/templates/harmony/entry/src/main/cpp/gitignore +4 -0
  192. package/src/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +8 -0
  193. package/src/init/templates/harmony/entry/src/main/ets/codegen/gitignore +2 -0
  194. package/src/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +11 -0
  195. package/src/init/templates/harmony/entry/src/main/ets/gitignore +1 -0
  196. package/src/init/templates/harmony/entry/src/main/ets/pages/.gitkeep +0 -0
  197. package/src/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +16 -0
  198. package/src/init/templates/harmony/entry/src/main/module.json5 +58 -0
  199. package/src/init/templates/harmony/entry/src/main/resources/base/element/color.json +8 -0
  200. package/src/init/templates/harmony/entry/src/main/resources/base/element/string.json +16 -0
  201. package/src/init/templates/harmony/entry/src/main/resources/base/media/background.png +0 -0
  202. package/src/init/templates/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
  203. package/src/init/templates/harmony/entry/src/main/resources/base/media/layered_image.json +7 -0
  204. package/src/init/templates/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
  205. package/src/init/templates/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  206. package/src/init/templates/harmony/entry/src/main/resources/gitignore +1 -0
  207. package/src/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +2 -0
  208. package/src/init/templates/harmony/entry/src/ohosTest/module.json5 +13 -0
  209. package/src/init/templates/harmony/gitignore +16 -0
  210. package/src/init/templates/harmony/hvigor/hvigor-config.json5 +22 -0
  211. package/src/init/templates/harmony/hvigorfile.ts +7 -0
  212. package/src/init/templates/index.ts +5 -0
  213. package/src/io/CliExecutor.ts +55 -40
  214. package/src/io/Logger.ts +77 -51
  215. package/src/io/RealFS.ts +15 -8
  216. package/src/io/TarGz.ts +1 -8
  217. package/src/io/__fixtures__.ts +15 -18
  218. package/src/io/fsUtils.ts +1 -7
  219. package/src/io/index.ts +1 -7
  220. package/src/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.ts +0 -7
  221. package/src/package-verifier/checks/HarmonyDirExistsCheck.ts +0 -7
  222. package/src/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.ts +0 -7
  223. package/src/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.ts +0 -7
  224. package/src/package-verifier/checks/index.ts +0 -7
  225. package/src/package-verifier/index.ts +0 -7
  226. package/src/package-verifier/types.ts +0 -7
  227. package/src/package-verifier/verify-package.ts +4 -13
  228. package/tsconfig.build.json +2 -5
  229. package/tsconfig.json +4 -0
  230. package/dist/commands/create-metro-host-constants.js +0 -67
  231. package/dist/commands/pack-harmony.js +0 -106
  232. package/dist/commands/unpack-harmony.js +0 -191
  233. package/src/commands/create-metro-host-constants.ts +0 -55
  234. package/src/commands/pack-harmony.ts +0 -128
  235. package/src/commands/unpack-harmony.ts +0 -240
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Huawei Technologies Co., Ltd.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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://gitee.com/openharmony-sig/ohos_react_native) for more detail.
3
+ Please refer to: [RNOH repo](https://gitcode.com/openharmony-sig/ohos_react_native) for more detail.
4
4
 
5
5
  # Documentation
6
6
 
7
- - [中文](https://gitee.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/README.md)
8
- - [English](https://gitee.com/openharmony-sig/ohos_react_native/blob/master/docs/en/README.md)
7
+ - [中文](https://gitcode.com/openharmony-sig/ohos_react_native/blob/0.77.1-rc.1-ohos/docs/zh-cn/README.md)
8
+ - [English](https://gitcode.com/openharmony-sig/ohos_react_native/blob/0.77.1-rc.1-ohos/docs/en/README.md)
9
9
 
10
10
  # License
11
11
 
12
- This library is licensed under The [MIT License (MIT)](https://gitee.com/openharmony-sig/ohos_react_native)
12
+ This library is licensed under The [MIT License (MIT)](https://gitcode.com/openharmony-sig/ohos_react_native)
@@ -1,25 +1,120 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.copyAssets = copyAssets;
2
16
  /**
3
17
  * Copyright (c) 2024 Huawei Technologies Co., Ltd.
4
18
  *
5
19
  * This source code is licensed under the MIT license found in the
6
20
  * LICENSE-MIT file in the root directory of this source tree.
7
21
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getAssetDestRelativePath = void 0;
10
- function getAssetDestRelativePath(asset) {
22
+ const fs_1 = __importDefault(require("fs"));
23
+ const path_1 = __importDefault(require("path"));
24
+ const ALLOWED_SCALES = [1, 2, 3, 4];
25
+ function filterAssetScales(scales) {
26
+ const result = scales.filter(scale => ALLOWED_SCALES.includes(scale));
27
+ if (result.length === 0 && scales.length > 0) {
28
+ // No matching scale found, but there are some available. Ideally we don't
29
+ // want to be in this situation and should throw, but for now as a fallback
30
+ // let's just use the closest larger image
31
+ const maxScale = ALLOWED_SCALES[ALLOWED_SCALES.length - 1];
32
+ for (const scale of scales) {
33
+ if (scale > maxScale) {
34
+ result.push(scale);
35
+ break;
36
+ }
37
+ }
38
+ // There is no larger scales available, use the largest we have
39
+ if (result.length === 0) {
40
+ result.push(scales[scales.length - 1]);
41
+ }
42
+ }
43
+ return result;
44
+ }
45
+ function copyAssets(logger, assetsData, assetsDest) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ if (assetsDest == null) {
48
+ logger.warn((s) => 'Assets destination folder is not set, skipping...');
49
+ return;
50
+ }
51
+ const filesToCopy = {};
52
+ const addAssetToCopy = (asset) => {
53
+ const validScales = filterAssetScales(asset.scales);
54
+ asset.scales.forEach((scale, idx) => {
55
+ if (!validScales.includes(scale)) {
56
+ return;
57
+ }
58
+ const src = asset.files[idx];
59
+ const dest = path_1.default.join(assetsDest, getAssetDestRelativePath(asset, scale));
60
+ filesToCopy[src] = dest;
61
+ });
62
+ };
63
+ assetsData.forEach(addAssetToCopy);
64
+ return copyFiles(logger, filesToCopy);
65
+ });
66
+ }
67
+ function getAssetDestRelativePath(asset, scale = 1) {
68
+ const suffix = scale === 1 ? '' : `@${scale}x`;
11
69
  const fileName = getResourceIdentifier(asset);
12
- return `${fileName}.${asset.type}`;
70
+ // Assets can have relative paths outside of the project root.
71
+ // Replace `../` with `_` to make sure they don't end up outside of
72
+ // the expected assets directory.
73
+ return `${fileName + suffix}.${asset.type}`.replace(/\.\.\//g, '_');
13
74
  }
14
- exports.getAssetDestRelativePath = getAssetDestRelativePath;
15
75
  function getResourceIdentifier(asset) {
16
76
  const folderPath = getBasePath(asset);
17
- return `${folderPath}/${asset.name}`.slice('assets/'.length);
77
+ return `${folderPath}/${asset.name}`.replace(/^assets\//, '');
18
78
  }
19
79
  function getBasePath(asset) {
20
- let basePath = asset.httpServerLocation;
21
- if (basePath[0] === '/') {
22
- basePath = basePath.substr(1);
80
+ const basePath = asset.httpServerLocation;
81
+ return basePath.startsWith('/') ? basePath.slice(1) : basePath;
82
+ }
83
+ function copyFiles(logger, fileDestBySrc) {
84
+ const fileSources = Object.keys(fileDestBySrc);
85
+ if (fileSources.length === 0) {
86
+ return Promise.resolve();
23
87
  }
24
- return basePath;
88
+ const assetFilesCount = fileSources.length;
89
+ return new Promise((resolve, reject) => {
90
+ const copyNext = (error) => {
91
+ if (error) {
92
+ reject(error);
93
+ return;
94
+ }
95
+ if (fileSources.length === 0) {
96
+ logger.info(() => `Copied ${assetFilesCount} ${assetFilesCount === 1 ? 'asset' : 'assets'}`);
97
+ resolve();
98
+ }
99
+ else {
100
+ // fileSources.length === 0 is checked in previous branch, so this is string
101
+ const src = fileSources.shift();
102
+ const dest = fileDestBySrc[src];
103
+ copyFile(src, dest, copyNext);
104
+ }
105
+ };
106
+ copyNext();
107
+ });
108
+ }
109
+ function copyFile(src, dest, onFinished) {
110
+ const destDir = path_1.default.dirname(dest);
111
+ fs_1.default.mkdir(destDir, { recursive: true }, (err) => {
112
+ if (err) {
113
+ onFinished(err);
114
+ return;
115
+ }
116
+ fs_1.default.createReadStream(src)
117
+ .pipe(fs_1.default.createWriteStream(dest))
118
+ .on('finish', onFinished);
119
+ });
25
120
  }
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -23,6 +17,7 @@ const json5_1 = __importDefault(require("json5"));
23
17
  const core_1 = require("../core");
24
18
  const mustache_1 = __importDefault(require("mustache"));
25
19
  const case_1 = __importDefault(require("case"));
20
+ const node_path_1 = __importDefault(require("node:path"));
26
21
  const ETS_RNOH_PACKAGES_FACTORY_TEMPLATE = `
27
22
  /*
28
23
  * This file was generated by RNOH autolinking.
@@ -50,7 +45,7 @@ const CPP_RNOH_PACKAGES_FACTORY_TEMPLATE = `
50
45
  #pragma once
51
46
  #include "RNOH/Package.h"
52
47
  {{#libraries}}
53
- #include "{{etsRNOHPackageClassName}}.h"
48
+ #include "{{cppRNOHPackageClassName}}.h"
54
49
  {{/libraries}}
55
50
 
56
51
  std::vector<rnoh::Package::Shared> createRNOHPackages(const rnoh::Package::Context &ctx) {
@@ -66,7 +61,7 @@ const CMAKE_AUTOLINKING_TEMPLATE = `
66
61
  # DO NOT modify it manually, your changes WILL be overwritten.
67
62
  cmake_minimum_required(VERSION 3.5)
68
63
 
69
- # @api
64
+ # @actor RNOH_APP
70
65
  function(autolink_libraries target)
71
66
  {{#libraries}}
72
67
  add_subdirectory("\${OH_MODULES_DIR}/{{{ohPackageName}}}/src/main/cpp" ./{{cmakeLibraryTargetName}})
@@ -95,9 +90,7 @@ class Autolinking {
95
90
  config.excludedNpmPackageNames.size > 0) {
96
91
  throw new core_1.DescriptiveError({
97
92
  whatHappened: 'Tried to exclude and include npm packages.',
98
- whatCanUserDo: {
99
- default: ['Include or exclude npm packages, but not both.'],
100
- },
93
+ whatCanUserDo: ['Include or exclude npm packages, but not both.'],
101
94
  extraData: {
102
95
  includedNpmPackageNamesCount: config.includedNpmPackageNames.size,
103
96
  excludedNpmPackageNamesCount: config.excludedNpmPackageNames.size,
@@ -113,11 +106,11 @@ class Autolinking {
113
106
  const skippedLibraryNpmPackageNames = [];
114
107
  yield new core_1.ProjectDependenciesManager(this.fs, projectRootPath).forEachAsync((dependency) => {
115
108
  var _a;
116
- const harFilePath = dependency.getHarFilePath();
117
- if (!harFilePath) {
109
+ const harFilePaths = dependency.getHarFilePaths();
110
+ if (harFilePaths.length === 0) {
118
111
  return;
119
112
  }
120
- nodeModuleHarPaths.push(harFilePath);
113
+ nodeModuleHarPaths.push(...harFilePaths);
121
114
  const packageJson = dependency.readPackageJSON();
122
115
  const providedAutolinkingConfig = (_a = packageJson.harmony) === null || _a === void 0 ? void 0 : _a.autolinking;
123
116
  if (providedAutolinkingConfig === undefined ||
@@ -125,7 +118,8 @@ class Autolinking {
125
118
  (config.excludedNpmPackageNames.has(packageJson.name) &&
126
119
  config.excludedNpmPackageNames.size > 0) ||
127
120
  (!config.includedNpmPackageNames.has(packageJson.name) &&
128
- config.includedNpmPackageNames.size > 0)) {
121
+ config.includedNpmPackageNames.size > 0) ||
122
+ harFilePaths.length !== 1) {
129
123
  skippedLibraryNpmPackageNames.push(packageJson.name);
130
124
  return;
131
125
  }
@@ -136,7 +130,7 @@ class Autolinking {
136
130
  cppRNOHPackageClassName: autolinkingConfig === null || autolinkingConfig === void 0 ? void 0 : autolinkingConfig.cppPackageClassName,
137
131
  cmakeLibraryTargetName: autolinkingConfig === null || autolinkingConfig === void 0 ? void 0 : autolinkingConfig.cmakeLibraryTargetName,
138
132
  ohPackageName: autolinkingConfig === null || autolinkingConfig === void 0 ? void 0 : autolinkingConfig.ohPackageName,
139
- harFilePathRelativeToHarmony: harFilePath
133
+ harFilePathRelativeToHarmony: harFilePaths[0]
140
134
  .relativeTo(harmonyProjectPath)
141
135
  .toString(),
142
136
  });
@@ -173,13 +167,14 @@ class Autolinking {
173
167
  const autolinkableHarFilePathsRelativeToHarmony = autolinkableLibraries.map((lib) => lib.harFilePathRelativeToHarmony);
174
168
  const unmanagedNativeDependencySpecifierByName = {};
175
169
  Object.entries(ohPackage.dependencies).forEach(([name, dependencySpecifier]) => {
176
- if (!dependencySpecifier.includes('file:')) {
170
+ if (!(dependencySpecifier.includes('file:') &&
171
+ dependencySpecifier.includes('node_modules'))) {
177
172
  unmanagedNativeDependencySpecifierByName[name] = dependencySpecifier;
178
173
  }
179
174
  else {
180
175
  const harFilePathRelativeToHarmony = dependencySpecifier.replace('file:', '');
181
- if (!autolinkableHarFilePathsRelativeToHarmony.includes(harFilePathRelativeToHarmony) &&
182
- input.nodeModuleHarFilePathsRelativeToHarmony.includes(harFilePathRelativeToHarmony)) {
176
+ if (!autolinkableHarFilePathsRelativeToHarmony.includes(node_path_1.default.normalize(harFilePathRelativeToHarmony)) &&
177
+ input.nodeModuleHarFilePathsRelativeToHarmony.includes(node_path_1.default.normalize(harFilePathRelativeToHarmony))) {
183
178
  unmanagedNativeDependencySpecifierByName[name] =
184
179
  dependencySpecifier;
185
180
  }
@@ -255,21 +250,21 @@ class Autolinking {
255
250
  this.fs.writeTextSync(path, content);
256
251
  });
257
252
  output.linkedLibraryNpmPackageNames.forEach((npmPackageName) => {
258
- this.logger.info((styles) => `[${styles.green(styles.bold('link'))}] ${npmPackageName}`);
253
+ this.logger.debug((styles) => `[${styles.green(styles.bold('link'))}] ${npmPackageName}`);
259
254
  });
260
255
  output.skippedLibraryNpmPackageNames.forEach((npmPackageName) => {
261
- this.logger.warn((styles) => `[${styles.yellow(styles.bold('skip'))}] ${npmPackageName}`);
256
+ this.logger.debug((styles) => `[${styles.yellow(styles.bold('skip'))}] ${npmPackageName}`);
262
257
  });
263
- this.logger.info(() => '');
258
+ this.logger.debug(() => '');
264
259
  const sortedPathsRelativeToRoot = pathAndContentPairs
265
260
  .map(([path]) => path.relativeTo(output.projectRootPath).toString())
266
261
  .sort();
267
262
  sortedPathsRelativeToRoot.forEach((pathStr) => {
268
- this.logger.info((styles) => styles.gray(`• ${pathStr}`));
263
+ this.logger.debug((styles) => styles.gray(`• ${pathStr}`));
269
264
  });
270
- this.logger.info(() => '');
271
- this.logger.info((styles) => `updated ${styles.green(styles.bold(sortedPathsRelativeToRoot.length))} file(s), linked ${styles.green(styles.bold(output.linkedLibraryNpmPackageNames.length))} libraries, skipped ${styles.yellow(styles.bold(output.skippedLibraryNpmPackageNames.length))} libraries`, { prefix: true });
272
- this.logger.info(() => '');
265
+ this.logger.debug(() => '');
266
+ this.logger.info((styles) => `updated ${styles.green(styles.bold(sortedPathsRelativeToRoot.length))} file(s), linked ${styles.green(styles.bold(output.linkedLibraryNpmPackageNames.length))} libraries, skipped ${styles.yellow(styles.bold(output.skippedLibraryNpmPackageNames.length))} libraries`);
267
+ this.logger.debug(() => '');
273
268
  }
274
269
  }
275
270
  exports.Autolinking = Autolinking;
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1,8 +1,2 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.CodegenError = void 0;
10
4
  const core_1 = require("../../core");
@@ -1,25 +1,16 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createEventNameFromEventHandlerName = void 0;
3
+ exports.createEventNameFromEventHandlerName = createEventNameFromEventHandlerName;
10
4
  const CodegenError_1 = require("./CodegenError");
11
5
  function createEventNameFromEventHandlerName(eventHandlerName) {
12
6
  const eventName = eventHandlerName.replace('on', '');
13
7
  if (eventName.length === 0) {
14
8
  throw new CodegenError_1.CodegenError({
15
9
  whatHappened: `Received invalid event handler name: ${eventHandlerName}`,
16
- whatCanUserDo: {
17
- default: [
18
- 'Change your event listener name to match naming convention "onEventName" e.g. "onPress"',
19
- ],
20
- },
10
+ whatCanUserDo: [
11
+ 'Change your event listener name to match naming convention "onEventName" e.g. "onPress"',
12
+ ],
21
13
  });
22
14
  }
23
15
  return eventName.charAt(0).toLowerCase() + eventName.slice(1);
24
16
  }
25
- exports.createEventNameFromEventHandlerName = createEventNameFromEventHandlerName;
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.wrapWithQuotes = exports.getStringifiedTSDefaultValueFromPropTypeAnnotation = exports.TypeAnnotationToTS = void 0;
3
+ exports.TypeAnnotationToTS = void 0;
4
+ exports.getStringifiedTSDefaultValueFromPropTypeAnnotation = getStringifiedTSDefaultValueFromPropTypeAnnotation;
5
+ exports.wrapWithQuotes = wrapWithQuotes;
10
6
  class TypeAnnotationToTS {
11
7
  constructor(aliasPrefix = '') {
12
8
  this.aliasPrefix = aliasPrefix;
@@ -126,7 +122,6 @@ function getStringifiedTSDefaultValueFromPropTypeAnnotation(propTypeAnnotation)
126
122
  }
127
123
  return null;
128
124
  }
129
- exports.getStringifiedTSDefaultValueFromPropTypeAnnotation = getStringifiedTSDefaultValueFromPropTypeAnnotation;
130
125
  function wrapWithQuotes(str) {
131
126
  if (str.includes("'")) {
132
127
  return `"${str}"`;
@@ -135,4 +130,3 @@ function wrapWithQuotes(str) {
135
130
  return `'${str}'`;
136
131
  }
137
132
  }
138
- exports.wrapWithQuotes = wrapWithQuotes;
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -14,17 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
14
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
15
9
  });
16
10
  };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
11
  Object.defineProperty(exports, "__esModule", { value: true });
21
12
  exports.UberSchema = void 0;
22
13
  const core_1 = require("../../core");
23
14
  // @ts-expect-error
24
- const combine_js_to_schema_js_1 = __importDefault(require("@react-native/codegen/lib/cli/combine/combine-js-to-schema.js"));
15
+ const combine_js_to_schema_js_1 = require("@react-native/codegen/lib/cli/combine/combine-js-to-schema.js");
25
16
  const CodegenError_1 = require("./CodegenError");
26
17
  function createRawUberSchemaFromSpecFilePaths(projectSourceFilePaths) {
27
- return (0, combine_js_to_schema_js_1.default)(projectSourceFilePaths.map((p) => p.getValue()));
18
+ return (0, combine_js_to_schema_js_1.combineSchemas)(projectSourceFilePaths.map((p) => p.getValue()));
28
19
  }
29
20
  /**
30
21
  * Contains component and turbo module (NativeModule) schemas. The "Uber" word is used here to highlight that SpecSchemas don't extend this class.
@@ -41,11 +32,9 @@ class UberSchema {
41
32
  if (err instanceof Error) {
42
33
  throw new CodegenError_1.CodegenError({
43
34
  whatHappened: "Couldn't create the schema",
44
- whatCanUserDo: {
45
- default: [
46
- `There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
47
- ],
48
- },
35
+ whatCanUserDo: [
36
+ `There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
37
+ ],
49
38
  });
50
39
  }
51
40
  throw err;
@@ -77,11 +66,9 @@ class UberSchema {
77
66
  if (err instanceof Error) {
78
67
  throw new CodegenError_1.CodegenError({
79
68
  whatHappened: "Couldn't create the schema",
80
- whatCanUserDo: {
81
- default: [
82
- `There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
83
- ],
84
- },
69
+ whatCanUserDo: [
70
+ `There's probably at least one spec file defined in your project or in a third-party package that breaks some code generation restrictions. Please check the message below. If it's ambiguous, debug the problem with divide and conquer strategy.\n\n${err.message}`,
71
+ ],
85
72
  });
86
73
  }
87
74
  throw err;
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
9
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
4
  };
@@ -35,6 +29,7 @@ class AppBuildTimeGlueCodeGenerator {
35
29
  generatedPackageH_v1.addComponent({
36
30
  name,
37
31
  supportedEventNames: eventNames,
32
+ isArkTSComponent: true,
38
33
  });
39
34
  });
40
35
  v1.turboModules.forEach((turboModule) => {
@@ -45,7 +40,7 @@ class AppBuildTimeGlueCodeGenerator {
45
40
  const basePackageClassName = `Base${case_1.default.pascal(libraryName)}Package`;
46
41
  const generatedPackageH_v2 = new BasePackageHTemplate_1.BasePackageHTemplate(basePackageClassName, this.codegenNoticeLines);
47
42
  components.forEach((component) => {
48
- generatedPackageH_v2.addComponent(component);
43
+ generatedPackageH_v2.addComponent(Object.assign(Object.assign({}, component), { isArkTSComponent: false }));
49
44
  });
50
45
  turboModules.forEach((turboModule) => {
51
46
  turboModules_indexTS.addReexport({ from: `./${turboModule.name}` });
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.ArkTSComponentCodeGeneratorArkTS = void 0;
10
4
  const core_1 = require("../core");
@@ -46,6 +40,9 @@ class ArkTSComponentCodeGeneratorArkTS {
46
40
  });
47
41
  });
48
42
  shape.commands.forEach((command) => {
43
+ componentJSIBinderHTemplate.addCommand({
44
+ name: command.name,
45
+ });
49
46
  componentUtilsTSTemplate.addCommand({
50
47
  name: command.name,
51
48
  argsTSType: '[' +
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.ArkTSComponentCodeGeneratorCAPI = void 0;
10
4
  const core_1 = require("../core");
@@ -44,6 +38,9 @@ class ArkTSComponentCodeGeneratorCAPI {
44
38
  });
45
39
  });
46
40
  shape.commands.forEach((command) => {
41
+ componentJSIBinderHTemplate.addCommand({
42
+ name: command.name,
43
+ });
47
44
  componentUtilsTSTemplate.addCommand({
48
45
  name: command.name,
49
46
  argsTSType: '[' +
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.CppComponentCodeGenerator = void 0;
10
4
  const templates_1 = require("../templates");
@@ -39,6 +33,9 @@ class CppComponentCodeGenerator {
39
33
  });
40
34
  });
41
35
  shape.commands.forEach((command) => {
36
+ componentJSIBinderHTemplate.addCommand({
37
+ name: command.name,
38
+ });
42
39
  componentInstanceSpecHTemplate.addCommand({
43
40
  name: command.name,
44
41
  args: command.typeAnnotation.params.map((param) => ({
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
9
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
4
  };
@@ -35,11 +29,11 @@ class LibGlueCodeGenerator {
35
29
  });
36
30
  arkTSComponents.forEach(({ componentName, eventNames }) => {
37
31
  components_indexTS.addReexport({ from: `./${componentName}` });
38
- basePackageTemplate.addComponent({ name: componentName, libraryCppName });
32
+ basePackageTemplate.addComponent({ name: componentName, libraryCppName, isArkTSComponent: true });
39
33
  eventNames.forEach((eventName) => basePackageTemplate.addArkTSEvent({ name: eventName }));
40
34
  });
41
35
  cppComponents.forEach(({ componentName }) => {
42
- basePackageTemplate.addComponent({ name: componentName, libraryCppName });
36
+ basePackageTemplate.addComponent({ name: componentName, libraryCppName, isArkTSComponent: false });
43
37
  });
44
38
  fileContentByPath.set(this.cppOutputPath.copyWithNewSegment('RNOH', 'generated', `${basePackageClassName}.h`), basePackageTemplate.build());
45
39
  fileContentByPath.set(this.etsOutputPath.copyWithNewSegment('components', 'ts.ts'), components_indexTS.build());
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NativeModuleCodeGenerator = void 0;
10
4
  const templates_1 = require("../templates");
@@ -53,7 +47,7 @@ class NativeModuleCodeGenerator {
53
47
  })),
54
48
  });
55
49
  });
56
- schema.spec.properties.map((prop) => {
50
+ schema.spec.methods.map((prop) => {
57
51
  if (prop.typeAnnotation.type === 'FunctionTypeAnnotation') {
58
52
  turboModuleCpp.addMethod({
59
53
  name: prop.name,
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
9
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
4
  };
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.UberGeneratorV1 = void 0;
10
4
  const core_1 = require("../core");
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.UberGeneratorV2 = void 0;
10
4
  const CppComponentCodeGenerator_1 = require("./CppComponentCodeGenerator");
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Copyright (c) 2024 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
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
3
  if (k2 === undefined) k2 = k;
10
4
  var desc = Object.getOwnPropertyDescriptor(m, k);