@deveco-test/deveco-code 0.1.0-TD.23.5 → 0.1.0-TD.24.test

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 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.23.5",
9
+ "version": "0.1.0-TD.24.test",
10
10
  "license": "MIT",
11
11
  "os": [
12
12
  "darwin",
@@ -25,8 +25,9 @@
25
25
  "assets/**/*"
26
26
  ],
27
27
  "optionalDependencies": {
28
- "@deveco-test/deveco-code-windows-x64": "0.1.0-TD.23.5",
29
- "@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.23.5",
30
- "@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.23.5"
28
+ "@deveco-test/deveco-code-windows-x64": "0.1.0-TD.24.test",
29
+ "@deveco-test/deveco-code-darwin-x64": "0.1.0-TD.24.test",
30
+ "@deveco-test/deveco-code-darwin-arm64": "0.1.0-TD.24.test",
31
+ "@deveco-test/deveco-code": "0.1.0-TD.24.test"
31
32
  }
32
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
  }
@@ -146,6 +149,10 @@ function copyVendor(packageDir) {
146
149
  if (fs.existsSync(vendorSrc)) {
147
150
  copyDir(vendorSrc, vendorDst)
148
151
  restoreDevecoCliDeps(path.join(vendorDst, "deveco-cli"))
152
+ restoreDevecoCliDeps(path.join(packageDir, "vendor", "deveco-cli"))
153
+ // Windows packs often drop Unix +x; force it back on macOS/Linux install.
154
+ ensureVendorExecutables(vendorDst)
155
+ ensureVendorExecutables(path.join(packageDir, "vendor"))
149
156
  }
150
157
  }
151
158
 
@@ -164,6 +171,38 @@ function restoreDevecoCliDeps(cliDir) {
164
171
  fs.unlinkSync(tarPath)
165
172
  }
166
173
 
174
+ /** Restore execute bits lost when packages are built/published from Windows. */
175
+ function ensureVendorExecutables(vendorRoot) {
176
+ if (process.platform === "win32" || !fs.existsSync(vendorRoot)) return
177
+
178
+ const stack = [vendorRoot]
179
+ while (stack.length > 0) {
180
+ const dir = stack.pop()
181
+ let entries
182
+ try {
183
+ entries = fs.readdirSync(dir, { withFileTypes: true })
184
+ } catch {
185
+ continue
186
+ }
187
+ for (const entry of entries) {
188
+ const full = path.join(dir, entry.name)
189
+ if (entry.isDirectory()) {
190
+ stack.push(full)
191
+ continue
192
+ }
193
+ if (!entry.isFile()) continue
194
+ // Top-level vendor/ripgrep/rg and nested @vscode/ripgrep*/**/rg
195
+ if (entry.name === "rg") {
196
+ try {
197
+ fs.chmodSync(full, 0o755)
198
+ } catch {
199
+ // Best-effort; ignore files we cannot chmod.
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
167
206
  function installPackage(name) {
168
207
  const version = packageJson.optionalDependencies?.[name]
169
208
  if (!version) return