@ohos-cpf/3rdloop 0.0.8 → 0.0.10

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 (220) hide show
  1. package/README.md +43 -0
  2. package/lib/cli.js +38 -5
  3. package/lib/doctor.js +111 -10
  4. package/lib/knowledge.js +440 -0
  5. package/lib/mcp.js +498 -0
  6. package/package.json +6 -2
  7. package/vendor/Archive/data/.index/meta.json +7 -0
  8. package/vendor/Archive/data/.index/search.db +0 -0
  9. package/vendor/Archive/data/docs/experiences/arkts-check-tool-pitfalls-baseline-comparison.md +13 -0
  10. package/vendor/Archive/data/docs/experiences/arkts-deep-path-import-recognition.md +31 -0
  11. package/vendor/Archive/data/docs/experiences/arkts-demo-coverage-entry-file-case-mismatch.md +25 -0
  12. package/vendor/Archive/data/docs/experiences/arkts-demo-coverage-import-trailing-slash.md +20 -0
  13. package/vendor/Archive/data/docs/experiences/arkts-library-source-files-may-be-ts.md +18 -0
  14. package/vendor/Archive/data/docs/experiences/arkts-typedarray-buffer-interface-cast-compile-fixes.md +36 -0
  15. package/vendor/Archive/data/docs/experiences/arkts-xts-compile-error-clustering-fix.md +24 -0
  16. package/vendor/Archive/data/docs/experiences/arkts-xts-doc-expected-value-runtime-probe.md +35 -0
  17. package/vendor/Archive/data/docs/experiences/arkts-xts-fixture-rawfile-testability-injection.md +33 -0
  18. package/vendor/Archive/data/docs/experiences/code-linter-chinese-comment-false-positive.md +16 -0
  19. package/vendor/Archive/data/docs/experiences/esobject-new-expression-variable-tracking.md +33 -0
  20. package/vendor/Archive/data/docs/experiences/filesystem-case-sensitivity-module-resolution.md +31 -0
  21. package/vendor/Archive/data/docs/experiences/gitcode-clone-redirect-warning-normal.md +13 -0
  22. package/vendor/Archive/data/docs/experiences/kn_msgvq1w585ec8319.md +77 -0
  23. package/vendor/Archive/data/docs/experiences/kn_msovnm6rd46de72c.md +98 -0
  24. package/vendor/Archive/data/docs/experiences/kn_mspt8vntfe708576.md +87 -0
  25. package/vendor/Archive/data/docs/experiences/kn_mspu1ei77adbbb48.md +133 -0
  26. package/vendor/Archive/data/docs/experiences/kn_mspubgak8d30bfce.md +128 -0
  27. package/vendor/Archive/data/docs/experiences/kn_mspug2de3cb1f7c3.md +115 -0
  28. package/vendor/Archive/data/docs/experiences/kn_skill_opt_001.md +38 -0
  29. package/vendor/Archive/data/docs/experiences/loop-artifacts-verification-evidence-triangle.md +19 -0
  30. package/vendor/Archive/data/docs/experiences/macos-bash-replace-build-ps1.md +19 -0
  31. package/vendor/Archive/data/docs/experiences/macos-bsd-diff-q-illegal-option.md +15 -0
  32. package/vendor/Archive/data/docs/experiences/migrate-cjs-compatible-api-version-map-limit.md +17 -0
  33. package/vendor/Archive/data/docs/experiences/mp3agic-arkts-library-behavior-quirks.md +21 -0
  34. package/vendor/Archive/data/docs/experiences/ohos-face-detection-scan-api-mapping.md +15 -0
  35. package/vendor/Archive/data/docs/experiences/pr-metadata-and-diff-integrity-verification.md +12 -0
  36. package/vendor/Archive/data/docs/experiences/rn-coverage-index-signature-pseudo-member-false-negative.md +32 -0
  37. package/vendor/Archive/data/docs/experiences/rn-memory-check-severity-calibration.md +21 -0
  38. package/vendor/Archive/data/docs/experiences/rn-platform-specific-api-exclusion-evidence.md +24 -0
  39. package/vendor/Archive/data/docs/experiences/rn-upstream-version-diff-pitfalls.md +17 -0
  40. package/vendor/Archive/data/docs/experiences/rn-version-gap-risk-rating-rules.md +13 -0
  41. package/vendor/Archive/data/docs/experiences/rn-view-lib-native-contract-diff-fabric-spec.md +16 -0
  42. package/vendor/Archive/data/docs/experiences/rnoh-adapter-package-version-field-semantics.md +18 -0
  43. package/vendor/Archive/data/docs/experiences/rnoh-arkts-sqlite-rows-array-format.md +18 -0
  44. package/vendor/Archive/data/docs/experiences/rnoh-dependency-residue-scan-strategy.md +18 -0
  45. package/vendor/Archive/data/docs/experiences/rnoh-example-local-lib-dep-use-tgz.md +53 -0
  46. package/vendor/Archive/data/docs/experiences/rnoh-example-prereserve-rntesterlist.md +17 -0
  47. package/vendor/Archive/data/docs/experiences/rnoh-example-template-compatiblesdkversion-upgrade.md +29 -0
  48. package/vendor/Archive/data/docs/experiences/rnoh-example-turbomodule-shell-adaptation-checklist.md +41 -0
  49. package/vendor/Archive/data/docs/experiences/rnoh-mcp-build-project-tool-risk.md +18 -0
  50. package/vendor/Archive/data/docs/experiences/rnoh-npm-devdependencies-version-precheck.md +29 -0
  51. package/vendor/Archive/data/docs/experiences/rnoh-repo-baseline-version-verification.md +13 -0
  52. package/vendor/Archive/data/docs/experiences/rnoh-repo-upstream-directory-mapping.md +18 -0
  53. package/vendor/Archive/data/docs/experiences/rnoh-stateless-library-zero-leak-verification.md +31 -0
  54. package/vendor/Archive/data/docs/experiences/rnoh-template-npmrc-credential-removal.md +15 -0
  55. package/vendor/Archive/data/docs/experiences/rnoh-turbomodule-codegen-wiring-verification.md +19 -0
  56. package/vendor/Archive/data/docs/experiences/rnoh-turbomodule-cpp-methodmap-compatibility-check.md +20 -0
  57. package/vendor/Archive/data/docs/experiences/scenario-doc-vs-source-signature-diff-four-patterns.md +24 -0
  58. package/vendor/Archive/data/docs/experiences/static-analysis-grep-cross-validation.md +29 -0
  59. package/vendor/Archive/demo.js +489 -0
  60. package/vendor/Archive/index.js +43 -0
  61. package/vendor/Archive/package.json +16 -0
  62. package/vendor/Archive/src/constants.js +83 -0
  63. package/vendor/Archive/src/data/stopwords.txt +110 -0
  64. package/vendor/Archive/src/data/synonyms.json +25 -0
  65. package/vendor/Archive/src/data/terms.txt +59 -0
  66. package/vendor/Archive/src/db/sqlite-backend.js +312 -0
  67. package/vendor/Archive/src/db/sqlite-schema.js +64 -0
  68. package/vendor/Archive/src/engine.js +501 -0
  69. package/vendor/Archive/src/index/index-manager.js +203 -0
  70. package/vendor/Archive/src/index/index-state.js +94 -0
  71. package/vendor/Archive/src/index/search-text-builder.js +106 -0
  72. package/vendor/Archive/src/index.js +22 -0
  73. package/vendor/Archive/src/parser/api-identifiers.js +121 -0
  74. package/vendor/Archive/src/parser/api-suffixes.js +48 -0
  75. package/vendor/Archive/src/parser/heading-normalize.js +40 -0
  76. package/vendor/Archive/src/parser/markdown-splitter.js +215 -0
  77. package/vendor/Archive/src/search/catalog-routing.js +87 -0
  78. package/vendor/Archive/src/search/fts-search.js +289 -0
  79. package/vendor/Archive/src/search/query-normalizer.js +159 -0
  80. package/vendor/Archive/src/search/query-rewriter.js +72 -0
  81. package/vendor/Archive/src/search/search-engine.js +72 -0
  82. package/vendor/Archive/src/search/snippet.js +64 -0
  83. package/vendor/Archive/src/store/dir-store.js +103 -0
  84. package/vendor/Archive/src/store/doc-store.js +36 -0
  85. package/vendor/Archive/src/tokenizer/lexicon.js +151 -0
  86. package/vendor/Archive/src/tokenizer/tokenizer.js +167 -0
  87. package/vendor/Archive/src/types.js +86 -0
  88. package/vendor/Archive/src/utils/hash.js +16 -0
  89. package/vendor/Archive/src/utils/lock.js +73 -0
  90. package/vendor/Archive/src/utils/path-safety.js +96 -0
  91. package/vendor/Archive/src/utils/paths.js +39 -0
  92. package/vendor/BadCase/rn/INDEX.md +127 -0
  93. package/vendor/BadCase/rn/cases/KI-001-webview/350/247/206/351/242/221/346/227/240/346/263/225/346/250/252/345/261/217.md +52 -0
  94. package/vendor/BadCase/rn/cases/KI-002-fastImage/347/203/255/346/233/264/346/226/260/345/233/276/347/211/207/345/244/261/350/264/245.md +37 -0
  95. package/vendor/BadCase/rn/cases/KI-003-wechat/347/274/251/347/225/245/345/233/276/346/234/254/345/234/260/345/233/276/347/211/207.md +62 -0
  96. package/vendor/BadCase/rn/cases/KI-004-wechat/345/233/236/350/260/203/346/227/266/345/272/217.md +47 -0
  97. package/vendor/BadCase/rn/cases/KI-005-geolocation/345/257/274/345/205/245/350/267/257/345/276/204/345/220/216/347/274/200.md +31 -0
  98. package/vendor/BadCase/rn/cases/KI-006-SmartRefreshLayout/346/231/272/350/203/275/346/214/207/351/222/210/345/264/251/346/272/203.md +55 -0
  99. package/vendor/BadCase/rn/cases/KI-007-orientation-locker/344/274/240/346/204/237/345/231/250/345/210/235/345/247/213/345/214/226.md +58 -0
  100. package/vendor/BadCase/rn/cases/KI-008-orientation-locker/344/274/240/346/204/237/345/231/250/345/274/225/347/224/250/350/256/241/346/225/260.md +47 -0
  101. package/vendor/BadCase/rn/cases/KI-009-pager-view/345/265/214/345/245/227/346/273/221/345/212/250.md +38 -0
  102. package/vendor/BadCase/rn/cases/KI-010-screens/346/211/213/345/212/277/345/206/262/347/252/201.md +48 -0
  103. package/vendor/BadCase/rn/cases/KI-011-spring-scrollview/346/211/213/345/212/277/351/207/215/345/244/215/347/273/221/345/256/232.md +49 -0
  104. package/vendor/BadCase/rn/cases/KI-012-qr-camera/346/250/252/345/261/217/351/200/202/351/205/215.md +59 -0
  105. package/vendor/BadCase/rn/cases/KI-013-webview/346/267/261/350/211/262/346/250/241/345/274/217/350/203/214/346/231/257/350/211/262.md +37 -0
  106. package/vendor/BadCase/rn/cases/KI-014-amap-geolocation/345/233/236/350/260/203/347/274/272/345/244/261.md +42 -0
  107. package/vendor/BadCase/rn/cases/KI-015-reanimated/350/277/220/350/241/214/346/227/266/346/236/220/346/236/204/345/264/251/346/272/203.md +54 -0
  108. package/vendor/BadCase/rn/cases/KI-016-fs/346/226/207/344/273/266/350/257/273/345/217/226/347/274/226/347/240/201.md +58 -0
  109. package/vendor/BadCase/rn/cases/KI-017-blob-util/345/217/202/346/225/260/347/274/226/347/240/201/351/224/231/350/257/257.md +39 -0
  110. package/vendor/BadCase/rn/cases/KI-018-modal/345/274/271/347/252/227/351/227/252/347/203/201.md +53 -0
  111. package/vendor/BadCase/rn/cases/KI-019-code-push/351/207/215/345/220/257/351/200/273/350/276/221/345/244/261/346/225/210.md +79 -0
  112. package/vendor/BadCase/rn/cases/KI-020-netinfo/346/225/217/346/204/237/344/277/241/346/201/257/346/263/204/351/234/262.md +60 -0
  113. package/vendor/BadCase/rn/cases/KI-021-video/346/234/254/345/234/260/350/247/206/351/242/221/346/222/255/346/224/276/345/274/202/345/270/270.md +79 -0
  114. package/vendor/BadCase/rn/cases/KI-022-audio-recorder-player/346/236/232/344/270/276/347/274/272/345/244/261.md +38 -0
  115. package/vendor/BadCase/rn/cases/KI-023-svg/346/270/220/345/217/230/347/273/247/346/211/277/345/244/261/346/225/210.md +62 -0
  116. package/vendor/BadCase/rn/generalization-log.md +55 -0
  117. package/vendor/BadCase/rn/pr-info/rntpc_react-native-SmartRefreshLayout-32.json +328 -0
  118. package/vendor/BadCase/rn/pr-info/rntpc_react-native-SmartRefreshLayout-32.md +382 -0
  119. package/vendor/BadCase/rn/pr-info/rntpc_react-native-amap-geolocation-27.json +1351 -0
  120. package/vendor/BadCase/rn/pr-info/rntpc_react-native-amap-geolocation-27.md +1176 -0
  121. package/vendor/BadCase/rn/pr-info/rntpc_react-native-audio-recorder-player-22.json +538 -0
  122. package/vendor/BadCase/rn/pr-info/rntpc_react-native-audio-recorder-player-22.md +1488 -0
  123. package/vendor/BadCase/rn/pr-info/rntpc_react-native-blob-util-23.json +211 -0
  124. package/vendor/BadCase/rn/pr-info/rntpc_react-native-blob-util-23.md +35 -0
  125. package/vendor/BadCase/rn/pr-info/rntpc_react-native-code-push-17.json +2048 -0
  126. package/vendor/BadCase/rn/pr-info/rntpc_react-native-code-push-17.md +3866 -0
  127. package/vendor/BadCase/rn/pr-info/rntpc_react-native-fast-image-102.json +198 -0
  128. package/vendor/BadCase/rn/pr-info/rntpc_react-native-fast-image-102.md +40 -0
  129. package/vendor/BadCase/rn/pr-info/rntpc_react-native-fs-38.json +751 -0
  130. package/vendor/BadCase/rn/pr-info/rntpc_react-native-fs-38.md +883 -0
  131. package/vendor/BadCase/rn/pr-info/rntpc_react-native-geolocation-24.json +1544 -0
  132. package/vendor/BadCase/rn/pr-info/rntpc_react-native-geolocation-24.md +2598 -0
  133. package/vendor/BadCase/rn/pr-info/rntpc_react-native-modal-20.json +246 -0
  134. package/vendor/BadCase/rn/pr-info/rntpc_react-native-modal-20.md +554 -0
  135. package/vendor/BadCase/rn/pr-info/rntpc_react-native-netinfo-31.json +211 -0
  136. package/vendor/BadCase/rn/pr-info/rntpc_react-native-netinfo-31.md +54 -0
  137. package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-45.json +1626 -0
  138. package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-45.md +2213 -0
  139. package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-51.json +208 -0
  140. package/vendor/BadCase/rn/pr-info/rntpc_react-native-orientation-locker-51.md +77 -0
  141. package/vendor/BadCase/rn/pr-info/rntpc_react-native-pager-view-32.json +377 -0
  142. package/vendor/BadCase/rn/pr-info/rntpc_react-native-pager-view-32.md +174 -0
  143. package/vendor/BadCase/rn/pr-info/rntpc_react-native-qr-decode-image-camera-37.json +232 -0
  144. package/vendor/BadCase/rn/pr-info/rntpc_react-native-qr-decode-image-camera-37.md +194 -0
  145. package/vendor/BadCase/rn/pr-info/rntpc_react-native-reanimated-82.json +198 -0
  146. package/vendor/BadCase/rn/pr-info/rntpc_react-native-reanimated-82.md +67 -0
  147. package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-87.json +198 -0
  148. package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-87.md +38 -0
  149. package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-93.json +208 -0
  150. package/vendor/BadCase/rn/pr-info/rntpc_react-native-screens-93.md +34 -0
  151. package/vendor/BadCase/rn/pr-info/rntpc_react-native-spring-scrollview-38.json +222 -0
  152. package/vendor/BadCase/rn/pr-info/rntpc_react-native-spring-scrollview-38.md +56 -0
  153. package/vendor/BadCase/rn/pr-info/rntpc_react-native-svg-117.json +463 -0
  154. package/vendor/BadCase/rn/pr-info/rntpc_react-native-svg-117.md +383 -0
  155. package/vendor/BadCase/rn/pr-info/rntpc_react-native-video-66.json +464 -0
  156. package/vendor/BadCase/rn/pr-info/rntpc_react-native-video-66.md +565 -0
  157. package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-112.json +198 -0
  158. package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-112.md +47 -0
  159. package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-121.json +232 -0
  160. package/vendor/BadCase/rn/pr-info/rntpc_react-native-webview-121.md +422 -0
  161. package/vendor/BadCase/rn/pr-info/rntpc_react-native-wechat-lib-15.json +295 -0
  162. package/vendor/BadCase/rn/pr-info/rntpc_react-native-wechat-lib-15.md +1038 -0
  163. package/vendor/BadCase/rn/rules/R-01-/345/205/250/345/261/217/347/252/227/345/217/243/347/212/266/346/200/201/347/256/241/347/220/206/345/256/214/346/225/264/346/200/247.md +20 -0
  164. package/vendor/BadCase/rn/rules/R-02-/350/265/204/346/272/220URI/345/275/242/346/200/201/345/210/206/346/224/257/350/246/206/347/233/226.md +21 -0
  165. package/vendor/BadCase/rn/rules/R-03-/351/231/204/345/261/236/346/223/215/344/275/234/345/244/261/350/264/245/351/230/273/346/226/255/344/270/273/346/265/201/347/250/213.md +20 -0
  166. package/vendor/BadCase/rn/rules/R-04-/345/274/202/346/255/245/345/233/236/350/260/203/346/263/250/345/206/214/346/227/266/345/272/217.md +20 -0
  167. package/vendor/BadCase/rn/rules/R-05-/346/250/241/345/235/227/345/257/274/345/205/245/350/267/257/345/276/204/350/247/204/350/214/203.md +19 -0
  168. package/vendor/BadCase/rn/rules/R-06-/344/274/240/346/204/237/345/231/250/347/241/254/344/273/266/346/235/203/351/231/220/346/214/211/351/234/200/350/216/267/345/217/226.md +21 -0
  169. package/vendor/BadCase/rn/rules/R-07-/346/231/272/350/203/275/346/214/207/351/222/210/347/224/237/345/221/275/345/221/250/346/234/237/347/256/241/347/220/206.md +20 -0
  170. package/vendor/BadCase/rn/rules/R-08-/346/211/213/345/212/277/344/272/213/344/273/266/346/263/250/345/206/214/344/270/216/345/206/262/347/252/201/345/244/204/347/220/206.md +22 -0
  171. package/vendor/BadCase/rn/rules/R-09-/346/250/252/347/253/226/345/261/217/345/244/232/345/275/242/346/200/201/345/270/203/345/261/200/351/200/202/351/205/215.md +20 -0
  172. package/vendor/BadCase/rn/rules/R-10-/346/267/261/350/211/262/346/250/241/345/274/217/344/270/273/351/242/230/351/242/234/350/211/262/351/200/202/351/205/215.md +19 -0
  173. package/vendor/BadCase/rn/rules/R-11-/346/216/245/345/217/243/345/233/236/350/260/203/345/256/236/347/216/260/345/256/214/346/225/264/346/200/247.md +20 -0
  174. package/vendor/BadCase/rn/rules/R-12-/345/216/237/347/224/237/350/277/220/350/241/214/346/227/266/350/265/204/346/272/220/346/236/220/346/236/204/346/227/266/345/272/217.md +20 -0
  175. package/vendor/BadCase/rn/rules/R-13-/346/226/207/344/273/266/346/225/260/346/215/256/347/274/226/347/240/201/344/270/216/346/240/274/345/274/217/345/205/274/345/256/271.md +21 -0
  176. package/vendor/BadCase/rn/rules/R-14-/345/212/250/347/224/273/345/210/235/345/247/213/345/214/226/346/227/266/345/272/217/344/270/216/347/212/266/346/200/201/345/220/214/346/255/245.md +20 -0
  177. package/vendor/BadCase/rn/rules/R-15-/347/212/266/346/200/201/346/214/201/344/271/205/345/214/226/344/270/216/351/207/215/345/220/257/351/200/273/350/276/221/344/270/200/350/207/264/346/200/247.md +20 -0
  178. package/vendor/BadCase/rn/rules/R-16-/346/225/217/346/204/237/344/277/241/346/201/257/346/227/245/345/277/227/346/263/204/351/234/262.md +19 -0
  179. package/vendor/BadCase/rn/rules/R-17-/345/252/222/344/275/223/350/265/204/346/272/220/347/224/237/345/221/275/345/221/250/346/234/237/344/270/216/351/224/231/350/257/257/345/244/204/347/220/206.md +21 -0
  180. package/vendor/BadCase/rn/rules/R-18-/350/203/275/345/212/233/346/236/232/344/270/276/351/205/215/347/275/256/345/256/214/346/225/264/346/200/247.md +19 -0
  181. package/vendor/BadCase/rn/rules/R-19-/345/233/276/345/275/242/346/270/262/346/237/223/345/261/236/346/200/247/347/273/247/346/211/277/344/270/216/351/207/215/347/275/256.md +19 -0
  182. package/vendor/MCP/README.md +490 -0
  183. package/vendor/MCP/config.json +29 -0
  184. package/vendor/MCP/package.json +23 -0
  185. package/vendor/MCP/scripts/analyze-demo-coverage.cjs +1203 -0
  186. package/vendor/MCP/scripts/analyze-xts-coverage.cjs +1245 -0
  187. package/vendor/MCP/scripts/deveco_docs.js +247 -0
  188. package/vendor/MCP/scripts/extract-interfaces.cjs +1487 -0
  189. package/vendor/MCP/scripts/flutter-analyze-demo-coverage.cjs +666 -0
  190. package/vendor/MCP/scripts/flutter-analyze-xts-coverage.cjs +684 -0
  191. package/vendor/MCP/scripts/flutter-extract-interfaces.cjs +1251 -0
  192. package/vendor/MCP/scripts/flutter-render-spec-doc.cjs +351 -0
  193. package/vendor/MCP/scripts/render-spec-doc.cjs +347 -0
  194. package/vendor/MCP/scripts/rn-analyze-demo-coverage.cjs +645 -0
  195. package/vendor/MCP/scripts/rn-analyze-test-coverage.cjs +614 -0
  196. package/vendor/MCP/scripts/rn-extract-interfaces.cjs +1462 -0
  197. package/vendor/MCP/scripts/rn-render-spec-doc.cjs +327 -0
  198. package/vendor/MCP/scripts/rn-scan-exports.cjs +1336 -0
  199. package/vendor/MCP/src/client/MCPClientPool.js +220 -0
  200. package/vendor/MCP/src/config/ConfigLoader.js +189 -0
  201. package/vendor/MCP/src/executor/ScriptExecutor.js +110 -0
  202. package/vendor/MCP/src/gateway/Gateway.js +451 -0
  203. package/vendor/MCP/src/index.js +87 -0
  204. package/vendor/MCP/src/library/KBToolProvider.js +229 -0
  205. package/vendor/MCP/src/library/logger.js +60 -0
  206. package/vendor/MCP/src/registry/ScriptRegistry.js +238 -0
  207. package/vendor/MCP/src/registry/ToolRegistry.js +111 -0
  208. package/vendor/MCP/src/types.js +115 -0
  209. package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +4 -2
  210. package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +3 -3
  211. package/vendor/Server/Skills/knowledge-import/SKILL.md +1 -1
  212. package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +12 -4
  213. package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +5 -4
  214. package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +2 -2
  215. package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +2 -2
  216. package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +1 -2
  217. package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +1 -1
  218. package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +1 -2
  219. package/vendor/Server/package.json +5 -1
  220. package/vendor/VERSION +3 -3
@@ -0,0 +1,1176 @@
1
+ # PR #27: feat(77):实现onLocationError功能
2
+
3
+ - **状态**: merged
4
+ - **作者**: a1461848339
5
+ - **创建时间**: 2026-07-04T09:26:06+08:00
6
+ - **分支**: 77code → br_rnoh0.77
7
+ - **变更文件数**: 48
8
+
9
+ ## PR 描述
10
+
11
+ feat(77):实现onLocationError功能
12
+
13
+ ## 变更文件
14
+
15
+ | 文件 | 变更 | +行 | -行 |
16
+ |------|------|-----|-----|
17
+ | `CHANGELOG.md` | ? | +4 | -1 |
18
+ | `OAT.xml` | ? | +6 | -1 |
19
+ | `example/.eslintrc` | added | +13 | -0 |
20
+ | `example/.gitignore` | added | +43 | -0 |
21
+ | `example/.node-version` | added | +1 | -0 |
22
+ | `example/.prettierrc.js` | added | +7 | -0 |
23
+ | `example/.watchmanconfig` | added | +1 | -0 |
24
+ | `example/app.json` | added | +4 | -0 |
25
+ | `example/babel.config.js` | added | +5 | -0 |
26
+ | `example/contexts.ts` | added | +3 | -0 |
27
+ | `example/harmony/.gitignore` | added | +17 | -0 |
28
+ | `example/harmony/AppScope/app.json5` | added | +10 | -0 |
29
+ | `example/harmony/AppScope/resources/base/element/string.json` | added | +8 | -0 |
30
+ | `example/harmony/build-profile.template.json5` | added | +45 | -0 |
31
+ | `example/harmony/codelinter.json` | added | +1 | -0 |
32
+ | `example/harmony/entry/.gitignore` | added | +7 | -0 |
33
+ | `example/harmony/entry/build-profile.json5` | added | +22 | -0 |
34
+ | `example/harmony/entry/hvigorfile.ts` | added | +1 | -0 |
35
+ | `example/harmony/entry/oh-package.json5` | added | +11 | -0 |
36
+ | `example/harmony/entry/src/main/cpp/.gitignore` | added | +2 | -0 |
37
+ | `example/harmony/entry/src/main/cpp/CMakeLists.txt` | added | +35 | -0 |
38
+ | `example/harmony/entry/src/main/cpp/PackageProvider.cpp` | added | +11 | -0 |
39
+ | `example/harmony/entry/src/main/ets/RNPackagesFactory.ets` | added | +8 | -0 |
40
+ | `example/harmony/entry/src/main/ets/entryability/EntryAbility.ets` | added | +8 | -0 |
41
+ | `example/harmony/entry/src/main/ets/pages/Index.ets` | added | +67 | -0 |
42
+ | `example/harmony/entry/src/main/ets/pages/TouchDisplayer.ets` | added | +37 | -0 |
43
+ | `example/harmony/entry/src/main/module.json5` | added | +67 | -0 |
44
+ | `example/harmony/entry/src/main/resources/base/element/color.json` | added | +8 | -0 |
45
+ | `example/harmony/entry/src/main/resources/base/element/string.json` | added | +20 | -0 |
46
+ | `example/harmony/entry/src/main/resources/base/profile/main_pages.json` | added | +5 | -0 |
47
+ | `example/harmony/entry/src/main/resources/rawfile/1.txt` | added | +0 | -0 |
48
+ | `example/harmony/hvigor/.gitignore` | added | +1 | -0 |
49
+ | `example/harmony/hvigor/hvigor-config.json5` | added | +14 | -0 |
50
+ | `example/harmony/hvigorfile.ts` | added | +1 | -0 |
51
+ | `example/harmony/oh-package.json5` | added | +12 | -0 |
52
+ | `example/index.js` | added | +5 | -0 |
53
+ | `example/jest.config.js` | added | +5 | -0 |
54
+ | `example/metro.config.js` | added | +21 | -0 |
55
+ | `example/package.json` | added | +59 | -0 |
56
+ | `example/react-native.config.js` | added | +3 | -0 |
57
+ | `example/scripts/create-build-profile.js` | added | +38 | -0 |
58
+ | `example/src/index.tsx` | added | +59 | -0 |
59
+ | `example/tsconfig.json` | added | +14 | -0 |
60
+ | `harmony/amap_geolocation.har` | ? | +0 | -0 |
61
+ | `harmony/amap_geolocation/oh-package.json5` | ? | +1 | -1 |
62
+ | `harmony/amap_geolocation/src/main/ets/AMapGeolocationModule.ts` | ? | +4 | -0 |
63
+ | `package.json` | ? | +1 | -1 |
64
+ | `readme.md` | ? | +2 | -2 |
65
+
66
+ ## Diff
67
+
68
+ ### `CHANGELOG.md`
69
+
70
+ ```diff
71
+ @@ -1,5 +1,8 @@
72
+ -# v1.2.4-rc.1
73
+ +
74
+ +
75
+ ## ReleaseLog
76
+ +### v1.3.1-rc.1
77
+ +- feat: 实现onLocationError功能
78
+ ### v1.3.0
79
+ - release version 1.3.0
80
+
81
+
82
+ ```
83
+
84
+ ### `OAT.xml`
85
+
86
+ ```diff
87
+ @@ -4,6 +4,8 @@
88
+ <licensefile>LICENSE</licensefile>
89
+ <filefilterlist>
90
+ <filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
91
+ + <filteritem type="filepath" name="example/.*" desc="generated example project, no copyright header required"/>
92
+ + <filteritem type="filepath" name="buildEnv.sh" desc="generated example build environment script, no copyright header required"/>
93
+ <filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加版权头"/>
94
+ <filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加版权头"/>
95
+ <filteritem type="filename" name="*.proto" desc="资源文件,不需要添加版权头"/>
96
+ @@ -14,6 +16,8 @@
97
+ <filteritem type="filename" name="LICENSE" desc="工程文件,不修改版权头"/>
98
+ </filefilter>
99
+ <filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
100
+ + <filteritem type="filepath" name="example/.*" desc="generated example project, no license header required"/>
101
+ + <filteritem type="filepath" name="buildEnv.sh" desc="generated example build environment script, no license header required"/>
102
+ <filteritem type="filename" name="hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不需要添加许可证头"/>
103
+ <filteritem type="filename" name="*.json5" desc="hvigor工程配置文件,DevEco Studio自动生成,不需要添加许可证头"/>
104
+ <filteritem type="filename" name="LICENSE" desc="原三方库证书文件无需更改,因此添加过滤"/>
105
+ @@ -24,6 +28,7 @@
106
+ <filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
107
+ </filefilter>
108
+ <filefilter name="binaryFileTypePolicyFilter" desc="Filters for resources files policies">
109
+ + <filteritem type="filepath" name="example/.*" desc="generated example project resources"/>
110
+ <filteritem type="filename" name="icon.png" desc="应用图标"/>
111
+ <filteritem type="filename" name="app_icon.png" desc="应用图标"/>
112
+ </filefilter>
113
+ @@ -34,4 +39,4 @@
114
+ </policy>
115
+ </policylist>
116
+ </oatconfig>
117
+ -</configuration>
118
+
119
+ +</configuration>
120
+
121
+ ```
122
+
123
+ ### `example/.eslintrc`
124
+
125
+ ```diff
126
+ @@ -0,0 +1,13 @@
127
+ +{
128
+ + "extends": "@react-native",
129
+ + "rules": {
130
+ + "react-native/no-inline-styles": "off",
131
+ + "react/no-unstable-nested-components": "off",
132
+ + "react/react-in-jsx-scope": "off",
133
+ + "@typescript-eslint/no-unused-vars": "warn",
134
+ + "react-hooks/exhaustive-deps": "off",
135
+ + "radix": "off",
136
+ + "prettier/prettier": "warn",
137
+ + "max-lines": "off"
138
+ + }
139
+ +}
140
+
141
+ ```
142
+
143
+ ### `example/.gitignore`
144
+
145
+ ```diff
146
+ @@ -0,0 +1,43 @@
147
+ +.husky
148
+ +bundle.harmony.js
149
+ +package-lock.json
150
+ +*.hbc
151
+ +lintCppResult.txt
152
+ +
153
+ +# OSX
154
+ +.DS_Store
155
+ +
156
+ +# Xcode
157
+ +build/
158
+ +*.pbxuser
159
+ +!default.pbxuser
160
+ +*.mode1v3
161
+ +!default.mode1v3
162
+ +*.mode2v3
163
+ +!default.mode2v3
164
+ +*.perspectivev3
165
+ +!default.perspectivev3
166
+ +xcuserdata
167
+ +*.xccheckout
168
+ +*.moved-aside
169
+ +DerivedData
170
+ +*.hmap
171
+ +*.ipa
172
+ +*.xcuserstate
173
+ +
174
+ +# Android/IntelliJ
175
+ +build/
176
+ +.idea
177
+ +.gradle
178
+ +local.properties
179
+ +*.iml
180
+ +*.hprof
181
+ +.cxx/
182
+ +*.keystore
183
+ +!debug.keystore
184
+ +BuildProfile.ets
185
+ +
186
+ +# node.js
187
+ +node_modules/
188
+ +npm-debug.log
189
+ +yarn-error.log
190
+
191
+ ```
192
+
193
+ ### `example/.node-version`
194
+
195
+ ```diff
196
+ @@ -0,0 +1 @@
197
+ +18
198
+
199
+ ```
200
+
201
+ ### `example/.prettierrc.js`
202
+
203
+ ```diff
204
+ @@ -0,0 +1,7 @@
205
+ +module.exports = {
206
+ + arrowParens: 'avoid',
207
+ + bracketSameLine: true,
208
+ + bracketSpacing: true,
209
+ + singleQuote: true,
210
+ + trailingComma: 'all',
211
+ +};
212
+
213
+ ```
214
+
215
+ ### `example/.watchmanconfig`
216
+
217
+ ```diff
218
+ @@ -0,0 +1 @@
219
+ +{}
220
+
221
+ ```
222
+
223
+ ### `example/app.json`
224
+
225
+ ```diff
226
+ @@ -0,0 +1,4 @@
227
+ +{
228
+ + "name": "app_name",
229
+ + "displayName": "tester"
230
+ +}
231
+
232
+ ```
233
+
234
+ ### `example/babel.config.js`
235
+
236
+ ```diff
237
+ @@ -0,0 +1,5 @@
238
+ +module.exports = {
239
+ + presets: ['module:@react-native/babel-preset'],
240
+ + plugins: [
241
+ + ],
242
+ +};
243
+
244
+ ```
245
+
246
+ ### `example/contexts.ts`
247
+
248
+ ```diff
249
+ @@ -0,0 +1,3 @@
250
+ +import React from 'react';
251
+ +
252
+ +export const AppParamsContext = React.createContext(undefined);
253
+
254
+ ```
255
+
256
+ ### `example/harmony/.gitignore`
257
+
258
+ ```diff
259
+ @@ -0,0 +1,17 @@
260
+ +package-lock.json
261
+ +/build-profile.json5
262
+ +
263
+ +rnoh_modules
264
+ +
265
+ +**/oh-package-lock.json5
266
+ +
267
+ +/node_modules
268
+ +/local.properties
269
+ +/.idea
270
+ +**/build
271
+ +/.hvigor
272
+ +.cxx
273
+ +/.clangd
274
+ +/.clang-format
275
+ +/.clang-tidy
276
+ +/oh_modules
277
+
278
+ ```
279
+
280
+ ### `example/harmony/AppScope/app.json5`
281
+
282
+ ```diff
283
+ @@ -0,0 +1,10 @@
284
+ +{
285
+ + "app": {
286
+ + "bundleName": "com.rntpc.amapgeolocation.demo",
287
+ + "vendor": "example",
288
+ + "versionCode": 1000000,
289
+ + "versionName": "1.0.0",
290
+ + "icon": "$media:app_icon",
291
+ + "label": "$string:app_name"
292
+ + }
293
+ +}
294
+
295
+ ```
296
+
297
+ ### `example/harmony/AppScope/resources/base/element/string.json`
298
+
299
+ ```diff
300
+ @@ -0,0 +1,8 @@
301
+ +{
302
+ + "string": [
303
+ + {
304
+ + "name": "app_name",
305
+ + "value": "RN Tester"
306
+ + }
307
+ + ]
308
+ +}
309
+
310
+ ```
311
+
312
+ ### `example/harmony/build-profile.template.json5`
313
+
314
+ ```diff
315
+ @@ -0,0 +1,45 @@
316
+ +{
317
+ + "app": {
318
+ + "products": [
319
+ + {
320
+ + "name": 'default',
321
+ + "signingConfig": 'default',
322
+ + "compatibleSdkVersion": '5.0.0(12)',
323
+ + "runtimeOS": 'HarmonyOS',
324
+ + "buildOption": {
325
+ + "strictMode": {
326
+ + "caseSensitiveCheck": true,
327
+ + "useNormalizedOHMUrl": false
328
+ + }
329
+ + }
330
+ + },
331
+ + ],
332
+ + "buildModeSet": [
333
+ + {
334
+ + "name": 'debug',
335
+ + },
336
+ + {
337
+ + "name": 'release',
338
+ + },
339
+ + ],
340
+ + "signingConfigs": []
341
+ + },
342
+ + "modules": [
343
+ + {
344
+ + "name": 'entry',
345
+ + "srcPath": './entry',
346
+ + "targets": [
347
+ + {
348
+ + "name": 'default',
349
+ + "applyToProducts": [
350
+ + 'default'
351
+ + ],
352
+ + },
353
+ + ],
354
+ + },
355
+ + {
356
+ + "name": 'amap_geolocation',
357
+ + "srcPath": '../../harmony/amap_geolocation'
358
+ + }
359
+ + ],
360
+ +}
361
+
362
+ ```
363
+
364
+ ### `example/harmony/codelinter.json`
365
+
366
+ ```diff
367
+ @@ -0,0 +1 @@
368
+ +{}
369
+
370
+ ```
371
+
372
+ ### `example/harmony/entry/.gitignore`
373
+
374
+ ```diff
375
+ @@ -0,0 +1,7 @@
376
+ +/node_modules
377
+ +/.preview
378
+ +/build
379
+ +/.cxx
380
+ +package-lock.json
381
+ +/oh_modules
382
+ +/assets
383
+
384
+ ```
385
+
386
+ ### `example/harmony/entry/build-profile.json5`
387
+
388
+ ```diff
389
+ @@ -0,0 +1,22 @@
390
+ +{
391
+ + "apiType": 'stageMode',
392
+ + "buildOption": {
393
+ + "externalNativeOptions": {
394
+ + "path": "./src/main/cpp/CMakeLists.txt",
395
+ + "arguments": "",
396
+ + "cppFlags": "-s",
397
+ + "abiFilters": [
398
+ + "arm64-v8a",
399
+ + "x86_64"
400
+ + ]
401
+ + },
402
+ + },
403
+ + "targets": [
404
+ + {
405
+ + "name": "default",
406
+ + },
407
+ + {
408
+ + "name": "ohosTest",
409
+ + }
410
+ + ]
411
+ +}
412
+
413
+ ```
414
+
415
+ ### `example/harmony/entry/hvigorfile.ts`
416
+
417
+ ```diff
418
+ @@ -0,0 +1 @@
419
+ +export { hapTasks } from '@ohos/hvigor-ohos-plugin';
420
+
421
+ ```
422
+
423
+ ### `example/harmony/entry/oh-package.json5`
424
+
425
+ ```diff
426
+ @@ -0,0 +1,11 @@
427
+ +{
428
+ + "license": "ISC",
429
+ + "devDependencies": {},
430
+ + "name": "entry",
431
+ + "description": "example description",
432
+ + "version": "1.0.0",
433
+ + "dependencies": {
434
+ + "@rnoh/react-native-openharmony": "file:../../node_modules/react-native-harmony/react_native_openharmony.har",
435
+ + "@react-native-ohos/react-native-amap-geolocation": "file:../../node_modules/@react-native-ohos/react-native-amap-geolocation/harmony/amap_geolocation.har"
436
+ + }
437
+ +}
438
+
439
+ ```
440
+
441
+ ### `example/harmony/entry/src/main/cpp/.gitignore`
442
+
443
+ ```diff
444
+ @@ -0,0 +1,2 @@
445
+ +jsbundle.h
446
+ +generated/
447
+
448
+ ```
449
+
450
+ ### `example/harmony/entry/src/main/cpp/CMakeLists.txt`
451
+
452
+ ```diff
453
+ @@ -0,0 +1,35 @@
454
+ +project(rnapp)
455
+ +cmake_minimum_required(VERSION 3.4.1)
456
+ +set(CMAKE_SKIP_BUILD_RPATH TRUE)
457
+ +set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
458
+ +set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
459
+ +set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
460
+ +set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
461
+ +set(LOG_VERBOSITY_LEVEL 1)
462
+ +set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
463
+ +set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
464
+ +set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
465
+ +
466
+ +set(WITH_HITRACE_SYSTRACE 1)
467
+ +add_compile_definitions(WITH_HITRACE_SYSTRACE)
468
+ +
469
+ +set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
470
+ +
471
+ +include_directories(${NATIVERENDER_ROOT_PATH}
472
+ + ${NATIVERENDER_ROOT_PATH}/include)
473
+ +
474
+ +add_subdirectory("${RNOH_CPP_DIR}" ./rn)
475
+ +
476
+ +# RNOH_BEGIN: manual_package_linking_1
477
+ +add_subdirectory("${OH_MODULE_DIR}/@react-native-ohos/react-native-amap-geolocation/src/main/cpp" ./amap_geolocation)
478
+ +# RNOH_END: manual_package_linking_1
479
+ +
480
+ +add_library(rnoh_app SHARED
481
+ + "./PackageProvider.cpp"
482
+ + "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
483
+ +)
484
+ +target_link_libraries(rnoh_app PUBLIC rnoh)
485
+ +
486
+ +# RNOH_BEGIN: manual_package_linking_2
487
+ +target_link_libraries(rnoh_app PUBLIC rnoh_amap_geolocation)
488
+ +# RNOH_END: manual_package_linking_2
489
+
490
+ ```
491
+
492
+ ### `example/harmony/entry/src/main/cpp/PackageProvider.cpp`
493
+
494
+ ```diff
495
+ @@ -0,0 +1,11 @@
496
+ +#include "RNOH/PackageProvider.h"
497
+ +#include "AMapGeolocationPackage.h"
498
+ +
499
+ +using namespace rnoh;
500
+ +
501
+ +std::vector<std::shared_ptr<Package>> PackageProvider::getPackages(Package::Context ctx)
502
+ +{
503
+ + return {
504
+ + std::make_shared<AMapGeolocationPackage>(ctx),
505
+ + };
506
+ +}
507
+
508
+ ```
509
+
510
+ ### `example/harmony/entry/src/main/ets/RNPackagesFactory.ets`
511
+
512
+ ```diff
513
+ @@ -0,0 +1,8 @@
514
+ +import type {RNPackageContext, RNPackage} from '@rnoh/react-native-openharmony/ts';
515
+ +import { AMapGeolocationPackage } from '@react-native-ohos/react-native-amap-geolocation/ts';
516
+ +
517
+ +export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
518
+ + return [
519
+ + new AMapGeolocationPackage(ctx),
520
+ + ];
521
+ +}
522
+
523
+ ```
524
+
525
+ ### `example/harmony/entry/src/main/ets/entryability/EntryAbility.ets`
526
+
527
+ ```diff
528
+ @@ -0,0 +1,8 @@
529
+ +import {RNAbility} from '@rnoh/react-native-openharmony';
530
+ +import { AbilityConstant, Want } from '@kit.AbilityKit';
531
+ +
532
+ +export default class EntryAbility extends RNAbility {
533
+ + getPagePath() {
534
+ + return 'pages/Index';
535
+ + }
536
+ +}
537
+
538
+ ```
539
+
540
+ ### `example/harmony/entry/src/main/ets/pages/Index.ets`
541
+
542
+ ```diff
543
+ @@ -0,0 +1,67 @@
544
+ +import {
545
+ + AnyJSBundleProvider,
546
+ + FileJSBundleProvider,
547
+ + MetroJSBundleProvider,
548
+ + ResourceJSBundleProvider,
549
+ + RNApp,
550
+ + RNOHErrorDialog,
551
+ + RNOHLogger,
552
+ + TraceJSBundleProviderDecorator,
553
+ + RNOHCoreContext
554
+ +} from '@rnoh/react-native-openharmony';
555
+ +import { createRNPackages } from '../RNPackagesFactory';
556
+ +
557
+ +@Entry
558
+ +@Component
559
+ +struct Index {
560
+ + @StorageLink('RNOHCoreContext') private rnohCoreContext: RNOHCoreContext | undefined = undefined
561
+ + @State shouldShow: boolean = false
562
+ + private logger!: RNOHLogger
563
+ + bundlePath: string = 'bunlde.harmony.js'
564
+ + @State hasBundle: boolean = false
565
+ +
566
+ + aboutToAppear() {
567
+ + this.logger = this.rnohCoreContext!.logger.clone("Index")
568
+ + const stopTracing = this.logger.clone("aboutToAppear").startTracing()
569
+ + this.shouldShow = true
570
+ + stopTracing()
571
+ + }
572
+ +
573
+ + onBackPress(): boolean | undefined {
574
+ + this.rnohCoreContext!.dispatchBackPress()
575
+ + return true
576
+ + }
577
+ +
578
+ + build() {
579
+ + Column() {
580
+ + if (this.rnohCoreContext && this.shouldShow) {
581
+ + if (this.rnohCoreContext?.isDebugModeEnabled) {
582
+ + RNOHErrorDialog({ ctx: this.rnohCoreContext })
583
+ + }
584
+ + RNApp({
585
+ + rnInstanceConfig: {
586
+ + createRNPackages,
587
+ + enableNDKTextMeasuring: true,
588
+ + enableBackgroundExecutor: false,
589
+ + enableCAPIArchitecture: true,
590
+ + },
591
+ + initialProps: { "foo": "bar" } as Record<string, string>,
592
+ + appKey: "app_name",
593
+ + onSetUp: (rnInstance) => {
594
+ + rnInstance.enableFeatureFlag("ENABLE_RN_INSTANCE_CLEAN_UP")
595
+ + },
596
+ + jsBundleProvider: new TraceJSBundleProviderDecorator(
597
+ + new AnyJSBundleProvider([
598
+ + new MetroJSBundleProvider(),
599
+ + new FileJSBundleProvider('/data/storage/el2/base/files/bundle.harmony.js'),
600
+ + new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'hermes_bundle.hbc'),
601
+ + new ResourceJSBundleProvider(this.rnohCoreContext.uiAbilityContext.resourceManager, 'bundle.harmony.js')
602
+ + ]),
603
+ + this.rnohCoreContext.logger),
604
+ + })
605
+ + }
606
+ + }
607
+ + .height('100%')
608
+ + .width('100%')
609
+ + }
610
+ +}
611
+
612
+ ```
613
+
614
+ ### `example/harmony/entry/src/main/ets/pages/TouchDisplayer.ets`
615
+
616
+ ```diff
617
+ @@ -0,0 +1,37 @@
618
+ +@Component
619
+ +export struct TouchDisplayer {
620
+ + @State currentTouches: TouchObject[] = []
621
+ + @State touchIndicatorOpacity: number = 0
622
+ + @BuilderParam buildChildren: () => void
623
+ + build() {
624
+ + Stack() {
625
+ + this.buildChildren()
626
+ + ForEach(this.currentTouches, (activeTouch: TouchObject) => {
627
+ + Stack() {
628
+ + }
629
+ + .width(64)
630
+ + .height(64)
631
+ + .backgroundColor("blue")
632
+ + .borderWidth(2)
633
+ + .borderColor("white")
634
+ + .opacity(this.touchIndicatorOpacity)
635
+ + .position({ x: activeTouch.x - 32, y: activeTouch.y - 32 })
636
+ + .borderRadius(1000)
637
+ + .hitTestBehavior(HitTestMode.Transparent)
638
+ + })
639
+ + }
640
+ + .width("100%")
641
+ + .height("100%")
642
+ + .hitTestBehavior(HitTestMode.Transparent)
643
+ + .onTouch(e => {
644
+ + this.currentTouches = e.touches
645
+ + this.touchIndicatorOpacity = 0.5
646
+ + animateTo({
647
+ + duration: 500,
648
+ + curve: Curve.Linear,
649
+ + }, () => {
650
+ + this.touchIndicatorOpacity = 0
651
+ + })
652
+ + })
653
+ + }
654
+ +}
655
+
656
+ ```
657
+
658
+ ### `example/harmony/entry/src/main/module.json5`
659
+
660
+ ```diff
661
+ @@ -0,0 +1,67 @@
662
+ +{
663
+ + "module": {
664
+ + "name": "entry",
665
+ + "type": "entry",
666
+ + "description": "$string:module_desc",
667
+ + "mainElement": "EntryAbility",
668
+ + "deviceTypes": [
669
+ + "default"
670
+ + ],
671
+ + "deliveryWithInstall": true,
672
+ + "installationFree": false,
673
+ + "pages": "$profile:main_pages",
674
+ + "requestPermissions": [
675
+ + {
676
+ + "name": "ohos.permission.INTERNET"
677
+ + },
678
+ + {
679
+ + "name": "ohos.permission.LOCATION",
680
+ + "reason": "$string:location_permission_reason",
681
+ + "usedScene": {
682
+ + "abilities": [
683
+ + "EntryAbility"
684
+ + ],
685
+ + "when": "inuse"
686
+ + }
687
+ + },
688
+ + {
689
+ + "name": "ohos.permission.APPROXIMATELY_LOCATION",
690
+ + "reason": "$string:location_permission_reason",
691
+ + "usedScene": {
692
+ + "abilities": [
693
+ + "EntryAbility"
694
+ + ],
695
+ + "when": "inuse"
696
+ + }
697
+ + },
698
+ + ],
699
+ + "metadata": [
700
+ + {
701
+ + "name": "OPTLazyForEach",
702
+ + "value": "true",
703
+ + }
704
+ + ],
705
+ + "abilities": [
706
+ + {
707
+ + "name": "EntryAbility",
708
+ + "srcEntry": "./ets/entryability/EntryAbility.ets",
709
+ + "description": "$string:EntryAbility_desc",
710
+ + "icon": "$media:icon",
711
+ + "label": "$string:EntryAbility_label",
712
+ + "startWindowIcon": "$media:icon",
713
+ + "startWindowBackground": "$color:start_window_background",
714
+ + "visible": true,
715
+ + "skills": [
716
+ + {
717
+ + "entities": [
718
+ + "entity.system.home"
719
+ + ],
720
+ + "actions": [
721
+ + "action.system.home"
722
+ + ]
723
+ + }
724
+ + ]
725
+ + }
726
+ + ]
727
+ + }
728
+ +}
729
+
730
+ ```
731
+
732
+ ### `example/harmony/entry/src/main/resources/base/element/color.json`
733
+
734
+ ```diff
735
+ @@ -0,0 +1,8 @@
736
+ +{
737
+ + "color": [
738
+ + {
739
+ + "name": "start_window_background",
740
+ + "value": "#FFFFFF"
741
+ + }
742
+ + ]
743
+ +}
744
+
745
+ ```
746
+
747
+ ### `example/harmony/entry/src/main/resources/base/element/string.json`
748
+
749
+ ```diff
750
+ @@ -0,0 +1,20 @@
751
+ +{
752
+ + "string": [
753
+ + {
754
+ + "name": "module_desc",
755
+ + "value": "module description"
756
+ + },
757
+ + {
758
+ + "name": "EntryAbility_desc",
759
+ + "value": "description"
760
+ + },
761
+ + {
762
+ + "name": "EntryAbility_label",
763
+ + "value": "RN Tester"
764
+ + },
765
+ + {
766
+ + "name": "location_permission_reason",
767
+ + "value": "Required to demonstrate location features."
768
+ + }
769
+ + ]
770
+ +}
771
+
772
+ ```
773
+
774
+ ### `example/harmony/entry/src/main/resources/base/profile/main_pages.json`
775
+
776
+ ```diff
777
+ @@ -0,0 +1,5 @@
778
+ +{
779
+ + "src": [
780
+ + "pages/Index"
781
+ + ]
782
+ +}
783
+
784
+ ```
785
+
786
+ ### `example/harmony/entry/src/main/resources/rawfile/1.txt`
787
+
788
+ ```diff
789
+ The file is empty
790
+ ```
791
+
792
+ ### `example/harmony/hvigor/.gitignore`
793
+
794
+ ```diff
795
+ @@ -0,0 +1 @@
796
+ +*.tgz
797
+
798
+ ```
799
+
800
+ ### `example/harmony/hvigor/hvigor-config.json5`
801
+
802
+ ```diff
803
+ @@ -0,0 +1,14 @@
804
+ +{
805
+ + "modelVersion": "5.0.0",
806
+ + "dependencies": {
807
+ + },
808
+ + "execution": {
809
+ + },
810
+ + "logging": {
811
+ + },
812
+ + "debugging": {
813
+ + "stacktrace": false
814
+ + },
815
+ + "nodeOptions": {
816
+ + }
817
+ +}
818
+
819
+ ```
820
+
821
+ ### `example/harmony/hvigorfile.ts`
822
+
823
+ ```diff
824
+ @@ -0,0 +1 @@
825
+ +export { appTasks } from '@ohos/hvigor-ohos-plugin';
826
+
827
+ ```
828
+
829
+ ### `example/harmony/oh-package.json5`
830
+
831
+ ```diff
832
+ @@ -0,0 +1,12 @@
833
+ +{
834
+ + "modelVersion": "5.0.0",
835
+ + "license": "ISC",
836
+ + "name": "rnoh",
837
+ + "description": "example description",
838
+ + "repository": {},
839
+ + "version": "1.0.0",
840
+ + "overrides": {
841
+ + "@rnoh/react-native-openharmony": "file:../node_modules/react-native-harmony/react_native_openharmony.har"
842
+ + },
843
+ + "dynamicDependencies": {}
844
+ +}
845
+
846
+ ```
847
+
848
+ ### `example/index.js`
849
+
850
+ ```diff
851
+ @@ -0,0 +1,5 @@
852
+ +import {AppRegistry} from 'react-native';
853
+ +import {name as appName} from './app.json';
854
+ +import AMapGeolocationDemo from './src/index';
855
+ +
856
+ +AppRegistry.registerComponent(appName, () => AMapGeolocationDemo);
857
+
858
+ ```
859
+
860
+ ### `example/jest.config.js`
861
+
862
+ ```diff
863
+ @@ -0,0 +1,5 @@
864
+ +/** @type {import('ts-jest').JestConfigWithTsJest} */
865
+ +module.exports = {
866
+ + preset: 'ts-jest',
867
+ + testEnvironment: 'node',
868
+ +};
869
+
870
+ ```
871
+
872
+ ### `example/metro.config.js`
873
+
874
+ ```diff
875
+ @@ -0,0 +1,21 @@
876
+ +const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
877
+ +const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config');
878
+ +
879
+ +const config = {
880
+ + transformer: {
881
+ + getTransformOptions: async () => ({
882
+ + transform: {
883
+ + experimentalImportSupport: false,
884
+ + inlineRequires: true,
885
+ + },
886
+ + }),
887
+ + },
888
+ +};
889
+ +
890
+ +module.exports = mergeConfig(
891
+ + getDefaultConfig(__dirname),
892
+ + createHarmonyMetroConfig({
893
+ + reactNativeHarmonyPackageName: 'react-native-harmony',
894
+ + }),
895
+ + config,
896
+ +);
897
+
898
+ ```
899
+
900
+ ### `example/package.json`
901
+
902
+ ```diff
903
+ @@ -0,0 +1,59 @@
904
+ +{
905
+ + "name": "react-native-harmony-tester",
906
+ + "version": "1.0.0",
907
+ + "private": true,
908
+ + "scripts": {
909
+ + "i": "cd ../ && npm i --legacy-peer-deps && npm pack && cd ./example && npm i",
910
+ + "reStart": "npm run install:pkg && npm run codegen && hdc rport tcp:8081 tcp:8081 && react-native start",
911
+ + "start": "hdc rport tcp:8081 tcp:8081 && react-native start",
912
+ + "codegen": "react-native codegen-harmony --rnoh-module-path ./harmony/entry/oh_modules/@rnoh/react-native-openharmony",
913
+ + "pack:pkg": "cd ../ && npm pack && cd ./example",
914
+ + "install:pkg": "npm uninstall @react-native-ohos/react-native-amap-geolocation && npm run pack:pkg && npm i @react-native-ohos/react-native-amap-geolocation@file:../react-native-ohos-react-native-amap-geolocation-1.3.1-rc.1.tgz",
915
+ + "dev": "npm run codegen && react-native bundle-harmony --dev --minify=false",
916
+ + "prod": "npm run codegen && react-native bundle-harmony --dev=false --minify=true",
917
+ + "postinstall": "node ./scripts/create-build-profile",
918
+ + "fast:pkg": "cd ../ && npm i --legacy-peer-deps && npm pack && cd ./example && npm i --force && npm run dev"
919
+ + },
920
+ + "dependencies": {
921
+ + "@react-native-ohos/react-native-amap-geolocation": "file:../react-native-ohos-react-native-amap-geolocation-1.3.1-rc.1.tgz",
922
+ + "react": "18.2.0",
923
+ + "react-native": "0.77.1",
924
+ + "react-native-harmony": "npm:@react-native-oh/react-native-harmony@0.77.72"
925
+ + },
926
+ + "devDependencies": {
927
+ + "@babel/core": "^7.25.2",
928
+ + "@babel/preset-env": "^7.25.3",
929
+ + "@babel/runtime": "^7.25.0",
930
+ + "@react-native-oh/react-native-harmony-cli": "0.77.72",
931
+ + "@react-native/babel-preset": "0.77.1",
932
+ + "@react-native-community/cli": "15.0.1",
933
+ + "@react-native-community/cli-platform-android": "15.0.1",
934
+ + "@react-native-community/cli-platform-ios": "15.0.1",
935
+ + "@react-native-community/eslint-config": "^3.2.0",
936
+ + "@react-native/eslint-config": "0.77.1",
937
+ + "@react-native/metro-config": "0.77.1",
938
+ + "@react-native/typescript-config": "0.77.1",
939
+ + "@tsconfig/react-native": "^3.0.0",
940
+ + "@types/d3-scale-chromatic": "^3.0.0",
941
+ + "@types/jest": "^29.5.13",
942
+ + "@types/react": "^18.2.6",
943
+ + "@types/react-test-renderer": "^18.0.0",
944
+ + "babel-jest": "^29.6.3",
945
+ + "eslint": "^8.19.0",
946
+ + "jest": "^29.7.0",
947
+ + "json5": "^2.2.3",
948
+ + "metro-react-native-babel-preset": "0.76.8",
949
+ + "prettier": "2.8.8",
950
+ + "react-test-renderer": "18.2.0",
951
+ + "typescript": "5.5.4"
952
+ + },
953
+ + "overrides": {
954
+ + "@react-native-community/cli": "15.0.1"
955
+ + },
956
+ + "resolutions": {
957
+ + "@react-native-community/cli": "15.0.1"
958
+ + },
959
+ + "engines": {
960
+ + "node": ">=18"
961
+ + }
962
+ +}
963
+
964
+ ```
965
+
966
+ ### `example/react-native.config.js`
967
+
968
+ ```diff
969
+ @@ -0,0 +1,3 @@
970
+ +module.exports = {
971
+ + project: {},
972
+ +};
973
+
974
+ ```
975
+
976
+ ### `example/scripts/create-build-profile.js`
977
+
978
+ ```diff
979
+ @@ -0,0 +1,38 @@
980
+ +const fs = require('fs');
981
+ +const JSON5 = require('json5');
982
+ +const path = require('path');
983
+ +
984
+ +const templatePath = path.join(
985
+ + __dirname,
986
+ + '..',
987
+ + 'harmony',
988
+ + 'build-profile.template.json5',
989
+ +);
990
+ +const existingProfilePath = path.join(
991
+ + __dirname,
992
+ + '..',
993
+ + 'harmony',
994
+ + 'build-profile.json5',
995
+ +);
996
+ +
997
+ +if (fs.existsSync(existingProfilePath)) {
998
+ + let existingProfile = JSON5.parse(
999
+ + fs.readFileSync(existingProfilePath, 'utf-8'),
1000
+ + );
1001
+ + let template = JSON5.parse(fs.readFileSync(templatePath, 'utf-8'));
1002
+ + let signingConfigs =
1003
+ + existingProfile.app && existingProfile.app.signingConfigs;
1004
+ +
1005
+ + existingProfile = {...template};
1006
+ +
1007
+ + if (signingConfigs) {
1008
+ + existingProfile.app.signingConfigs = signingConfigs;
1009
+ + }
1010
+ +
1011
+ + fs.writeFileSync(
1012
+ + existingProfilePath,
1013
+ + JSON5.stringify(existingProfile, null, 2),
1014
+ + );
1015
+ +} else {
1016
+ + fs.copyFileSync(templatePath, existingProfilePath);
1017
+ +}
1018
+
1019
+ ```
1020
+
1021
+ ### `example/src/index.tsx`
1022
+
1023
+ ```diff
1024
+ @@ -0,0 +1,59 @@
1025
+ +import React, {useState} from 'react';
1026
+ +import {Button, SafeAreaView, StyleSheet, Text, View} from 'react-native';
1027
+ +import {
1028
+ + Geolocation,
1029
+ + setNeedAddress,
1030
+ + setOnceLocation,
1031
+ +} from '@react-native-ohos/react-native-amap-geolocation';
1032
+ +
1033
+ +export default function AMapGeolocationDemo(): React.JSX.Element {
1034
+ + const [message, setMessage] = useState('Ready');
1035
+ +
1036
+ + const requestLocation = () => {
1037
+ + setNeedAddress(true);
1038
+ + setOnceLocation(true);
1039
+ + setMessage('Locating...');
1040
+ +
1041
+ + Geolocation.getCurrentPosition(
1042
+ + position => {
1043
+ + const {latitude, longitude} = position.coords;
1044
+ + setMessage(`lat: ${latitude}, lng: ${longitude}`);
1045
+ + },
1046
+ + error => {
1047
+ + setMessage(error.message || `Location error: ${error.code}`);
1048
+ + },
1049
+ + );
1050
+ + };
1051
+ +
1052
+ + return (
1053
+ + <SafeAreaView style={styles.container}>
1054
+ + <View style={styles.panel}>
1055
+ + <Text style={styles.title}>AMap Geolocation</Text>
1056
+ + <Text style={styles.message}>{message}</Text>
1057
+ + <Button title="Get Current Location" onPress={requestLocation} />
1058
+ + </View>
1059
+ + </SafeAreaView>
1060
+ + );
1061
+ +}
1062
+ +
1063
+ +const styles = StyleSheet.create({
1064
+ + container: {
1065
+ + flex: 1,
1066
+ + backgroundColor: '#f5f5f5',
1067
+ + },
1068
+ + panel: {
1069
+ + flex: 1,
1070
+ + justifyContent: 'center',
1071
+ + padding: 24,
1072
+ + gap: 16,
1073
+ + },
1074
+ + title: {
1075
+ + color: '#111111',
1076
+ + fontSize: 22,
1077
+ + fontWeight: '600',
1078
+ + },
1079
+ + message: {
1080
+ + color: '#333333',
1081
+ + fontSize: 16,
1082
+ + },
1083
+ +});
1084
+
1085
+ ```
1086
+
1087
+ ### `example/tsconfig.json`
1088
+
1089
+ ```diff
1090
+ @@ -0,0 +1,14 @@
1091
+ +{
1092
+ + "extends": "@react-native/typescript-config/tsconfig.json",
1093
+ + "compilerOptions": {
1094
+ + "jsx": "react-native",
1095
+ + "paths": {
1096
+ + "react-native": [
1097
+ + "./node_modules/react-native-harmony"
1098
+ + ],
1099
+ + },
1100
+ + },
1101
+ + "exclude": [
1102
+ + "harmony"
1103
+ + ]
1104
+ +}
1105
+
1106
+ ```
1107
+
1108
+ ### `harmony/amap_geolocation.har`
1109
+
1110
+ ```diff
1111
+ Binary files no preview for this file type
1112
+ ```
1113
+
1114
+ ### `harmony/amap_geolocation/oh-package.json5`
1115
+
1116
+ ```diff
1117
+ @@ -1,6 +1,6 @@
1118
+ {
1119
+ "name": "@react-native-ohos/react-native-amap-geolocation",
1120
+ - "version": "1.3.0",
1121
+ + "version": "1.3.1-rc.1",
1122
+ "description": "ReactNative geolocation module for Harmony",
1123
+ "main": "Index.ets",
1124
+ "author": "",
1125
+
1126
+ ```
1127
+
1128
+ ### `harmony/amap_geolocation/src/main/ets/AMapGeolocationModule.ts`
1129
+
1130
+ ```diff
1131
+ @@ -95,6 +95,10 @@ export class AMapGeolocationModule extends TurboModule implements IAMapLocationL
1132
+ };
1133
+
1134
+ onLocationError(locationErrorInfo: e45): void {
1135
+ + this.ctx.rnInstance.emitDeviceEvent("AMapGeolocation", {
1136
+ + errorCode: locationErrorInfo.errorCode,
1137
+ + errorInfo: locationErrorInfo.errorMsg
1138
+ + })
1139
+ };
1140
+
1141
+ requestPermissions(): void {
1142
+
1143
+ ```
1144
+
1145
+ ### `package.json`
1146
+
1147
+ ```diff
1148
+ @@ -7,7 +7,7 @@
1149
+ "location",
1150
+ "geolocation"
1151
+ ],
1152
+ - "version": "1.3.0",
1153
+ + "version": "1.3.1-rc.1",
1154
+ "author": "7c00 <i@7c00.cc>",
1155
+ "repository": {
1156
+ "type": "git",
1157
+
1158
+ ```
1159
+
1160
+ ### `readme.md`
1161
+
1162
+ ```diff
1163
+ @@ -4,9 +4,9 @@ This project is based on [react-native-amap-geolocation@1.2.3](http://github.c
1164
+
1165
+ ## Documentation
1166
+
1167
+ -[中文](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/zh-cn/react-native-amap-geolocation.md)
1168
+ +[中文](https://gitcode.com/CPF-RN/usage-docs/blob/master/zh-cn/react-native-amap-geolocation.md)
1169
+
1170
+ -[English](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/en/react-native-amap-geolocation.md)
1171
+ +[English](https://gitcode.com/CPF-RN/usage-docs/blob/master/en/react-native-amap-geolocation.md)
1172
+
1173
+ ## License
1174
+
1175
+
1176
+ ```