@harmonyos-arkts/d2h 0.1.33 → 0.1.35
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/.claude-plugin/plugin.json +1 -1
- package/agents/android-to-hmos-00-orchestrator.md +1 -0
- package/agents/d2h.md +5 -3
- package/package.json +1 -1
- package/schemas/code-stats.schema.json +2 -2
- package/skills/d2h-code-audit/SKILL.md +17 -6
- package/skills/d2h-code-audit/references/code-stats-schema.md +64 -2
- package/skills/d2h-code-audit/scripts/code_stats.py +1 -1
- package/skills/d2h-code-audit/scripts/increment_delta.py +299 -0
- package/skills/d2h-dashboard/app/assets/{Analysis-Dj-4QEJi.js → Analysis-S3iFh2nP.js} +1 -1
- package/skills/d2h-dashboard/app/assets/CodeAudit-BI5iNy2f.css +1 -0
- package/skills/d2h-dashboard/app/assets/CodeAudit-BeZMoO_s.js +1 -0
- package/skills/d2h-dashboard/app/assets/{FeaturesList-C5yGUbRo.js → FeaturesList-CdKAoNw5.js} +1 -1
- package/skills/d2h-dashboard/app/assets/{Overview-CNkA3J9F.js → Overview-C43KVHdP.js} +1 -1
- package/skills/d2h-dashboard/app/assets/Overview-CzysQJHh.css +1 -0
- package/skills/d2h-dashboard/app/assets/{Project-BC9Tz1WY.js → Project-D5loWYjZ.js} +1 -1
- package/skills/d2h-dashboard/app/assets/{SpecDetail-DguVmqAE.js → SpecDetail-XCDyawZ3.js} +1 -1
- package/skills/d2h-dashboard/app/assets/{SpecItemDetail-7s7SaF3O.js → SpecItemDetail-BDl_Qqfx.js} +2 -2
- package/skills/d2h-dashboard/app/assets/datetime-DBOJn2GA.js +1 -0
- package/skills/d2h-dashboard/app/assets/{index-B3nfIPBm.js → index-C1bO3C02.js} +2 -2
- package/skills/d2h-dashboard/app/assets/{navigation-d1Uf6TR4.js → navigation-BGPexEv8.js} +1 -1
- package/skills/d2h-dashboard/app/index.html +1 -1
- package/skills/d2h-spec-generate/SKILL.md +17 -11
- package/skills/language/h5/d2h-h5-analyse/SKILL.md +34 -0
- package/skills/language/h5/d2h-h5-analyse/references/scenarios.md +36 -0
- package/skills/language/h5/d2h-h5-coding/SKILL.md +33 -0
- package/skills/language/h5/d2h-h5-coding/references/bridge-contracts.md +44 -0
- package/skills/language/h5/d2h-h5-coding/references/examples.md +28 -0
- package/skills/language/h5/d2h-h5-coding/references/scenarios.md +40 -0
- package/skills/language/h5/d2h-h5-coding/references/webview-implementation.md +144 -0
- package/skills/preparing-migration-workspace/SKILL.md +0 -1
- package/skills/d2h-dashboard/app/assets/CodeAudit-Ctt3XEec.css +0 -1
- package/skills/d2h-dashboard/app/assets/CodeAudit-TcIcLwQL.js +0 -1
- package/skills/d2h-dashboard/app/assets/Overview-Cmz8yjX-.css +0 -1
- package/skills/d2h-dashboard/app/assets/datetime-CHrzCsjX.js +0 -1
package/agents/d2h.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: d2h
|
|
3
3
|
description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁移场景加载专项 Skill,完成页面规划、逐页开发、必要验证和最终交付。
|
|
4
|
+
version: 0.1.35
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Android to HarmonyOS Migration Agent
|
|
@@ -34,7 +35,7 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
|
|
|
34
35
|
| 开始或恢复迁移,定位工程、准备工具链、读取状态、执行 Preflight、检查设备 | `preparing-migration-workspace` |
|
|
35
36
|
| 迁移实时看板(progress.json 就绪后自动启动;阶段进度、功能清单、Spec 执行、耗时/token 总览) | `d2h-dashboard` |
|
|
36
37
|
| 从源码生成可审计功能清单、MVP/core/full 阶段、逐功能技术栈/三方 SDK/SO/权限与跨仓实现状态 | `d2h-app-solution` |
|
|
37
|
-
|
|
|
38
|
+
| 代码静态分析(主流程两次触发:开始时 Android 基线,代码转换完成后双端终检):超大文件(默认 2000 行)、模块数、三方依赖、SO 依赖统计与对比 | `d2h-code-audit` |
|
|
38
39
|
| 从 Android 源码生成或刷新 Facts、UTG、点击路径和 `.migration/utg/page.json` | `d2h-utg-static-generate` |
|
|
39
40
|
| 需要 AI 修复源码派生 UTG,或在 Android 设备上按已有计划采集运行时证据 | `d2h-utg-ai-generate` |
|
|
40
41
|
| 根据 Facts、源码和 UTG 生成页面计划、完整 `spec.md` 及初始账本 | `d2h-spec-generate` |
|
|
@@ -60,6 +61,7 @@ description: Android 应用到 HarmonyOS 的 AI 驱动迁移主 Agent;按迁
|
|
|
60
61
|
1. 加载 `managing-d2h-toolchain` skill 完成基础工具链预检和安装,仅需要执行一次
|
|
61
62
|
2. 加载 `preparing-migration-workspace`,完成工具链、Android/HarmonyOS 工程、迁移工作区、配置、基线和设备检查。迁移工作区使用 Android 工程父目录下的 `<工程名>-migration/.migration/`,不得写入 Android 工程内部。
|
|
62
63
|
3. `.migration/progress.json` 就绪(`progress init` 首次创建或恢复时已存在)后,立即加载 `d2h-dashboard` 自动启动实时看板并用默认浏览器打开网页;看板启动或打开失败只记录,不阻塞迁移。
|
|
64
|
+
4. 工作区就绪后加载 `d2h-code-audit`,对 Android 工程执行基线扫描(超大文件、模块数、三方依赖、SO 统计),产物写入 `.migration/code-audit/baseline-android/code-stats.json`;HarmonyOS 工程此时已存在(恢复迁移或复用已有工程)时,追加单侧基线 `.migration/code-audit/baseline-harmony/code-stats.json`。恢复时已有基线且对应源码基线未变则沿用,不重复扫描。
|
|
63
65
|
|
|
64
66
|
### 二、功能清单生成
|
|
65
67
|
|
|
@@ -102,7 +104,7 @@ c. 主 Agent 复核本次构建与必要验证结果,不另设逐页测试流
|
|
|
102
104
|
d. 主 Agent 复核作用域提交和工作区,核对 `batch_report.json` 中记录的真实实现文件、来源、本次构建与测试证据、差异及阻塞,原位更新并保留历史。
|
|
103
105
|
e. 当前任务闭环后,重新核对前置并评估上下文与宿主续会话能力,适合时复用同一 worker 继续组内下一项,否则明确调整分组并重新派发剩余任务;本组完成后再按计划派发下一组。受阻时继续修复当前任务或记录外部阻塞,不自动跳过或扩组。里程碑与波次组织交付顺序,不拆分页面闭环或改变验收要求。
|
|
104
106
|
|
|
105
|
-
3.
|
|
107
|
+
3. 本次确认范围的开发任务全部完成、进入完成条件核对前,第二次加载 `d2h-code-audit` 对 Android 与 HarmonyOS 工程执行双端同扫终检(comparison 必须双端同次生成,阶段一单侧基线无 comparison):超大文件(默认 2000 行)、模块数、三方依赖与 SO 依赖统计及对比,产物写入 `.migration/code-audit/code-stats.json`,与阶段一基线分开保留;增量轮重扫前先将上一轮终检产物原样归档到 `.migration/code-audit/history/code-stats-<generated_at>.json`,终检后运行差量脚本生成 `.migration/code-audit/increment-delta.json` 记录本次增量(逐侧行数、依赖与超大文件差量;增量轮以最近归档终检为 previous,首轮以阶段一基线为 previous,已有鸿蒙工程时 harmony 侧有基线,缺 previous 的侧在 notes 如实说明)。HarmonyOS 侧超大文件如实记录,不静默省略,也不阻塞本次范围交付。
|
|
106
108
|
|
|
107
109
|
若当前环境不支持独立 page-worker,必须明确报告该开发模式无法执行,不能静默改成主 Agent 批量开发。
|
|
108
110
|
|
|
@@ -150,7 +152,7 @@ hdc 不在 PATH 或仍悬挂时改用 `cmd /c "… > log 2>&1"` 文件重定向
|
|
|
150
152
|
- 所有 Spec 功能项都有真实、可达的 HarmonyOS 实现。
|
|
151
153
|
- HarmonyOS 工程构建、安装、启动成功,开发阶段必要验证通过;仅在用户明确要求专项测试时核对其实际结果。
|
|
152
154
|
- `batch_report.json` 已记录最终开发复核、必要验证结果、未验证项及实际证据路径,队列、页面明细和汇总一致。
|
|
153
|
-
- 已按 `d2h-code-audit`
|
|
155
|
+
- 已按 `d2h-code-audit` 完成双端静态分析终检,`.migration/code-audit/code-stats.json` 已生成;HarmonyOS 侧超大文件已如实记录并标注。
|
|
154
156
|
- 所有页面、可见控件、状态、导航、Dialog、业务功能、数据效果和错误路径均真实实现。
|
|
155
157
|
- Facts 或 UTG 遗漏、但经源码或运行时发现的行为也已实现并验证。
|
|
156
158
|
- 无法等价的差异已经明确呈现,没有被静默标记为完成。
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://chuanqi.dev/schemas/code-stats.schema.json",
|
|
4
4
|
"title": "Dual-Platform Code Stats Report",
|
|
5
|
-
"description": "d2h-code-audit 产出的双端(Android/HarmonyOS
|
|
5
|
+
"description": "d2h-code-audit 产出的双端(Android/HarmonyOS)代码静态分析事实,纯脚本确定性生成;语言已知枚举为 kotlin|java|arkts|typescript|javascript|dart|vue|cpp|xml,未映射文本扩展落入 other。",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": [
|
|
8
8
|
"schema_version",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"properties": {
|
|
19
19
|
"schema_version": { "const": "1.0" },
|
|
20
|
-
"title": { "const": "
|
|
20
|
+
"title": { "const": "双端代码静态分析" },
|
|
21
21
|
"language": { "const": "zh-CN" },
|
|
22
22
|
"generated_by": { "const": "d2h-code-audit/scripts/code_stats.py" },
|
|
23
23
|
"generated_at": { "type": "string", "minLength": 1 },
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: d2h-code-audit
|
|
3
|
-
description: 双端(Android + HarmonyOS
|
|
3
|
+
description: 双端(Android + HarmonyOS)代码静态分析:超大文件检测(默认 2000 行)、模块数、三方依赖(gradle/ohpm)、SO/JAR/AAR 原生库统计与双端对比。当用户要求"统计代码行""检查超大文件""大文件检测""盘点模块/SDK/SO 依赖""对比两端代码规模""代码静态分析""代码健康检查"时触发;也是 d2h 迁移主流程的开始基线(Android 单侧;已有鸿蒙工程时含 HarmonyOS 单侧)与代码转换完成后的双端终检环节,并为首轮与增量轮派生 increment-delta.json 差量。只产出确定性 code-stats.json 与 increment-delta.json,不修改代码、不做架构决策。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# 双端代码静态分析
|
|
7
7
|
|
|
8
8
|
从确定性脚本事实出发统计 Android 与 HarmonyOS 工程的代码规模、超大文件、模块与依赖。本 Skill 不评估架构优劣、不修复超大文件、不替代构建或测试。
|
|
9
9
|
|
|
10
10
|
## 输入与默认值
|
|
11
11
|
|
|
12
12
|
- Android 工程根目录(可选)与 HarmonyOS 工程根目录(可选),至少其一;独立调用时由用户提供。
|
|
13
|
-
- 由 `d2h`
|
|
13
|
+
- 由 `d2h` 完整迁移流程调用时产物分三类:基线(阶段一工作区就绪后;Android 始终扫描,输出 `.migration/code-audit/baseline-android/`;HarmonyOS 工程已存在时追加单侧基线,输出 `.migration/code-audit/baseline-harmony/`;单侧基线无 comparison)、双端终检(代码转换完成后同扫,输出 `.migration/code-audit/`,同次生成 comparison;增量轮重扫前先将上一轮终检产物原样归档到 `.migration/code-audit/history/code-stats-<generated_at>.json`)与增量差量(终检后运行 `increment_delta.py` 输出 `.migration/code-audit/increment-delta.json`;增量轮以最近归档终检为 previous,首轮以阶段一基线为 previous)。Android 取当前迁移工程,HarmonyOS 取 `.migration/config.json` 的 `harmonyProject`。恢复时已有基线且对应源码基线未变则沿用,不重复扫描。
|
|
14
14
|
- 超大文件阈值默认 2000 行(`--threshold` 可调),未映射扩展的白名单与识别规则见 [metrics.md](references/metrics.md)。
|
|
15
15
|
|
|
16
16
|
## 核心约束
|
|
@@ -50,14 +50,25 @@ python3 <skill-dir>/scripts/validate_code_stats.py \
|
|
|
50
50
|
|
|
51
51
|
校验器会复核超大文件的实际物理行数、依赖声明位置存在性与全部计数一致性;error 必须修复(重新扫描,不是手改 JSON)。
|
|
52
52
|
|
|
53
|
-
### 3.
|
|
53
|
+
### 3. 生成增量差量(迁移流程终检后)
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
```bash
|
|
56
|
+
python3 <skill-dir>/scripts/increment_delta.py \
|
|
57
|
+
--previous /abs/.migration/code-audit/history/code-stats-<generated_at>.json \
|
|
58
|
+
--current /abs/.migration/code-audit/code-stats.json \
|
|
59
|
+
--output /abs/.migration/code-audit
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--previous` 可传 1~2 份(按 repositories id 识别各侧来源;增量轮传最近归档终检一份,首轮传阶段一基线)。产物 `increment-delta.json` 是两份快照的确定性差量:逐侧 code/by_language 差量、模块与依赖/原生库 added/removed、依赖 version_changed、超大文件 added/removed/persisted,以及双端同源时的 comparison_delta;口径漂移与缺失 previous 在 notes 说明。不重扫源码,不回写 code-stats.json。
|
|
63
|
+
|
|
64
|
+
### 4. 返回
|
|
65
|
+
|
|
66
|
+
返回 `code-stats.json` 路径、超大纲要和注意事项(`notes`);迁移流程终检后另返回 `increment-delta.json` 路径与本次增量摘要;不展开修复动作。
|
|
56
67
|
|
|
57
68
|
## 最终质量门槛
|
|
58
69
|
|
|
59
70
|
- 校验器零 error;`--strict` 下零 warning 或每条 warning 已说明。
|
|
60
|
-
- 每个数字都能回溯到 `code-stats.json
|
|
71
|
+
- 每个数字都能回溯到 `code-stats.json`,无凭印象补充的统计;差量产物(如有)的每个数字可回溯到 inputs 中两份快照的 sha256。
|
|
61
72
|
- 鸿蒙侧超大文件全部列出且带模块归属;`module: unknown` 的条目已复核解释。
|
|
62
73
|
- 未识别扩展的大体量文件没有被忽略,`notes` 逐条有说明。
|
|
63
74
|
|
|
@@ -14,13 +14,15 @@
|
|
|
14
14
|
8. comparison
|
|
15
15
|
9. notes
|
|
16
16
|
10. 最小示例
|
|
17
|
+
11. 迁移流程产物目录约定
|
|
18
|
+
12. 增量差量产物(increment-delta.json)
|
|
17
19
|
|
|
18
20
|
## 1. 顶层结构
|
|
19
21
|
|
|
20
22
|
```json
|
|
21
23
|
{
|
|
22
24
|
"schema_version": "1.0",
|
|
23
|
-
"title": "
|
|
25
|
+
"title": "双端代码静态分析",
|
|
24
26
|
"language": "zh-CN",
|
|
25
27
|
"generated_by": "d2h-code-audit/scripts/code_stats.py",
|
|
26
28
|
"generated_at": "2026-11-05T10:00:00+08:00",
|
|
@@ -161,7 +163,7 @@
|
|
|
161
163
|
```json
|
|
162
164
|
{
|
|
163
165
|
"schema_version": "1.0",
|
|
164
|
-
"title": "
|
|
166
|
+
"title": "双端代码静态分析",
|
|
165
167
|
"language": "zh-CN",
|
|
166
168
|
"generated_by": "d2h-code-audit/scripts/code_stats.py",
|
|
167
169
|
"generated_at": "2026-11-05T10:00:00+08:00",
|
|
@@ -258,3 +260,63 @@
|
|
|
258
260
|
"notes": []
|
|
259
261
|
}
|
|
260
262
|
```
|
|
263
|
+
|
|
264
|
+
## 11. 迁移流程产物目录约定
|
|
265
|
+
|
|
266
|
+
由 `d2h` 完整迁移流程调用时,迁移工作区的产物靠目录区分:
|
|
267
|
+
|
|
268
|
+
| 产物 | 触发环节 | 扫描范围 | 路径 |
|
|
269
|
+
|---|---|---|---|
|
|
270
|
+
| Android 基线 | 阶段一「启动或恢复」工作区就绪后 | 仅 `--android` 单侧,无 `comparison`,`notes` 含"仅统计 Android 侧"说明 | `.migration/code-audit/baseline-android/code-stats.json` |
|
|
271
|
+
| HarmonyOS 基线 | 阶段一,且 HarmonyOS 工程已存在(恢复迁移或复用已有工程) | 仅 `--harmony` 单侧,无 `comparison` | `.migration/code-audit/baseline-harmony/code-stats.json` |
|
|
272
|
+
| 双端终检 | 代码转换完成、进入完成条件核对前 | `--android --harmony` 双端同扫,同次生成 `comparison` | `.migration/code-audit/code-stats.json` |
|
|
273
|
+
| 归档终检 | 增量轮重扫前,上一轮终检原样移入 | 不重扫,仅归档 | `.migration/code-audit/history/code-stats-<generated_at>.json` |
|
|
274
|
+
| 增量差量 | 每轮终检后 | 不重扫,两份快照的确定性派生(见第 12 节) | `.migration/code-audit/increment-delta.json` |
|
|
275
|
+
|
|
276
|
+
- 基线与归档历史永久保留,不被终检覆盖;当轮终检产物是完成条件引用的唯一版本。
|
|
277
|
+
- 恢复会话时,基线已存在且对应源码基线(git revision)未变则沿用,不重复扫描。
|
|
278
|
+
- `comparison` 只能由双端同次扫描生成(见第 8 节),单侧基线产物中必须缺席。
|
|
279
|
+
|
|
280
|
+
## 12. 增量差量产物(increment-delta.json)
|
|
281
|
+
|
|
282
|
+
`increment_delta.py --previous <旧快照>... --current <新快照> --output <目录>` 的产物,是两份 code-stats.json 的纯函数差量:不重扫源码、不回写任何 code-stats.json。`--previous` 可传 1~2 份,按 `repositories[].id` 识别各侧来源;同侧出现在多份 previous 中时报错。previous 选取约定:增量轮用最近归档终检,首轮用阶段一基线。
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"schema_version": "1.0",
|
|
287
|
+
"title": "增量开发差量",
|
|
288
|
+
"generated_by": "d2h-code-audit/scripts/increment_delta.py",
|
|
289
|
+
"generated_at": "...",
|
|
290
|
+
"inputs": {
|
|
291
|
+
"current": { "path": "...", "sha256": "...", "generated_at": "...", "repositories": [ { "id": "harmony", "revision": "1a2b3c4" } ] },
|
|
292
|
+
"previous_by_side": {
|
|
293
|
+
"android": { "path": "...", "sha256": "...", "generated_at": "...", "source_kind": "baseline-android", "revision": "..." },
|
|
294
|
+
"harmony": { "path": "...", "sha256": "...", "generated_at": "...", "source_kind": "history-final", "revision": "..." }
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
"sides": {
|
|
298
|
+
"harmony": {
|
|
299
|
+
"code": { "total_files_delta": 3, "total_lines_delta": 4200, "by_language_delta": [ { "language": "arkts", "files_delta": 3, "lines_delta": 4200 } ] },
|
|
300
|
+
"modules": { "added": [ { "name": "feature:profile", "path": "feature/profile", "kind": "library" } ], "removed": [] },
|
|
301
|
+
"third_party_dependencies": { "added": [ { "name": "@ohos/axios", "version": "^2.2.0" } ], "removed": [], "version_changed": [ { "name": "libx", "from": "1.0.0", "to": "1.2.0" } ] },
|
|
302
|
+
"native_libraries": { "added": [], "removed": [] },
|
|
303
|
+
"oversized_files": { "added": [ { "path": "entry/src/main/ets/pages/Profile.ets", "lines": 2300, "language": "arkts", "module": "entry" } ], "removed": [], "persisted": [ { "path": "entry/src/main/ets/pages/Index.ets", "lines_delta": 320, "module": "entry" } ] }
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"comparison_delta": {
|
|
307
|
+
"oversized": { "android_count": 0, "harmony_count": 1 },
|
|
308
|
+
"modules": { "android": 0, "harmony": 1 },
|
|
309
|
+
"third_party_dependencies": { "android": 0, "harmony": 2 },
|
|
310
|
+
"native_libraries": { "android": 0, "harmony": 0 },
|
|
311
|
+
"total_lines": { "android": 0, "harmony": 4200 }
|
|
312
|
+
},
|
|
313
|
+
"notes": []
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
- 差量一律为 current − previous;`by_language_delta` 与 `oversized_files.persisted` 只列非零项,其余 added/removed 全量列出。
|
|
318
|
+
- `previous_by_side.<id>` 为 null 表示该侧无可用 previous(如全新迁移首轮 harmony 无基线),该侧不进 `sides`,notes 如实说明。
|
|
319
|
+
- `source_kind` 由 previous 路径确定性推导:`baseline-android` / `baseline-harmony` / `history-final`(路径含 history 目录)/ `external`。
|
|
320
|
+
- `version_changed` 对比依赖级 `version`;同名多版本冲突仍以声明级字段为准(见第 4 节)。
|
|
321
|
+
- `comparison_delta` 仅当两侧 previous 为同一份双端终检快照(增量轮)时生成;首轮以基线为 previous(两侧不同源)时不生成,notes 说明。
|
|
322
|
+
- notes 暴露口径漂移:快照间 `thresholds`、`scanned_extensions`、`excluded_patterns` 不一致时逐条提示,差量解读需结合说明。
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Deterministic increment delta between two code-stats.json snapshots.
|
|
3
|
+
|
|
4
|
+
Produces increment-delta.json per skills/d2h-code-audit/references/code-stats-schema.md §12.
|
|
5
|
+
Pure function of the two input files; never rescans source trees.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import hashlib
|
|
12
|
+
import json
|
|
13
|
+
import sys
|
|
14
|
+
from collections import OrderedDict
|
|
15
|
+
from datetime import datetime
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
SCHEMA_VERSION = "1.0"
|
|
19
|
+
TITLE = "增量开发差量"
|
|
20
|
+
GENERATED_BY = "d2h-code-audit/scripts/increment_delta.py"
|
|
21
|
+
|
|
22
|
+
SOURCE_KIND_DIRS = {
|
|
23
|
+
"baseline-android": "baseline-android",
|
|
24
|
+
"baseline-harmony": "baseline-harmony",
|
|
25
|
+
"history": "history-final",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def load_stats(path: Path) -> dict:
|
|
30
|
+
try:
|
|
31
|
+
data = json.loads(path.read_text(encoding="utf-8"))
|
|
32
|
+
except (OSError, ValueError) as error:
|
|
33
|
+
raise SystemExit("无法读取 code-stats.json:{}({})".format(path, error))
|
|
34
|
+
if (
|
|
35
|
+
not isinstance(data, dict)
|
|
36
|
+
or data.get("schema_version") != "1.0"
|
|
37
|
+
or not isinstance(data.get("sides"), dict)
|
|
38
|
+
or not data["sides"]
|
|
39
|
+
or not isinstance(data.get("repositories"), list)
|
|
40
|
+
):
|
|
41
|
+
raise SystemExit("无效的 code-stats.json:{}".format(path))
|
|
42
|
+
return data
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def file_sha256(path: Path) -> str:
|
|
46
|
+
return hashlib.sha256(path.read_bytes()).hexdigest()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def source_kind(path: Path) -> str:
|
|
50
|
+
for part in path.parts:
|
|
51
|
+
if part in SOURCE_KIND_DIRS:
|
|
52
|
+
return SOURCE_KIND_DIRS[part]
|
|
53
|
+
return "external"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def revision_of(data: dict, side_id: str):
|
|
57
|
+
for repo in data["repositories"]:
|
|
58
|
+
if repo.get("id") == side_id:
|
|
59
|
+
return repo.get("revision")
|
|
60
|
+
return None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def by_language_delta(previous: dict, current: dict) -> list:
|
|
64
|
+
previous_map = {row["language"]: row for row in previous.get("by_language", [])}
|
|
65
|
+
current_map = {row["language"]: row for row in current.get("by_language", [])}
|
|
66
|
+
rows = []
|
|
67
|
+
for language in sorted(set(previous_map) | set(current_map)):
|
|
68
|
+
old = previous_map.get(language, {})
|
|
69
|
+
new = current_map.get(language, {})
|
|
70
|
+
files_delta = new.get("files", 0) - old.get("files", 0)
|
|
71
|
+
lines_delta = new.get("lines", 0) - old.get("lines", 0)
|
|
72
|
+
if files_delta or lines_delta:
|
|
73
|
+
rows.append(OrderedDict([
|
|
74
|
+
("language", language),
|
|
75
|
+
("files_delta", files_delta),
|
|
76
|
+
("lines_delta", lines_delta),
|
|
77
|
+
]))
|
|
78
|
+
return rows
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def delta_side(previous: dict, current: dict) -> "OrderedDict":
|
|
82
|
+
previous_code = previous.get("code", {})
|
|
83
|
+
current_code = current.get("code", {})
|
|
84
|
+
code = OrderedDict([
|
|
85
|
+
("total_files_delta", current_code.get("total_files", 0) - previous_code.get("total_files", 0)),
|
|
86
|
+
("total_lines_delta", current_code.get("total_lines", 0) - previous_code.get("total_lines", 0)),
|
|
87
|
+
("by_language_delta", by_language_delta(previous_code, current_code)),
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
previous_modules = {item["name"]: item for item in previous.get("modules", [])}
|
|
91
|
+
current_modules = {item["name"]: item for item in current.get("modules", [])}
|
|
92
|
+
modules = OrderedDict([
|
|
93
|
+
("added", [current_modules[name] for name in sorted(set(current_modules) - set(previous_modules))]),
|
|
94
|
+
("removed", sorted(set(previous_modules) - set(current_modules))),
|
|
95
|
+
])
|
|
96
|
+
|
|
97
|
+
previous_deps = {item["name"]: item for item in previous.get("third_party_dependencies", [])}
|
|
98
|
+
current_deps = {item["name"]: item for item in current.get("third_party_dependencies", [])}
|
|
99
|
+
version_changed = []
|
|
100
|
+
for name in sorted(set(previous_deps) & set(current_deps)):
|
|
101
|
+
old_version = previous_deps[name].get("version")
|
|
102
|
+
new_version = current_deps[name].get("version")
|
|
103
|
+
if old_version != new_version:
|
|
104
|
+
version_changed.append(OrderedDict([
|
|
105
|
+
("name", name),
|
|
106
|
+
("from", old_version),
|
|
107
|
+
("to", new_version),
|
|
108
|
+
]))
|
|
109
|
+
deps = OrderedDict([
|
|
110
|
+
("added", [OrderedDict([("name", name), ("version", current_deps[name].get("version"))])
|
|
111
|
+
for name in sorted(set(current_deps) - set(previous_deps))]),
|
|
112
|
+
("removed", sorted(set(previous_deps) - set(current_deps))),
|
|
113
|
+
("version_changed", version_changed),
|
|
114
|
+
])
|
|
115
|
+
|
|
116
|
+
previous_native = {item["name"] for item in previous.get("native_libraries", [])}
|
|
117
|
+
current_native = {item["name"] for item in current.get("native_libraries", [])}
|
|
118
|
+
native = OrderedDict([
|
|
119
|
+
("added", sorted(current_native - previous_native)),
|
|
120
|
+
("removed", sorted(previous_native - current_native)),
|
|
121
|
+
])
|
|
122
|
+
|
|
123
|
+
previous_oversized = {item["path"]: item for item in previous.get("oversized_files", [])}
|
|
124
|
+
current_oversized = {item["path"]: item for item in current.get("oversized_files", [])}
|
|
125
|
+
persisted = []
|
|
126
|
+
for path in sorted(set(previous_oversized) & set(current_oversized)):
|
|
127
|
+
lines_delta = current_oversized[path]["lines"] - previous_oversized[path]["lines"]
|
|
128
|
+
if lines_delta:
|
|
129
|
+
persisted.append(OrderedDict([
|
|
130
|
+
("path", path),
|
|
131
|
+
("lines_delta", lines_delta),
|
|
132
|
+
("module", current_oversized[path].get("module")),
|
|
133
|
+
]))
|
|
134
|
+
oversized = OrderedDict([
|
|
135
|
+
("added", [current_oversized[path] for path in sorted(set(current_oversized) - set(previous_oversized))]),
|
|
136
|
+
("removed", sorted(set(previous_oversized) - set(current_oversized))),
|
|
137
|
+
("persisted", persisted),
|
|
138
|
+
])
|
|
139
|
+
|
|
140
|
+
return OrderedDict([
|
|
141
|
+
("code", code),
|
|
142
|
+
("modules", modules),
|
|
143
|
+
("third_party_dependencies", deps),
|
|
144
|
+
("native_libraries", native),
|
|
145
|
+
("oversized_files", oversized),
|
|
146
|
+
])
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def comparison_delta(previous: dict, current: dict) -> "OrderedDict":
|
|
150
|
+
previous_comparison = previous["comparison"]
|
|
151
|
+
current_comparison = current["comparison"]
|
|
152
|
+
result = OrderedDict()
|
|
153
|
+
for key in ("modules", "third_party_dependencies", "native_libraries", "total_lines"):
|
|
154
|
+
result[key] = OrderedDict([
|
|
155
|
+
("android", current_comparison[key]["android"] - previous_comparison[key]["android"]),
|
|
156
|
+
("harmony", current_comparison[key]["harmony"] - previous_comparison[key]["harmony"]),
|
|
157
|
+
])
|
|
158
|
+
result["oversized"] = OrderedDict([
|
|
159
|
+
("android_count", current_comparison["oversized"]["android_count"] - previous_comparison["oversized"]["android_count"]),
|
|
160
|
+
("harmony_count", current_comparison["oversized"]["harmony_count"] - previous_comparison["oversized"]["harmony_count"]),
|
|
161
|
+
])
|
|
162
|
+
return result
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def main() -> int:
|
|
166
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
167
|
+
parser.add_argument("--previous", action="append", required=True, type=Path,
|
|
168
|
+
metavar="CODE_STATS_JSON", help="上一份 code-stats.json,可重复传入 1~2 份")
|
|
169
|
+
parser.add_argument("--current", required=True, type=Path, help="当前 code-stats.json")
|
|
170
|
+
parser.add_argument("--output", type=Path, default=Path("."), help="输出目录(默认当前目录)")
|
|
171
|
+
args = parser.parse_args()
|
|
172
|
+
|
|
173
|
+
current_path = args.current.expanduser().resolve()
|
|
174
|
+
current = load_stats(current_path)
|
|
175
|
+
previous_files = OrderedDict()
|
|
176
|
+
for raw in args.previous:
|
|
177
|
+
path = raw.expanduser().resolve()
|
|
178
|
+
if str(path) in previous_files:
|
|
179
|
+
parser.error("重复传入同一份 previous:{}".format(path))
|
|
180
|
+
previous_files[str(path)] = (path, load_stats(path))
|
|
181
|
+
|
|
182
|
+
previous_by_side = OrderedDict()
|
|
183
|
+
for side_id in current["sides"]:
|
|
184
|
+
matches = [(path, data) for path, data in previous_files.values() if side_id in data["sides"]]
|
|
185
|
+
if len(matches) > 1:
|
|
186
|
+
parser.error("多份 previous 包含 {} 侧:{}".format(side_id, ", ".join(str(p) for p, _ in matches)))
|
|
187
|
+
if matches:
|
|
188
|
+
path, data = matches[0]
|
|
189
|
+
previous_by_side[side_id] = OrderedDict([
|
|
190
|
+
("path", str(path)),
|
|
191
|
+
("sha256", file_sha256(path)),
|
|
192
|
+
("generated_at", data.get("generated_at")),
|
|
193
|
+
("source_kind", source_kind(path)),
|
|
194
|
+
("revision", revision_of(data, side_id)),
|
|
195
|
+
])
|
|
196
|
+
else:
|
|
197
|
+
previous_by_side[side_id] = None
|
|
198
|
+
|
|
199
|
+
notes = []
|
|
200
|
+
for side_id, entry in previous_by_side.items():
|
|
201
|
+
if entry is None:
|
|
202
|
+
notes.append("{} 侧无可用 previous 快照,未计算该侧差量".format(side_id))
|
|
203
|
+
for path, (path_obj, data) in previous_files.items():
|
|
204
|
+
for side_id in data["sides"]:
|
|
205
|
+
if side_id not in current["sides"]:
|
|
206
|
+
notes.append("previous({})中 {} 侧在 current 缺席,未使用".format(path_obj.name, side_id))
|
|
207
|
+
|
|
208
|
+
used_thresholds = {current.get("thresholds", {}).get("oversized_file_lines")}
|
|
209
|
+
used_previous_data = {}
|
|
210
|
+
for side_id, entry in previous_by_side.items():
|
|
211
|
+
if entry is not None:
|
|
212
|
+
used_previous_data[side_id] = load_stats(Path(entry["path"]))
|
|
213
|
+
used_thresholds.add(used_previous_data[side_id].get("thresholds", {}).get("oversized_file_lines"))
|
|
214
|
+
if len(used_thresholds) > 1:
|
|
215
|
+
notes.append("thresholds 在快照间不一致({}),超大文件差量口径可能漂移".format(
|
|
216
|
+
"、".join(str(value) for value in sorted(used_thresholds, key=lambda v: (v is None, v)))))
|
|
217
|
+
for side_id, previous_data in used_previous_data.items():
|
|
218
|
+
for field in ("scanned_extensions", "excluded_patterns"):
|
|
219
|
+
if previous_data["sides"][side_id].get("code", {}).get(field) != \
|
|
220
|
+
current["sides"][side_id].get("code", {}).get(field):
|
|
221
|
+
notes.append("{} 侧 {} 在快照间不一致,行数差量口径可能漂移".format(side_id, field))
|
|
222
|
+
|
|
223
|
+
sides = OrderedDict()
|
|
224
|
+
for side_id in current["sides"]:
|
|
225
|
+
if previous_by_side[side_id] is not None:
|
|
226
|
+
sides[side_id] = delta_side(
|
|
227
|
+
used_previous_data[side_id]["sides"][side_id],
|
|
228
|
+
current["sides"][side_id],
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
comparison_section = None
|
|
232
|
+
if "comparison" in current:
|
|
233
|
+
entries = [entry for entry in previous_by_side.values() if entry is not None]
|
|
234
|
+
same_source = (
|
|
235
|
+
len(current["sides"]) == 2
|
|
236
|
+
and len(entries) == 2
|
|
237
|
+
and len({entry["path"] for entry in entries}) == 1
|
|
238
|
+
)
|
|
239
|
+
if same_source:
|
|
240
|
+
previous_data = used_previous_data[next(iter(used_previous_data))]
|
|
241
|
+
if "comparison" in previous_data:
|
|
242
|
+
comparison_section = comparison_delta(previous_data, current)
|
|
243
|
+
else:
|
|
244
|
+
notes.append("previous 终检快照缺少 comparison,未生成 comparison_delta")
|
|
245
|
+
else:
|
|
246
|
+
notes.append("各侧 previous 非同一份双端终检快照,未生成 comparison_delta")
|
|
247
|
+
|
|
248
|
+
report = OrderedDict([
|
|
249
|
+
("schema_version", SCHEMA_VERSION),
|
|
250
|
+
("title", TITLE),
|
|
251
|
+
("language", "zh-CN"),
|
|
252
|
+
("generated_by", GENERATED_BY),
|
|
253
|
+
("generated_at", datetime.now().astimezone().isoformat(timespec="seconds")),
|
|
254
|
+
("inputs", OrderedDict([
|
|
255
|
+
("current", OrderedDict([
|
|
256
|
+
("path", str(current_path)),
|
|
257
|
+
("sha256", file_sha256(current_path)),
|
|
258
|
+
("generated_at", current.get("generated_at")),
|
|
259
|
+
("repositories", [OrderedDict([("id", repo.get("id")), ("revision", repo.get("revision"))])
|
|
260
|
+
for repo in current["repositories"]]),
|
|
261
|
+
])),
|
|
262
|
+
("previous_by_side", previous_by_side),
|
|
263
|
+
])),
|
|
264
|
+
("sides", sides),
|
|
265
|
+
])
|
|
266
|
+
if comparison_section is not None:
|
|
267
|
+
report["comparison_delta"] = comparison_section
|
|
268
|
+
report["notes"] = notes
|
|
269
|
+
|
|
270
|
+
args.output.mkdir(parents=True, exist_ok=True)
|
|
271
|
+
out_path = args.output / "increment-delta.json"
|
|
272
|
+
out_path.write_text(
|
|
273
|
+
json.dumps(report, ensure_ascii=False, indent=2) + "\n",
|
|
274
|
+
encoding="utf-8",
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
print("increment-delta.json: {}".format(out_path))
|
|
278
|
+
for side_id, delta in sides.items():
|
|
279
|
+
code = delta["code"]
|
|
280
|
+
deps = delta["third_party_dependencies"]
|
|
281
|
+
oversized = delta["oversized_files"]
|
|
282
|
+
print("[{}] lines_delta={} deps +{}/-{} (changed {}) oversized +{}/-{} persisted={}".format(
|
|
283
|
+
side_id,
|
|
284
|
+
code["total_lines_delta"],
|
|
285
|
+
len(deps["added"]), len(deps["removed"]), len(deps["version_changed"]),
|
|
286
|
+
len(oversized["added"]), len(oversized["removed"]), len(oversized["persisted"]),
|
|
287
|
+
))
|
|
288
|
+
if comparison_section is not None:
|
|
289
|
+
print("[comparison_delta] lines android={} harmony={} oversized android={} harmony={}".format(
|
|
290
|
+
comparison_section["total_lines"]["android"], comparison_section["total_lines"]["harmony"],
|
|
291
|
+
comparison_section["oversized"]["android_count"], comparison_section["oversized"]["harmony_count"],
|
|
292
|
+
))
|
|
293
|
+
for note in notes:
|
|
294
|
+
print("[note] {}".format(note))
|
|
295
|
+
return 0
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
if __name__ == "__main__":
|
|
299
|
+
sys.exit(main())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,O as t,Y as n,Z as r,_ as i,a,c as o,f as s,i as c,j as l,n as u,o as d,p as f,s as p,t as m,v as h,x as g,y as _}from"./_plugin-vue_export-helper-B9l48Cov.js";import{d as v,t as y}from"./index-
|
|
1
|
+
import{C as e,O as t,Y as n,Z as r,_ as i,a,c as o,f as s,i as c,j as l,n as u,o as d,p as f,s as p,t as m,v as h,x as g,y as _}from"./_plugin-vue_export-helper-B9l48Cov.js";import{d as v,t as y}from"./index-C1bO3C02.js";import{t as b}from"./PageHeading-B5I3tpO8.js";import{a as x,r as S}from"./datetime-DBOJn2GA.js";var C={class:`tree-node`},w=[`disabled`,`aria-expanded`,`title`],T={class:`caret-icon`},E=[`title`],D=[`title`],O={key:0,class:`node-children`},k=m(f({__name:`DirectoryTree`,props:{node:{},depth:{},defaultExpandDepth:{}},setup(i){let s=i,l=t(s.depth<(s.defaultExpandDepth??0)),f=c(()=>(s.node.children?.length??0)>0),m=()=>{f.value&&(l.value=!l.value)};return(t,s)=>{let c=e(`DirectoryTree`,!0);return _(),o(`div`,C,[a(`div`,{class:n([`node-row`,{leaf:!f.value}]),onClick:m},[a(`button`,{type:`button`,class:n([`caret-btn`,{open:l.value}]),disabled:!f.value,"aria-expanded":f.value?l.value:void 0,title:f.value?l.value?`收起`:`展开`:void 0,onClick:v(m,[`stop`])},[a(`span`,T,r(f.value?l.value?`▾`:`▸`:`·`),1)],10,w),a(`span`,{class:`node-name`,title:i.node.name},r(i.node.name),9,E),i.node.description?(_(),o(`span`,{key:0,class:`node-desc`,title:i.node.description},r(i.node.description),9,D)):p(``,!0)],2),l.value&&f.value?(_(),o(`div`,O,[(_(!0),o(u,null,g(i.node.children,(e,t)=>(_(),d(c,{key:`${e.path}-${t}`,node:e,depth:i.depth+1,"default-expand-depth":i.defaultExpandDepth},null,8,[`node`,`depth`,`default-expand-depth`]))),128))])):p(``,!0)])}}}),[[`__scopeId`,`data-v-d73ec2a5`]]),A={key:0,class:`panel placeholder`},j={class:`sec-nav`,"aria-label":`页内模块导航`},M=[`title`,`onClick`],N={class:`tag nav-updated`},P={id:`sec-project`,class:`panel sec-anchor`},F={class:`row`},I={class:`tag`},L={class:`project-name`},ee={class:`project-summary`},R={key:0,class:`roots`},z={class:`root-item`},B={class:`root-item`},V={key:1,class:`scope-list`},H={key:0,class:`proposal-grid`,"aria-label":`架构方案对照`},U=[`id`],W={class:`row`},G={class:`proposal-id`},K={class:`proposal-summary`},q={key:0,class:`decisions`},J={key:1,class:`tree-wrap`},Y={id:`sec-attention`,class:`panel sec-anchor`},X={class:`row`},Z={key:0,class:`tag orange`},Q={key:0,class:`attention-list`},$={key:1,class:`empty-inline`},te=2,ne=m(f({__name:`Analysis`,setup(e){let n=y.architecturePlan,d=t(null),f=t(null),m;i(()=>{m=x(n,(e,t)=>{d.value=e,f.value=t.mtimeMs??null})}),h(()=>m?.());let v=c(()=>S(d.value,f.value)),C=c(()=>d.value?.proposals??[]),w=c(()=>[{id:`sec-project`,label:`项目概览`},...C.value.map((e,t)=>({id:`sec-proposal-${t}`,label:e.name})),{id:`sec-attention`,label:`风险与注意`}]),T=e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`})};return(e,t)=>(_(),o(u,null,[s(b,{kicker:`D2H / analysis`,title:`架构分析与设计`,note:`结构分析 · 方案对照 · ${l(n)} 实时渲染`},null,8,[`note`]),d.value?(_(),o(u,{key:1},[a(`nav`,j,[(_(!0),o(u,null,g(w.value,e=>(_(),o(`button`,{key:e.id,type:`button`,class:`sec-link`,title:e.label,onClick:t=>T(e.id)},r(e.label),9,M))),128)),a(`span`,N,`更新于 `+r(v.value),1)]),a(`section`,P,[a(`div`,F,[t[2]||=a(`h2`,null,`项目概览`,-1),a(`span`,I,`更新于 `+r(v.value),1)]),a(`p`,L,r(d.value.project?.name||`未命名项目`),1),a(`p`,ee,r(d.value.project?.summary),1),d.value.project?.androidRoot||d.value.project?.targetRoot?(_(),o(`div`,R,[a(`div`,z,[t[3]||=a(`small`,null,`Android 源工程`,-1),a(`span`,null,r(d.value.project.androidRoot||`—`),1)]),a(`div`,B,[t[4]||=a(`small`,null,`HarmonyOS 目标工程`,-1),a(`span`,null,r(d.value.project.targetRoot||`—`),1)])])):p(``,!0),d.value.project?.scope?.length?(_(),o(`ul`,V,[(_(!0),o(u,null,g(d.value.project.scope,(e,t)=>(_(),o(`li`,{key:t},r(e),1))),128))])):p(``,!0)]),C.value.length?(_(),o(`div`,H,[(_(!0),o(u,null,g(C.value,(e,n)=>(_(),o(`section`,{id:`sec-proposal-${n}`,key:e.id,class:`panel sec-anchor proposal-panel`},[a(`div`,W,[a(`h2`,null,r(e.name),1),a(`code`,G,r(e.id),1)]),a(`p`,K,r(e.summary),1),e.decisions?.length?(_(),o(`div`,q,[t[5]||=a(`small`,{class:`block-label`},`关键决策(点击展开详情)`,-1),(_(!0),o(u,null,g(e.decisions,(e,t)=>(_(),o(`details`,{key:t,class:`decision-item`},[a(`summary`,null,r(e.title),1),a(`p`,null,r(e.description),1)]))),128))])):p(``,!0),e.directoryTree?(_(),o(`div`,J,[t[6]||=a(`small`,{class:`block-label`},`目录树`,-1),s(k,{node:e.directoryTree,depth:0,"default-expand-depth":te},null,8,[`node`])])):p(``,!0)],8,U))),128))])):p(``,!0),a(`section`,Y,[a(`div`,X,[t[7]||=a(`h2`,null,`风险与注意`,-1),d.value.attentionPoints?.length?(_(),o(`span`,Z,r(d.value.attentionPoints.length)+` 项`,1)):p(``,!0)]),d.value.attentionPoints?.length?(_(),o(`div`,Q,[(_(!0),o(u,null,g(d.value.attentionPoints,(e,t)=>(_(),o(`details`,{key:t,class:`attention-item`},[a(`summary`,null,r(e.title),1),a(`p`,null,r(e.description),1)]))),128))])):(_(),o(`div`,$,`暂无风险记录`))])],64)):(_(),o(`section`,A,[t[0]||=a(`span`,{class:`glyph`},`⌕`,-1),t[1]||=a(`strong`,null,`等待数据`,-1),a(`small`,null,`正在读取 `+r(l(n))+`…(尚未生成架构规划时此页为空)`,1)]))],64))}}),[[`__scopeId`,`data-v-fdcc2af8`]]);export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.section-index[data-v-a06cb940]{color:#4c77dc;background:#eaf1ff;border-radius:6px;justify-content:center;align-items:center;min-width:22px;height:22px;margin-right:8px;padding:0 6px;font-size:12px;display:inline-flex}.compare-table[data-v-a06cb940]{border-collapse:collapse;width:100%;margin:16px 0;font-size:13px}.compare-table th[data-v-a06cb940],.compare-table td[data-v-a06cb940]{text-align:left;border-bottom:1px solid #edf0f4;padding:10px 12px}.compare-table thead th[data-v-a06cb940]{color:var(--muted);letter-spacing:.5px;background:#f7f9fc;border-bottom:2px solid #e3e9f2;font-size:11px;font-weight:600}.compare-table tbody tr:last-child td[data-v-a06cb940]{border-bottom:0}.compare-table tbody tr:hover td[data-v-a06cb940]{background:#f8faff}.compare-label[data-v-a06cb940]{color:#34445c;width:40%;font-weight:600}.compare-value[data-v-a06cb940]{white-space:nowrap;font-size:18px;font-weight:650}.android-value[data-v-a06cb940]{color:#3766dc}.harmony-value[data-v-a06cb940]{color:#168168}.meta-list[data-v-a06cb940]{gap:2px;margin-top:4px;display:grid}.meta-item[data-v-a06cb940]{border-top:1px solid #edf0f4;gap:16px;padding:7px 0;font-size:13px;display:flex}.meta-item[data-v-a06cb940]:first-child{border-top:0}.meta-item small[data-v-a06cb940]{flex-shrink:0;width:80px}.meta-value[data-v-a06cb940]{color:#34445c;overflow-wrap:anywhere}.side-panel[data-v-a06cb940]{border-top:3px solid #65a7a3}.summary-counts[data-v-a06cb940]{grid-template-columns:repeat(5,1fr);gap:8px;margin:16px 0;display:grid}.summary-counts strong[data-v-a06cb940]{font-size:24px;font-weight:650;display:block}.summary-counts small[data-v-a06cb940]{font-size:11px}.summary-counts>div[data-v-a06cb940]{background:#f4f6fa;border-radius:8px;padding:8px 10px}.module-pills[data-v-a06cb940],.ext-pills[data-v-a06cb940]{flex-wrap:wrap;gap:7px;margin:4px 0 14px;display:flex}.module-tag[data-v-a06cb940]{color:#48736e;background:#edf5f2}.ext-tag[data-v-a06cb940]{color:#61728a;background:#f1f3f7}.block-label[data-v-a06cb940]{color:var(--muted);letter-spacing:1px;margin:18px 0 8px;font-size:11px;display:block}.lang-table[data-v-a06cb940]{gap:6px;display:grid}.lang-row[data-v-a06cb940]{grid-template-columns:110px 90px 90px 1fr;align-items:center;gap:10px;font-size:13px;display:grid}.lang-name[data-v-a06cb940]{color:#34445c;font-weight:600}.lang-files[data-v-a06cb940],.lang-lines[data-v-a06cb940]{color:#61728a;font-size:12px}.lang-bar[data-v-a06cb940]{background:#edf1f7;border-radius:8px;height:8px;overflow:hidden}.lang-bar i[data-v-a06cb940]{background:var(--blue);border-radius:8px;height:100%;display:block}.dep-list[data-v-a06cb940]{display:grid}.dep-group[data-v-a06cb940]{border:1px solid #edf0f4;border-radius:8px;margin-top:18px;overflow:hidden}.dep-group>summary[data-v-a06cb940]{cursor:pointer;color:#34445c;background:#f7f9fc;align-items:center;gap:10px;padding:11px 14px;font-size:13px;font-weight:650;list-style:none;display:flex}.dep-group>summary[data-v-a06cb940]::-webkit-details-marker{display:none}.dep-group>summary[data-v-a06cb940]:before{content:"▸";color:#8191a8;font-size:13px;transition:transform .15s}.dep-group[open]>summary[data-v-a06cb940]:before{transform:rotate(90deg)}.dep-group>summary[data-v-a06cb940]:hover{color:var(--blue)}.dep-group-label[data-v-a06cb940]{min-width:0}.dep-group .dep-list[data-v-a06cb940]{padding:4px 14px 10px}.dep-item[data-v-a06cb940]{border-top:1px solid #edf0f4;padding:6px 0}.dep-item[data-v-a06cb940]:first-child{border-top:0}.dep-item summary[data-v-a06cb940]{cursor:pointer;color:#34445c;align-items:center;gap:8px;padding:6px 4px;font-size:13px;list-style:none;display:flex}.dep-item summary[data-v-a06cb940]::-webkit-details-marker{display:none}.dep-item summary[data-v-a06cb940]:before{content:"▸";color:#8191a8;font-size:12px;transition:transform .15s}.dep-item[open] summary[data-v-a06cb940]:before{transform:rotate(90deg)}.dep-item summary[data-v-a06cb940]:hover{color:var(--blue)}.dep-item summary code[data-v-a06cb940]{color:#2d59c2;overflow-wrap:anywhere;font-size:12px}.dep-decls[data-v-a06cb940]{gap:4px;padding:0 4px 8px 24px;display:grid}.dep-decl[data-v-a06cb940]{color:#61728a;overflow-wrap:anywhere;font-size:12px}.muted-tag[data-v-a06cb940]{color:#61728a;background:#f1f3f7}.oversized-list[data-v-a06cb940]{gap:6px;display:grid}.oversized-item[data-v-a06cb940]{align-items:center;gap:10px;font-size:13px;display:flex}.oversized-item code[data-v-a06cb940]{color:#b54545;overflow-wrap:anywhere}.question-list[data-v-a06cb940]{color:#48586f;margin:4px 0 0;padding-left:18px;font-size:13px;line-height:1.7}.question-list li[data-v-a06cb940]{overflow-wrap:anywhere;margin:4px 0}.empty-inline[data-v-a06cb940]{color:var(--muted);font-size:13px}.timeline[data-v-a06cb940]{align-items:stretch;padding:16px 0 4px;display:flex;overflow-x:auto}.tl-node[data-v-a06cb940]{border-top:2px solid #e3e9f2;flex:160px;min-width:160px;padding:12px 14px 0 2px;position:relative}.tl-dot[data-v-a06cb940]{background:#8aa0c4;border:2px solid #fff;border-radius:50%;width:10px;height:10px;position:absolute;top:-6px;left:0;box-shadow:0 0 0 1px #c9d6ea}.tl-node.tl-history .tl-dot[data-v-a06cb940]{background:#6f8bb5}.tl-node.active .tl-dot[data-v-a06cb940]{background:var(--blue);box-shadow:0 0 0 3px #dce8ff}.tl-node.ghost[data-v-a06cb940]{opacity:.55}.tl-node.ghost .tl-dot[data-v-a06cb940]{background:#d3dbe6;box-shadow:0 0 0 1px #e2e8f1}.tl-body[data-v-a06cb940]{gap:2px;font-size:12px;display:grid}.tl-body strong[data-v-a06cb940]{color:#34445c;font-size:13px}.tl-node.active .tl-body strong[data-v-a06cb940]{color:var(--blue)}.tl-body small[data-v-a06cb940]{color:var(--muted)}.tl-lines[data-v-a06cb940]{color:#48586f}.tl-rev[data-v-a06cb940]{overflow-wrap:anywhere;font-size:11px}.delta-grid[data-v-a06cb940]{grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;margin:14px 0 4px;display:grid}.delta-side[data-v-a06cb940]{border:1px solid #edf0f4;border-radius:10px;padding:14px}.delta-side.is-android[data-v-a06cb940]{border-top:3px solid #3766dc}.delta-side.is-harmony[data-v-a06cb940]{border-top:3px solid #168168}.delta-side-head[data-v-a06cb940]{justify-content:space-between;margin-bottom:10px}.delta-side-head strong[data-v-a06cb940]{color:#34445c;font-size:14px}.delta-kpis[data-v-a06cb940]{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.kpi[data-v-a06cb940]{background:#f4f6fa;border-radius:8px;padding:8px 10px}.kpi strong[data-v-a06cb940]{font-size:20px;font-weight:650;display:block}.kpi small[data-v-a06cb940]{color:var(--muted);font-size:11px}.tone-pos[data-v-a06cb940]{color:#2463eb}.tone-neg[data-v-a06cb940]{color:#b54545}.tone-zero[data-v-a06cb940]{color:var(--muted)}.delta-detail[data-v-a06cb940]{margin-top:12px}.delta-row[data-v-a06cb940]{color:#48586f;overflow-wrap:anywhere;padding:4px 0;font-size:12.5px}.delta-row.row-module[data-v-a06cb940]{color:#48736e}.delta-row.row-muted[data-v-a06cb940]{color:var(--muted)}.delta-row.row-oversized-bad[data-v-a06cb940]{color:#b54545}.delta-row.row-oversized-good[data-v-a06cb940]{color:#15825e}.delta-comparison[data-v-a06cb940]{margin-top:6px}.cd-chips[data-v-a06cb940]{flex-wrap:wrap;gap:7px;display:flex}.delta-notes[data-v-a06cb940]{margin-top:10px}@media (width<=700px){.delta-kpis[data-v-a06cb940]{grid-template-columns:repeat(1,1fr)}.summary-counts[data-v-a06cb940]{grid-template-columns:repeat(2,1fr)}.lang-row[data-v-a06cb940]{grid-template-columns:90px 70px 70px 1fr;gap:6px}.compare-table th[data-v-a06cb940],.compare-table td[data-v-a06cb940]{padding:8px 9px}.compare-value[data-v-a06cb940]{font-size:15px}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as e,X as t,Y as n,Z as r,_ as i,a,c as o,d as s,f as ee,i as c,j as l,n as u,p as te,s as d,t as f,v as ne,x as p,y as m}from"./_plugin-vue_export-helper-B9l48Cov.js";import{i as re,t as h}from"./index-C1bO3C02.js";import{t as ie}from"./PageHeading-B5I3tpO8.js";import{a as g,i as ae,n as _,o as oe,r as se}from"./datetime-DBOJn2GA.js";var ce={key:0,class:`panel placeholder`},le={class:`panel`},ue={class:`row`},de={class:`tag muted-tag`},fe={class:`timeline`},pe={class:`tl-body`},me={key:0},he={class:`tl-lines`},ge={key:1,class:`tl-rev`},_e={key:0,class:`empty-inline`},ve={key:1,class:`empty-inline`},ye={key:0,class:`panel`},be={class:`row`},xe={class:`tag`},v={class:`delta-grid`},y={class:`row delta-side-head`},b={class:`tag muted-tag`},x={class:`delta-kpis`},S={class:`kpi`},C={class:`kpi`},w={class:`kpi`},T={key:0,class:`dep-group delta-detail`},E={class:`tag muted-tag`},D={class:`dep-list`},O={key:0,class:`delta-comparison`},k={class:`cd-chips`},A={key:1,class:`question-list delta-notes`},j={key:1,class:`panel`},M={class:`panel`},Se={class:`row`},Ce={class:`tag`},we={class:`compare-table`},Te={class:`compare-label`},Ee={class:`compare-value android-value`},De={class:`compare-value harmony-value`},Oe={class:`meta-list`},ke={class:`meta-value`},Ae={class:`row`},je={class:`section-index`},Me={class:`tag`},Ne={class:`summary-counts`},Pe={class:`module-pills`},Fe={class:`lang-table`},Ie={class:`lang-name`},Le={class:`lang-files`},Re={class:`lang-lines`},ze={class:`lang-bar`},Be={class:`ext-pills`},Ve=[`open`],He={class:`tag muted-tag`},Ue={class:`dep-list`},We={class:`tag muted-tag`},Ge={class:`dep-decls`},Ke={key:1,class:`tag muted-tag`},qe={class:`oversized-list`},Je={class:`tag orange`},Ye={key:4,class:`empty-inline`},Xe={class:`panel`},Ze={class:`row`},Qe={class:`section-index`},$e={key:0,class:`tag orange`},et={key:0,class:`question-list`},tt={key:1,class:`empty-inline`},nt=`code-audit/history/`,N=f(te({__name:`CodeAudit`,setup(te){let f=h.codeStats,N=h.codeStatsBaselineAndroid,rt=h.codeStatsBaselineHarmony,it=h.incrementDelta,P=e(null),F=e(null),I=e(null),L=e(null),R=e(null),z=e([]),B;async function V(){try{let e=await ae(nt),t=await Promise.all(e.map(async({relPath:e})=>{try{return{relPath:e,data:await oe(e)}}catch{return null}}));z.value=t.filter(e=>e!==null).sort((e,t)=>(e.data.generated_at||``).localeCompare(t.data.generated_at||``))}catch(e){console.warn(`[CodeAudit] 读取 history 归档失败:`,e)}}i(()=>{let e=[g(f,(e,t)=>{P.value=e,F.value=t.mtimeMs??null,V()}),g(N,e=>{I.value=e}),g(rt,e=>{L.value=e}),g(it,e=>{R.value=e})];B=()=>e.forEach(e=>e()),V()}),ne(()=>B?.());let at=c(()=>se(P.value,F.value)),H=[`android`,`harmony`],U=c(()=>P.value?.sides?H.filter(e=>P.value?.sides[e]).map(e=>({key:e,...P.value.sides[e]})):[]),W=e=>P.value?.repositories.find(t=>t.id===e)?.label??(e===`android`?`Android`:`HarmonyOS`),ot=e=>e?`${e.code.total_files} 文件 / ${e.code.total_lines} 行`:re,st=(e,t)=>{let n=Math.max(1,...e.code.by_language.map(e=>e.lines));return`${Math.round(100*t/n)}%`},ct=c(()=>{let e=P.value?.comparison;return e?[{label:`模块数`,values:[e.modules.android,e.modules.harmony]},{label:`三方依赖`,values:[e.third_party_dependencies.android,e.third_party_dependencies.harmony]},{label:`原生库`,values:[e.native_libraries.android,e.native_libraries.harmony]},{label:`物理行数`,values:[e.total_lines.android,e.total_lines.harmony]},{label:`超大文件(≥${P.value.thresholds.oversized_file_lines} 行)`,values:[e.oversized.android_count,e.oversized.harmony_count]}]:[]}),G=e=>e.repositories.map(e=>`${e.id}: ${e.revision||`unknown`}`).join(` · `),K=e=>H.filter(t=>e.sides?.[t]).map(t=>`${t===`android`?`A`:`H`} ${e.sides[t].code.total_lines.toLocaleString()} 行`).join(` / `)||`unknown`,q=c(()=>{let e=[];return I.value&&e.push({key:`b-android`,kind:`baseline`,title:`Android 基线`,time:_(I.value.generated_at),revision:G(I.value),lines:K(I.value)}),e.push(L.value?{key:`b-harmony`,kind:`baseline`,title:`HarmonyOS 基线`,time:_(L.value.generated_at),revision:G(L.value),lines:K(L.value)}:{key:`b-harmony`,kind:`baseline`,title:`HarmonyOS 基线`,time:``,revision:``,lines:`未生成(全新迁移或未到阶段)`,ghost:!0}),z.value.forEach((t,n)=>{e.push({key:t.relPath,kind:`history`,title:`第 ${n+1} 轮终检`,time:_(t.data.generated_at),revision:G(t.data),lines:K(t.data)})}),P.value&&e.push({key:`current`,kind:`current`,title:`当前终检`,time:_(P.value.generated_at),revision:G(P.value),lines:K(P.value),active:!0}),e}),lt=c(()=>!!(P.value||I.value||L.value||z.value.length)),J={"baseline-android":`Android 基线`,"baseline-harmony":`HarmonyOS 基线`,"history-final":`上一轮终检`,external:`外部快照`},Y=e=>e>0?`+${e}`:`${e}`,X=e=>e>0?`tone-pos`:e<0?`tone-neg`:`tone-zero`,ut=c(()=>H.filter(e=>R.value?.sides?.[e]).map(e=>({key:e,side:R.value.sides[e]}))),dt=e=>{let t=R.value?.inputs.previous_by_side?.[e];return t?`对比${J[t.source_kind]??t.source_kind} · ${_(t.generated_at)}`:`无对比快照(该侧未计算)`},Z=e=>e.third_party_dependencies.added.length-e.third_party_dependencies.removed.length,ft=e=>e.oversized_files.added.length+e.oversized_files.persisted.length,Q=e=>{let t=[];for(let n of e.modules.added)t.push({cls:`row-module`,text:`新增模块 ${n.name} · ${n.kind}`});for(let n of e.modules.removed)t.push({cls:`row-muted`,text:`移除模块 ${n}`});for(let n of e.third_party_dependencies.added)t.push({cls:`row-dep`,text:`新增依赖 ${n.name}${n.version?` @ ${n.version}`:``}`});for(let n of e.third_party_dependencies.version_changed)t.push({cls:`row-dep`,text:`依赖升级 ${n.name} ${n.from??`unknown`} → ${n.to??`unknown`}`});for(let n of e.third_party_dependencies.removed)t.push({cls:`row-muted`,text:`移除依赖 ${n}`});for(let n of e.native_libraries.added)t.push({cls:`row-dep`,text:`新增原生库 ${n}`});for(let n of e.native_libraries.removed)t.push({cls:`row-muted`,text:`移除原生库 ${n}`});for(let n of e.oversized_files.added)t.push({cls:`row-oversized-bad`,text:`超大新增 ${n.path} · ${n.lines} 行${n.module&&n.module!==`unknown`?`(${n.module})`:``}`});for(let n of e.oversized_files.persisted)t.push({cls:`row-oversized-bad`,text:`超大恶化 ${n.path} · ${Y(n.lines_delta)} 行`});for(let n of e.oversized_files.removed)t.push({cls:`row-oversized-good`,text:`超大消除 ${n}`});return t},$=c(()=>{let e=R.value?.comparison_delta;return e?[{label:`物理行数`,a:e.total_lines.android,h:e.total_lines.harmony},{label:`模块`,a:e.modules.android,h:e.modules.harmony},{label:`三方依赖`,a:e.third_party_dependencies.android,h:e.third_party_dependencies.harmony},{label:`原生库`,a:e.native_libraries.android,h:e.native_libraries.harmony},{label:`超大文件`,a:e.oversized.android_count,h:e.oversized.harmony_count}]:[]});return(e,i)=>(m(),o(u,null,[ee(ie,{kicker:`D2H / code-audit`,title:`代码静态分析`,note:`双端代码规模 · 模块 · 依赖 · 超大文件 · ${l(f)} 实时渲染`},null,8,[`note`]),lt.value?(m(),o(u,{key:1},[a(`section`,le,[a(`div`,ue,[i[2]||=a(`h2`,null,[a(`span`,{class:`section-index`},`00`),s(`分析快照`)],-1),a(`span`,de,r(q.value.length)+` 份`,1)]),a(`div`,fe,[(m(!0),o(u,null,p(q.value,e=>(m(),o(`div`,{key:e.key,class:n([`tl-node`,[`tl-${e.kind}`,{ghost:e.ghost,active:e.active}]])},[i[3]||=a(`div`,{class:`tl-dot`},null,-1),a(`div`,pe,[a(`strong`,null,r(e.title),1),e.ghost?d(``,!0):(m(),o(`small`,me,r(e.time),1)),a(`small`,he,r(e.lines),1),e.revision?(m(),o(`small`,ge,r(e.revision),1)):d(``,!0)])],2))),128))]),z.value.length?(m(),o(`small`,_e,` 历史归档 `+r(z.value.length)+` 份(code-audit/history/);节点为概要,完整明细仅展示当前终检 `,1)):(m(),o(`small`,ve,`暂无历史归档;增量轮重扫前上一轮终检会移入 history/`))]),R.value?(m(),o(`section`,ye,[a(`div`,be,[i[4]||=a(`h2`,null,[a(`span`,{class:`section-index`},`01`),s(`本轮分析`)],-1),a(`span`,xe,`生成于 `+r(l(_)(R.value.generated_at)),1)]),a(`div`,v,[(m(!0),o(u,null,p(ut.value,e=>(m(),o(`div`,{key:e.key,class:n([`delta-side`,e.key===`android`?`is-android`:`is-harmony`])},[a(`div`,y,[a(`strong`,null,r(W(e.key)),1),a(`span`,b,r(dt(e.key)),1)]),a(`div`,x,[a(`div`,S,[a(`strong`,{class:n(X(e.side.code.total_lines_delta))},r(Y(e.side.code.total_lines_delta)),3),a(`small`,null,`行数(`+r(Y(e.side.code.total_files_delta))+` 文件)`,1)]),a(`div`,C,[a(`strong`,{class:n(X(Z(e.side)))},r(Y(Z(e.side))),3),a(`small`,null,`依赖 +`+r(e.side.third_party_dependencies.added.length)+` −`+r(e.side.third_party_dependencies.removed.length)+` ~`+r(e.side.third_party_dependencies.version_changed.length),1)]),a(`div`,w,[a(`strong`,{class:n(ft(e.side)?`tone-neg`:`tone-zero`)},`+`+r(e.side.oversized_files.added.length)+` ↗`+r(e.side.oversized_files.persisted.length),3),a(`small`,null,`超大新增/恶化 · ✓`+r(e.side.oversized_files.removed.length)+` 消除`,1)])]),Q(e.side).length?(m(),o(`details`,T,[a(`summary`,null,[i[5]||=a(`span`,{class:`dep-group-label`},`本轮明细`,-1),a(`span`,E,r(Q(e.side).length)+` 条`,1)]),a(`div`,D,[(m(!0),o(u,null,p(Q(e.side),(e,t)=>(m(),o(`div`,{key:t,class:n([`delta-row`,e.cls])},r(e.text),3))),128))])])):d(``,!0)],2))),128))]),$.value.length?(m(),o(`div`,O,[i[6]||=a(`small`,{class:`block-label`},`双端差距变化(当前 − 对比基准)`,-1),a(`div`,k,[(m(!0),o(u,null,p($.value,e=>(m(),o(`span`,{key:e.label,class:`tag`},r(e.label)+` A `+r(Y(e.a))+` / H `+r(Y(e.h)),1))),128))])])):d(``,!0),R.value.notes.length?(m(),o(`ul`,A,[(m(!0),o(u,null,p(R.value.notes,(e,t)=>(m(),o(`li`,{key:t},r(e),1))),128))])):d(``,!0)])):P.value?(m(),o(`section`,j,[...i[7]||=[a(`div`,{class:`row`},[a(`h2`,null,[a(`span`,{class:`section-index`},`01`),s(`本轮分析`)])],-1),a(`div`,{class:`empty-inline`},`本轮差量尚未生成(本轮终检后由 increment_delta.py 产出 increment-delta.json)`,-1)]])):d(``,!0),P.value?(m(),o(u,{key:2},[a(`section`,M,[a(`div`,Se,[i[8]||=a(`h2`,null,[a(`span`,{class:`section-index`},`02`),s(`双端对照`)],-1),a(`span`,Ce,`更新于 `+r(at.value),1)]),a(`table`,we,[i[9]||=a(`thead`,null,[a(`tr`,null,[a(`th`,null,`指标`),a(`th`,null,`Android`),a(`th`,null,`HarmonyOS`)])],-1),a(`tbody`,null,[(m(!0),o(u,null,p(ct.value,e=>(m(),o(`tr`,{key:e.label},[a(`td`,Te,r(e.label),1),a(`td`,Ee,r(e.values[0]),1),a(`td`,De,r(e.values[1]),1)]))),128))])]),a(`div`,Oe,[(m(!0),o(u,null,p(P.value.repositories,e=>(m(),o(`div`,{key:e.id,class:`meta-item`},[a(`small`,null,r(e.label),1),a(`span`,ke,r(e.path)+` · rev `+r(e.revision||l(`unknown`)),1)]))),128))])]),(m(!0),o(u,null,p(U.value,(e,n)=>(m(),o(`section`,{key:e.key,class:`panel side-panel`},[a(`div`,Ae,[a(`h2`,null,[a(`span`,je,r(String(n+3).padStart(2,`0`)),1),s(r(W(e.key))+` 代码规模`,1)]),a(`span`,Me,r(ot(e)),1)]),a(`div`,Ne,[a(`div`,null,[a(`strong`,null,r(e.code.total_files),1),i[10]||=a(`small`,null,`总文件`,-1)]),a(`div`,null,[a(`strong`,null,r(e.code.total_lines),1),i[11]||=a(`small`,null,`总行数`,-1)]),a(`div`,null,[a(`strong`,null,r(e.module_count),1),i[12]||=a(`small`,null,`模块`,-1)]),a(`div`,null,[a(`strong`,null,r(e.third_party_dependency_count),1),i[13]||=a(`small`,null,`三方依赖`,-1)]),a(`div`,null,[a(`strong`,null,r(e.native_library_count),1),i[14]||=a(`small`,null,`原生库`,-1)])]),a(`div`,Pe,[(m(!0),o(u,null,p(e.modules,e=>(m(),o(`span`,{key:e.name,class:`tag module-tag`},r(e.name)+` · `+r(e.kind),1))),128))]),e.code.by_language.length?(m(),o(u,{key:0},[i[15]||=a(`small`,{class:`block-label`},`按语言`,-1),a(`div`,Fe,[(m(!0),o(u,null,p(e.code.by_language,n=>(m(),o(`div`,{key:n.language,class:`lang-row`},[a(`span`,Ie,r(n.language),1),a(`span`,Le,r(n.files)+` 文件`,1),a(`span`,Re,r(n.lines)+` 行`,1),a(`div`,ze,[a(`i`,{style:t({width:st(e,n.lines)})},null,4)])]))),128))])],64)):d(``,!0),e.code.other_extensions.length?(m(),o(u,{key:1},[i[16]||=a(`small`,{class:`block-label`},`其他扩展名(未映射到核心语言桶)`,-1),a(`div`,Be,[(m(!0),o(u,null,p(e.code.other_extensions,e=>(m(),o(`span`,{key:e.extension,class:`tag ext-tag`},r(e.extension||`(无扩展名)`)+` · `+r(e.files)+` 文件 / `+r(e.lines)+` 行 `,1))),128))])],64)):d(``,!0),e.third_party_dependencies.length?(m(),o(`details`,{key:2,class:`dep-group`,open:e.key===`android`},[a(`summary`,null,[i[17]||=a(`span`,{class:`dep-group-label`},`三方依赖`,-1),a(`span`,He,r(e.third_party_dependency_count),1)]),a(`div`,Ue,[(m(!0),o(u,null,p(e.third_party_dependencies,e=>(m(),o(`details`,{key:e.name,class:`dep-item`},[a(`summary`,null,[a(`code`,null,r(e.name),1),i[18]||=s(),a(`span`,We,r(e.version),1)]),a(`div`,Ge,[(m(!0),o(u,null,p(e.declarations,(e,t)=>(m(),o(`div`,{key:t,class:`dep-decl`},[s(r(e.path),1),e.line_start?(m(),o(u,{key:0},[s(`:`+r(e.line_start),1)],64)):d(``,!0),e.scope?(m(),o(`span`,Ke,r(e.scope),1)):d(``,!0)]))),128))])]))),128))])],8,Ve)):d(``,!0),e.oversized_files.length?(m(),o(u,{key:3},[i[20]||=a(`small`,{class:`block-label`},`超大文件`,-1),a(`div`,qe,[(m(!0),o(u,null,p(e.oversized_files,e=>(m(),o(`div`,{key:e.path,class:`oversized-item`},[a(`code`,null,r(e.path),1),i[19]||=s(),a(`span`,Je,r(e.lines)+` 行`,1)]))),128))])],64)):(m(),o(`small`,Ye,`无超大文件(阈值 `+r(P.value.thresholds.oversized_file_lines)+` 行)`,1))]))),128)),a(`section`,Xe,[a(`div`,Ze,[a(`h2`,null,[a(`span`,Qe,r(String(U.value.length+3).padStart(2,`0`)),1),i[21]||=s(`注意事项`,-1)]),P.value.notes.length?(m(),o(`span`,$e,r(P.value.notes.length)+` 项`,1)):d(``,!0)]),P.value.notes.length?(m(),o(`ul`,et,[(m(!0),o(u,null,p(P.value.notes,(e,t)=>(m(),o(`li`,{key:t},r(e),1))),128))])):(m(),o(`div`,tt,`无注意事项`))])],64)):d(``,!0)],64)):(m(),o(`section`,ce,[i[0]||=a(`span`,{class:`glyph`},`∑`,-1),i[1]||=a(`strong`,null,`等待数据`,-1),a(`small`,null,`正在读取 `+r(l(f))+`…(尚未生成代码静态分析报告时此页为空)`,1)]))],64))}}),[[`__scopeId`,`data-v-a06cb940`]]);export{N as default};
|