Skip to content

fix(release): build @book.dev/mcp before the desktop sidecar so bun can resolve it#152

Merged
eliotlim merged 1 commit into
mainfrom
fix/release-sidecar-mcp-build
Jul 13, 2026
Merged

fix(release): build @book.dev/mcp before the desktop sidecar so bun can resolve it#152
eliotlim merged 1 commit into
mainfrom
fix/release-sidecar-mcp-build

Conversation

@eliotlim

Copy link
Copy Markdown
Owner

Problem

The v2.1.0 desktop Release fails on all three platforms (macOS/Windows/Linux) at "Build Tauri bundles":

error: Could not resolve: "@book.dev/mcp". Maybe you need to "bun install"?
    at packages/server/src/mcpHttp.ts:41

during bun build packages/server/src/bin.bun.ts --compile (the sidecar compile).

Root cause

AGENT-5 (#150) made packages/server depend on @book.dev/mcp (app.tsmcpHttp.ts imports createOpenBookMcpServer). Bun --compile resolves that workspace package via its main: dist/index.js. Root package.json build:libs was updated to build mcp in order (sdk → ui → mcp → server), but the Tauri beforeBuildCommand in tauri.conf.json still hand-listed only sdk → ui → server:sidecar, so mcp was never built before the compile.

@book.dev/server is only a devDependency of @book.dev/mcp and nothing in packages/mcp/src imports it, so mcp builds cleanly before the sidecar (the cycle is test-only).

Fix

  1. tauri.conf.json beforeBuildCommand: build @book.dev/mcp before build:sidecar (parity with build:libs).
  2. packages/server/scripts/build-sidecar.mjs: on-demand build @book.dev/mcp if its dist/index.js is missing (mirrors the existing viewer-bundle on-demand build) so a standalone build:sidecar is self-sufficient.

Verification (reproduced the real bun --compile — mocked tests hid the original break)

  • Reproduced the exact Could not resolve "@book.dev/mcp" failure with packages/mcp/dist absent.
  • After the fix (mcp/dist absent, exercising change Load workspace from filesystem #2): pnpm --filter @book.dev/server run build:sidecar succeeds — logs @book.dev/mcp dist missing — building it…, builds mcp, compiles the sidecar → openbook-server-aarch64-apple-darwin, 83.8 MB, Mach-O 64-bit executable arm64.
  • rm -rf packages/mcp/dist then re-run: on-demand rebuild works, binary re-produced.
  • Binary --help runs (exit 0).

Board: AGENT-8 (under the Agent epic).

🤖 Generated with Claude Code

…an resolve it

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFk2T9k3p7ghCjdzMfkA5w
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app.book.pub Ready Ready Preview, Comment Jul 13, 2026 3:15pm

Request Review

@eliotlim eliotlim merged commit ac71130 into main Jul 13, 2026
10 checks passed
@eliotlim eliotlim deleted the fix/release-sidecar-mcp-build branch July 13, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant