@wwkit/shared 1.0.17 → 1.0.18

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/shell.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwkit/shared",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "author": "bluesliu <langcai163@163.com>",
5
5
  "description": "Shared utilities for @wwkit packages — config loader, platform detection",
6
6
  "type": "module",
package/src/shell.js CHANGED
@@ -303,12 +303,15 @@ const marker = `# >>> wwkit ${name} >>>`
303
303
 
304
304
  /**
305
305
  * 按优先级检测可用的网络探测工具
306
- * 顺序: ping > curl > wget
306
+ * 顺序: curl > wget > ping
307
307
  *
308
- * @returns {string|null} 'ping' | 'curl' | 'wget' | null
308
+ * curl 优先:支持代理(-x)、输出 locale 无关(HTTP 状态码)、检查 HTTP 层可达性。
309
+ * ping 最后:ICMP 不支持代理、输出依赖系统语言(中文 Windows 乱码)、仅检查网络层。
310
+ *
311
+ * @returns {string|null} 'curl' | 'wget' | 'ping' | null
309
312
  */
310
313
  getNetProbeTool() {
311
- for (const cmd of ['ping', 'curl', 'wget']) {
314
+ for (const cmd of ['curl', 'wget', 'ping']) {
312
315
  if (this.isCommandAvailable(cmd)) return cmd
313
316
  }
314
317
  return null