Migrate miro-sync to render plugin system#99
Conversation
- Move src/integrations/miro/ to src/plugins/miro/ as built-in sctx-miro plugin - Remove deprecated buildDepthMap function from layout.ts - Move miroBoardId/miroFrameId from SpaceConfig to miro plugin config - Add PLUGIN_PREFIX export to api.ts - Add callbacks.persistConfig to PluginContext for plugin config persistence - Combine updatePluginConfig into updateSpaceField with optional plugin param - Update convenience commands to call render hooks instead of plugins directly - Enforce plugin boundary: plugins only import types from ../../api Closes #65, closes #68
|
Claude finished @mindsocket's task in 3m 58s —— View job Code Review ✅
Overall Assessment ✅This is a well-executed migration that successfully moves the miro-sync functionality into the render plugin system. The architecture is clean, tests are comprehensive, and documentation is thorough. Recommended with minor suggestions. Architecture & Design ✅Excellent refactoring:
Removed technical debt:
Code Quality 🟡1. Error Handling with
|
|
Claude finished @mindsocket's task in 1m 58s —— View job Code Review ✅
Overall Assessment ✅Excellent work! This PR successfully migrates the miro-sync functionality into the render plugin system with clean architecture and comprehensive testing. The PR feedback commit (74d1e3c) addressed the main concern from the initial review by replacing What Changed Since Initial ReviewThe PR feedback commit made two key improvements: 1. Fixed Error Handling ✅ - src/plugins/miro/sync.ts:14-29All // Before:
if (!token) {
console.error('MIRO_TOKEN environment variable is required');
process.exit(1);
}
// After:
if (!token) throw new Error('MIRO_TOKEN environment variable is required');This makes the function:
The error messages are also clearer and more actionable. 2. Code Style Cleanup ✅ - plugin/.claude-plugin/plugin.jsonMinor formatting improvement (array condensing) - no functional change. Architecture & Design ✅Excellent refactoring:
Code Quality ✅All previous concerns have been addressed: ✅ Error Handling - FIXED
✅ Type SafetyThe const options = {
newFrame: data?.newFrame as string | undefined,
dryRun: data?.dryRun as boolean | undefined,
verbose: data?.verbose as boolean | undefined,
};The data comes from CLI flags which are already validated by the command layer. This is a reasonable trade-off for simplicity. ✅ Plugin Name NormalizationThe logic in src/config.ts:215-220 and src/plugins/loader.ts:119 is flexible and handles both prefixed and non-prefixed config keys. This is user-friendly and well-documented in README.md. Test Coverage ✅Comprehensive:
Documentation ✅Excellent:
The migration path is clear: // Old (removed):
{ "miroBoardId": "...", "miroFrameId": "..." }
// New:
{ "plugins": { "miro": { "boardId": "...", "frameId": "..." } } }Breaking Changes
|
Summary
miro-synccommand to the render plugin hook system assctx-mirobuilt-in pluginsrc/integrations/miro/tosrc/plugins/miro/buildDepthMapfunctionmiroBoardId/miroFrameIdfrom coreSpaceConfigto miro plugin configcallbacks.persistConfigtoPluginContextfor plugin config persistenceupdatePluginConfigintoupdateSpaceFieldwith optionalpluginparam../../apiBreaking changes
miroBoardId/miroFrameIdremoved from space config. Migrate tospace.plugins.miro.boardId/frameId../../api(affects external plugins)Test plan
bun run src/index.ts miro-sync <space>still worksCloses #65
Closes #68