Release Notes
v0.5.0 - Git-like Staging Workflow & Major Improvements
π Major Features: Git-like Staging + Critical Fixes + Performance Boost
This release represents the biggest advancement since launch, introducing a revolutionary Git-like staging workflow alongside critical bug fixes, comprehensive testing, and significant performance improvements. This transforms notion-md-sync into a professional-grade tool suitable for production workflows.
π― New Git-like Commands
Check what's changed:
notion-md-sync status
# Output:
# Changes staged for sync:
# staged: docs/ready-file.md
#
# Changes not staged for sync:
# modified: docs/updated-file.md
# new file: docs/new-file.mdStage files for sync:
notion-md-sync add docs/file.md # Stage specific file
notion-md-sync add docs/ # Stage all files in directory
notion-md-sync add . # Stage all changed files
notion-md-sync add *.md # Stage with patternsUnstage files:
notion-md-sync reset docs/file.md # Unstage specific file
notion-md-sync reset . # Unstage all filesPush only staged changes:
notion-md-sync push # Push only staged files
notion-md-sync push docs/file.md # Auto-stage and push specific file
notion-md-sync push --dry-run # Preview what would be pushedπ§ Intelligent Change Detection
- Hybrid Detection: Fast timestamp checking with SHA256 hash verification for accuracy
- Performance Optimized: Only calculates hashes when timestamps suggest changes
- Reliable Tracking: Persistent
.notion-sync/directory stores file states - Auto-Update: Smart timestamp updates prevent unnecessary future hash calculations
π Enhanced Push Behavior
- Staging-First: Push now only syncs staged files (no more accidental syncs!)
- Auto-Staging: Specific file pushes automatically stage the file first
- Success Tracking: Successfully pushed files are automatically unstaged
- Partial Failure Handling: Failed pushes remain staged for retry
π Comprehensive Status Display
- Color-Coded Output: Green for staged, red for modified/new
- Clear Instructions: Helpful hints for next steps
- File Categories: Staged, modified, new, and deleted files clearly separated
- Summary Messages: Git-like guidance for common workflows
πΎ Persistent State Management
.notion-sync/Directory: Stores staging index and file tracking data- JSON Index: Human-readable staging state storage
- Automatic Cleanup: Successful syncs automatically update tracking
- Cross-Session: Staging state persists across CLI sessions
π§ Technical Improvements
- Type-Safe Staging: New
stagingpackage with proper error handling - Memory Efficient: Incremental file processing prevents memory issues
- Path Handling: Robust relative/absolute path conversion
- Error Recovery: Graceful handling of file access issues
π Workflow Examples
Basic staging workflow:
# See what's changed
notion-md-sync status
# Stage files you want to sync
notion-md-sync add docs/important.md docs/update.md
# Preview the sync
notion-md-sync push --dry-run
# Sync to Notion
notion-md-sync pushSelective staging:
# Stage only specific files
notion-md-sync add docs/chapter1.md docs/chapter2.md
# Unstage one file
notion-md-sync reset docs/chapter2.md
# Push remaining staged files
notion-md-sync pushπ Developer Experience
This brings the familiar Git workflow to Notion sync:
- Predictable: Only staged files sync, no surprises
- Controlled: Choose exactly what changes to publish
- Efficient: Skip unchanged files automatically
- Professional: Industry-standard version control patterns
β οΈ Breaking Changes
- Push behavior:
notion-md-sync pushnow only pushes staged files - New default: Staging is now the default workflow (not opt-in)
- Migration: Existing users should run
notion-md-sync add .to stage all files
π Critical Bug Fixes
Fixed: Code Blocks Empty Content
CRITICAL FIX: Code blocks were appearing in Notion but with no content inside.
What was broken:
- Fenced code blocks (
```language) showed up as empty blocks in Notion - Only the language label appeared, but no actual code content
- Affected all programming languages and code examples
What's fixed:
- π§ Rewrote Code Block Extraction: Implemented proper AST content extraction for fenced code blocks
- π» Full Content Preservation: Code blocks now sync with complete source code intact
- π― Language Detection: Enhanced language mapping (jsβjavascript, pyβpython, 70+ languages)
- β Notion Validation: Automatic language validation with fallback to "plain text"
Testing Impact: All code examples now appear correctly in Notion with proper syntax highlighting.
Fixed: Sync Performance Issues
Major performance improvements for large documents and many files.
What was improved:
- β‘ Parallel Block Deletion: Replaced sequential deletion with 5-worker concurrent processing
- π Optimized Update Process: Reduced delays and improved block handling efficiency
- π Performance Results:
- Large documents (400+ lines): 4.5 seconds (fast)
- Small documents now process without corruption
- Pull operations: 2-3 seconds consistently
Technical details:
- Implemented
bulkDeleteBlocks()with worker pools - Added proper error handling for undeletable blocks
- Optimized sequential fallback for reliability
π§ͺ Comprehensive Testing Suite
NEW: Full test coverage with CI/CD integration for bulletproof reliability.
Test Coverage Added
pkg/sync/: 27 test cases covering markdownβblocks conversion, language mappingpkg/config/: 6 test cases covering configuration loading, environment variablespkg/staging/: 5 test cases covering staging workflow, change detectionpkg/markdown/: 4 test cases covering frontmatter, file parsing
CI/CD Integration
- β Automated Testing: GitHub Actions runs full test suite on every commit
- π Multi-Platform: Tests run on Linux, macOS, and Windows
- π‘οΈ Build Validation: Binaries only created if all tests pass
- π Coverage Reports: Comprehensive test coverage tracking
Developer Benefits
- π Bug Prevention: Catch regressions before they reach users
- π Reliability: Every function tested with edge cases
- π Confidence: Tests validate all critical workflows work correctly
π Security Enhancements
Major security audit and fixes implemented.
Critical Fixes Applied
- π¨ Removed Hardcoded Credentials: Eliminated exposed API tokens from repository
- π‘οΈ Fixed Shell Injection: Secure
.envfile parsing in run scripts - π Input Validation: Enhanced path validation for file operations
- π Security Guidelines: Updated documentation with best practices
Security Features
- β HTTPS-Only: All API communications use secure protocols
- β Environment Variables: Proper secret management patterns
- β File Permissions: Secure file creation with appropriate permissions
- β Error Handling: No sensitive data leakage in error messages
π― Enhanced Markdown Support
Improved Code Block Handling
- 70+ Programming Languages: Comprehensive language detection and mapping
- Smart Aliases: Common abbreviations automatically mapped (jsβjavascript, pyβpython)
- Syntax Preservation: Code formatting preserved exactly from markdown to Notion
- Fallback Handling: Unknown languages default to "plain text" with content intact
Better Block Processing
- H4+ Support: Headers above H3 automatically convert to H3 (Notion's limit)
- Rich Text Handling: Improved bold, italic, and inline code processing
- List Improvements: Enhanced bulleted and numbered list conversion
- Blockquote Support: Proper quote block formatting
β οΈ Breaking Changes
- Push behavior:
notion-md-sync pushnow only pushes staged files - New default: Staging is now the default workflow (not opt-in)
- Migration: Existing users should run
notion-md-sync add .to stage all files
π Developer Experience Improvements
This release brings enterprise-grade reliability:
- π Predictable: Comprehensive testing ensures consistent behavior
- π‘οΈ Secure: Security audit eliminates vulnerabilities
- β‘ Fast: Performance optimizations for large-scale usage
- π― Professional: Git-like workflow familiar to developers
- π Documented: Enhanced documentation with testing and security guides
This is the biggest enhancement since the initial release, bringing notion-md-sync in line with modern development workflows while ensuring bulletproof reliability!