@syengup/friday-channel-next 0.0.16 → 0.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 (3) hide show
  1. package/install.js +8 -2
  2. package/install.sh +10 -7
  3. package/package.json +1 -1
package/install.js CHANGED
@@ -59,10 +59,15 @@ if (!PKG) {
59
59
  process.exit(1);
60
60
  }
61
61
 
62
- // Auto-detect best registry (if npmjs.org is unreachable, use npmmirror)
62
+ // Auto-detect best registry (measure latency; fall back to npmmirror if slow/unreachable)
63
63
  let registryFlag = "";
64
64
  try {
65
- execSync('curl -s --connect-timeout 3 --max-time 5 https://registry.npmjs.org/ >/dev/null 2>&1');
65
+ const start = Date.now();
66
+ execSync('curl -s -o /dev/null --connect-timeout 2 --max-time 4 https://registry.npmjs.org/', { stdio: "pipe", timeout: 6000 });
67
+ if (Date.now() - start > 1500) {
68
+ warn("Default registry slow, using https://registry.npmmirror.com");
69
+ registryFlag = "--registry=https://registry.npmmirror.com";
70
+ }
66
71
  } catch {
67
72
  warn("Default registry unreachable, using https://registry.npmmirror.com");
68
73
  registryFlag = "--registry=https://registry.npmmirror.com";
@@ -248,6 +253,7 @@ if (verified) {
248
253
  warn("Installation complete, but gateway verification failed.");
249
254
  warn("Check 'openclaw gateway status' and restart the gateway if needed.");
250
255
  warn("Also ensure OpenClaw is updated to 2026.5.7 or above: openclaw update");
256
+ warn("同时请确认 OpenClaw 已升级至 2026.5.7 或以上版本:openclaw update");
251
257
  }
252
258
  log("");
253
259
 
package/install.sh CHANGED
@@ -39,13 +39,15 @@ else
39
39
  exit 1
40
40
  fi
41
41
 
42
- # Auto-detect best registry (if npmjs.org is unreachable, use npmmirror)
43
- if curl -s --connect-timeout 3 https://registry.npmjs.org/ >/dev/null 2>&1; then
44
- REGISTRY=""
45
- else
46
- warn "Default registry unreachable, using https://registry.npmmirror.com"
47
- REGISTRY="--registry=https://registry.npmmirror.com"
48
- fi
42
+ # Auto-detect best registry (measure latency; fall back to npmmirror if slow/unreachable)
43
+ TIME=$(curl -s -o /dev/null -w '%{time_total}' --connect-timeout 2 --max-time 4 https://registry.npmjs.org/ 2>/dev/null || echo "999")
44
+ case "$TIME" in
45
+ 0.*) ;; # under 1s — fast enough
46
+ *)
47
+ warn "Default registry slow/unreachable, using https://registry.npmmirror.com"
48
+ REGISTRY="--registry=https://registry.npmmirror.com"
49
+ ;;
50
+ esac
49
51
 
50
52
  if [ ! -f "$OPENCLAW_CONFIG" ]; then
51
53
  err "OpenClaw config not found at $OPENCLAW_CONFIG"
@@ -291,5 +293,6 @@ else
291
293
  warn "Installation complete, but gateway verification failed."
292
294
  warn "Check 'openclaw gateway status' and restart the gateway if needed."
293
295
  warn "Also ensure OpenClaw is updated to 2026.5.7 or above: openclaw update"
296
+ warn "同时请确认 OpenClaw 已升级至 2026.5.7 或以上版本:openclaw update"
294
297
  fi
295
298
  log "--------------------------------------------------"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syengup/friday-channel-next",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "OpenClaw Friday Next Apple channel plugin",
5
5
  "type": "module",
6
6
  "files": [