refactor: remove all document conversion support, keep only media conversions

This commit completely removes document conversion functionality to focus
exclusively on media file conversions (video, audio, images).

Changes:
- Remove all document converter services (pandocService.ts, pdfService.ts, docxService.ts)
- Uninstall document-related packages: marked, turndown, dompurify, jspdf, pdfjs-dist, docx, mammoth, @types/turndown
- Remove document formats (PDF, DOCX, Markdown, HTML, TXT) from formatMappings.ts
- Remove pandoc converter from FileConverter.tsx
- Remove pandoc loader and references from wasmLoader.ts
- Update TypeScript types to remove 'pandoc' from ConverterEngine and 'document' from FileCategory
- Remove pandoc from WASMModuleState interface
- Update README.md to remove all document conversion documentation
- Update UI descriptions to reflect media-only conversions

Supported conversions now:
- Video: MP4, WebM, AVI, MOV, MKV, GIF
- Audio: MP3, WAV, OGG, AAC, FLAC
- Images: PNG, JPG, WebP, GIF, BMP, TIFF, SVG

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-17 11:35:20 +01:00
parent de3997f4df
commit 594a0ca314
10 changed files with 6 additions and 1867 deletions

View File

@@ -7,7 +7,6 @@ import type { ConverterEngine, WASMModuleState } from '@/types/conversion';
const moduleState: WASMModuleState = {
ffmpeg: false,
imagemagick: false,
pandoc: false,
};
/**
@@ -15,7 +14,6 @@ const moduleState: WASMModuleState = {
*/
let ffmpegInstance: FFmpeg | null = null;
let imagemagickInstance: any = null;
let pandocInstance: any = null;
/**
* Load FFmpeg WASM module
@@ -75,33 +73,6 @@ export async function loadImageMagick(): Promise<any> {
}
}
/**
* Load Pandoc converter (uses pure JavaScript libraries, not WASM)
* Note: We use marked + turndown instead of actual Pandoc WASM
*/
export async function loadPandoc(): Promise<any> {
if (pandocInstance && moduleState.pandoc) {
return pandocInstance;
}
try {
// Import the converter libraries
const [marked, turndown] = await Promise.all([
import('marked'),
import('turndown'),
]);
pandocInstance = { marked, turndown };
moduleState.pandoc = true;
console.log('Document converter loaded successfully');
return pandocInstance;
} catch (error) {
console.error('Failed to load document converter:', error);
throw new Error('Failed to load document converter');
}
}
/**
* Get loaded module state
*/
@@ -125,8 +96,6 @@ export async function loadModule(engine: ConverterEngine): Promise<any> {
return loadFFmpeg();
case 'imagemagick':
return loadImageMagick();
case 'pandoc':
return loadPandoc();
default:
throw new Error(`Unknown converter engine: ${engine}`);
}
@@ -148,10 +117,5 @@ export function unloadAll(): void {
moduleState.imagemagick = false;
}
if (pandocInstance) {
pandocInstance = null;
moduleState.pandoc = false;
}
console.log('All WASM modules unloaded');
}