Skip to content

2026-03-11 docs server bin deletion bugfix

Symptom

After publishing version 0.0.10, running npx -y -p @ray-js/robot-map-sdk@latest robot-map-docs failed with command not found.

Reproducible steps

  1. Run npm run mcp:build.
  2. Observe that bin/docs-server.js is removed.
  3. Publish package with package.json still declaring "robot-map-docs": "./bin/docs-server.js".
  4. Execute npx ... robot-map-docs from a clean environment.

Root cause

tsup.mcp.config.ts used:

  • outDir: 'bin'
  • clean: true

mcp:build therefore cleaned the entire bin/ folder and rebuilt only mcp-server, deleting docs-server.js.

Patch summary

  • Restored bin/docs-server.js.
  • Changed MCP tsup config to clean: false so mcp:build no longer wipes other bin scripts.
  • Hardened publish guard in prepublishOnly: fail fast if bin/docs-server.js is missing before publish.

Risk assessment

  • Low runtime risk.
  • Main tradeoff: with clean: false, stale MCP artifacts could remain in bin/ if filenames change in the future.

Regression checklist

  • [x] bin/docs-server.js exists after npm run mcp:build.
  • [x] npm run lint passes.
  • [x] npx tsc --noEmit passes.
  • [x] npm pack --dry-run --json includes bin/docs-server.js.

最后更新于: