@ohos-cpf/3rdloop 0.0.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.
- package/README.md +425 -0
- package/bin/3rdloop.mjs +48 -0
- package/lib/cli.js +741 -0
- package/lib/config.js +318 -0
- package/lib/doctor.js +114 -0
- package/lib/exit-codes.js +31 -0
- package/lib/opencode.js +156 -0
- package/lib/orch.js +427 -0
- package/lib/queries.js +264 -0
- package/lib/runner.js +979 -0
- package/lib/step.js +326 -0
- package/lib/ui.js +223 -0
- package/lib/workflow.js +291 -0
- package/lib/workflows.js +132 -0
- package/package.json +50 -0
- package/vendor/Server/Agent/SkillSelector/README.md +344 -0
- package/vendor/Server/Agent/SkillSelector/core/Agent.js +207 -0
- package/vendor/Server/Agent/SkillSelector/index.js +14 -0
- package/vendor/Server/Agent/SkillSelector/llm/llmClient.js +313 -0
- package/vendor/Server/Agent/SkillSelector/llm/prompts.js +161 -0
- package/vendor/Server/Agent/SkillSelector/llm/reactSteps.js +144 -0
- package/vendor/Server/Agent/SkillSelector/matcher/fuzzyMatcher.js +433 -0
- package/vendor/Server/Agent/SkillSelector/scanner/skillScanner.js +382 -0
- package/vendor/Server/Agent/SkillSelector/types.js +63 -0
- package/vendor/Server/Agent/SkillSelector/utils/actionWords.js +60 -0
- package/vendor/Server/Brain/AnalysisStrategies.js +422 -0
- package/vendor/Server/Brain/Brain.js +686 -0
- package/vendor/Server/Brain/DecompositionStrategies.js +621 -0
- package/vendor/Server/Brain/PlanPersistence.js +196 -0
- package/vendor/Server/Brain/SkillExecutor.js +251 -0
- package/vendor/Server/Brain/index.js +11 -0
- package/vendor/Server/CLI/cli.js +243 -0
- package/vendor/Server/CLI/opencode/index.js +804 -0
- package/vendor/Server/CLI/opencode.js +5 -0
- package/vendor/Server/DbUse/MessageArchive.js +61 -0
- package/vendor/Server/DbUse/StorageManager.js +107 -0
- package/vendor/Server/DbUse/adapters/BaseAdapter.js +94 -0
- package/vendor/Server/DbUse/adapters/FileAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonAdapter.js +138 -0
- package/vendor/Server/DbUse/adapters/JsonlAdapter.js +114 -0
- package/vendor/Server/DbUse/adapters/SqliteAdapter.js +157 -0
- package/vendor/Server/DbUse/index.js +160 -0
- package/vendor/Server/DbUse/stores/SessionStore.js +279 -0
- package/vendor/Server/DbUse/stores/TaskExecutionStore.js +133 -0
- package/vendor/Server/DbUse/stores/TaskRegistryStore.js +262 -0
- package/vendor/Server/DbUse/stores/TaskStepStore.js +279 -0
- package/vendor/Server/FlexRunner/FlexRunner.js +1759 -0
- package/vendor/Server/FlexRunner/index.js +12 -0
- package/vendor/Server/Knowledge/KnowledgeImporter.js +523 -0
- package/vendor/Server/Knowledge/KnowledgeManager.js +341 -0
- package/vendor/Server/Knowledge/index.js +33 -0
- package/vendor/Server/LoopEngine/LoopEngine.js +1133 -0
- package/vendor/Server/LoopEngine/index.js +11 -0
- package/vendor/Server/Orchestrator/Orchestrator.js +1425 -0
- package/vendor/Server/Orchestrator/StepNode.js +312 -0
- package/vendor/Server/Orchestrator/index.js +13 -0
- package/vendor/Server/Routes/controllers/BrainController.js +241 -0
- package/vendor/Server/Routes/controllers/FlexRunnerController.js +1125 -0
- package/vendor/Server/Routes/controllers/HealthController.js +44 -0
- package/vendor/Server/Routes/controllers/KnowledgeImportController.js +355 -0
- package/vendor/Server/Routes/controllers/LoopEngineController.js +788 -0
- package/vendor/Server/Routes/controllers/OrchestratorController.js +911 -0
- package/vendor/Server/Routes/controllers/StatsController.js +57 -0
- package/vendor/Server/Routes/controllers/StreamController.js +67 -0
- package/vendor/Server/Routes/library/logger.js +179 -0
- package/vendor/Server/Routes/library/zipArchive.js +172 -0
- package/vendor/Server/Routes/router/Router.js +204 -0
- package/vendor/Server/Routes/routes/brain.js +47 -0
- package/vendor/Server/Routes/routes/flexrunner.js +72 -0
- package/vendor/Server/Routes/routes/health.js +28 -0
- package/vendor/Server/Routes/routes/index.js +57 -0
- package/vendor/Server/Routes/routes/knowledge.js +55 -0
- package/vendor/Server/Routes/routes/loopengine.js +58 -0
- package/vendor/Server/Routes/routes/orchestrator.js +61 -0
- package/vendor/Server/Routes/routes/registry.js +98 -0
- package/vendor/Server/Routes/routes/stats.js +23 -0
- package/vendor/Server/Routes/routes/stream.js +30 -0
- package/vendor/Server/Routes/server.js +202 -0
- package/vendor/Server/Routes/sse/SseHub.js +308 -0
- package/vendor/Server/Skills/acceptance-check/SKILL.md +174 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE1_ARTIFACT_COLLECTION.md +52 -0
- package/vendor/Server/Skills/acceptance-check/references/PHASE2_CRITERIA_EVALUATION.md +77 -0
- package/vendor/Server/Skills/arkts-code-check/SKILL.md +314 -0
- package/vendor/Server/Skills/arkts-code-check/references/CODE_CHECK_GUIDE.md +160 -0
- package/vendor/Server/Skills/arkts-code-check/references/FILE_TYPE_GUIDE.md +29 -0
- package/vendor/Server/Skills/arkts-code-check/references/PHASE1_INFO_COLLECTION.md +222 -0
- package/vendor/Server/Skills/arkts-code-check/references/REPORT_TEMPLATE.md +220 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/SKILL.md +329 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-compile-validate/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-code/SKILL.md +291 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/API_SIGNATURE_CHECKS.md +68 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/BUILD_VALIDATION.md +184 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/CODE_STANDARDS.md +337 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/EXAMPLES.md +400 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/SYSTEM_API_LOOKUP.md +99 -0
- package/vendor/Server/Skills/arkts-library-demo-code/references/TEMPLATE.md +544 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-demo-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-demo-coverage/SKILL.md +174 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/SKILL.md +321 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/EXAMPLES.md +100 -0
- package/vendor/Server/Skills/arkts-library-demo-scenario/references/TEMPLATE.md +185 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/SKILL.md +234 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +103 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/CHECK_DIMENSIONS.md +89 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/COMPLIANCE_CHECKLIST.md +62 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/KB_QUERY_GUIDE.md +108 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/MCP_TOOL_DISCOVERY.md +124 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/REPORT_TEMPLATE.md +90 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/references/SCORING_FORMULA.md +57 -0
- package/vendor/Server/Skills/arkts-library-documentation-quality-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/arkts-library-interface-spec/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-memory-leak-check/SKILL.md +392 -0
- package/vendor/Server/Skills/arkts-library-source-clone/SKILL.md +113 -0
- package/vendor/Server/Skills/arkts-library-stability-check/SKILL.md +313 -0
- package/vendor/Server/Skills/arkts-library-stability-check/assets/REPORT_TEMPLATE.md +154 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CHECKLIST.md +166 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/CODE_EXAMPLES.md +309 -0
- package/vendor/Server/Skills/arkts-library-stability-check/references/SCORING_RULES.md +90 -0
- package/vendor/Server/Skills/arkts-library-stability-check/scripts/validate-skill.cjs +282 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/SKILL.md +361 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/assets/REPORT_TEMPLATE.md +146 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/CHECKLIST.md +253 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/references/MCP_TOOL_USAGE.md +115 -0
- package/vendor/Server/Skills/arkts-library-test-coverage-check/scripts/validate-skill.cjs +263 -0
- package/vendor/Server/Skills/arkts-library-xts-code/SKILL.md +455 -0
- package/vendor/Server/Skills/arkts-library-xts-code/assets/report-template.md +60 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/ACCESS_MODIFIER_PRECHECK.md +76 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/BUILD_VERIFICATION.md +200 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/CODE_STANDARDS.md +519 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SUBAGENT_PROMPT_TEMPLATE.md +276 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/SYSTEM_API_LOOKUP.md +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/references/XTS_TEMPLATE.md +767 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/arkts-library-xts-code/scripts/precheck-access-modifiers.cjs +221 -0
- package/vendor/Server/Skills/arkts-library-xts-code-fix/SKILL.md +229 -0
- package/vendor/Server/Skills/arkts-library-xts-coverage/SKILL.md +97 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/SKILL.md +194 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/EXAMPLES.md +576 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TEMPLATE.md +575 -0
- package/vendor/Server/Skills/arkts-library-xts-doc/references/TESTABILITY_GUIDE.md +182 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/SKILL.md +491 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/references/error-fixing-examples.md +217 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/build.ps1 +93 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/code-linter.cjs +433 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/migrate.cjs +851 -0
- package/vendor/Server/Skills/arkts-library-xts-execution/scripts/ohpm-switch.cjs +789 -0
- package/vendor/Server/Skills/flutter-code-check/SKILL.md +299 -0
- package/vendor/Server/Skills/flutter-code-check/assets/OUTPUT_TEMPLATE.md +312 -0
- package/vendor/Server/Skills/flutter-code-check/references/CHECKLIST.md +190 -0
- package/vendor/Server/Skills/flutter-code-check/references/PLATFORMS.md +134 -0
- package/vendor/Server/Skills/flutter-code-check/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/flutter-interface/README.md +75 -0
- package/vendor/Server/Skills/flutter-interface/SKILL.md +291 -0
- package/vendor/Server/Skills/flutter-interface/references/EXAMPLES.md +336 -0
- package/vendor/Server/Skills/flutter-interface/references/GIT_CLONE_GUIDE.md +190 -0
- package/vendor/Server/Skills/flutter-interface/references/SCRIPT_REFERENCE.md +258 -0
- package/vendor/Server/Skills/flutter-interface/references/TEMPLATE.md +254 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/SKILL.md +518 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/CHECKLIST.md +382 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +342 -0
- package/vendor/Server/Skills/flutter-library-consistency-check/references/PLATFORM_LIMITATION_GUIDE.md +71 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/SKILL.md +519 -0
- package/vendor/Server/Skills/flutter-library-documentation-quality-check/references/CHECKLIST.md +407 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/SKILL.md +653 -0
- package/vendor/Server/Skills/flutter-library-memory-leak-check/references/CHECKLIST.md +397 -0
- package/vendor/Server/Skills/flutter-library-stability-check/SKILL.md +745 -0
- package/vendor/Server/Skills/flutter-library-stability-check/references/CHECKLIST.md +721 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/SKILL.md +414 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/assets/REPORT_TEMPLATE.md +150 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/CHECKLIST.md +304 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCORING_RULES.md +265 -0
- package/vendor/Server/Skills/flutter-library-test-coverage-check/references/SCRIPT_USAGE.md +286 -0
- package/vendor/Server/Skills/knowledge-import/SKILL.md +383 -0
- package/vendor/Server/Skills/knowledge-import/references/MCP_TOOL_USAGE.md +165 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_LOCATOR_GUIDE.md +91 -0
- package/vendor/Server/Skills/knowledge-import/references/SKILL_OPTIMIZATION_GUIDE.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/SKILL.md +301 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/assets/PR_ISSUE_TEMPLATE.md +105 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/references/GITCODE_API.md +127 -0
- package/vendor/Server/Skills/ohos-lib-pr-push/scripts/gitcode-api.cjs +208 -0
- package/vendor/Server/Skills/rn-code-check/SKILL.md +321 -0
- package/vendor/Server/Skills/rn-code-check/references/API-GUIDE.md +235 -0
- package/vendor/Server/Skills/rn-code-check/references/CHECKLIST.md +189 -0
- package/vendor/Server/Skills/rn-code-check/references/REPORT-TEMPLATE.md +247 -0
- package/vendor/Server/Skills/rn-lib-add-example/SKILL.md +198 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/APP_RENAME_GUIDE.md +40 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/SHELL_ADAPTATION_CHECKLIST.md +78 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/TEMPLATE_REPO_GUIDE.md +70 -0
- package/vendor/Server/Skills/rn-lib-add-example/references/VERIFICATION_GUIDE.md +47 -0
- package/vendor/Server/Skills/rn-lib-add-example/scripts/create-example.cjs +252 -0
- package/vendor/Server/Skills/rn-lib-update-doc/SKILL.md +176 -0
- package/vendor/Server/Skills/rn-lib-update-doc/config.json +5 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/changelog-template.md +35 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/format-diff.md +137 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/link-registry.json +33 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2-overview.md +40 -0
- package/vendor/Server/Skills/rn-lib-update-doc/references/model-0.4.2.md +429 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/detect-readme-format.cjs +105 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/find-usage-doc.cjs +90 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/link-verify.cjs +213 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-changelog.cjs +73 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-package-meta.cjs +258 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/normalize-readme-links.cjs +341 -0
- package/vendor/Server/Skills/rn-lib-update-doc/scripts/resolve-usage-docs.cjs +67 -0
- package/vendor/Server/Skills/rn-library-consistency-check/SKILL.md +299 -0
- package/vendor/Server/Skills/rn-library-consistency-check/assets/REPORT_TEMPLATE.md +293 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_COMPONENT_CHECK_GUIDE.md +857 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/ARKTS_TURBOMODULE_CHECK_GUIDE.md +856 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CHECKLIST.md +157 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_COMPONENT_CHECK_GUIDE.md +801 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/CPP_TURBOMODULE_CHECK_GUIDE.md +684 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/FUNCTION_COMPARISON_GUIDE.md +233 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/NATIVE_COMPONENT_IDENTIFICATION.md +1373 -0
- package/vendor/Server/Skills/rn-library-consistency-check/references/SCORING_STANDARD.md +220 -0
- package/vendor/Server/Skills/rn-library-consistency-check/scripts/validate-skill.py +245 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL.md +414 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/MODEL_en.md +413 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/assets/REPORT_TEMPLATE.md +311 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CHECK_CHECKLIST.md +355 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/CROSS_VALIDATION_GUIDE.md +115 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/DOC_COLLECTION_GUIDE.md +139 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/EXAMPLES.md +586 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/references/GOTCHAS.md +57 -0
- package/vendor/Server/Skills/rn-library-documentation-quality-check/scripts/validate-skill.py +259 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/SKILL.md +301 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/assets/REPORT_TEMPLATE.md +148 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/DOC_ANNOTATION_GUIDE.md +118 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/SCRIPT_USAGE_GUIDE.md +168 -0
- package/vendor/Server/Skills/rn-library-interface-analyzer/references/URL_PARSING_RULES.md +176 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/SKILL.md +274 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/case-template.md +45 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/assets/rule-template.md +25 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/PR_FETCH_GUIDE.md +61 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/references/RULE_TEMPLATE_GUIDE.md +165 -0
- package/vendor/Server/Skills/rn-library-issue-generalizer/scripts/fetch-pr-info.py +239 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/SKILL.md +263 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/assets/REPORT_TEMPLATE.md +96 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/COMPLIANCE_CHECKLIST.md +58 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/INSPECTION_GUIDE.md +99 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/PRESCREEN_GUIDE.md +64 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/references/SOURCE_PREP_GUIDE.md +75 -0
- package/vendor/Server/Skills/rn-library-known-issue-check/scripts/validate-known-issue-report.py +164 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/SKILL.md +339 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/assets/REPORT_TEMPLATE.md +83 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/CHECKLIST.md +859 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/references/HARMONY_CODE_PATTERNS.md +122 -0
- package/vendor/Server/Skills/rn-library-memory-leak-check/scripts/scan_harmony_code.py +279 -0
- package/vendor/Server/Skills/rn-library-stability-check/SKILL.md +273 -0
- package/vendor/Server/Skills/rn-library-stability-check/assets/REPORT_TEMPLATE.md +129 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/CHECKLIST.md +581 -0
- package/vendor/Server/Skills/rn-library-stability-check/references/SCORING_RULES.md +138 -0
- package/vendor/Server/Skills/rn-library-stability-check/scripts/scan-harmony-code.py +168 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/SKILL.md +506 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/CHECKLIST.md +280 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/DEMO_LOCATION.md +221 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/REPORT_TEMPLATE.md +209 -0
- package/vendor/Server/Skills/rn-library-test-coverage-check/references/SCRIPT_USAGE.md +325 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/SKILL.md +279 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/assets/TEST_FILE_TEMPLATES.md +404 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_TROUBLESHOOTING.md +185 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/BUILD_WORKFLOW.md +265 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COMMON_CONFIG.md +189 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/CONFIG_GUIDE.md +203 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/COVERAGE_ANALYZER.md +147 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/DESIGN_DOC_GUIDE.md +148 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_FLOW.md +165 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/GENERATION_STRATEGY.md +195 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/HARMONY_SCANNER.md +249 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/JEST_FRAMEWORK.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/PLATFORM_COMPAT.md +161 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/RN_TEST_PATTERNS.md +413 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/SOURCE_PARSER.md +235 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TEST_CONVENTIONS.md +245 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/TROUBLESHOOTING.md +282 -0
- package/vendor/Server/Skills/rn-ohos-xts-generator/references/USAGE_GUIDE.md +251 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/SKILL.md +469 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/CPTF_TEST_TEMPLATE.md +310 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/assets/DEMO_PAGE_TEMPLATE.md +303 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/CPTF_TEST_GENERATION_GUIDE.md +421 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/DEMO_GENERATION_GUIDE.md +358 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/QUALITY_CHECKLIST.md +114 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/references/SPEC_PARSING_GUIDE.md +274 -0
- package/vendor/Server/Skills/rnoh-cptf-api-test/scripts/validate-rnoh-cptf-api-test.sh +185 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/SKILL.md +191 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/assets/TEST_TEMPLATE.md +216 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/CPTF_SETUP.md +107 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/references/DEMO_ANALYSIS.md +120 -0
- package/vendor/Server/Skills/rnoh-cptf-demo-test/scripts/validate-rnoh-cptf-test.sh +108 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/SKILL.md +237 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/references/DEBUG_PLAYBOOK.md +261 -0
- package/vendor/Server/Skills/rnoh-cptf-test-run/scripts/validate-run-env.sh +112 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/SKILL.md +498 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/adapt-checklist.md +270 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/api-migration-checklist.md +164 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/common-compile-errors.md +556 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/deveco-cli-tools.md +459 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/edge-cases.md +65 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/har-tgz-build.md +512 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/references/version-compat-matrix.md +132 -0
- package/vendor/Server/Skills/rnoh-lib-code-adapt/scripts/auto-integrate.sh +424 -0
- package/vendor/Server/Skills/rnoh-lib-demo-coverage/SKILL.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/SKILL.md +306 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/DEMO_PAGE_TEMPLATE.md +485 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/assets/INDEX_TEMPLATE.md +172 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/DEMO_CODE_RULES.md +422 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/QUALITY_CHECKLIST.md +95 -0
- package/vendor/Server/Skills/rnoh-lib-demo-create/references/SOURCE_EXPLORATION.md +169 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/SKILL.md +554 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/assets/DEMO_DOC_TEMPLATE.md +106 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/COVERAGE_INCREMENTAL.md +216 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/DEMO_DESIGN_RULES.md +413 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/OUTPUT_FORMAT.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-demo-doc/references/QUALITY_CHECKLIST.md +98 -0
- package/vendor/Server/Skills/rnoh-lib-func-test/SKILL.md +337 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/SKILL.md +722 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/assets/PORT_REPORT_TEMPLATE.md +219 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/DEMO_PORTING_GUIDE.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/PORT_VERIFICATION.md +269 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/references/RNT_PROJECT_STRUCTURE.md +173 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/analyze-demo-deps.cjs +267 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/detect-rnoh-version.cjs +174 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/find-rnt-demo.sh +111 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/port-demo.sh +186 -0
- package/vendor/Server/Skills/rnoh-lib-rnt-search/scripts/read-lib-meta.cjs +150 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/SKILL.md +296 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/jest-troubleshooting.md +371 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/port-test-demo-guide.md +212 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/runtime-troubleshooting.md +345 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/references/unit-test-template.md +223 -0
- package/vendor/Server/Skills/rnoh-lib-test-align/scripts/port-test-demo.sh +1053 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/SKILL.md +255 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_ADAPTATION.md +77 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/OHOS_API_LOOKUP.md +224 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/references/script-reference.md +174 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/detect-upstream-version.js +967 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/generate-diff.js +1798 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/scripts/package.json +5 -0
- package/vendor/Server/Skills/rnoh-lib-version-diff/templates/report-template.md +137 -0
- package/vendor/Server/Skills/rnoh-lib-xts-coverage/SKILL.md +145 -0
- package/vendor/Server/Skills/skill-generator/SKILL.md +365 -0
- package/vendor/Server/Skills/skill-generator/assets/SKILL_TEMPLATE.md +183 -0
- package/vendor/Server/Skills/skill-generator/references/COMPLIANCE_CHECKLIST.md +82 -0
- package/vendor/Server/Skills/skill-generator/references/KB_QUERY_GUIDE.md +110 -0
- package/vendor/Server/Skills/skill-generator/references/MCP_TOOL_DISCOVERY.md +122 -0
- package/vendor/Server/Skills/skill-generator/references/SKILL_SPEC.md +121 -0
- package/vendor/Server/Skills/skill-generator/scripts/validate-skill.cjs +259 -0
- package/vendor/Server/Skills/task-analysis/SKILL.md +234 -0
- package/vendor/Server/Skills/task-analysis/assets/OUTPUT_EXAMPLES.md +160 -0
- package/vendor/Server/Skills/task-analysis/references/ACCEPTANCE_CRITERIA_GUIDE.md +190 -0
- package/vendor/Server/Skills/task-analysis/references/ANALYSIS_SCHEMA.md +224 -0
- package/vendor/Server/Skills/task-analysis/references/INTEGRATION_CONTEXT.md +162 -0
- package/vendor/Server/Skills/task-analysis/references/LESSONS_LEARNED.md +55 -0
- package/vendor/Server/Skills/task-analysis/references/REPLAN_CONTEXT_GUIDE.md +126 -0
- package/vendor/Server/Skills/task-analysis/scripts/validate-analysis-output.sh +256 -0
- package/vendor/Server/Skills/task-decomposition/SKILL.md +529 -0
- package/vendor/Server/Skills/task-decomposition/assets/OUTPUT_EXAMPLES.md +451 -0
- package/vendor/Server/Skills/task-decomposition/references/ACCEPTANCE_CRITERIA_GUIDE.md +179 -0
- package/vendor/Server/Skills/task-decomposition/references/DEPENDENCY_GRAPH_GUIDE.md +152 -0
- package/vendor/Server/Skills/task-decomposition/references/INTEGRATION_CONTEXT.md +175 -0
- package/vendor/Server/Skills/task-decomposition/references/REPLAN_CONTEXT_GUIDE.md +195 -0
- package/vendor/Server/Skills/task-decomposition/references/TASK_DECOMPOSITION_TEMPLATES.md +226 -0
- package/vendor/Server/Skills/task-decomposition/scripts/list-available-skills.cjs +263 -0
- package/vendor/Server/Skills/task-decomposition/scripts/skill-blacklist.json +29 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-decomposition-output.cjs +376 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-param-consistency.cjs +259 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-specified-skills.cjs +216 -0
- package/vendor/Server/Skills/task-decomposition/scripts/validate-step-graph.cjs +425 -0
- package/vendor/Server/Skills/tpc-cpp-check/SKILL.md +427 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/CHECKLIST.md +214 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/HPKBUILD_GUIDE.md +235 -0
- package/vendor/Server/Skills/tpc-cpp-check/references/REPORT_TEMPLATE.md +250 -0
- package/vendor/Server/TestCheck/TestCheck.js +775 -0
- package/vendor/Server/TestCheck/index.js +11 -0
- package/vendor/Server/library/McpToolGuide.js +280 -0
- package/vendor/Server/library/StatsService.js +127 -0
- package/vendor/Server/library/cstTime.js +16 -0
- package/vendor/Server/package.json +17 -0
- package/vendor/VERSION +3 -0
- package/workflows/pr-check.mjs +106 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# rnt Demo 迁移报告模板
|
|
2
|
+
|
|
3
|
+
> Agent 读取此模板,填充 `{{占位符}}` 实际值后写入目标路径。
|
|
4
|
+
> 输出路径:`{libPath}/rnt-demo-port-report.md`(或 `{libPath}/rn-lib-ohos/rnt-demo-port-report.md` 处于父流程中时)
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# rnt Demo 迁移报告 — {{库名}}
|
|
9
|
+
|
|
10
|
+
> 生成时间:{{生成时间}}
|
|
11
|
+
> 生成工具:rnoh-lib-rnt-search v1.0.0
|
|
12
|
+
|
|
13
|
+
## 1. 基本信息
|
|
14
|
+
|
|
15
|
+
| 项 | 值 |
|
|
16
|
+
|----|-----|
|
|
17
|
+
| 目标库 | {{packageName}} |
|
|
18
|
+
| 库版本 | {{version}} |
|
|
19
|
+
| harmony.alias | {{alias}} |
|
|
20
|
+
| 目标库根目录 | {{libPath}} |
|
|
21
|
+
| 目标 example/src | {{targetExampleSrc}} |
|
|
22
|
+
| rnt 工程根 | {{rntPath}} |
|
|
23
|
+
| 库分支 | {{libBranch}} |
|
|
24
|
+
| rnt 分支 | {{rntBranch}} |
|
|
25
|
+
| RNOH 版本 | {{rnohVersion}} |
|
|
26
|
+
| example/package.json RN 版本 | {{exampleRnVersion}} |
|
|
27
|
+
| 版本一致性 | ✅ 一致 / ❌ 不一致 |
|
|
28
|
+
|
|
29
|
+
## 2. demo 来源
|
|
30
|
+
|
|
31
|
+
| 项 | 值 |
|
|
32
|
+
|----|-----|
|
|
33
|
+
| rnt 子工程 | {{rntSubproject}} |
|
|
34
|
+
| demo 目录路径 | {{demoPath}} |
|
|
35
|
+
| 命中候选名 | {{matchedSearchName}} |
|
|
36
|
+
| 扫描方式 | 自动扫描 / 用户指定 |
|
|
37
|
+
| demo 结构 | 根级入口 / testCase 嵌套 / 混合 |
|
|
38
|
+
|
|
39
|
+
## 3. 库元数据(read-lib-meta.cjs 摘要)
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{{libMetaJson}}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> 完整元数据由 `read-lib-meta.cjs` 输出。`autolinkingResolved` 供下游 `rn-lib-add-example` 壳层适配使用。
|
|
46
|
+
|
|
47
|
+
## 4. 迁移文件清单
|
|
48
|
+
|
|
49
|
+
迁移文件总数:{{文件总数}}
|
|
50
|
+
|
|
51
|
+
> 迁移模式:**增量添加**(`--ignore-existing`),不覆盖目标已有文件。
|
|
52
|
+
|
|
53
|
+
| # | 相对路径 | 类型 | 迁移状态 | 备注 |
|
|
54
|
+
|---|---------|------|---------|------|
|
|
55
|
+
| 1 | App.tsx | 入口 | ✅ 新增 | displayName: {{displayName}} |
|
|
56
|
+
| 2 | index.tsx | 导出 | ✅ 新增 / ⚠️ 冲突保留 | — |
|
|
57
|
+
| 3 | tests/index.tsx | testerino 注册 | ✅ 新增 | 路径已修正 |
|
|
58
|
+
| ... | ... | ... | ... | ... |
|
|
59
|
+
|
|
60
|
+
### 4.0 冲突文件清单(目标版本已保留)
|
|
61
|
+
|
|
62
|
+
> 以下文件在目标 `example/src/` 中已存在,**目标版本已保留,demo 版本未写入**。请人工确认是否需要合并:
|
|
63
|
+
|
|
64
|
+
| # | 相对路径 | 目标版本来源 | 建议 |
|
|
65
|
+
|---|---------|-------------|------|
|
|
66
|
+
| 1 | {{冲突文件}} | example 模板 / 上次迁移 | 手动对比差异后决定是否合并 |
|
|
67
|
+
| ... | ... | ... | ... |
|
|
68
|
+
|
|
69
|
+
> 若无冲突文件,本节标注「无冲突」。
|
|
70
|
+
|
|
71
|
+
### 4.1 排除项
|
|
72
|
+
|
|
73
|
+
以下目录/文件未迁移(脚本默认排除):
|
|
74
|
+
|
|
75
|
+
- `node_modules/`
|
|
76
|
+
- `build/`
|
|
77
|
+
- `__tests__/`(demo 自带测试)
|
|
78
|
+
- `.cxx/` / `oh_modules/`
|
|
79
|
+
- `.DS_Store` / `*.log`
|
|
80
|
+
|
|
81
|
+
### 4.2 原生代码(若有)
|
|
82
|
+
|
|
83
|
+
> demo 含以下原生文件,未迁移到 `example/src/`,需由 `rn-lib-add-example` 处理壳层适配:
|
|
84
|
+
|
|
85
|
+
| 文件 | 类型 | 建议处理 |
|
|
86
|
+
|------|------|---------|
|
|
87
|
+
| {{原生文件}} | .ets / .cpp / .h | 移至 `example/harmony/` |
|
|
88
|
+
|
|
89
|
+
## 5. 依赖增量清单
|
|
90
|
+
|
|
91
|
+
### 5.1 目标库本身
|
|
92
|
+
|
|
93
|
+
| 包名 | 引用方式 | 建议写入 example/package.json |
|
|
94
|
+
|------|---------|------------------------------|
|
|
95
|
+
| {{packageName}} | `import { X } from '{{alias}}'` | `"{{packageName}}": "file:../{{tgzName}}"` |
|
|
96
|
+
|
|
97
|
+
### 5.2 RNOH 框架依赖
|
|
98
|
+
|
|
99
|
+
| 包名 | 当前版本 | 建议版本 | 来源 |
|
|
100
|
+
|------|---------|---------|------|
|
|
101
|
+
| @react-native-oh/react-native-harmony | — | {{rnohVersion}} | example 模板默认 |
|
|
102
|
+
|
|
103
|
+
### 5.3 RN 通用依赖
|
|
104
|
+
|
|
105
|
+
| 包名 | demo 引用 | 建议版本来源 |
|
|
106
|
+
|------|----------|-------------|
|
|
107
|
+
| {{pkgName}} | `import { X } from '{{pkgName}}'` | example 模板 / rnt 工程 |
|
|
108
|
+
|
|
109
|
+
### 5.4 待人工确认依赖
|
|
110
|
+
|
|
111
|
+
> 以下依赖未自动分类,请用户确认是否写入 example/package.json:
|
|
112
|
+
|
|
113
|
+
| 包名 | demo 引用 | 说明 |
|
|
114
|
+
|------|----------|------|
|
|
115
|
+
| {{pkgName}} | `import { X } from '{{pkgName}}'` | {{说明}} |
|
|
116
|
+
|
|
117
|
+
## 6. 路径修正记录
|
|
118
|
+
|
|
119
|
+
> 仅记录**本次新增文件**的修正。目标已有文件(冲突保留项)不修改,其待修正项列入第 10 章待人工确认。
|
|
120
|
+
|
|
121
|
+
| # | 文件 | 修正类型 | 修正前 | 修正后 | 原因 |
|
|
122
|
+
|---|------|---------|--------|--------|------|
|
|
123
|
+
| 1 | index.tsx | 入口接入 | 独立内容 | re-export testCase/App | demo 入口未接入(仅新增文件) |
|
|
124
|
+
| 2 | testCase/Navigation.tsx | 硬编码标题 | "RN Svg Capi Tester" | "RN Pdf Tester" | 遗留其他库标题 |
|
|
125
|
+
| ... | ... | ... | ... | ... | ... |
|
|
126
|
+
|
|
127
|
+
## 7. 入口文件信息
|
|
128
|
+
|
|
129
|
+
| 文件 | 字段 | 值 |
|
|
130
|
+
|------|------|-----|
|
|
131
|
+
| {{appPath}} | displayName | {{displayName}} |
|
|
132
|
+
| {{appPath}} | title | {{title}} |
|
|
133
|
+
| index.tsx | 接入方式 | re-export {{appPath}} / 独立入口 |
|
|
134
|
+
| {{testIndexPath}} | 注册组件名 | {{registeredNames}} |
|
|
135
|
+
|
|
136
|
+
## 8. 目标库引用方式
|
|
137
|
+
|
|
138
|
+
| demo 引用方式 | example 配置建议 | 状态 |
|
|
139
|
+
|--------------|-----------------|------|
|
|
140
|
+
| `import { X } from '{{alias}}'` | metro.config.js extraNodeModules | 待 rn-lib-add-example 配置 |
|
|
141
|
+
| `import { X } from '{{packageName}}'` | tsconfig.json paths | 待 rn-lib-add-example 配置 |
|
|
142
|
+
|
|
143
|
+
## 9. 验证检查结果
|
|
144
|
+
|
|
145
|
+
| # | 检查项 | 结果 | 备注 |
|
|
146
|
+
|---|--------|------|------|
|
|
147
|
+
| 1.1.1 | 文件完整性 | ✅ / ❌ | {{备注}} |
|
|
148
|
+
| 1.1.2 | 入口文件存在 | ✅ / ❌ | {{备注}} |
|
|
149
|
+
| 1.1.3 | testerino 注册存在 | ✅ / ❌ | {{备注}} |
|
|
150
|
+
| 1.1.4 | 无排除项残留 | ✅ / ❌ | {{备注}} |
|
|
151
|
+
| 1.1.5 | index.tsx 引用 demo 入口 | ✅ / ❌ | {{备注}} |
|
|
152
|
+
| 1.2.1 | 子目录下无错误相对路径 | ✅ / ❌ | {{备注}} |
|
|
153
|
+
| 1.2.2 | import 路径可解析 | ✅ / ❌ | {{备注}} |
|
|
154
|
+
| 1.3.1 | 目标库引用方式一致 | ✅ / ❌ | {{备注}} |
|
|
155
|
+
| 1.3.2 | displayName 存在 | ✅ / ❌ | {{备注}} |
|
|
156
|
+
| 1.3.3 | 无硬编码其他库标题 | ✅ / ❌ | {{备注}} |
|
|
157
|
+
| 1.4.1 | 外部依赖已列出 | ✅ / ❌ | {{备注}} |
|
|
158
|
+
| 1.4.2 | 无未识别 require | ✅ / ❌ | {{备注}} |
|
|
159
|
+
| 1.4.3 | **外部依赖已在 example/package.json 声明** | ✅ / ❌ | {{缺失依赖列表}} |
|
|
160
|
+
| 1.5.1 | **无孤立文件(所有 demo 可导航)** | ✅ / ❌ | {{孤立文件列表}} |
|
|
161
|
+
| 1.5.2 | **菜单可滚动(条目 > 5 时为 ScrollView)** | ✅ / ❌ | {{条目数}} |
|
|
162
|
+
| 1.5.3 | **原有 App.tsx 可访问** | ✅ / ❌ | {{备注}} |
|
|
163
|
+
| 1.5.4 | **入口链路端到端完整** | ✅ / ❌ | {{备注}} |
|
|
164
|
+
| 1.6.1 | **build-profile 无越界路径** | ✅ / ❌ | {{备注}} |
|
|
165
|
+
| 1.6.2 | **.har 文件路径有效** | ✅ / ❌ | {{备注}} |
|
|
166
|
+
| 1.7.1 | 库与 rnt 版本一致 | ✅ / ❌ | {{备注}} |
|
|
167
|
+
| 1.7.2 | example/package.json 版本匹配 | ✅ / ❌ | {{备注}} |
|
|
168
|
+
|
|
169
|
+
## 10. 构建前置检查结果
|
|
170
|
+
|
|
171
|
+
| # | 检查项 | 结果 | 备注 / 修正内容 |
|
|
172
|
+
|---|--------|------|----------------|
|
|
173
|
+
| 1 | **外部依赖缺失清单** | ✅ 无缺失 / ❌ 缺失 | {{缺失依赖列表 + 建议写入值}} |
|
|
174
|
+
| 2 | **build-profile.json5 路径越界** | ✅ 无越界 / ❌ 已修正 | {{修正详情:复制了哪些模块、修改了哪些 srcPath}} |
|
|
175
|
+
| 3 | **.har 文件路径验证** | ✅ 全部有效 / ❌ 已修正 | {{修正详情:哪些 oh-package.json5 的 file: 路径被修改}} |
|
|
176
|
+
| 4 | **入口链路验证** | ✅ 完整 / ❌ 有断裂 | {{断裂点}} |
|
|
177
|
+
|
|
178
|
+
## 11. 待人工确认项
|
|
179
|
+
|
|
180
|
+
| # | 项 | 说明 | 建议 |
|
|
181
|
+
|---|----|------|------|
|
|
182
|
+
| 1 | 冲突文件合并 | demo 与目标同名文件已保留目标版本(见 4.0 章) | 手动对比差异后决定是否合并 |
|
|
183
|
+
| 2 | 入口文件接入 | 若 index.tsx 为已有文件且未引用 demo 入口 | 手动在已有 index.tsx 中添加 re-export |
|
|
184
|
+
| 3 | 已有文件硬编码标题 | 目标已有文件中的 Navigation.tsx 等含其他库标题 | 手动修正或确认无需处理 |
|
|
185
|
+
| 4 | 业务无关依赖 | demo 引用了与目标库无关的包 | 确认是否写入 example/package.json |
|
|
186
|
+
| 5 | 版本不一致 | example/package.json RN 版本与目标 RNOH 版本不一致 | 由 rn-lib-add-example 更新 |
|
|
187
|
+
| ... | ... | ... | ... |
|
|
188
|
+
|
|
189
|
+
## 12. 后续步骤建议
|
|
190
|
+
|
|
191
|
+
本 SKILL 已完成 demo 文件**增量迁移**(不覆盖已有文件)与新增文件路径修正。建议执行以下后续步骤:
|
|
192
|
+
|
|
193
|
+
1. **执行 `rn-lib-add-example`** 完成:
|
|
194
|
+
- example 模板创建(若缺失)
|
|
195
|
+
- `example/package.json` 依赖写入(消费本报告第 5 章,**特别是缺失依赖**)
|
|
196
|
+
- `metro.config.js` / `tsconfig.json` 别名配置(消费本报告第 8 章)
|
|
197
|
+
- Harmony 壳层适配(RNPackagesFactory.ets / CMakeLists.txt / build-profile.template.json5 等)
|
|
198
|
+
- License 头补全 / OAT.xml 过滤项
|
|
199
|
+
|
|
200
|
+
2. **编译验证**(确认构建前置检查全部通过后):
|
|
201
|
+
```bash
|
|
202
|
+
cd example && npm i --legacy-peer-deps # 安装 JS 依赖
|
|
203
|
+
cd harmony && ohpm install # 安装鸿蒙原生依赖
|
|
204
|
+
cd .. && npm run dev # 生成 JS bundle
|
|
205
|
+
cd harmony && devecocli build # 编译鸿蒙工程
|
|
206
|
+
```
|
|
207
|
+
> `npm i` 只装 JS 依赖,`ohpm install` 才装 .har 依赖,两者都不可省略。
|
|
208
|
+
|
|
209
|
+
3. **(可选)执行 `rnoh-lib-demo-coverage`** 评估 demo 对库 API 的覆盖程度。
|
|
210
|
+
|
|
211
|
+
4. **人工确认**本报告第 11 章的待确认项,特别是:
|
|
212
|
+
- 缺失依赖是否已写入 example/package.json
|
|
213
|
+
- 冲突文件是否需要手动合并(第 4.0 章)
|
|
214
|
+
- 已有 index.tsx 是否需要手动接入 demo 入口
|
|
215
|
+
- 已有文件中的硬编码标题是否需要修正
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
> 报告生成完毕。如有疑问,请检查 `references/` 下的详细指南。
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
# Demo 迁移详细指南
|
|
2
|
+
|
|
3
|
+
> 本文档说明 demo 迁移的完整流程、库元数据字段、依赖分析规则、路径修正检查清单。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 库元数据字段
|
|
8
|
+
|
|
9
|
+
`scripts/read-lib-meta.cjs` 输出 JSON,各字段用途:
|
|
10
|
+
|
|
11
|
+
| 字段 | 类型 | 来源 | 用途 |
|
|
12
|
+
|------|------|------|------|
|
|
13
|
+
| `packageName` | string | `package.json.name` | npm 包名,写入 example `dependencies` |
|
|
14
|
+
| `version` | string | `package.json.version` | tgz 版本号 |
|
|
15
|
+
| `alias` | string | `harmony.alias` 或 scoped | metro 别名,候选搜索名 |
|
|
16
|
+
| `scoped` | string | packageName 去 scope | 候选搜索名 |
|
|
17
|
+
| `dirBase` | string | 目录 basename | 候选搜索名 |
|
|
18
|
+
| `searchNames` | string[] | 上述去重 | demo 扫描候选名列表 |
|
|
19
|
+
| `autolinking` | object \| null | `harmony.autolinking` | 鸿蒙化链接配置(供下游壳层适配) |
|
|
20
|
+
| `autolinkingResolved` | object | 脚本推断 | 源码模块路径、CMake 路径等(供下游使用) |
|
|
21
|
+
| `codegenConfig` | object \| null | `package.json.codegenConfig` | codegen 配置 |
|
|
22
|
+
|
|
23
|
+
### 1.1 autolinkingResolved 字段
|
|
24
|
+
|
|
25
|
+
| 字段 | 说明 | 下游用途 |
|
|
26
|
+
|------|------|---------|
|
|
27
|
+
| `ohPackageName` | ohpm 包名 | `RNPackagesFactory.ets` import |
|
|
28
|
+
| `sourceModulePath` | `harmony/{module}/` 路径 | CMake `add_subdirectory`、`build-profile.template.json5` 的 `srcPath` |
|
|
29
|
+
| `harmonyModuleName` | 源码模块目录名 | `build-profile.template.json5` 的 `modules[].name` |
|
|
30
|
+
| `hasCpp` | 是否有 C++ 源码 | 决定是否写 CMake |
|
|
31
|
+
| `cmakeCppPath` | C++ 源码路径(node_modules 下) | CMake `add_subdirectory` |
|
|
32
|
+
| `cmakeShortName` | CMake 短名 | `add_subdirectory` 第二参数 |
|
|
33
|
+
| `etsPackageClassName` | ETS Package 类名 | `RNPackagesFactory.ets` |
|
|
34
|
+
| `cppPackageClassName` | C++ Package 类名 | `PackageProvider.cpp` |
|
|
35
|
+
| `cmakeLibraryTargetName` | CMake link target | `target_link_libraries` |
|
|
36
|
+
|
|
37
|
+
> ⚠️ `sourceModulePath` **不要**写入 `package.json` 的 `harmony.autolinking.mainHarPath`(会导致 RNOH CLI 扫不到 `.har`)。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. 依赖分析与写入
|
|
42
|
+
|
|
43
|
+
### 2.1 依赖分类
|
|
44
|
+
|
|
45
|
+
`scripts/analyze-demo-deps.cjs` 扫描 demo 源码的 `import` / `require` 语句,按以下规则分类:
|
|
46
|
+
|
|
47
|
+
| 类别 | 判定规则 | 处理方式 |
|
|
48
|
+
|------|---------|---------|
|
|
49
|
+
| **相对路径** | `import './xxx'` / `import '../xxx'` | 忽略(demo 内部引用) |
|
|
50
|
+
| **Node 内置** | `fs` / `path` / `util` / `os` 等 | 忽略 |
|
|
51
|
+
| **React 核心** | `react` / `react-native` | 忽略(example 模板已内置) |
|
|
52
|
+
| **目标库本身** | `module === alias` 或 `packageName` | 标注,由 `rn-lib-add-example` 改为 `file:../<tgz>` |
|
|
53
|
+
| **RNOH 框架** | `@react-native-oh/*` / `@rnoh/*` / `react-native-harmony` | 列入 example `dependencies`,版本对齐 RNOH |
|
|
54
|
+
| **RN 通用包** | `react-native-*` / `@react-native-*` / `@react-native-community/*` | 列入 example `dependencies` |
|
|
55
|
+
| **其他第三方** | 不属于以上类别 | 列入「待人工确认」清单 |
|
|
56
|
+
|
|
57
|
+
### 2.2 依赖版本对齐
|
|
58
|
+
|
|
59
|
+
迁移报告产出依赖增量时,**不自动指定版本号**,由 `rn-lib-add-example` 按以下规则对齐:
|
|
60
|
+
|
|
61
|
+
| 依赖类型 | 版本来源 |
|
|
62
|
+
|----------|---------|
|
|
63
|
+
| 目标库本身 | `libPath/package.json` 的 `version`,引用方式 `file:../<name>-<version>.tgz` |
|
|
64
|
+
| RNOH 框架 | example 模板默认版本,或用户指定的 RNOH 版本 |
|
|
65
|
+
| 通用 RN 包 | example 模板已有版本优先;模板无则取 rnt 工程的版本 |
|
|
66
|
+
| 其他第三方 | 询问用户,或取 rnt 工程版本 |
|
|
67
|
+
|
|
68
|
+
### 2.3 依赖写入职责
|
|
69
|
+
|
|
70
|
+
> ⚠️ 本 SKILL **不**自动写入 `example/package.json`。只产出依赖增量清单,由下游 `rn-lib-add-example` 统一写入。
|
|
71
|
+
|
|
72
|
+
理由:
|
|
73
|
+
1. 版本对齐需要 example 模板上下文,本 SKILL 不感知模板版本
|
|
74
|
+
2. 避免多次写入冲突(`rn-lib-add-example` 也会写依赖)
|
|
75
|
+
3. 保持职责单一:本 SKILL 只做「分析」,不做「写入」
|
|
76
|
+
|
|
77
|
+
### 2.4 外部依赖存在性检查(必执行)
|
|
78
|
+
|
|
79
|
+
`analyze-demo-deps.cjs` 输出的 `externalDeps` 中每个包,**必须逐一检查**是否已在 `example/package.json` 中声明。缺失依赖会导致运行时崩溃。
|
|
80
|
+
|
|
81
|
+
**典型缺失场景**:
|
|
82
|
+
|
|
83
|
+
| 缺失依赖 | 原因 | 影响 | 补齐方式 |
|
|
84
|
+
|---------|------|------|---------|
|
|
85
|
+
| `@rnoh/testerino` | rnt demo 使用 testerino 测试框架,example 未声明 | 所有 `Tester`/`TestCase`/`TestSuite` 组件无法渲染 | 从 rnt 工程复制 `rnoh-testerino-<version>.tgz` 到 example 目录,以 `file:` 方式写入 dependencies |
|
|
86
|
+
| `@react-native-ohos/<pkg>` | demo 引用了其他鸿蒙化库但 example 未安装 | 引用该库的组件崩溃 | 从 rnt 工程或 npm registry 获取版本,写入 dependencies |
|
|
87
|
+
| 其他第三方包 | demo 引用了 example 未安装的包 | 引用该包的组件崩溃 | 询问用户或从 rnt 工程获取版本 |
|
|
88
|
+
|
|
89
|
+
**检查方法**:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# 读取 example/package.json 已声明的依赖
|
|
93
|
+
node -e "const p=require('<libPath>/example/package.json'); const all={...p.dependencies,...p.devDependencies}; console.log(JSON.stringify(Object.keys(all)))"
|
|
94
|
+
|
|
95
|
+
# 对比 analyze-demo-deps.cjs 的 externalDeps 输出,找出未声明的包
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 2.5 从 rnt 工程提取缺失依赖版本
|
|
99
|
+
|
|
100
|
+
当发现缺失依赖时,从 rnt 工程的 `package.json` 中提取版本与引用方式:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# 在 rnt 子工程的 package.json 中搜索缺失依赖
|
|
104
|
+
grep -r "<missingDep>" <rntPath>/*/package.json
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
常见模式:
|
|
108
|
+
- `@rnoh/testerino` → `"file:./rnoh_package/testerino/rnoh-testerino-0.0.12.tgz"` → 复制 tgz 到 example,以 `file:./rnoh-testerino-0.0.12.tgz` 引用
|
|
109
|
+
- `@react-native-ohos/*` → `"http://<registry>/<pkg>/-/<pkg>-<version>.tgz"` 或 `"file:../<xxx>.har"` → 按相同方式写入
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 3. 迁移流程细节
|
|
114
|
+
|
|
115
|
+
### 3.1 迁移前检查
|
|
116
|
+
|
|
117
|
+
| 检查项 | 通过条件 | 失败处理 |
|
|
118
|
+
|--------|---------|---------|
|
|
119
|
+
| `demoPath` 存在 | 目录可访问 | 报错终止,提示用户重新提供 |
|
|
120
|
+
| `targetExampleSrc` 存在 | 目录可访问 | 引导用户先执行 `rn-lib-add-example` 创建模板 |
|
|
121
|
+
| `targetExampleSrc` 可写 | 有写权限 | 报错并终止 |
|
|
122
|
+
| 目标已有同名文件 | 列出冲突文件 | **保留目标版本**,demo 版本不写入(`--ignore-existing`),报告中标注冲突项供人工确认 |
|
|
123
|
+
|
|
124
|
+
### 3.2 --clean 选项
|
|
125
|
+
|
|
126
|
+
`--clean` 启用时,迁移前清空 `targetExampleSrc`:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# 脚本行为
|
|
130
|
+
rm -rf <targetExampleSrc>/*
|
|
131
|
+
# 然后复制 demo 内容
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> ⚠️ `--clean` **必须**由用户明确同意。Agent 不得自动启用。**默认模式为增量添加(`--ignore-existing`),不覆盖已有文件**。建议保留通用组件 `Navigation.tsx`(若 demo 仍使用)——脚本默认不清除 `components/Navigation.tsx`,可通过 `--clean-all` 强制全清。
|
|
135
|
+
|
|
136
|
+
### 3.3 默认排除项
|
|
137
|
+
|
|
138
|
+
`port-demo.sh` 默认排除以下目录/文件:
|
|
139
|
+
|
|
140
|
+
| 排除项 | 原因 |
|
|
141
|
+
|--------|------|
|
|
142
|
+
| `node_modules/` | demo 自身的依赖,example 会重新 install |
|
|
143
|
+
| `build/` | 构建产物 |
|
|
144
|
+
| `__tests__/` | demo 自带的测试,example 有自己的 testerino 注册 |
|
|
145
|
+
| `.cxx/` / `oh_modules/` | 鸿蒙构建产物 |
|
|
146
|
+
| `.DS_Store` | macOS 垃圾文件 |
|
|
147
|
+
| `*.log` | 日志文件 |
|
|
148
|
+
|
|
149
|
+
可通过 `--exclude` 参数追加自定义排除项。
|
|
150
|
+
|
|
151
|
+
### 3.4 rsync 复制
|
|
152
|
+
|
|
153
|
+
使用 `rsync -a --ignore-existing` 保留文件元数据(mtime、权限),**仅添加目标不存在的文件,不覆盖已有文件**:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
rsync -a --ignore-existing \
|
|
157
|
+
--exclude 'node_modules/' \
|
|
158
|
+
--exclude 'build/' \
|
|
159
|
+
--exclude '__tests__/' \
|
|
160
|
+
--exclude '.cxx/' \
|
|
161
|
+
--exclude 'oh_modules/' \
|
|
162
|
+
--exclude '.DS_Store' \
|
|
163
|
+
--exclude '*.log' \
|
|
164
|
+
"<demoPath>/" "<targetExampleSrc>/"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
> 注意末尾 `/`:`<demoPath>/` 表示复制目录内容,`<demoPath>`(无 `/`)会复制目录本身。
|
|
168
|
+
>
|
|
169
|
+
> `--ignore-existing` 确保目标已有文件保留不动,冲突文件在脚本输出中列出供 Agent 写入报告。
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 4. 路径修正检查清单
|
|
174
|
+
|
|
175
|
+
迁移完成后,**逐文件**检查以下内容(使用 `Edit` 工具)。
|
|
176
|
+
|
|
177
|
+
> ⚠️ **仅修正本次新增的文件**:如果某文件是目标已有的(冲突保留项),**不修改它**,仅在报告中标注需人工处理。
|
|
178
|
+
|
|
179
|
+
### 4.1 相对路径修正
|
|
180
|
+
|
|
181
|
+
| 文件 | 检查内容 | 修正规则 |
|
|
182
|
+
|------|---------|---------|
|
|
183
|
+
| `tests/index.tsx` | 引用 demo 子目录的路径 | `./xxx` → `../xxx`(tests/ 在 src/tests/ 下,引用上级) |
|
|
184
|
+
| `tests/*.tsx` | 同上 | 同上 |
|
|
185
|
+
| 任何子目录文件 | 引用其他子目录 | 确保相对路径从 `example/src/` 起算 |
|
|
186
|
+
|
|
187
|
+
**示例**:
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
// ❌ 迁移前(rnt demo 内 tests/index.tsx)
|
|
191
|
+
import { CameraDemo } from './camera/CameraDemo';
|
|
192
|
+
import { Navigation } from './components/Navigation';
|
|
193
|
+
|
|
194
|
+
// ✅ 迁移后(example/src/tests/index.tsx)
|
|
195
|
+
import { CameraDemo } from '../camera/CameraDemo';
|
|
196
|
+
import { Navigation } from '../components/Navigation';
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 4.2 入口文件对齐与接入
|
|
200
|
+
|
|
201
|
+
| 文件 | 检查内容 |
|
|
202
|
+
|------|---------|
|
|
203
|
+
| `App.tsx`(可在嵌套子目录如 `testCase/App.tsx`) | `displayName` / `title` 与 demo 名称一致 |
|
|
204
|
+
| `index.tsx`(根级) | 是否已引用 demo 入口;若未引用,re-export demo 入口 |
|
|
205
|
+
| `Test/index.tsx` 或 `tests/index.tsx` | testerino 注册的组件名与 `App.displayName` 一致 |
|
|
206
|
+
|
|
207
|
+
**入口接入检查**:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# 确认 index.tsx 是否引用了 demo 入口(testCase/App, demo/App, ./App 等)
|
|
211
|
+
grep -l "testCase/App\|demo/App\|./App" example/src/index.tsx
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
若未引用,**仅在 `index.tsx` 是本次新增文件时**才更新为 re-export;若 `index.tsx` 是目标已有文件,不覆盖,在报告中标注「入口未接入,需人工处理」:
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
// index.tsx — 更新为 re-export demo 入口(仅当 index.tsx 是本次新增文件时)
|
|
218
|
+
export {
|
|
219
|
+
default,
|
|
220
|
+
displayName,
|
|
221
|
+
framework,
|
|
222
|
+
category,
|
|
223
|
+
title,
|
|
224
|
+
documentationURL,
|
|
225
|
+
description,
|
|
226
|
+
examples,
|
|
227
|
+
} from './testCase/App';
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### 4.3 Navigation.tsx 硬编码标题修正
|
|
231
|
+
|
|
232
|
+
`Navigation.tsx`(或类似共享组件)从 rnt 复制后可能包含**其他库的硬编码标题**。
|
|
233
|
+
|
|
234
|
+
**检测**:`analyze-demo-deps.cjs` 的 `hardcodedTitles` 字段列出所有匹配 `RN <Xxx> (Capi )?Tester` 的文本。
|
|
235
|
+
|
|
236
|
+
**修正**(**仅针对本次新增的文件**,目标已有文件不修改,在报告中标注):
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
// ❌ 迁移前(遗留的 Svg 库标题)
|
|
240
|
+
<Text>RN Svg Capi Tester</Text>
|
|
241
|
+
|
|
242
|
+
// ✅ 迁移后(替换为目标库 alias,如 react-native-pdf → Pdf)
|
|
243
|
+
<Text>RN Pdf Tester</Text>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 4.4 目标库引用对齐
|
|
247
|
+
|
|
248
|
+
确认 demo 中目标库的引用方式与 example 配置一致:
|
|
249
|
+
|
|
250
|
+
| demo 引用方式 | example 需配置 |
|
|
251
|
+
|--------------|---------------|
|
|
252
|
+
| `import { X } from '<alias>'` | `metro.config.js` 的 `extraNodeModules['<alias>']` 指向 `node_modules/<ohPackageName>` |
|
|
253
|
+
| `import { X } from '<packageName>'` | `tsconfig.json` 的 `paths['<packageName>']` 指向 `./node_modules/<ohPackageName>` |
|
|
254
|
+
| `import { X } from '<packageName>/src/internal'` | 列入「待人工确认」,不自动改写 |
|
|
255
|
+
|
|
256
|
+
> 引用方式对齐的最终写入由 `rn-lib-add-example` 完成。本 SKILL 只检查并在报告中标注不一致项。
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 5. 迁移后自检
|
|
261
|
+
|
|
262
|
+
迁移完成后,执行以下自检(不需运行 `npm install`,仅静态检查):
|
|
263
|
+
|
|
264
|
+
| 检查项 | 方法 | 通过标准 |
|
|
265
|
+
|--------|------|---------|
|
|
266
|
+
| 文件完整性 | 对比 `demoPath` 与 `targetExampleSrc` 文件清单 | **本次新增文件**全部迁移到位(冲突文件保留目标版本,不计入缺失) |
|
|
267
|
+
| 入口文件存在 | `find example/src -name "App.tsx" -o -name "index.tsx"` | 两个文件都存在(可嵌套) |
|
|
268
|
+
| index.tsx 接入 | `grep "testCase/App\|demo/App\|./App" example/src/index.tsx` | index.tsx 引用 demo 入口(若 index.tsx 为已有文件未接入,标注为待人工确认) |
|
|
269
|
+
| 相对路径有效 | grep `from '\./` 在子目录下 | 无错误的同级引用(仅检查本次新增文件) |
|
|
270
|
+
| 目标库引用一致 | grep `import.*from.*'<alias>\|<packageName>'` | 引用方式与 example 配置一致(仅检查本次新增文件) |
|
|
271
|
+
| 无硬编码标题 | grep `RN.*Tester` 在 Navigation.tsx 等 | 无其他库的遗留标题(仅本次新增文件已修正;已有文件标注待人工处理) |
|
|
272
|
+
| 无残留排除项 | `ls example/src/node_modules` 等 | 不存在(应被排除) |
|
|
273
|
+
| **外部依赖已声明** | 对比 `externalDeps` 与 `example/package.json` | 所有外部依赖已在 dependencies/devDependencies 中声明(Phase 4.1) |
|
|
274
|
+
| **无孤立文件** | 对比迁移文件列表与 index.tsx demos 数组 | 所有有 export 的组件都被入口直接/间接引用(Phase 6.6) |
|
|
275
|
+
| **菜单可滚动** | 检查 demos 条目数与菜单容器类型 | 条目 > 5 时菜单容器为 ScrollView(Phase 6.7) |
|
|
276
|
+
| **原有 App.tsx 可访问** | 检查 index.tsx 是否包含 OriginalApp 菜单项 | 原有 demo 入口未丢失(Phase 6.8) |
|
|
277
|
+
| **入口链路完整** | index.js → src/index.tsx → demos → 各组件 → ./demo/ | 全链路可导入(Phase 6.9) |
|
|
278
|
+
| **build-profile 无越界** | 检查 modules[].srcPath 是否以 ../ 开头 | 所有路径在工程内(Phase 5.1) |
|
|
279
|
+
| **.har 路径有效** | 逐一 ls 验证 oh-package.json5 中的 file: 引用 | 所有 .har 文件存在(Phase 5.2) |
|
|
280
|
+
|
|
281
|
+
> 自检脚本由 Agent 串联执行,结果写入迁移报告。
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## 6. 构建前置检查
|
|
286
|
+
|
|
287
|
+
迁移完成后、执行编译前,必须确认以下构建前置条件已满足:
|
|
288
|
+
|
|
289
|
+
### 6.1 build-profile.json5 模块路径越界
|
|
290
|
+
|
|
291
|
+
`example/harmony/build-profile.json5` 与 `build-profile.template.json5` 中的 `modules[].srcPath` **不可**以 `../` 开头(越出工程根目录)。
|
|
292
|
+
|
|
293
|
+
**典型问题**:库的源码模块在 `libPath/harmony/safe_area/`,build-profile 引用为 `../../harmony/safe_area` → hvigor 报错。
|
|
294
|
+
|
|
295
|
+
**修正**:
|
|
296
|
+
1. `cp -R <libPath>/harmony/<module> example/harmony/<module>`
|
|
297
|
+
2. 修改 `srcPath` 为 `./<module>`
|
|
298
|
+
3. 修正被复制模块的 `oh-package.json5` 中 `.har` 路径
|
|
299
|
+
|
|
300
|
+
> 符号链接不可行:hvigor 不跟随 symlink。
|
|
301
|
+
|
|
302
|
+
### 6.2 .har 文件路径验证
|
|
303
|
+
|
|
304
|
+
被复制模块的 `oh-package.json5` 中 `file:` 引用的 `.har` 文件路径可能因目录层级变化而失效。
|
|
305
|
+
|
|
306
|
+
**典型问题**:原始路径 `file:../../node_modules/@react-native-oh/react-native-harmony/harmony/react_native_openharmony.har`(多一层 `harmony/`),复制后应为 `file:../../node_modules/@react-native-oh/react-native-harmony/react_native_openharmony.har`。
|
|
307
|
+
|
|
308
|
+
**验证方法**:逐一 `ls -la` 检查每个 `file:` 引用的文件是否存在。
|
|
309
|
+
|
|
310
|
+
### 6.3 编译验证步骤
|
|
311
|
+
|
|
312
|
+
确认前置检查通过后,按以下顺序执行编译:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# 1. 安装 JS 依赖
|
|
316
|
+
cd example && npm i --legacy-peer-deps
|
|
317
|
+
|
|
318
|
+
# 2. 安装鸿蒙原生依赖
|
|
319
|
+
cd harmony && ohpm install
|
|
320
|
+
|
|
321
|
+
# 3. 生成 JS bundle
|
|
322
|
+
cd .. && npm run dev
|
|
323
|
+
|
|
324
|
+
# 4. 编译鸿蒙工程
|
|
325
|
+
cd harmony && devecocli build
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
> `npm i` 只装 JS 依赖,`ohpm install` 才装原生 .har 依赖,两者都不可省略。
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## 7. 与 rn-lib-add-example 的衔接
|
|
333
|
+
|
|
334
|
+
本 SKILL 完成后,迁移报告中的以下内容会被 `rn-lib-add-example` 消费:
|
|
335
|
+
|
|
336
|
+
| 报告章节 | 下游用途 |
|
|
337
|
+
|----------|---------|
|
|
338
|
+
| 依赖增量清单 | 写入 `example/package.json` 的 `dependencies` |
|
|
339
|
+
| 目标库引用方式 | 配置 `metro.config.js` 的 `extraNodeModules` |
|
|
340
|
+
| 入口文件 displayName | 配置 `App.tsx` 与 `Test/index.tsx` 注册 |
|
|
341
|
+
| 版本一致性检测结果 | 决定是否需要更新 example/package.json 的 react-native / react-native-harmony 版本 |
|
|
342
|
+
| 待人工确认项 | 由用户或 Agent 在壳层适配阶段决策 |
|
|
343
|
+
| 原生代码标注 | 决定是否需要 CMake / RNPackagesFactory 适配 |
|
|
344
|
+
|
|
345
|
+
> 迁移报告是本 SKILL 的**唯一交付物**,下游 SKILL 通过读取报告获取所需信息。
|