@harmonyos-arkts/d2h 0.1.29 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +6 -2
  3. package/agents/d2h.md +23 -14
  4. package/dist/bin/install-opencode.js +17 -4
  5. package/dist/src/install-opencode.js +6 -4
  6. package/dist/src/install-tui-extension.js +1 -1
  7. package/dist/src/metrics-plugin.js +4 -3
  8. package/dist/src/poc.js +53 -0
  9. package/docs/architecture-plan-guide.zh-CN.md +30 -46
  10. package/docs/poc-rule-evaluation.md +38 -0
  11. package/package.json +3 -2
  12. package/schemas/code-stats.schema.json +245 -0
  13. package/skills/android2hmos_resources_convert/SKILL.md +1 -9
  14. package/skills/d2h-app-solution/SKILL.md +3 -3
  15. package/skills/d2h-app-solution/references/inventory-schema.md +2 -2
  16. package/skills/d2h-architecture-plan/SKILL.md +23 -22
  17. package/skills/d2h-architecture-plan/references/architecture-plan.example.json +650 -76
  18. package/skills/d2h-architecture-plan/references/directory-creation.md +7 -7
  19. package/skills/d2h-architecture-plan/references/hybrid-design.md +63 -63
  20. package/skills/d2h-architecture-plan/references/json-contract.md +42 -27
  21. package/skills/d2h-architecture-plan/references/layout-reference.md +25 -72
  22. package/skills/d2h-architecture-plan/references/plan-contract.md +24 -34
  23. package/skills/d2h-architecture-plan/references/source-review.md +10 -7
  24. package/skills/d2h-architecture-plan/scripts/architecture_plan.py +50 -16
  25. package/skills/d2h-code-audit/SKILL.md +68 -0
  26. package/skills/d2h-code-audit/references/code-stats-schema.md +260 -0
  27. package/skills/d2h-code-audit/references/metrics.md +94 -0
  28. package/skills/d2h-code-audit/scripts/code_stats.py +600 -0
  29. package/skills/d2h-code-audit/scripts/validate_code_stats.py +446 -0
  30. package/skills/d2h-dashboard/SKILL.md +59 -33
  31. package/skills/d2h-dashboard/app/assets/Analysis-9GrmuIjp.css +1 -0
  32. package/skills/d2h-dashboard/app/assets/Analysis-Dj-4QEJi.js +1 -0
  33. package/skills/d2h-dashboard/app/assets/CodeAudit-Ctt3XEec.css +1 -0
  34. package/skills/d2h-dashboard/app/assets/CodeAudit-TcIcLwQL.js +1 -0
  35. package/skills/d2h-dashboard/app/assets/FeaturesList-C5yGUbRo.js +1 -0
  36. package/skills/d2h-dashboard/app/assets/FeaturesList-CZ40orVY.css +1 -0
  37. package/skills/d2h-dashboard/app/assets/Overview-CNkA3J9F.js +1 -0
  38. package/skills/d2h-dashboard/app/assets/Overview-Cmz8yjX-.css +1 -0
  39. package/skills/d2h-dashboard/app/assets/PageHeading-B5I3tpO8.js +1 -0
  40. package/skills/d2h-dashboard/app/assets/PageHeading-BIDu_a9G.css +1 -0
  41. package/skills/d2h-dashboard/app/assets/Project-BC9Tz1WY.js +1 -0
  42. package/skills/d2h-dashboard/app/assets/Project-BRyXCzsB.css +1 -0
  43. package/skills/d2h-dashboard/app/assets/Review-BfWvqlU9.js +1 -0
  44. package/skills/d2h-dashboard/app/assets/SpecDetail-BHB6smtT.css +1 -0
  45. package/skills/d2h-dashboard/app/assets/SpecDetail-DguVmqAE.js +1 -0
  46. package/skills/d2h-dashboard/app/assets/SpecItemDetail-7s7SaF3O.js +69 -0
  47. package/skills/d2h-dashboard/app/assets/SpecItemDetail-Bf4pGDEN.css +1 -0
  48. package/skills/d2h-dashboard/app/assets/_plugin-vue_export-helper-B9l48Cov.js +1 -0
  49. package/skills/d2h-dashboard/app/assets/batchReport-B3IzPnHF.js +1 -0
  50. package/skills/d2h-dashboard/app/assets/datetime-CHrzCsjX.js +1 -0
  51. package/skills/d2h-dashboard/app/assets/index-B3nfIPBm.js +3 -0
  52. package/skills/d2h-dashboard/app/assets/index-CnjP19Vs.css +1 -0
  53. package/skills/d2h-dashboard/app/assets/navigation-d1Uf6TR4.js +1 -0
  54. package/skills/d2h-dashboard/app/dataApi.mjs +387 -0
  55. package/skills/d2h-dashboard/app/index.html +14 -0
  56. package/skills/d2h-dashboard/app/package.json +12 -0
  57. package/skills/d2h-dashboard/app/serve.mjs +310 -0
  58. package/skills/d2h-hypium-forge/SKILL.md +6 -1
  59. package/skills/d2h-spec-develop/SKILL.md +24 -25
  60. package/skills/d2h-spec-develop/scripts/__pycache__/check_acceptance.cpython-313.pyc +0 -0
  61. package/skills/d2h-spec-develop/scripts/check_acceptance.py +66 -0
  62. package/skills/d2h-spec-generate/SKILL.md +2 -0
  63. package/skills/d2h-spec-plan/SKILL.md +6 -0
  64. package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/__pycache__/native_common.cpython-313.pyc +0 -0
  65. package/skills/d2h-architecture-plan/scripts/test_architecture_plan.py +0 -241
  66. package/skills/d2h-spec-generate/assets/spec-template.md +0 -109
  67. package/skills/d2h-spec-generate/references/from-plan.md +0 -27
  68. package/skills/d2h-spec-generate/references/spec-content.md +0 -32
  69. package/skills/maintaining-migration-report/SKILL.md +0 -144
  70. package/skills/maintaining-migration-report/references/final-acceptance.md +0 -48
  71. package/skills/maintaining-migration-report/references/source-provenance.md +0 -66
  72. /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/SKILL.md +0 -0
  73. /package/skills/{cpp → language/cpp}/d2h-native-library-analyse/scripts/analyse-android-so.py +0 -0
  74. /package/skills/{cpp → language/cpp}/d2h-native-library-build/SKILL.md +0 -0
  75. /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/build-config-mapping.md +0 -0
  76. /package/skills/{cpp → language/cpp}/d2h-native-library-build/references/jni-to-napi-mapping.md +0 -0
  77. /package/skills/{cpp → language/cpp}/d2h-native-library-build/scripts/check-android-so.py +0 -0
  78. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/SKILL.md +0 -0
  79. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-build-sign-run.md +0 -0
  80. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/app.json5 +0 -0
  81. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/AppScope/resources/base/element/string.json +0 -0
  82. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/README.md +0 -0
  83. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/build-profile.json5 +0 -0
  84. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/build-profile.json5 +0 -0
  85. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/hvigorfile.ts +0 -0
  86. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/oh-package.json5 +0 -0
  87. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/entryability/EntryAbility.ets +0 -0
  88. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/Index.ets +0 -0
  89. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/ets/pages/NativeVerifyDemo.ets +0 -0
  90. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/module.json5 +0 -0
  91. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/color.json +0 -0
  92. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/element/string.json +0 -0
  93. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/main/resources/base/profile/main_pages.json +0 -0
  94. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/FFmpegVerify.test.ets +0 -0
  95. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/ets/test/List.test.ets +0 -0
  96. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/entry/src/ohosTest/module.json5 +0 -0
  97. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigor/hvigor-config.json5 +0 -0
  98. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/hvigorfile.ts +0 -0
  99. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-project-template/oh-package.json5 +0 -0
  100. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/demo-template.md +0 -0
  101. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/references/hypium-test-template.md +0 -0
  102. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/device-verify.py +0 -0
  103. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/native_common.py +0 -0
  104. /package/skills/{cpp → language/cpp}/d2h-native-library-verify/scripts/verify-ohos-native.py +0 -0
@@ -1,122 +1,696 @@
1
1
  {
2
- "projectName": "示例邮件客户端",
3
- "directoryTree": {
4
- "name": "示例邮件客户端",
5
- "path": ".",
6
- "description": "已选单 HAP 结构,复用现有 entry;本树描述目标职责,不表示已完成实现。",
7
- "children": [
8
- {
9
- "name": "AppScope",
10
- "path": "AppScope",
11
- "description": "应用级名称、图标等配置与资源。",
12
- "children": []
13
- },
14
- {
15
- "name": "entry",
16
- "path": "entry",
17
- "description": "产品 HAP,负责启动、装配和页面承载。",
18
- "kind": "HAP",
2
+ "project": {
3
+ "name": "示例菜谱应用",
4
+ "summary": "协议演示:假定 Android app 模块含分类、首页、个人中心三个职责独立的主 Tab,infra 模块提供网络和通用存储;用于说明两套目录及交互,不代表已分析某个真实工程。",
5
+ "androidRoot": "E:/ExampleAndroid/RecipeApp",
6
+ "targetRoot": "E:/ExampleHarmony/RecipeApp",
7
+ "scope": [
8
+ "三个主 Tab 及其详情、搜索和历史页面",
9
+ "共享基础网络、通用存储与应用装配"
10
+ ]
11
+ },
12
+ "attentionPoints": [
13
+ {
14
+ "title": "优化方案需要业务模块集成",
15
+ "description": "从 app 内的业务包拆为三个 HAR,需调整公开导出、资源归属和入口装配;同一业务内的多个页面仍留在同一模块。"
16
+ },
17
+ {
18
+ "title": "平台适配仍需实际验证",
19
+ "description": "本例路径是演示数据。Android 网络和持久化实现不能仅靠目录保留就视为已迁移,模块注册、SDK 能力与编译运行仍需在真实项目核验。"
20
+ }
21
+ ],
22
+ "proposals": [
23
+ {
24
+ "id": "android-mirror",
25
+ "name": "方案 A:原结构对照",
26
+ "summary": "保留 app、infra 模块名和原包族,逐处对照最直接;保留 app 内集中业务的组织成本,仅做鸿蒙必需适配。",
27
+ "directoryTree": {
28
+ "name": "RecipeApp",
29
+ "path": ".",
30
+ "description": "严格对应示例 Android 模块与相对目录,尚未创建。",
19
31
  "children": [
20
32
  {
21
- "name": "src",
22
- "path": "entry/src",
23
- "description": "产品模块源码与资源。",
33
+ "name": "AppScope",
34
+ "path": "AppScope",
35
+ "description": "应用级身份与资源。",
24
36
  "children": [
25
37
  {
26
- "name": "main",
27
- "path": "entry/src/main",
28
- "description": "产品的生产源码和资源根。",
38
+ "name": "resources",
39
+ "path": "AppScope/resources",
40
+ "description": "应用级身份资源目录。",
29
41
  "children": [
30
42
  {
31
- "name": "ets",
32
- "path": "entry/src/main/ets",
33
- "description": "ArkTS 源码,按装配、页面和共享数据职责组织。",
43
+ "name": "base",
44
+ "path": "AppScope/resources/base",
45
+ "description": "应用默认身份资源。",
34
46
  "children": [
35
47
  {
36
- "name": "entryability",
37
- "path": "entry/src/main/ets/entryability",
38
- "description": "应用入口和生命周期,调用装配并承载导航。",
48
+ "name": "element",
49
+ "path": "AppScope/resources/base/element",
50
+ "description": "应用名称等应用级文字配置。",
39
51
  "children": []
40
52
  },
41
53
  {
42
- "name": "composition",
43
- "path": "entry/src/main/ets/composition",
44
- "description": "创建并持有共享邮件仓库,为页面提供同一实例。",
54
+ "name": "media",
55
+ "path": "AppScope/resources/base/media",
56
+ "description": "应用图标等应用级图像。",
45
57
  "children": []
46
- },
58
+ }
59
+ ]
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "name": "app",
67
+ "path": "app",
68
+ "description": "HAP:与源 app 应用模块对应,保留内部包族。",
69
+ "children": [
70
+ {
71
+ "name": "src",
72
+ "path": "app/src",
73
+ "description": "模块源码与资源目录。",
74
+ "children": [
75
+ {
76
+ "name": "main",
77
+ "path": "app/src/main",
78
+ "description": "模块生产源码与资源根。",
79
+ "children": [
47
80
  {
48
- "name": "navigation",
49
- "path": "entry/src/main/ets/navigation",
50
- "description": "注册列表与阅读路由,跨页只传邮件标识。",
51
- "children": []
81
+ "name": "ets",
82
+ "path": "app/src/main/ets",
83
+ "description": "ArkTS 源码目录。",
84
+ "children": [
85
+ {
86
+ "name": "com",
87
+ "path": "app/src/main/ets/com",
88
+ "description": "保留源包族层级,方便原开发者定位。",
89
+ "children": [
90
+ {
91
+ "name": "acme",
92
+ "path": "app/src/main/ets/com/acme",
93
+ "description": "保留源包族层级,方便原开发者定位。",
94
+ "children": [
95
+ {
96
+ "name": "recipe",
97
+ "path": "app/src/main/ets/com/acme/recipe",
98
+ "description": "保留源包族层级,方便原开发者定位。",
99
+ "children": [
100
+ {
101
+ "name": "classification",
102
+ "path": "app/src/main/ets/com/acme/recipe/classification",
103
+ "description": "对应源分类业务包,保留分类、详情及菜篮子职责。",
104
+ "children": []
105
+ },
106
+ {
107
+ "name": "home",
108
+ "path": "app/src/main/ets/com/acme/recipe/home",
109
+ "description": "对应源首页业务包,保留首页、搜索与博主相关页面。",
110
+ "children": []
111
+ },
112
+ {
113
+ "name": "mine",
114
+ "path": "app/src/main/ets/com/acme/recipe/mine",
115
+ "description": "对应源个人中心包,保留个人信息与浏览历史。",
116
+ "children": []
117
+ },
118
+ {
119
+ "name": "di",
120
+ "path": "app/src/main/ets/com/acme/recipe/di",
121
+ "description": "对应源应用装配包,提供共享依赖。",
122
+ "children": []
123
+ }
124
+ ]
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "name": "entryability",
132
+ "path": "app/src/main/ets/entryability",
133
+ "description": "鸿蒙必需入口适配;这是目标新增目录。",
134
+ "children": []
135
+ }
136
+ ]
52
137
  },
53
138
  {
54
- "name": "features",
55
- "path": "entry/src/main/ets/features",
56
- "description": "页面业务区,不额外拆成独立构建模块。",
139
+ "name": "resources",
140
+ "path": "app/src/main/resources",
141
+ "description": "对应源 app 的资源职责,格式适配为鸿蒙资源。",
57
142
  "children": [
58
143
  {
59
- "name": "mail",
60
- "path": "entry/src/main/ets/features/mail",
61
- "description": "邮件页面业务,消费共享邮件仓库。",
144
+ "name": "base",
145
+ "path": "app/src/main/resources/base",
146
+ "description": "该模块的默认资源集。",
62
147
  "children": [
63
148
  {
64
- "name": "messagelist",
65
- "path": "entry/src/main/ets/features/mail/messagelist",
66
- "description": "邮件列表展示、页面状态和筛选交互。",
149
+ "name": "element",
150
+ "path": "app/src/main/resources/base/element",
151
+ "description": "该模块实际需要的文字与样式等资源。",
67
152
  "children": []
68
153
  },
69
154
  {
70
- "name": "messageview",
71
- "path": "entry/src/main/ets/features/mail/messageview",
72
- "description": "邮件阅读与附件展示,只持有当前页面的展示状态。",
155
+ "name": "media",
156
+ "path": "app/src/main/resources/base/media",
157
+ "description": "该模块拥有的图像等媒体资源。",
73
158
  "children": []
74
159
  }
75
160
  ]
76
161
  }
77
162
  ]
163
+ }
164
+ ]
165
+ }
166
+ ]
167
+ }
168
+ ],
169
+ "kind": "HAP"
170
+ },
171
+ {
172
+ "name": "infra",
173
+ "path": "infra",
174
+ "description": "HAR:一对一对应源 infra 基础模块。",
175
+ "children": [
176
+ {
177
+ "name": "src",
178
+ "path": "infra/src",
179
+ "description": "模块源码与资源目录。",
180
+ "children": [
181
+ {
182
+ "name": "main",
183
+ "path": "infra/src/main",
184
+ "description": "模块生产源码与资源根。",
185
+ "children": [
186
+ {
187
+ "name": "ets",
188
+ "path": "infra/src/main/ets",
189
+ "description": "ArkTS 源码目录。",
190
+ "children": [
191
+ {
192
+ "name": "com",
193
+ "path": "infra/src/main/ets/com",
194
+ "description": "保留源包族层级,方便原开发者定位。",
195
+ "children": [
196
+ {
197
+ "name": "acme",
198
+ "path": "infra/src/main/ets/com/acme",
199
+ "description": "保留源包族层级,方便原开发者定位。",
200
+ "children": [
201
+ {
202
+ "name": "infra",
203
+ "path": "infra/src/main/ets/com/acme/infra",
204
+ "description": "保留源包族层级,方便原开发者定位。",
205
+ "children": [
206
+ {
207
+ "name": "net",
208
+ "path": "infra/src/main/ets/com/acme/infra/net",
209
+ "description": "保留源基础网络包族,替换 Android 网络实现。",
210
+ "children": []
211
+ },
212
+ {
213
+ "name": "store",
214
+ "path": "infra/src/main/ets/com/acme/infra/store",
215
+ "description": "保留源通用存储包族,平台实现后续适配。",
216
+ "children": []
217
+ }
218
+ ]
219
+ }
220
+ ]
221
+ }
222
+ ]
223
+ }
224
+ ]
78
225
  },
79
226
  {
80
- "name": "shared",
81
- "path": "entry/src/main/ets/shared",
82
- "description": "跨页面共享业务及数据所有者。",
227
+ "name": "resources",
228
+ "path": "infra/src/main/resources",
229
+ "description": "基础能力实际拥有的模块资源。",
83
230
  "children": [
84
231
  {
85
- "name": "mailstore",
86
- "path": "entry/src/main/ets/shared/mailstore",
87
- "description": "邮件仓库唯一所有者,封装数据库与查询;不引用页面。",
88
- "children": []
232
+ "name": "base",
233
+ "path": "infra/src/main/resources/base",
234
+ "description": "该模块的默认资源集。",
235
+ "children": [
236
+ {
237
+ "name": "element",
238
+ "path": "infra/src/main/resources/base/element",
239
+ "description": "该模块实际需要的文字与样式等资源。",
240
+ "children": []
241
+ }
242
+ ]
89
243
  }
90
244
  ]
91
245
  }
92
246
  ]
93
- },
94
- {
95
- "name": "resources",
96
- "path": "entry/src/main/resources",
97
- "description": "产品和页面资源,共用模块资源根并区分命名归属。",
98
- "children": []
99
247
  }
100
248
  ]
101
249
  }
102
- ]
250
+ ],
251
+ "kind": "HAR"
103
252
  }
104
253
  ]
105
- }
106
- ]
107
- },
108
- "decisions": [
109
- {
110
- "title": "复用 entry,保持单 HAP",
111
- "description": "当前没有业务独立安装、多 HAP 共享或分包加载需求,页面规模无需拆库;产品入口与装配直接落在现有 entry。"
112
- },
113
- {
114
- "title": "列表与阅读按页面分开",
115
- "description": "保留 messagelist/messageview 业务名方便定位,分别组织页面和展示状态;它们是 HAP 内的普通目录,跨页导航传邮件标识,不互传可变页面状态。"
254
+ },
255
+ "decisions": [
256
+ {
257
+ "title": "模块及包族一对一对应",
258
+ "description": "app 与 infra 沿用源模块名;java/kotlin 语言根适配为 ets,其下 com/acme/recipe 与 com/acme/infra 的相对层级保留,不按 Tab 再拆库。"
259
+ },
260
+ {
261
+ "title": "保留依赖,显式增加入口适配",
262
+ "description": "app 依赖 infra 的网络与存储公开能力,app/src/main/ets/com/acme/recipe/di 保留装配职责;app/src/main/ets/entryability 是鸿蒙入口新增适配。基础库不反向依赖页面。"
263
+ }
264
+ ]
116
265
  },
117
266
  {
118
- "title": "入口装配仓库,页面依赖仓库公开能力",
119
- "description": "shared/mailstore 是邮件数据唯一所有者;entryability 调用 composition 创建并提供同一仓库实例,列表和阅读通过仓库查询邮件及访问附件。mailstore 不引用页面,数据库初始化和迁移由它负责,实例的提供与释放由 composition 负责。"
267
+ "id": "hybrid",
268
+ "name": "方案 B:融合优化",
269
+ "summary": "entry 保持产品壳,feature 按三个独立主 Tab 组织,common/infra 保留熟悉的基础包族;更便于分域维护,代价是首次拆包与路由/资源集成。",
270
+ "directoryTree": {
271
+ "name": "RecipeApp",
272
+ "path": ".",
273
+ "description": "兼顾鸿蒙模块职责与源命名的优化结构,尚未创建。",
274
+ "children": [
275
+ {
276
+ "name": "AppScope",
277
+ "path": "AppScope",
278
+ "description": "应用级身份与资源。",
279
+ "children": [
280
+ {
281
+ "name": "resources",
282
+ "path": "AppScope/resources",
283
+ "description": "应用级身份资源目录。",
284
+ "children": [
285
+ {
286
+ "name": "base",
287
+ "path": "AppScope/resources/base",
288
+ "description": "应用默认身份资源。",
289
+ "children": [
290
+ {
291
+ "name": "element",
292
+ "path": "AppScope/resources/base/element",
293
+ "description": "应用名称等应用级文字配置。",
294
+ "children": []
295
+ },
296
+ {
297
+ "name": "media",
298
+ "path": "AppScope/resources/base/media",
299
+ "description": "应用图标等应用级图像。",
300
+ "children": []
301
+ }
302
+ ]
303
+ }
304
+ ]
305
+ }
306
+ ]
307
+ },
308
+ {
309
+ "name": "entry",
310
+ "path": "entry",
311
+ "description": "HAP:产品入口、启动、导航和装配。",
312
+ "children": [
313
+ {
314
+ "name": "src",
315
+ "path": "entry/src",
316
+ "description": "模块源码与资源目录。",
317
+ "children": [
318
+ {
319
+ "name": "main",
320
+ "path": "entry/src/main",
321
+ "description": "模块生产源码与资源根。",
322
+ "children": [
323
+ {
324
+ "name": "ets",
325
+ "path": "entry/src/main/ets",
326
+ "description": "ArkTS 源码目录。",
327
+ "children": [
328
+ {
329
+ "name": "entryability",
330
+ "path": "entry/src/main/ets/entryability",
331
+ "description": "入口类与应用生命周期。",
332
+ "children": []
333
+ },
334
+ {
335
+ "name": "navigation",
336
+ "path": "entry/src/main/ets/navigation",
337
+ "description": "集成各业务模块公开页面路由。",
338
+ "children": []
339
+ },
340
+ {
341
+ "name": "composition",
342
+ "path": "entry/src/main/ets/composition",
343
+ "description": "创建并提供业务及基础依赖,按生命周期释放。",
344
+ "children": []
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "name": "resources",
350
+ "path": "entry/src/main/resources",
351
+ "description": "产品壳与应用身份资源。",
352
+ "children": [
353
+ {
354
+ "name": "base",
355
+ "path": "entry/src/main/resources/base",
356
+ "description": "该模块的默认资源集。",
357
+ "children": [
358
+ {
359
+ "name": "element",
360
+ "path": "entry/src/main/resources/base/element",
361
+ "description": "该模块实际需要的文字与样式等资源。",
362
+ "children": []
363
+ },
364
+ {
365
+ "name": "media",
366
+ "path": "entry/src/main/resources/base/media",
367
+ "description": "该模块拥有的图像等媒体资源。",
368
+ "children": []
369
+ }
370
+ ]
371
+ }
372
+ ]
373
+ }
374
+ ]
375
+ }
376
+ ]
377
+ }
378
+ ],
379
+ "kind": "HAP"
380
+ },
381
+ {
382
+ "name": "feature",
383
+ "path": "feature",
384
+ "description": "业务模块分组目录,与 entry 同级。",
385
+ "children": [
386
+ {
387
+ "name": "classification",
388
+ "path": "feature/classification",
389
+ "description": "HAR:对应源 classification 包与独立主 Tab,包含分类、菜谱详情、菜篮子。",
390
+ "children": [
391
+ {
392
+ "name": "src",
393
+ "path": "feature/classification/src",
394
+ "description": "模块源码与资源目录。",
395
+ "children": [
396
+ {
397
+ "name": "main",
398
+ "path": "feature/classification/src/main",
399
+ "description": "模块生产源码与资源根。",
400
+ "children": [
401
+ {
402
+ "name": "ets",
403
+ "path": "feature/classification/src/main/ets",
404
+ "description": "ArkTS 源码目录。",
405
+ "children": [
406
+ {
407
+ "name": "pages",
408
+ "path": "feature/classification/src/main/ets/pages",
409
+ "description": "分类、菜谱详情、菜篮子页面,作为同一业务模块内的普通目录。",
410
+ "children": []
411
+ },
412
+ {
413
+ "name": "viewModels",
414
+ "path": "feature/classification/src/main/ets/viewModels",
415
+ "description": "本模块页面展示状态与交互,不跨模块传递私有状态。",
416
+ "children": []
417
+ }
418
+ ]
419
+ },
420
+ {
421
+ "name": "resources",
422
+ "path": "feature/classification/src/main/resources",
423
+ "description": "本业务模块页面资源。",
424
+ "children": [
425
+ {
426
+ "name": "base",
427
+ "path": "feature/classification/src/main/resources/base",
428
+ "description": "该模块的默认资源集。",
429
+ "children": [
430
+ {
431
+ "name": "element",
432
+ "path": "feature/classification/src/main/resources/base/element",
433
+ "description": "该模块实际需要的文字与样式等资源。",
434
+ "children": []
435
+ },
436
+ {
437
+ "name": "media",
438
+ "path": "feature/classification/src/main/resources/base/media",
439
+ "description": "该模块拥有的图像等媒体资源。",
440
+ "children": []
441
+ }
442
+ ]
443
+ }
444
+ ]
445
+ }
446
+ ]
447
+ }
448
+ ]
449
+ }
450
+ ],
451
+ "kind": "HAR"
452
+ },
453
+ {
454
+ "name": "home",
455
+ "path": "feature/home",
456
+ "description": "HAR:对应源 home 包与独立主 Tab,包含首页、搜索与博主信息。",
457
+ "children": [
458
+ {
459
+ "name": "src",
460
+ "path": "feature/home/src",
461
+ "description": "模块源码与资源目录。",
462
+ "children": [
463
+ {
464
+ "name": "main",
465
+ "path": "feature/home/src/main",
466
+ "description": "模块生产源码与资源根。",
467
+ "children": [
468
+ {
469
+ "name": "ets",
470
+ "path": "feature/home/src/main/ets",
471
+ "description": "ArkTS 源码目录。",
472
+ "children": [
473
+ {
474
+ "name": "pages",
475
+ "path": "feature/home/src/main/ets/pages",
476
+ "description": "首页、搜索与博主信息页面,作为同一业务模块内的普通目录。",
477
+ "children": []
478
+ },
479
+ {
480
+ "name": "viewModels",
481
+ "path": "feature/home/src/main/ets/viewModels",
482
+ "description": "本模块页面展示状态与交互,不跨模块传递私有状态。",
483
+ "children": []
484
+ }
485
+ ]
486
+ },
487
+ {
488
+ "name": "resources",
489
+ "path": "feature/home/src/main/resources",
490
+ "description": "本业务模块页面资源。",
491
+ "children": [
492
+ {
493
+ "name": "base",
494
+ "path": "feature/home/src/main/resources/base",
495
+ "description": "该模块的默认资源集。",
496
+ "children": [
497
+ {
498
+ "name": "element",
499
+ "path": "feature/home/src/main/resources/base/element",
500
+ "description": "该模块实际需要的文字与样式等资源。",
501
+ "children": []
502
+ },
503
+ {
504
+ "name": "media",
505
+ "path": "feature/home/src/main/resources/base/media",
506
+ "description": "该模块拥有的图像等媒体资源。",
507
+ "children": []
508
+ }
509
+ ]
510
+ }
511
+ ]
512
+ }
513
+ ]
514
+ }
515
+ ]
516
+ }
517
+ ],
518
+ "kind": "HAR"
519
+ },
520
+ {
521
+ "name": "mine",
522
+ "path": "feature/mine",
523
+ "description": "HAR:对应源 mine 包与独立主 Tab,包含个人中心和浏览历史。",
524
+ "children": [
525
+ {
526
+ "name": "src",
527
+ "path": "feature/mine/src",
528
+ "description": "模块源码与资源目录。",
529
+ "children": [
530
+ {
531
+ "name": "main",
532
+ "path": "feature/mine/src/main",
533
+ "description": "模块生产源码与资源根。",
534
+ "children": [
535
+ {
536
+ "name": "ets",
537
+ "path": "feature/mine/src/main/ets",
538
+ "description": "ArkTS 源码目录。",
539
+ "children": [
540
+ {
541
+ "name": "pages",
542
+ "path": "feature/mine/src/main/ets/pages",
543
+ "description": "个人中心和浏览历史页面,作为同一业务模块内的普通目录。",
544
+ "children": []
545
+ },
546
+ {
547
+ "name": "viewModels",
548
+ "path": "feature/mine/src/main/ets/viewModels",
549
+ "description": "本模块页面展示状态与交互,不跨模块传递私有状态。",
550
+ "children": []
551
+ }
552
+ ]
553
+ },
554
+ {
555
+ "name": "resources",
556
+ "path": "feature/mine/src/main/resources",
557
+ "description": "本业务模块页面资源。",
558
+ "children": [
559
+ {
560
+ "name": "base",
561
+ "path": "feature/mine/src/main/resources/base",
562
+ "description": "该模块的默认资源集。",
563
+ "children": [
564
+ {
565
+ "name": "element",
566
+ "path": "feature/mine/src/main/resources/base/element",
567
+ "description": "该模块实际需要的文字与样式等资源。",
568
+ "children": []
569
+ },
570
+ {
571
+ "name": "media",
572
+ "path": "feature/mine/src/main/resources/base/media",
573
+ "description": "该模块拥有的图像等媒体资源。",
574
+ "children": []
575
+ }
576
+ ]
577
+ }
578
+ ]
579
+ }
580
+ ]
581
+ }
582
+ ]
583
+ }
584
+ ],
585
+ "kind": "HAR"
586
+ }
587
+ ]
588
+ },
589
+ {
590
+ "name": "common",
591
+ "path": "common",
592
+ "description": "通用能力模块分组目录,与 entry 同级。",
593
+ "children": [
594
+ {
595
+ "name": "infra",
596
+ "path": "common/infra",
597
+ "description": "HAR:沿用源 infra 名称与包族,承接通用基础能力。",
598
+ "children": [
599
+ {
600
+ "name": "src",
601
+ "path": "common/infra/src",
602
+ "description": "模块源码与资源目录。",
603
+ "children": [
604
+ {
605
+ "name": "main",
606
+ "path": "common/infra/src/main",
607
+ "description": "模块生产源码与资源根。",
608
+ "children": [
609
+ {
610
+ "name": "ets",
611
+ "path": "common/infra/src/main/ets",
612
+ "description": "ArkTS 源码目录。",
613
+ "children": [
614
+ {
615
+ "name": "com",
616
+ "path": "common/infra/src/main/ets/com",
617
+ "description": "保留源包族层级,方便原开发者定位。",
618
+ "children": [
619
+ {
620
+ "name": "acme",
621
+ "path": "common/infra/src/main/ets/com/acme",
622
+ "description": "保留源包族层级,方便原开发者定位。",
623
+ "children": [
624
+ {
625
+ "name": "infra",
626
+ "path": "common/infra/src/main/ets/com/acme/infra",
627
+ "description": "保留源包族层级,方便原开发者定位。",
628
+ "children": [
629
+ {
630
+ "name": "net",
631
+ "path": "common/infra/src/main/ets/com/acme/infra/net",
632
+ "description": "网络管理与基础传输;不持有页面对象或页面状态。",
633
+ "children": []
634
+ },
635
+ {
636
+ "name": "store",
637
+ "path": "common/infra/src/main/ets/com/acme/infra/store",
638
+ "description": "通用持久化包装;业务数据所有权留在所属业务。",
639
+ "children": []
640
+ }
641
+ ]
642
+ }
643
+ ]
644
+ }
645
+ ]
646
+ }
647
+ ]
648
+ },
649
+ {
650
+ "name": "resources",
651
+ "path": "common/infra/src/main/resources",
652
+ "description": "基础能力自身资源。",
653
+ "children": [
654
+ {
655
+ "name": "base",
656
+ "path": "common/infra/src/main/resources/base",
657
+ "description": "该模块的默认资源集。",
658
+ "children": [
659
+ {
660
+ "name": "element",
661
+ "path": "common/infra/src/main/resources/base/element",
662
+ "description": "该模块实际需要的文字与样式等资源。",
663
+ "children": []
664
+ }
665
+ ]
666
+ }
667
+ ]
668
+ }
669
+ ]
670
+ }
671
+ ]
672
+ }
673
+ ],
674
+ "kind": "HAR"
675
+ }
676
+ ]
677
+ }
678
+ ]
679
+ },
680
+ "decisions": [
681
+ {
682
+ "title": "独立主 Tab 形成业务 HAR",
683
+ "description": "feature/classification、feature/home、feature/mine 沿用源业务包名,各含其详情等页面;独立维护与构建验证形成清晰边界,承担 HAR 配置、公开导出和集成成本。不会为每个页面再拆 HAR。"
684
+ },
685
+ {
686
+ "title": "基础包族保留在 common/infra",
687
+ "description": "infra 移入 common 分组后仍保留 com/acme/infra/net 与 store 层级,便于对照源改动;平台 API 替换不等于重排所有基础包。"
688
+ },
689
+ {
690
+ "title": "产品壳装配,状态归所属业务",
691
+ "description": "entry/src/main/ets/composition 通过公开能力创建和提供实例,entry/src/main/ets/navigation 集成业务路由。业务模块依赖 common/infra;页面私有状态由各模块 viewModels 持有,不反向引用 entry、不互传其他模块的私有状态。"
692
+ }
693
+ ]
120
694
  }
121
695
  ]
122
696
  }