feat: comprehensive asset management system and testing improvements
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
Asset Management System (Issue #142): - Add complete asset management framework with deduplication - Implement AssetManager, AssetRegistry, and AssetDeduplicator classes - Add AssetPackager for markdown document packaging - Create comprehensive test suite for all asset management components - Add asset constants and custom exceptions for robust error handling Markdown Processing Enhancements: - Update markdown_commands.py with improved functionality - Enhanced parsing and content aggregation capabilities - Improved filename encoding/decoding for special characters Test Suite Improvements: - Add comprehensive tests for Issue #138 markdown parsing - Enhance Issue #139 content aggregation and end-to-end testing - Complete test coverage for new asset management features Examples and Documentation: - Update BildungsKanonJon.md example with enhanced content - Generate corresponding HTML output for documentation - Add asset registry configuration Development Tools: - Add install script for simplified setup This commit represents a major enhancement to MarkiTect's asset handling capabilities with full test coverage and improved markdown processing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
72
markitect/assets/__init__.py
Normal file
72
markitect/assets/__init__.py
Normal file
@@ -0,0 +1,72 @@
|
||||
"""
|
||||
Asset management module for MarkiTect.
|
||||
|
||||
This module provides comprehensive asset management capabilities including:
|
||||
- Content-addressable asset storage with deduplication
|
||||
- JSON-based asset registry and metadata management
|
||||
- Cross-platform symlink support with Windows fallback
|
||||
- ZIP-based .mdpkg package creation and extraction
|
||||
- High-level API for coordinating all asset operations
|
||||
|
||||
The module follows the Content-Addressable Package System with Symlinks approach,
|
||||
providing efficient storage, deduplication, and cross-platform compatibility.
|
||||
|
||||
Key Classes:
|
||||
AssetManager: High-level API coordinator for all asset operations
|
||||
AssetRegistry: JSON-based asset metadata persistence and hashing
|
||||
AssetDeduplicator: Content-based deduplication with symlink support
|
||||
MarkdownPackager: .mdpkg package creation and extraction
|
||||
|
||||
Usage:
|
||||
from markitect.assets import AssetManager
|
||||
|
||||
# Initialize asset manager
|
||||
manager = AssetManager()
|
||||
|
||||
# Add an asset
|
||||
result = manager.add_asset(Path("image.png"), "Project logo")
|
||||
|
||||
# Create a package
|
||||
manager.create_package(Path("project/"), Path("project.mdpkg"))
|
||||
|
||||
# Extract a package
|
||||
manager.extract_package(Path("project.mdpkg"), Path("workspace/"))
|
||||
"""
|
||||
|
||||
from .manager import AssetManager
|
||||
from .registry import AssetRegistry
|
||||
from .deduplicator import AssetDeduplicator
|
||||
from .packager import MarkdownPackager
|
||||
from .exceptions import (
|
||||
AssetError, RegistryError, DeduplicationError,
|
||||
PackagingError, AssetManagerError
|
||||
)
|
||||
from .constants import (
|
||||
DEFAULT_CONFIG, PACKAGE_EXTENSION, MANIFEST_FORMAT_VERSION,
|
||||
DEFAULT_EXCLUDE_PATTERNS, CONFLICT_RESOLUTION_OPTIONS
|
||||
)
|
||||
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# Public API exports
|
||||
__all__ = [
|
||||
# Main classes
|
||||
'AssetManager',
|
||||
'AssetRegistry',
|
||||
'AssetDeduplicator',
|
||||
'MarkdownPackager',
|
||||
|
||||
# Exceptions
|
||||
'AssetError',
|
||||
'RegistryError',
|
||||
'DeduplicationError',
|
||||
'PackagingError',
|
||||
'AssetManagerError',
|
||||
|
||||
# Constants
|
||||
'DEFAULT_CONFIG',
|
||||
'PACKAGE_EXTENSION',
|
||||
'MANIFEST_FORMAT_VERSION',
|
||||
'DEFAULT_EXCLUDE_PATTERNS',
|
||||
'CONFLICT_RESOLUTION_OPTIONS'
|
||||
]
|
||||
Reference in New Issue
Block a user