super-productivity/packages/plugin-dev/sync-md
Johannes Millan c9723cb6c9 feat(plugins): enhance plugin system with improved iframe communication and sync-md updates
- Add triggerSync method to plugin bridge for sync operations
- Enhance plugin iframe utility with better message handling and hook support
- Update sync-md plugin with improved error handling and sync state management
- Add plugin context validation for sync operations
- Update plugin API types with proper exports
- Improve bidirectional sync in sync-md plugin
- Add translation constant for sync context validation
2025-06-24 21:04:38 +02:00
..
scripts feat(plugins): enhance plugin system with improved iframe communication and sync-md updates 2025-06-24 21:04:38 +02:00
src feat(plugins): enhance plugin system with improved iframe communication and sync-md updates 2025-06-24 21:04:38 +02:00
IMPLEMENTATION.md docs(sync-md): add comprehensive implementation documentation 2025-06-24 21:04:38 +02:00
index.html feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
manifest.json feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
package-lock.json fix(sync-md): correct markdown parsing for asterisk format tasks 2025-06-24 21:04:38 +02:00
package.json feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
plugin.js feat(plugins): enhance plugin system with improved iframe communication and sync-md updates 2025-06-24 21:04:38 +02:00
quick-test.ts fix(sync-md): correct markdown parsing for asterisk format tasks 2025-06-24 21:04:38 +02:00
README.md feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
sync-example.ts feat(sync-md): integrate Solid.js version with bidirectional sync 2025-06-24 21:04:38 +02:00
sync-md-icon.svg feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
test-sync-logic.ts feat(sync-md): integrate Solid.js version with bidirectional sync 2025-06-24 21:04:38 +02:00
tsconfig.json feat(sync-md): convert plugin to Solid.js with bidirectional sync 2025-06-24 21:04:38 +02:00
vite.config.ts feat(plugins): enhance plugin system with improved iframe communication and sync-md updates 2025-06-24 21:04:38 +02:00

Sync.md Plugin (Solid.js Version)

A SuperProductivity plugin that syncs markdown files with project tasks, now built with Solid.js for better performance and maintainability.

Features

  • Bidirectional Sync: Sync changes from markdown to project and vice versa
  • One-way Sync Options: Choose to sync only from file to project or project to file
  • Conflict Detection: Detects when both file and project have changed
  • Real-time Monitoring: Watches markdown files for changes
  • Modern UI: Built with Solid.js for a responsive, reactive interface

Sync Logic

The plugin uses a sophisticated bidirectional sync algorithm that:

  1. Tracks Changes: Maintains checksums of tasks and file content to detect changes
  2. Detects Conflicts: Identifies when both sides have modified the same task
  3. Preserves Hierarchy: Maintains task/subtask relationships during sync
  4. Handles Deletions: Marks tasks for deletion rather than removing them

Development

# Install dependencies
npm install

# Development server
npm run dev

# Build for production
npm run build

# Package as plugin
npm run package

Testing Sync Logic

# Run sync logic tests
npx tsx test-sync-logic.ts

Architecture

  • src/App.tsx - Main Solid.js application component
  • src/syncLogic.ts - Core bidirectional sync algorithm
  • plugin.js - Plugin entry point that integrates with SuperProductivity
  • index.html - HTML template for the plugin UI

Sync Directions

  • Bidirectional: Changes sync both ways with conflict detection
  • File → Project: Markdown file is the source of truth
  • Project → File: SuperProductivity project is the source of truth