Skip to content

Conversation

@szelemeh
Copy link
Contributor

Short description

This PR refactors add-projects and update-projects tools to use the centralized mapProject helper function from tool-helpers.js, ensuring consistent project mapping across the codebase.

Changes

  • Refactored project mapping: Replaced inline mapping logic in add-projects.ts and update-projects.ts with the shared mapProject helper
  • Added schema validation tests: Comprehensive tests ensuring structured output strictly matches ProjectSchema with no extra API properties leaking through
  • Fixed import paths: Added missing .js extensions to module imports in test files

Why

The inline mapping logic was duplicated and could drift out of sync. Using the centralized mapProject helper:

  • Ensures consistency across all project-related tools
  • Makes it easier to update the mapping logic in one place
  • Prevents extra API properties from leaking into structured output

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (README, etc.) - N/A, no API changes
  • New tools added to getMcpServer AND exported in src/index.ts - N/A, refactoring only

- Replace inline project mapping logic with centralized mapProject helper
- Add comprehensive output schema validation tests
- Ensure structured output strictly matches ProjectSchema (no extra API properties)
- Fix module import paths in test files (add .js extension)
@scottlovegrove scottlovegrove merged commit ddb1f8e into Doist:main Dec 1, 2025
2 checks passed
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.

2 participants