@harmonyos-arkts/d2h 0.1.10 → 0.1.11
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 +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,12 +37,12 @@ android-to-hmos-migration/
|
|
|
37
37
|
D2H 安装器按 `skills/managing-d2h-toolchain/toolchain.json` 中联测的版本安装 AppGraph、droid2hmos 和 Agent/Skill,原有行为保持不变。[`managing-d2h-toolchain`](skills/managing-d2h-toolchain/SKILL.md) 现在也能独立检查、按需安装同一工具组合,不依赖 `d2h` 命令:在 Skill 目录运行 `node scripts/manage-toolchain.mjs check`,未通过时运行 `node scripts/manage-toolchain.mjs install`。以下命令可使用 D2H 安装器;独立 Skill 脚本随本版本提供:
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
41
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
42
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
43
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
44
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
45
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
40
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 install --agent opencode
|
|
41
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 install --agent vscode
|
|
42
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 install --agent vscode --remote
|
|
43
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 doctor --agent vscode
|
|
44
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 upgrade --check
|
|
45
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --check-env --output-dir ./environment-report
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
VS Code 目标是 Huawei HarmonyOS Dev Assistant 扩展;安装器复制 Agent/Skill、注册 `d2h` 并设置读写编辑权限,同时将模式名显示为“安卓转鸿蒙”。扩展使用已解包的 OpenCode 缓存运行,安装器会同步更新当前活动缓存并备份改动;请先启动扩展一次以生成缓存,安装后在 VS Code 中执行“Developer: Reload Window”使对话后端重新读取配置。`doctor --agent vscode` 会检查扩展文件和活动缓存。详细用法见 [环境检查说明](docs/environment-check.md)。受管 CLI 的全局 npm link 默认保留;显式运行 `d2h install --force --agent vscode` 或 Skill 的 `node scripts/manage-toolchain.mjs install --force` 才会替换全局链接,不会修改链接指向的源码目录。
|
|
@@ -57,27 +57,27 @@ Claude Code:
|
|
|
57
57
|
OpenCode(Node.js 22.5–24.x,支持 Windows/macOS/Linux,无需克隆仓库或安装 Shell):
|
|
58
58
|
|
|
59
59
|
```sh
|
|
60
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
60
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
安装器把 npm 包内的 `skills/` 和 `agents/` 复制到当前用户的 OpenCode 全局配置目录。更新已有安装时使用:
|
|
64
64
|
|
|
65
65
|
```sh
|
|
66
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
66
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --force
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
先预览或指定目录:
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
73
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
72
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --dry-run
|
|
73
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --config-dir /path/to/opencode
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
默认目标为 OpenCode,也可显式使用 `--agent opencode`。安装到 DevEco Code:
|
|
77
77
|
|
|
78
78
|
```sh
|
|
79
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
80
|
-
npx --yes @harmonyos-arkts/d2h@0.1.
|
|
79
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --agent deveco
|
|
80
|
+
npx --yes @harmonyos-arkts/d2h@0.1.11 --agent deveco --force
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
DevEco Code 默认安装到 `~/.config/deveco`(Windows 为 `%USERPROFILE%\.config\deveco`),目录优先级为 `--config-dir` → `DEVECO_CONFIG_DIR` → `$XDG_CONFIG_HOME/deveco` → `~/.config/deveco`。OpenCode 使用 `OPENCODE_CONFIG_DIR`,两者互不混用。安装时会在目标的 `opencode.json` 插件数组中加入仅用于 `d2h` 的 `opencode-metrics-plugin-lite`;加 `--remote` 则使用 `opencode-metrics-plugin`。重复安装会切换版本,不会同时启用两者。安装完成后重启对应应用;已有其他配置保留。`--config-dir` 与 `--agent` 的参数顺序不影响结果。
|
|
@@ -92,7 +92,7 @@ sh ./install-opencode.sh
|
|
|
92
92
|
|
|
93
93
|
该脚本把 `skills/` 和 `agents/` 安装到当前用户的 OpenCode 全局配置目录,不读取或改写 `opencode.json`。更新已有安装时使用 `--force`;本地开发需要让全局安装实时跟随仓库时使用 `--link --force`。可通过 `--config-dir` 和 `--source-dir` 适配自定义目录,先用 `--dry-run` 检查操作。完整参数见 `sh ./install-opencode.sh --help`。
|
|
94
94
|
|
|
95
|
-
npm 安装器支持同样的参数,完整说明见 `npx --yes @harmonyos-arkts/d2h@0.1.
|
|
95
|
+
npm 安装器支持同样的参数,完整说明见 `npx --yes @harmonyos-arkts/d2h@0.1.11 --help`。本地开发可使用 `npm run build && node dist/bin/install-opencode.js --source-dir /path/to/repository --link --force`。Windows 下 Agent 文件符号链接需要开发者模式或管理员权限;默认复制模式不需要。不要将 `npx` 缓存作为长期链接来源,缓存清理后链接可能失效。
|
|
96
96
|
|
|
97
97
|
维护者发布:安装开发依赖后运行 `npm run build`,将 TypeScript 源码编译到 `dist/`;`npm run check && npm test` 检查类型并测试编译后的 CLI,然后 `npm publish`。npm 包使用 `dist/bin/install-opencode.js` 作为入口,包含编译后的运行代码、Agent、完整 Skill 资源树及 schema,不包含 TypeScript 源码、研发文档和测试;发布时不会自动修改用户配置,只有显式执行 `npx` 安装器才会安装。
|
|
98
98
|
|