Conversation
- Added section for using the package as an npm module in custom MCP services. - Included minimal TypeScript example for integration. - Updated Node.js version requirement to 20+. - Documented build artifacts and TypeScript declaration files. build: Improve build script and TypeScript configuration - Added error handling and cleanup in build.sh. - Configured TypeScript to generate declaration files and bundled them. - Created rollup configuration for bundling TypeScript declarations. refactor: Update package.json for module exports and types - Set main, module, and types fields to point to built files. - Added exports field for better module resolution. refactor: Implement tools registration for MCP server - Created tools.ts for registering MCP tools. - Refactored server.ts to use the new tools registration. - Added detailed documentation for the parse_stack tool. fix: Enhance parser validation and error handling - Improved type validation for raw tokens from WebAssembly. - Added type guards and refined error messages in the parser. chore: Remove unused guide.xml file and update tsconfig - Deleted guide.xml as it was no longer needed. - Updated tsconfig to include types directory for better type resolution. test: Add TypeScript declaration file for source_map_parser_node - Created source_map_parser_node.d.ts for better type support in the project. style: Update Vite configuration for library entry points - Modified Vite config to specify multiple entry points for better modularity.
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the source-map-parser-mcp project by enabling it to be used as an npm module in custom MCP services while also improving the overall build system and code quality. The changes include adding library-style exports, documentation updates, build system improvements, and enhanced type safety.
- Added support for using the package as an npm module with TypeScript types and ES/CJS exports
- Improved build system with TypeScript declaration bundling and better error handling
- Refactored MCP tool registration into a separate reusable module
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.mjs | Updated to build multiple entry points (index.ts and main.ts) |
| tsconfig.build.json | New TypeScript config for generating declaration files |
| src/tools.ts | New module that extracts and encapsulates MCP tool registration |
| src/server.ts | Refactored to use the new tools module and improved Chinese documentation |
| src/parser.ts | Enhanced type validation and error handling with proper type guards |
| src/index.ts | New library entry point exporting public API |
| src/cachingFetch.ts | Added buffer to ArrayBuffer conversion utility |
| rollup.config.dts.mjs | New Rollup config for bundling TypeScript declarations |
| package.json | Updated package.json with proper module exports and types |
| build.sh | Enhanced build script with error handling and declaration bundling |
| README files | Added documentation for npm module usage and updated Node.js version |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 48.15% 51.13% +2.97%
==========================================
Files 5 6 +1
Lines 353 397 +44
Branches 52 63 +11
==========================================
+ Hits 170 203 +33
- Misses 183 193 +10
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
build: Improve build script and TypeScript configuration
refactor: Update package.json for module exports and types
refactor: Implement tools registration for MCP server
fix: Enhance parser validation and error handling
chore: Remove unused guide.xml file and update tsconfig
test: Add TypeScript declaration file for source_map_parser_node
style: Update Vite configuration for library entry points