@react-native-oh/react-native-harmony-cli 0.77.22 → 0.77.33

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 (200) hide show
  1. package/dist/assetResolver.js +74 -43
  2. package/dist/autolinking/Autolinking.js +179 -178
  3. package/dist/codegen/core/CodegenError.js +23 -3
  4. package/dist/codegen/core/EventUtils.js +3 -3
  5. package/dist/codegen/core/TypeAnnotationToTS.js +28 -24
  6. package/dist/codegen/core/UberSchema.js +97 -55
  7. package/dist/codegen/generators/AppBuildTimeGlueCodeGenerator.js +41 -28
  8. package/dist/codegen/generators/ArkTSComponentCodeGeneratorArkTS.js +34 -27
  9. package/dist/codegen/generators/ArkTSComponentCodeGeneratorCAPI.js +33 -25
  10. package/dist/codegen/generators/CppComponentCodeGenerator.js +28 -23
  11. package/dist/codegen/generators/LibGlueCodeGenerator.js +29 -26
  12. package/dist/codegen/generators/NativeModuleCodeGenerator.js +30 -25
  13. package/dist/codegen/generators/SharedComponentCodeGenerator.js +15 -15
  14. package/dist/codegen/generators/UberGeneratorV1.js +24 -18
  15. package/dist/codegen/generators/UberGeneratorV2.js +36 -28
  16. package/dist/codegen/templates/BaseComponentInstanceHTemplate.js +24 -50
  17. package/dist/codegen/templates/BasePackageHTemplate.js +21 -120
  18. package/dist/codegen/templates/ComponentDescriptorHTemplate.js +8 -54
  19. package/dist/codegen/templates/ComponentJSIBinderHTemplate.js +27 -75
  20. package/dist/codegen/templates/ComponentUtilsTSTemplate.js +29 -162
  21. package/dist/codegen/templates/IndexTSTemplate.js +17 -37
  22. package/dist/codegen/templates/RNOHGeneratedPackageHTemplate.js +24 -119
  23. package/dist/codegen/templates/TurboModuleCppTemplate.js +15 -38
  24. package/dist/codegen/templates/TurboModuleHTemplate.js +11 -32
  25. package/dist/codegen/templates/TurboModuleSpecTSTemplate.js +19 -52
  26. package/dist/commands/bundle-harmony.js +221 -118
  27. package/dist/commands/clean-harmony.js +63 -58
  28. package/dist/commands/codegen-harmony.js +175 -104
  29. package/dist/commands/codegen-lib-harmony.js +116 -76
  30. package/dist/commands/init-harmony.js +196 -151
  31. package/dist/commands/init.js +961 -537
  32. package/dist/commands/link-harmony.js +82 -35
  33. package/dist/commands/run-harmony.js +518 -374
  34. package/dist/commands/verify-package-harmony.js +117 -54
  35. package/dist/core/AbsolutePath.js +49 -33
  36. package/dist/core/CodegenConfig.js +22 -24
  37. package/dist/core/DescriptiveError.js +37 -18
  38. package/dist/core/FileSystem.js +18 -14
  39. package/dist/core/OHPackageJSON5.js +23 -17
  40. package/dist/core/PackageJSON.js +42 -26
  41. package/dist/core/ProjectDependenciesManager.js +92 -40
  42. package/dist/core/ValidationError.js +22 -2
  43. package/dist/core/fs.js +7 -10
  44. package/dist/index.js +1 -1
  45. package/dist/init/templates/AppScopeAppJSON5Template.js +8 -21
  46. package/dist/init/templates/AppScopeStringVarTemplate.js +8 -19
  47. package/dist/init/templates/EntryIndexTemplate.js +8 -56
  48. package/dist/init/templates/EntryStringVarTemplate.js +8 -27
  49. package/dist/init/templates/HvigorConfigJson5Template.js +8 -33
  50. package/dist/init/templates/MetroConfigTemplate.js +8 -38
  51. package/dist/init/templates/OhPackageJson5Template.js +8 -28
  52. package/dist/io/CliExecutor.js +98 -46
  53. package/dist/io/Logger.js +46 -40
  54. package/dist/io/RealFS.js +100 -43
  55. package/dist/io/TarGz.js +8 -11
  56. package/dist/io/__fixtures__.js +141 -79
  57. package/dist/io/fsUtils.js +12 -13
  58. package/dist/package-verifier/checks/HarmonyDirContainsOnlyHarsCheck.js +47 -19
  59. package/dist/package-verifier/checks/HarmonyDirExistsCheck.js +41 -13
  60. package/dist/package-verifier/checks/NpmAnAndOhPackageVersionsAreEqual.js +38 -8
  61. package/dist/package-verifier/checks/OhPackageNameFollowsNamingConventionCheck.js +54 -22
  62. package/dist/package-verifier/verify-package.js +133 -56
  63. package/dist/simulator/LaunchSimulator.js +301 -217
  64. package/package.json +2 -11
  65. package/scripts/sync-hvigor.js +27 -0
  66. package/src/autolinking/Autolinking.ts +1 -1
  67. package/src/codegen/generators/UberGeneratorV1.ts +7 -2
  68. package/src/codegen/generators/UberGeneratorV2.ts +6 -1
  69. package/src/commands/codegen-harmony.ts +17 -7
  70. package/src/commands/run-harmony.ts +0 -2
  71. package/src/simulator/LaunchSimulator.ts +9 -2
  72. package/dist/init/templates/harmony/AppScope/app.json5 +0 -10
  73. package/dist/init/templates/harmony/AppScope/resources/base/element/string.json +0 -8
  74. package/dist/init/templates/harmony/AppScope/resources/base/media/app_icon.png +0 -0
  75. package/dist/init/templates/harmony/build-profile.json5 +0 -36
  76. package/dist/init/templates/harmony/codelinter.json +0 -32
  77. package/dist/init/templates/harmony/entry/build-profile.json5 +0 -18
  78. package/dist/init/templates/harmony/entry/gitignore +0 -7
  79. package/dist/init/templates/harmony/entry/hvigorfile.ts +0 -13
  80. package/dist/init/templates/harmony/entry/oh-package.json5 +0 -9
  81. package/dist/init/templates/harmony/entry/src/main/cpp/CMakeLists.txt +0 -27
  82. package/dist/init/templates/harmony/entry/src/main/cpp/PackageProvider.cpp +0 -13
  83. package/dist/init/templates/harmony/entry/src/main/cpp/gitignore +0 -4
  84. package/dist/init/templates/harmony/entry/src/main/ets/PackageProvider.ets +0 -8
  85. package/dist/init/templates/harmony/entry/src/main/ets/codegen/gitignore +0 -2
  86. package/dist/init/templates/harmony/entry/src/main/ets/entryability/EntryAbility.ets +0 -11
  87. package/dist/init/templates/harmony/entry/src/main/ets/gitignore +0 -1
  88. package/dist/init/templates/harmony/entry/src/main/ets/pages/.gitkeep +0 -0
  89. package/dist/init/templates/harmony/entry/src/main/ets/workers/RNOHWorker.ets +0 -16
  90. package/dist/init/templates/harmony/entry/src/main/module.json5 +0 -65
  91. package/dist/init/templates/harmony/entry/src/main/resources/base/element/color.json +0 -8
  92. package/dist/init/templates/harmony/entry/src/main/resources/base/element/string.json +0 -16
  93. package/dist/init/templates/harmony/entry/src/main/resources/base/media/background.png +0 -0
  94. package/dist/init/templates/harmony/entry/src/main/resources/base/media/foreground.png +0 -0
  95. package/dist/init/templates/harmony/entry/src/main/resources/base/media/layered_image.json +0 -7
  96. package/dist/init/templates/harmony/entry/src/main/resources/base/media/startIcon.png +0 -0
  97. package/dist/init/templates/harmony/entry/src/main/resources/base/profile/main_pages.json +0 -5
  98. package/dist/init/templates/harmony/entry/src/main/resources/gitignore +0 -1
  99. package/dist/init/templates/harmony/entry/src/ohosTest/ets/test/List.test.ets +0 -2
  100. package/dist/init/templates/harmony/entry/src/ohosTest/module.json5 +0 -13
  101. package/dist/init/templates/harmony/gitignore +0 -16
  102. package/dist/init/templates/harmony/hvigor/hvigor-config.json5 +0 -22
  103. package/dist/init/templates/harmony/hvigorfile.ts +0 -7
  104. package/harmony/rnoh-hvigor-plugin-0.77.22.tgz +0 -0
  105. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/02febc14 +0 -0
  106. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/0429e5b7 +0 -0
  107. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/05339e68 +0 -0
  108. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/070be2fe +0 -0
  109. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/07851ff1 +0 -0
  110. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12e10c06 +0 -0
  111. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/12e1d696 +0 -0
  112. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/14950087 +0 -0
  113. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/15e87372 +0 -0
  114. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/19e6ecbe +0 -0
  115. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1aac0ac4 +0 -0
  116. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1b8db102 +0 -0
  117. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/1c181646 +0 -0
  118. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/203e747c +0 -0
  119. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/21ba4c08 +0 -0
  120. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/259939e5 +0 -0
  121. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/288ba98c +0 -0
  122. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2a45461c +0 -0
  123. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2d773091 +0 -0
  124. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2eda89fc +0 -0
  125. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/2f584eca +0 -0
  126. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/35b495ca +0 -0
  127. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/36478aed +0 -0
  128. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3844e772 +0 -0
  129. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/3ee777f4 +0 -0
  130. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/471ac436 +0 -0
  131. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4a91abcc +0 -0
  132. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4d1a5094 +0 -0
  133. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4d3ef38f +0 -0
  134. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4daf5855 +0 -0
  135. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4ef0389f +0 -0
  136. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/4f72da28 +0 -0
  137. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/59d3e924 +0 -0
  138. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5a8edfaa +0 -0
  139. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/5d28a510 +0 -0
  140. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/61a6391d +0 -0
  141. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/65921a14 +0 -0
  142. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6624e7fc +0 -0
  143. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/66d28144 +0 -0
  144. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/6aceb8d2 +0 -0
  145. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/702393d3 +0 -0
  146. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/714f932b +0 -0
  147. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/73f9d4a6 +0 -0
  148. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/78d3adae +0 -0
  149. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7b6564b8 +0 -0
  150. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7c7c3e6e +0 -0
  151. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7cbc9b6a +0 -0
  152. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7dd579e0 +0 -0
  153. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7e0b7d06 +0 -0
  154. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7e153eef +0 -0
  155. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7ee84fd7 +0 -0
  156. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/7f5146a4 +0 -0
  157. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/844e633a +0 -0
  158. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/8a1af22c +0 -0
  159. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/90a1680d +0 -0
  160. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/a15fb79a +0 -0
  161. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ac288a8a +0 -0
  162. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ad7a66b4 +0 -0
  163. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/aee8805e +0 -0
  164. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b0487ec8 +0 -0
  165. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b10e16d2 +0 -0
  166. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b32d42ac +0 -0
  167. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b7d8f35c +0 -0
  168. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/b96748af +0 -0
  169. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/bedb2fea +0 -0
  170. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c01ad640 +0 -0
  171. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c0472cf5 +0 -0
  172. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c102ed0f +0 -0
  173. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c1a91819 +0 -0
  174. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c243857a +0 -0
  175. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c407792f +0 -0
  176. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c4459bee +0 -0
  177. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c72a4dcd +0 -0
  178. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c83537a9 +0 -0
  179. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c88f7498 +0 -0
  180. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/c8d04070 +0 -0
  181. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/cc44d6f1 +0 -0
  182. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/d4d913f6 +0 -0
  183. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/da97f202 +0 -0
  184. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/dc965522 +0 -0
  185. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/dff6f700 +0 -0
  186. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e507c001 +0 -0
  187. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e52f3f2d +0 -0
  188. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e5c3890d +0 -0
  189. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e720074d +0 -0
  190. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e7656fa7 +0 -0
  191. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e80bcaac +0 -0
  192. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/e8e7900e +0 -0
  193. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ee8993f9 +0 -0
  194. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/ef8cf362 +0 -0
  195. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f1405b1d +0 -0
  196. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f20f0e0d +0 -0
  197. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f2586978 +0 -0
  198. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/f53cd716 +0 -0
  199. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/fe71f6bb +0 -0
  200. package/node-compile-cache/v22.14.0-x64-efe9a9df-0/febfc20b +0 -0
@@ -8,6 +8,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
11
38
  var __asyncValues = (this && this.__asyncValues) || function (o) {
12
39
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
13
40
  var m = o[Symbol.asyncIterator], i;
@@ -15,16 +42,22 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
15
42
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
16
43
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
17
44
  };
18
- var __importDefault = (this && this.__importDefault) || function (mod) {
19
- return (mod && mod.__esModule) ? mod : { "default": mod };
45
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
46
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
47
+ if (ar || !(i in from)) {
48
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
49
+ ar[i] = from[i];
50
+ }
51
+ }
52
+ return to.concat(ar || Array.prototype.slice.call(from));
20
53
  };
21
54
  Object.defineProperty(exports, "__esModule", { value: true });
22
55
  exports.commandVerifyPackageHarmony = void 0;
23
- const cli_tools_1 = require("@react-native-community/cli-tools");
24
- const chalk_1 = __importDefault(require("chalk"));
25
- const core_1 = require("../core");
26
- const io_1 = require("../io");
27
- const package_verifier_1 = require("../package-verifier");
56
+ var cli_tools_1 = require("@react-native-community/cli-tools");
57
+ var chalk_1 = require("chalk");
58
+ var core_1 = require("../core");
59
+ var io_1 = require("../io");
60
+ var package_verifier_1 = require("../package-verifier");
28
61
  exports.commandVerifyPackageHarmony = {
29
62
  name: 'verify-package-harmony',
30
63
  description: 'Validates that a package is compliant with guidelines',
@@ -40,25 +73,37 @@ exports.commandVerifyPackageHarmony = {
40
73
  {
41
74
  name: '--skip-checks <string...>',
42
75
  description: 'Disable certain checks by their names',
43
- parse: (val, prev) => (prev ? [...prev, val] : [val]),
76
+ parse: function (val, prev) { return (prev ? __spreadArray(__spreadArray([], prev, true), [val], false) : [val]); },
44
77
  },
45
78
  ],
46
- func: (argv, config, rawArgs) => __awaiter(void 0, void 0, void 0, function* () {
47
- var _a, e_1, _b, _c;
48
- const loader = (0, cli_tools_1.getLoader)();
49
- try {
50
- const args = validateArgs(rawArgs);
51
- loader.info(`Verifying RNOH package: ${args.packagePath.getValue()}`);
52
- const checkResults = [];
53
- try {
54
- for (var _d = true, _e = __asyncValues((0, package_verifier_1.verifyRNOHPackage)({
55
- npmPackagePath: args.packagePath,
56
- hasHarmonyCode: args.hasHarmonyCode,
57
- checkNamesToSkip: args.checkNamesToSkip,
58
- })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
59
- _c = _f.value;
60
- _d = false;
61
- const checkResult = _c;
79
+ func: function (argv, config, rawArgs) { return __awaiter(void 0, void 0, void 0, function () {
80
+ var loader, args, checkResults, _a, _b, _c, checkResult, e_1_1, err_1;
81
+ var _d, e_1, _e, _f;
82
+ return __generator(this, function (_g) {
83
+ switch (_g.label) {
84
+ case 0:
85
+ loader = (0, cli_tools_1.getLoader)();
86
+ _g.label = 1;
87
+ case 1:
88
+ _g.trys.push([1, 14, , 15]);
89
+ args = validateArgs(rawArgs);
90
+ loader.info("Verifying RNOH package: ".concat(args.packagePath.getValue()));
91
+ checkResults = [];
92
+ _g.label = 2;
93
+ case 2:
94
+ _g.trys.push([2, 7, 8, 13]);
95
+ _a = true, _b = __asyncValues((0, package_verifier_1.verifyRNOHPackage)({
96
+ npmPackagePath: args.packagePath,
97
+ hasHarmonyCode: args.hasHarmonyCode,
98
+ checkNamesToSkip: args.checkNamesToSkip,
99
+ }));
100
+ _g.label = 3;
101
+ case 3: return [4 /*yield*/, _b.next()];
102
+ case 4:
103
+ if (!(_c = _g.sent(), _d = _c.done, !_d)) return [3 /*break*/, 6];
104
+ _f = _c.value;
105
+ _a = false;
106
+ checkResult = _f;
62
107
  if (checkResult.type === 'START_PROCESS') {
63
108
  loader.start(chalk_1.default.gray(checkResult.name));
64
109
  }
@@ -66,31 +111,49 @@ exports.commandVerifyPackageHarmony = {
66
111
  checkResults.push(checkResult);
67
112
  logCheckResult(loader, checkResult);
68
113
  }
69
- }
70
- }
71
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
72
- finally {
73
- try {
74
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
75
- }
76
- finally { if (e_1) throw e_1.error; }
77
- }
78
- if (checkResults.every((checkResult) => checkResult.status === 'pass' || checkResult.status === 'skip')) {
79
- loader.info(chalk_1.default.bold('OK'));
80
- }
81
- else {
82
- loader.info(chalk_1.default.red('Package verification failed. Please fix those checks before publishing your package.'));
83
- process.exit(1);
84
- }
85
- }
86
- catch (err) {
87
- if (err instanceof core_1.DescriptiveError) {
88
- new io_1.Logger().descriptiveError(err);
89
- process.exit(1);
114
+ _g.label = 5;
115
+ case 5:
116
+ _a = true;
117
+ return [3 /*break*/, 3];
118
+ case 6: return [3 /*break*/, 13];
119
+ case 7:
120
+ e_1_1 = _g.sent();
121
+ e_1 = { error: e_1_1 };
122
+ return [3 /*break*/, 13];
123
+ case 8:
124
+ _g.trys.push([8, , 11, 12]);
125
+ if (!(!_a && !_d && (_e = _b.return))) return [3 /*break*/, 10];
126
+ return [4 /*yield*/, _e.call(_b)];
127
+ case 9:
128
+ _g.sent();
129
+ _g.label = 10;
130
+ case 10: return [3 /*break*/, 12];
131
+ case 11:
132
+ if (e_1) throw e_1.error;
133
+ return [7 /*endfinally*/];
134
+ case 12: return [7 /*endfinally*/];
135
+ case 13:
136
+ if (checkResults.every(function (checkResult) {
137
+ return checkResult.status === 'pass' || checkResult.status === 'skip';
138
+ })) {
139
+ loader.info(chalk_1.default.bold('OK'));
140
+ }
141
+ else {
142
+ loader.info(chalk_1.default.red('Package verification failed. Please fix those checks before publishing your package.'));
143
+ process.exit(1);
144
+ }
145
+ return [3 /*break*/, 15];
146
+ case 14:
147
+ err_1 = _g.sent();
148
+ if (err_1 instanceof core_1.DescriptiveError) {
149
+ new io_1.Logger().descriptiveError(err_1);
150
+ process.exit(1);
151
+ }
152
+ throw err_1;
153
+ case 15: return [2 /*return*/];
90
154
  }
91
- throw err;
92
- }
93
- }),
155
+ });
156
+ }); },
94
157
  };
95
158
  function validateArgs(args) {
96
159
  if (!args.packagePath) {
@@ -108,17 +171,17 @@ function validateArgs(args) {
108
171
  };
109
172
  }
110
173
  function logCheckResult(loader, checkResult) {
111
- const prefix = (() => {
174
+ var prefix = (function () {
112
175
  switch (checkResult.status) {
113
176
  case 'pass':
114
- return `${chalk_1.default.green('PASS')}`;
177
+ return "".concat(chalk_1.default.green('PASS'));
115
178
  case 'fail':
116
- return `${chalk_1.default.red('FAIL')}`;
179
+ return "".concat(chalk_1.default.red('FAIL'));
117
180
  case 'skip':
118
- return `${chalk_1.default.yellow('SKIP')}`;
181
+ return "".concat(chalk_1.default.yellow('SKIP'));
119
182
  }
120
183
  })();
121
184
  loader.info(checkResult.message
122
- ? `[${chalk_1.default.bold(prefix)}] ${chalk_1.default.bold(checkResult.name)}\n${checkResult.message}`
123
- : `[${chalk_1.default.bold(prefix)}] ${chalk_1.default.bold(checkResult.name)}`);
185
+ ? "[".concat(chalk_1.default.bold(prefix), "] ").concat(chalk_1.default.bold(checkResult.name), "\n").concat(checkResult.message)
186
+ : "[".concat(chalk_1.default.bold(prefix), "] ").concat(chalk_1.default.bold(checkResult.name)));
124
187
  }
@@ -1,56 +1,72 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
4
10
  };
5
11
  Object.defineProperty(exports, "__esModule", { value: true });
6
12
  exports.AbsolutePath = void 0;
7
- const node_path_1 = __importDefault(require("node:path"));
8
- class AbsolutePath {
9
- static fromSegments(...segments) {
10
- return new AbsolutePath(node_path_1.default.join(...segments));
11
- }
12
- constructor(path) {
13
+ var node_path_1 = require("node:path");
14
+ var AbsolutePath = /** @class */ (function () {
15
+ function AbsolutePath(path) {
13
16
  this.value = '';
14
17
  this.value = node_path_1.default.resolve(path);
15
18
  }
16
- getValue() {
19
+ AbsolutePath.fromSegments = function () {
20
+ var segments = [];
21
+ for (var _i = 0; _i < arguments.length; _i++) {
22
+ segments[_i] = arguments[_i];
23
+ }
24
+ return new AbsolutePath(node_path_1.default.join.apply(node_path_1.default, segments));
25
+ };
26
+ AbsolutePath.prototype.getValue = function () {
17
27
  return this.value;
18
- }
19
- toString() {
28
+ };
29
+ AbsolutePath.prototype.toString = function () {
20
30
  return this.value;
21
- }
22
- copyWithNewSegment(...relativePath) {
23
- return new AbsolutePath(node_path_1.default.join(this.getValue(), ...relativePath));
24
- }
25
- getExtension() {
26
- const maybeExtWithDot = node_path_1.default.extname(this.value);
31
+ };
32
+ AbsolutePath.prototype.copyWithNewSegment = function () {
33
+ var relativePath = [];
34
+ for (var _i = 0; _i < arguments.length; _i++) {
35
+ relativePath[_i] = arguments[_i];
36
+ }
37
+ return new AbsolutePath(node_path_1.default.join.apply(node_path_1.default, __spreadArray([this.getValue()], relativePath, false)));
38
+ };
39
+ AbsolutePath.prototype.getExtension = function () {
40
+ var maybeExtWithDot = node_path_1.default.extname(this.value);
27
41
  if (maybeExtWithDot) {
28
42
  return maybeExtWithDot.substring(1);
29
43
  }
30
44
  return null;
31
- }
32
- getBasename() {
45
+ };
46
+ AbsolutePath.prototype.getBasename = function () {
33
47
  return node_path_1.default.basename(this.value);
34
- }
35
- getDirectoryPath() {
36
- const dirPath = node_path_1.default.extname(this.value)
48
+ };
49
+ AbsolutePath.prototype.getDirectoryPath = function () {
50
+ var dirPath = node_path_1.default.extname(this.value)
37
51
  ? node_path_1.default.dirname(this.value)
38
52
  : this.value;
39
53
  return new AbsolutePath(dirPath);
40
- }
41
- relativeTo(absolutePath) {
54
+ };
55
+ AbsolutePath.prototype.relativeTo = function (absolutePath) {
42
56
  return new RelativePath(node_path_1.default.relative(absolutePath.getValue(), this.value));
43
- }
44
- }
57
+ };
58
+ return AbsolutePath;
59
+ }());
45
60
  exports.AbsolutePath = AbsolutePath;
46
- class RelativePath {
47
- constructor(value) {
61
+ var RelativePath = /** @class */ (function () {
62
+ function RelativePath(value) {
48
63
  this.value = value;
49
64
  }
50
- getValue() {
65
+ RelativePath.prototype.getValue = function () {
51
66
  return this.value;
52
- }
53
- toString() {
67
+ };
68
+ RelativePath.prototype.toString = function () {
54
69
  return this.value;
55
- }
56
- }
70
+ };
71
+ return RelativePath;
72
+ }());
@@ -1,17 +1,18 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.CodegenConfig = void 0;
7
- const node_fs_1 = __importDefault(require("node:fs"));
8
- const io_1 = require("../io");
9
- const DescriptiveError_1 = require("./DescriptiveError");
10
- class CodegenConfig {
11
- static fromRawCodegenConfig(rawCodegenConfig, packageRootPath, projectRootPath, packageName) {
4
+ var node_fs_1 = require("node:fs");
5
+ var io_1 = require("../io");
6
+ var DescriptiveError_1 = require("./DescriptiveError");
7
+ var CodegenConfig = /** @class */ (function () {
8
+ function CodegenConfig(specFilePaths, version) {
9
+ this.specFilePaths = specFilePaths;
10
+ this.version = version;
11
+ }
12
+ CodegenConfig.fromRawCodegenConfig = function (rawCodegenConfig, packageRootPath, projectRootPath, packageName) {
12
13
  var _a, _b;
13
- const SUPPORTED_SPEC_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx'];
14
- const specPaths = ((_a = rawCodegenConfig.specPaths) !== null && _a !== void 0 ? _a : []).map((rawSpecPath) => {
14
+ var SUPPORTED_SPEC_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx'];
15
+ var specPaths = ((_a = rawCodegenConfig.specPaths) !== null && _a !== void 0 ? _a : []).map(function (rawSpecPath) {
15
16
  if (rawSpecPath.startsWith('~')) {
16
17
  return projectRootPath.copyWithNewSegment(rawSpecPath.replace('~', ''));
17
18
  }
@@ -19,12 +20,12 @@ class CodegenConfig {
19
20
  return packageRootPath.copyWithNewSegment(rawSpecPath);
20
21
  }
21
22
  });
22
- const specFilePaths = specPaths.flatMap((specPath) => {
23
+ var specFilePaths = specPaths.flatMap(function (specPath) {
23
24
  if (!node_fs_1.default.existsSync(specPath.getValue())) {
24
25
  throw new DescriptiveError_1.DescriptiveError({
25
- whatHappened: `No such file or directory: ${specPath.getValue()}`,
26
+ whatHappened: "No such file or directory: ".concat(specPath.getValue()),
26
27
  whatCanUserDo: [
27
- `Please verify "${packageName}/package.json::harmony::codegenConfig". If you are not the maintainer of this package, please report this problem to the package maintainer.`,
28
+ "Please verify \"".concat(packageName, "/package.json::harmony::codegenConfig\". If you are not the maintainer of this package, please report this problem to the package maintainer."),
28
29
  ],
29
30
  });
30
31
  }
@@ -32,7 +33,7 @@ class CodegenConfig {
32
33
  return (0, io_1.findFilePathsWithExtensions)(specPath, SUPPORTED_SPEC_EXTENSIONS);
33
34
  }
34
35
  else {
35
- const ext = specPath.getExtension();
36
+ var ext = specPath.getExtension();
36
37
  if (ext && SUPPORTED_SPEC_EXTENSIONS.includes(ext)) {
37
38
  return [specPath];
38
39
  }
@@ -40,16 +41,13 @@ class CodegenConfig {
40
41
  }
41
42
  });
42
43
  return new CodegenConfig(specFilePaths, (_b = rawCodegenConfig.version) !== null && _b !== void 0 ? _b : 1);
43
- }
44
- constructor(specFilePaths, version) {
45
- this.specFilePaths = specFilePaths;
46
- this.version = version;
47
- }
48
- getSpecFilePaths() {
44
+ };
45
+ CodegenConfig.prototype.getSpecFilePaths = function () {
49
46
  return this.specFilePaths;
50
- }
51
- getVersion() {
47
+ };
48
+ CodegenConfig.prototype.getVersion = function () {
52
49
  return this.version;
53
- }
54
- }
50
+ };
51
+ return CodegenConfig;
52
+ }());
55
53
  exports.CodegenConfig = CodegenConfig;
@@ -1,18 +1,35 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.DescriptiveError = void 0;
4
- class DescriptiveError extends Error {
5
- constructor(data) {
6
- super(data.whatHappened);
7
- this.data = data;
19
+ var DescriptiveError = /** @class */ (function (_super) {
20
+ __extends(DescriptiveError, _super);
21
+ function DescriptiveError(data) {
22
+ var _this = _super.call(this, data.whatHappened) || this;
23
+ _this.data = data;
24
+ return _this;
8
25
  }
9
- isUnexpected() {
26
+ DescriptiveError.prototype.isUnexpected = function () {
10
27
  return 'unexpected' in this.data;
11
- }
12
- getMessage() {
28
+ };
29
+ DescriptiveError.prototype.getMessage = function () {
13
30
  return this.data.whatHappened;
14
- }
15
- getSuggestions() {
31
+ };
32
+ DescriptiveError.prototype.getSuggestions = function () {
16
33
  var _a;
17
34
  if ('whatCanUserDo' in this.data) {
18
35
  return (_a = this.data.whatCanUserDo) !== null && _a !== void 0 ? _a : [];
@@ -20,11 +37,11 @@ class DescriptiveError extends Error {
20
37
  else {
21
38
  return [];
22
39
  }
23
- }
24
- getRawData() {
40
+ };
41
+ DescriptiveError.prototype.getRawData = function () {
25
42
  return this.data;
26
- }
27
- getDetails() {
43
+ };
44
+ DescriptiveError.prototype.getDetails = function () {
28
45
  var _a;
29
46
  if (!this.data.extraData) {
30
47
  return '';
@@ -33,10 +50,11 @@ class DescriptiveError extends Error {
33
50
  return this.data.extraData.trim();
34
51
  }
35
52
  if (this.data.extraData instanceof Error) {
36
- let lines = [
37
- `${this.data.extraData.name}: ${this.data.extraData.message}`,
53
+ var lines = [
54
+ "".concat(this.data.extraData.name, ": ").concat(this.data.extraData.message),
38
55
  ];
39
- for (let stackEntry of ((_a = this.data.extraData.stack) !== null && _a !== void 0 ? _a : '').split('\n')) {
56
+ for (var _i = 0, _b = ((_a = this.data.extraData.stack) !== null && _a !== void 0 ? _a : '').split('\n'); _i < _b.length; _i++) {
57
+ var stackEntry = _b[_i];
40
58
  lines.push('');
41
59
  lines.push(stackEntry);
42
60
  }
@@ -48,6 +66,7 @@ class DescriptiveError extends Error {
48
66
  catch (err) {
49
67
  return '';
50
68
  }
51
- }
52
- }
69
+ };
70
+ return DescriptiveError;
71
+ }(Error));
53
72
  exports.DescriptiveError = DescriptiveError;
@@ -1,19 +1,22 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.FS = exports.Dirent = void 0;
7
- const node_path_1 = __importDefault(require("node:path"));
8
- class Dirent {
9
- }
4
+ var node_path_1 = require("node:path");
5
+ var Dirent = /** @class */ (function () {
6
+ function Dirent() {
7
+ }
8
+ return Dirent;
9
+ }());
10
10
  exports.Dirent = Dirent;
11
- class FS {
12
- findFilePathsWithExtensions(dirPath, fileExtensions) {
13
- let results = [];
14
- const dirents = this.readDirentsSync(dirPath);
15
- for (const dirent of dirents) {
16
- const path = dirPath.copyWithNewSegment(dirent.name.toString());
11
+ var FS = /** @class */ (function () {
12
+ function FS() {
13
+ }
14
+ FS.prototype.findFilePathsWithExtensions = function (dirPath, fileExtensions) {
15
+ var results = [];
16
+ var dirents = this.readDirentsSync(dirPath);
17
+ for (var _i = 0, dirents_1 = dirents; _i < dirents_1.length; _i++) {
18
+ var dirent = dirents_1[_i];
19
+ var path = dirPath.copyWithNewSegment(dirent.name.toString());
17
20
  if (dirent.isDirectory()) {
18
21
  results = results.concat(this.findFilePathsWithExtensions(path, fileExtensions));
19
22
  }
@@ -22,6 +25,7 @@ class FS {
22
25
  }
23
26
  }
24
27
  return results;
25
- }
26
- }
28
+ };
29
+ return FS;
30
+ }());
27
31
  exports.FS = FS;
@@ -1,23 +1,29 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.OHPackageJSON5 = void 0;
7
- const json5_1 = __importDefault(require("json5"));
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- class OHPackageJSON5 {
10
- static fromPath(ohPackageJson5Path) {
11
- return new OHPackageJSON5(json5_1.default.parse(node_fs_1.default.readFileSync(ohPackageJson5Path.getValue(), { encoding: 'utf-8' })));
12
- }
13
- constructor(rawData) {
4
+ var json5_1 = require("json5");
5
+ var node_fs_1 = require("node:fs");
6
+ var OHPackageJSON5 = /** @class */ (function () {
7
+ function OHPackageJSON5(rawData) {
14
8
  this.rawData = rawData;
15
9
  }
16
- get name() {
17
- return this.rawData['name'];
18
- }
19
- get version() {
20
- return this.rawData['version'];
21
- }
22
- }
10
+ OHPackageJSON5.fromPath = function (ohPackageJson5Path) {
11
+ return new OHPackageJSON5(json5_1.default.parse(node_fs_1.default.readFileSync(ohPackageJson5Path.getValue(), { encoding: 'utf-8' })));
12
+ };
13
+ Object.defineProperty(OHPackageJSON5.prototype, "name", {
14
+ get: function () {
15
+ return this.rawData['name'];
16
+ },
17
+ enumerable: false,
18
+ configurable: true
19
+ });
20
+ Object.defineProperty(OHPackageJSON5.prototype, "version", {
21
+ get: function () {
22
+ return this.rawData['version'];
23
+ },
24
+ enumerable: false,
25
+ configurable: true
26
+ });
27
+ return OHPackageJSON5;
28
+ }());
23
29
  exports.OHPackageJSON5 = OHPackageJSON5;