refactor: migrate build system to tsdown and dist output directory#136
Conversation
…tions - Changed build output from `build/` to `dist/` across various files, including Dockerfile, package.json, and integration tests. - Updated entry points and scripts to reflect the new output structure. - Removed obsolete CommonJS configuration and introduced `tsdown` for building. - Added logo asset and updated server configuration to include versioning and logo data. - Adjusted test fixtures to align with the new module paths.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR migrates the MCP server build system from separate TypeScript configurations outputting to ChangesBuild System Migration to tsdown with dist Output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mcp-server/src/server.ts`:
- Around line 47-62: The file dereferences build-injected globals
__LOGO_BASE64__ and __VERSION__ directly (used to set logoBase64 and version for
the McpServer) which throws ReferenceError in test environments; guard these by
checking typeof __LOGO_BASE64__ and typeof __VERSION__ and provide safe
fallbacks (e.g. empty string or a default version) before constructing the
McpServer options so tests can import src/server.ts without CI failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9096d716-96c3-484b-bd65-dfd4a82e5b1d
⛔ Files ignored due to path filters (2)
mcp-server/assets/logo.pngis excluded by!**/*.pngmcp-server/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (17)
.github/workflows/dependabot-review.ymlCONTRIBUTE.mdDockerfilemcp-server/.gitignoremcp-server/package.jsonmcp-server/scripts/sync-readme-tools.mjsmcp-server/scripts/write-cjs-package-json.mjsmcp-server/src/cli-bin.integration.test.tsmcp-server/src/package-environments.integration.test.tsmcp-server/src/package-published-esm.integration.test.tsmcp-server/src/server.tsmcp-server/test/fixtures/consumer-cjs-dynamic-import.cjsmcp-server/test/fixtures/consumer-cjs.cjsmcp-server/test/fixtures/consumer-esm.mjsmcp-server/tsconfig.cjs.jsonmcp-server/tsdown.config.tsmcp-server/vitest.config.ts
💤 Files with no reviewable changes (2)
- mcp-server/scripts/write-cjs-package-json.mjs
- mcp-server/tsconfig.cjs.json
The tsdown build injects these globals via `define`, but Vitest runs source directly and was missing them, causing server.test.ts to fail. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
tsc+write-cjs-package-json.mjsbuild pipeline withtsdown, outputting todist/instead ofbuild/dist/pathsrelease/*branches in addition tomainChanges breakdown
Build tooling
tsdown.config.tsas the new bundler config producingdist/api.mjs,dist/api.cjs, anddist/index.mjstsconfig.cjs.jsonandscripts/write-cjs-package-json.mjs(no longer needed)rimrafdev dependency withtsdownPackage configuration (
package.json)bin,main,module,types,exportsto point atdist/build,clean,prepublishOnlyscripts to usetsdownauditproduction dependencyDockerfile
tsdown.config.ts+assets/instead of old scriptsdist/andassets/; entry point changed todist/index.mjsnode:24-alpineServer (
src/server.ts)versionfrompackage.jsonat build timeassets/logo.pngserverInfowith version and logo to the MCP server constructorTests & fixtures
dist/pathsconsumer-cjs.cjs,consumer-cjs-dynamic-import.cjs,consumer-esm.mjs) updated import pathsCI & docs
dependabot-review.ymlupdated boot-check pathCONTRIBUTE.mdupdated local testing instructions.release-it.jsonnow allowsrelease/*branchesReview hints
tsdown.config.tsandpackage.jsonto understand the new build shapeexportsmap covers all consumption patterns (ESM, CJS require, CJS dynamic import)server.tschanges are mostly additive (version + logo injection)Made with Cursor
Summary by CodeRabbit