项目文件夹

文件
caorushizi 28e2c58366 fix(node-service): fail fast when the preferred port is already bound
If a stray MediaGo instance (typically the installed Desktop build
running in the background from the Start menu) already holds the
preferred port, a freshly-spawned child fails to bind and exits
immediately — but `waitForHealthy()` happily answers green because
the *other* instance's `/healthy` responds on the same port.
ServiceRunner then considers the service "started" and every
subsequent request silently lands on the wrong process. In practice
this surfaced as dev mode talking to the installed Go Core and
reporting a stale gopeed binary path, even though the dev build had
already been rebuilt with aria2c.

Pre-check: before spawning, open and close a throwaway TCP listener
on `<bindHost>:<preferredPort>`. If the bind fails, throw a
human-readable error instead of proceeding. The tiny check-vs-bind
race window is acceptable for catching the real-world "long-running
stray instance" case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 17:10:30 +08:00
..
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00
2026-04-02 20:34:37 +08:00

tsdown-starter

A starter for creating a TypeScript package.

Development

  • Install dependencies:
npm install
  • Run the unit tests:
npm run test
  • Build the library:
npm run build