super-productivity/packages/plugin-dev/sync-md
Johannes Millan 33102f6a3e fix(sync-md): fix window focus immediate sync trigger
Store pendingMdToSpSync config in local variable before calling handleMdToSpSync
to prevent race conditions when window gains focus during debounce period.
2025-07-10 16:27:35 +02:00
..
docs feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00
scripts feat(syncMd): update build configuration and archive old implementation 2025-07-10 14:57:08 +02:00
src fix(sync-md): fix window focus immediate sync trigger 2025-07-10 16:27:35 +02:00
.eslintrc.json feat(syncMd): add comprehensive test suite and development configuration 2025-07-10 14:56:19 +02:00
.gitignore feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00
.prettierrc.json feat(syncMd): add comprehensive test suite and development configuration 2025-07-10 14:56:19 +02:00
jest.config.cjs feat(syncMd): add comprehensive test suite and development configuration 2025-07-10 14:56:19 +02:00
package-lock.json feat(syncMd): update build configuration and archive old implementation 2025-07-10 14:57:08 +02:00
package.json feat(syncMd): update build configuration and archive old implementation 2025-07-10 14:57:08 +02:00
README.md feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00
tsconfig.json feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00
vite.config.ts feat(sync-md): new approach and make it work better 2025-07-07 18:39:14 +02:00

Sync-MD Plugin v2.0.0

A SuperProductivity plugin that enables bidirectional synchronization between markdown files and project tasks.

Features

  • Bidirectional Sync: Keep markdown files and SuperProductivity tasks in sync
  • Batch API Integration: Efficient bulk operations for better performance
  • Smart Debouncing: 10-second delays prevent conflicts during active editing
  • Real-time Monitoring: File system watching with automatic sync triggers
  • Task Hierarchy: Preserves parent-child relationships in markdown
  • Modern Architecture: Built with Solid.js UI and modular TypeScript

Quick Start

# Install dependencies
npm install

# Development mode with hot reload
npm run dev:watch

# Build for production
npm run build

# Package as plugin
npm run package

Architecture

Core Components

  • src/fileWatcherBatch.ts - Main sync engine with batch API support
  • src/background.ts - Plugin lifecycle and message handling
  • src/App.tsx - Solid.js UI for configuration
  • src/utils/ - Reusable utilities (parser, debouncer, file ops)

Build System

  • build-proper.js - Main build script
  • build-plugin.js - Package as distributable ZIP
  • watch-and-build.js - Development with auto-rebuild

Configuration

{
  projectId: "project-uuid",
  filePath: "/path/to/tasks.md",
  syncDirection: "fileToProject" | "projectToFile" | "bidirectional"
}

Markdown Format

- [ ] Parent task
  - [x] <!-- sp:task-id --> Completed subtask
  - [ ] Pending subtask

Tasks are linked using HTML comments containing unique IDs.

Testing

# Run all tests
npm test

# Watch mode
npm run test:watch

# Coverage report
npm run test:coverage

Documentation

For detailed documentation, see:

Cleanup

To remove old/unnecessary files after updating:

chmod +x cleanup.sh
./cleanup.sh