@deveco-test/deveco-code 0.1.0-TD.22 → 0.1.0-TD.24
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 +0 -1
- package/package.json +5 -5
- package/postinstall.mjs +20 -0
package/README.md
CHANGED
|
@@ -241,7 +241,6 @@ DevEco Code 集成了常用 HarmonyOS 开发工具能力:
|
|
|
241
241
|
| `hdc_log` | 收集/清理设备日志/查看连接模拟器 |
|
|
242
242
|
| `verify_ui` | 执行 UI 操作验证功能是否正确 |
|
|
243
243
|
| `arkts_check` | ArkTS 静态语法检查 |
|
|
244
|
-
| `arkts_knowledge_search` | HarmonyOS 知识搜索 |
|
|
245
244
|
| `switch_cwd` | 切换构建项目路径 |
|
|
246
245
|
|
|
247
246
|
常见场景包括:从零到一创建 HarmonyOS 工程、增量开发页面、修复编译报错、真机调试。
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "node ./postinstall.mjs"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.1.0-TD.
|
|
9
|
+
"version": "0.1.0-TD.24",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"os": [
|
|
12
12
|
"darwin",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"assets/**/*"
|
|
26
26
|
],
|
|
27
27
|
"optionalDependencies": {
|
|
28
|
-
"@deveco-test/deveco-code-windows-x64": "0.1.0-TD.
|
|
29
|
-
"@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.
|
|
30
|
-
"@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.
|
|
31
|
-
"@deveco-test/deveco-code": "0.1.0-TD.
|
|
28
|
+
"@deveco-test/deveco-code-windows-x64": "0.1.0-TD.24",
|
|
29
|
+
"@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.24",
|
|
30
|
+
"@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.24",
|
|
31
|
+
"@deveco-test/deveco-code": "0.1.0-TD.24"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -136,6 +136,9 @@ function copyDir(src, dst) {
|
|
|
136
136
|
copyDir(srcPath, dstPath)
|
|
137
137
|
} else {
|
|
138
138
|
fs.copyFileSync(srcPath, dstPath)
|
|
139
|
+
if (process.platform !== "win32") {
|
|
140
|
+
fs.chmodSync(dstPath, fs.statSync(srcPath).mode)
|
|
141
|
+
}
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
}
|
|
@@ -145,7 +148,24 @@ function copyVendor(packageDir) {
|
|
|
145
148
|
const vendorDst = path.join(__dirname, "vendor")
|
|
146
149
|
if (fs.existsSync(vendorSrc)) {
|
|
147
150
|
copyDir(vendorSrc, vendorDst)
|
|
151
|
+
restoreDevecoCliDeps(path.join(vendorDst, "deveco-cli"))
|
|
152
|
+
restoreDevecoCliDeps(path.join(packageDir, "vendor", "deveco-cli"))
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function restoreDevecoCliDeps(cliDir) {
|
|
157
|
+
const tarPath = path.join(cliDir, "deps.tar.gz")
|
|
158
|
+
if (!fs.existsSync(tarPath)) return
|
|
159
|
+
const result = childProcess.spawnSync("tar", ["-xzf", tarPath, "-C", cliDir], {
|
|
160
|
+
stdio: "inherit",
|
|
161
|
+
windowsHide: true,
|
|
162
|
+
shell: true,
|
|
163
|
+
})
|
|
164
|
+
if (result.status !== 0) {
|
|
165
|
+
console.warn("Warning: failed to restore deveco-cli dependencies")
|
|
166
|
+
return
|
|
148
167
|
}
|
|
168
|
+
fs.unlinkSync(tarPath)
|
|
149
169
|
}
|
|
150
170
|
|
|
151
171
|
function installPackage(name) {
|