Commit graph

46 commits

Author SHA1 Message Date
Your Name
56161ed2e1 fix: format E2E tests and add helpers to knip ignore 2026-01-23 00:26:11 +08:00
Your Name
840c215597 test(e2e): add End-to-End test suite
Added comprehensive E2E tests:

1. API E2E Tests (api.e2e.test.ts):
   - Healthcheck API testing
   - Static resources verification
   - Module loading tests
   - Converter properties validation
   - File type normalization tests
   - i18n module tests
   - Transfer module tests
   - Database structure tests

2. Converter E2E Tests (converters.e2e.test.ts):
   - Real Inkscape conversions (SVG → PNG/PDF/EPS)
   - Real Pandoc conversions (Markdown → HTML/DOCX/RST)
   - Dasel format conversions (JSON → YAML/TOML)
   - Batch conversion tests
   - Error handling tests
   - Auto-detection of available tools

3. Test Infrastructure:
   - helpers.ts: Tool detection, test file generation
   - fixtures/: Sample test files (SVG, MD, JSON)
   - .gitignore: Exclude output directory

Total: 34 new E2E tests
2026-01-23 00:14:31 +08:00
Your Name
26304a295e fix(inkscape): use headless-safe export syntax (--export-type/--export-filename)
Breaking change from Inkscape 1.0+:
- Old syntax: inkscape input.png -o output.svg (triggers GTK init)
- New syntax: inkscape input.png --export-type=svg --export-filename=output.svg

This is the correct headless-safe approach, no need for xvfb.

Ref: https://inkscape.org/doc/inkscape-man.html
2026-01-23 00:01:24 +08:00
Your Name
b5992a84e0 fix(inkscape): use xvfb-run for headless execution
- Inkscape requires X11 display connection, causing 'GtkStyleContext without display' error
- Solution: use xvfb-run to create virtual X11 display
- Fallback: try direct inkscape if xvfb-run fails
- Add xvfb package to Dockerfile
- Update inkscape tests for new xvfb-run behavior

Fixes: Gtk-ERROR: Can't create a GtkStyleContext without a display connection
2026-01-22 23:56:47 +08:00
Your Name
89c121bdf9 fix: 簡化 MinerU 和 PDFMathTranslate 的程式碼,改善錯誤處理與參數傳遞 2026-01-22 22:27:40 +08:00
Your Name
4ca92e3a22 release: v0.1.11 - BabelDOC 翻譯引擎與穩定性改進
## 新增功能

- BabelDOC PDF 翻譯引擎:支援 PDF/Markdown/HTML 輸出,15 種目標語言

- Dockerfile 更新:pipx 安裝 babeldoc,warmup 預載資源

## 修復

- 修正 user.tsx XSS 安全警告(label 包裹 safe span)

## 品質保證

- 173 個測試全數通過

- TypeScript / ESLint / Prettier / Knip 檢查通過
2026-01-22 17:41:12 +08:00
Your Name
912546aaa7 fix: ENOENT download error for archive-only converters (PDFMathTranslate/MinerU)
- Add existsSync checks in download.tsx before file access
- Fix normalizeFiletype.ts: md-t/md-i return original format (not tar.gz)
- Add outputMode: 'archive' support in main.ts with auto .tar suffix
- PDFMathTranslate outputs translated-<lang>.pdf + bilingual-<lang>.pdf (no original)
- MinerU outputs complete folder in .tar with logging
- Hide preview icon for .tar files in results.tsx
- Update Bun version: 1.2.2 -> 1.3.6
- Add Step 19: auto-deploy to remote server after Docker push

All 159 tests pass.
2026-01-22 00:47:37 +08:00
Your Name
79fc6f7067 fix: resolve lint issues (XSS K601, knip unused exports, eslint errors)
- Fix XSS warnings in user.tsx by adding safe attribute to elements
- Remove unused exports: ChunkUploadRequest, getArchiveInfo,
  getFileForDirectDownload, createDirectDownloadHeaders, createConverterArchive
- Fix eslint no-unused-vars errors across multiple files
- Fix pdfmathtranslate async Promise executor issue
- Update tests to use toThrow instead of toMatch for Error objects
- Apply prettier formatting
2026-01-21 16:00:26 +08:00
Your Name
d943771f36 feat: add PDFMathTranslate converter for PDF translation with mathematical content
- Introduced PDFMathTranslate converter to handle PDF translations while preserving mathematical formulas.
- Updated Dockerfile to include necessary dependencies and pre-download models during build.
- Enhanced README.md to document the new converter and its features.
- Added tests for PDFMathTranslate to ensure correct functionality and error handling.
2026-01-21 14:31:19 +08:00
Your Name
5322f85721 feat: 實作全域檔案傳輸機制與 .tar 封裝規範
## 主要變更

### 新增全域檔案傳輸模組 (src/transfer/)
- constants.ts: 定義傳輸常數(10MB 門檻、5MB chunk 大小)
- types.ts: 傳輸類型定義
- uploadManager.ts: 後端上傳管理器(支援直傳與 chunk)
- downloadManager.ts: 後端下載管理器(支援直傳與 chunk)
- archiveManager.ts: 封裝管理器(僅允許 .tar)
- index.ts: 統一匯出

### 新增 API 端點
- uploadChunk.tsx: Chunk 上傳 API
- downloadChunk.tsx: Chunk 下載 API

### 前端更新
- public/script.js: 整合智慧傳輸策略(≤10MB 直傳,>10MB chunk)
- public/transfer.js: 前端傳輸管理模組

### 轉換器更新
- mineru.ts: 改用 .tar 格式(不壓縮),禁止 .tar.gz
- download.tsx: 使用統一的封裝管理器

### 測試
- tests/transfer/: 完整傳輸機制測試套件
- tests/converters/mineru.test.ts: 更新以符合 .tar 規範

### 文件
- README.md: 新增檔案傳輸機制說明

## 設計原則
- 檔案 ≤10MB:直接傳輸
- 檔案 >10MB:使用 5MB chunks 分段傳輸
- 多檔輸出:僅允許 .tar 封裝(禁止 .tar.gz/.zip)
- 引擎層不感知 chunk(僅傳輸層處理)
2026-01-21 13:58:01 +08:00
Your Name
f7ebc084ea refactor: update MinerU to use tar.gz and mineru CLI
- Change archive format from zip to tar.gz
- Use 'mineru' CLI command instead of 'magic-pdf'
- Install mineru[all] via pipx in Dockerfile
- Remove zip dependency from Dockerfile
- Update normalizeFiletype to output tar.gz extension
- Update all tests for tar.gz output format
- Simplify README MinerU section
2026-01-21 12:20:40 +08:00
Your Name
e5ca364563 feat: integrate MinerU document to Markdown converter
- Add MinerU converter engine (src/converters/mineru.ts)
- Support md-t (table as Markdown) and md-i (table as image) output formats
- Input formats: pdf, ppt, pptx, xls, xlsx, doc, docx
- Output as ZIP archive containing Markdown and images
- Update Dockerfile to install magic-pdf via pipx
- Add zip utility for archive creation
- Update normalizeFiletype to map md-t/md-i to zip extension
- Add comprehensive tests for MinerU converter
- Update README with MinerU documentation
2026-01-21 12:10:49 +08:00
Your Name
a0eccf0437 fix(libreoffice): PDF 轉 DOCX 修正 (v0.1.8)
- 新增 PDF 匯入管線:PDF → DOCX/ODT/RTF/TXT/HTML 使用 --infilter=writer_pdf_import
- 新增輸出檔案存在性驗證,避免 ENOENT 錯誤
- 改善錯誤訊息:密碼保護、檔案損壞、無匯出過濾器等情境
- 重寫測試套件:19 個測試全數通過
2026-01-20 14:38:17 +08:00
kunal763
c3f17cc5a7
feat: add VCF to CSV converter (#497) 2026-01-11 16:38:32 +01:00
Jörg Krzeslak
0521af0d52 test: fix code style issue 2025-12-14 02:57:00 +01:00
Jörg Krzeslak
826dc1062a test: add awaits to rejects and resolves 2025-12-14 02:57:00 +01:00
Jörg Krzeslak
84d7da0195 test: add tests for dasel, pandoc and vtracer 2025-12-14 02:57:00 +01:00
Jörg Krzeslak
ad000f35ba test: add libreoffice.test.ts 2025-12-14 02:57:00 +01:00
Emrik Östling
3e7e95b53c
feature: add download all file by file alongside the tar download (#415) 2025-10-07 21:27:31 +02:00
Jörg Krzeslak
d994c38219 test: fix imports after eslint config changes 2025-08-11 15:09:20 +02:00
Jörg Krzeslak
c0105889ab test: extract duplicate code into another helper 2025-08-11 13:16:31 +02:00
Jörg Krzeslak
c6006b58d2 test: add test case to libjxl.test.ts when input and output are not jxl 2025-08-11 13:16:23 +02:00
Jörg Krzeslak
178f009458 test: extend fail test with different error messages 2025-08-11 13:16:17 +02:00
Jörg Krzeslak
9c24cf4aba test: add test case to ffmpeg.test.ts 2025-08-11 13:16:11 +02:00
Jörg Krzeslak
af68498494 test: change order of parameters in ExecFileFn type 2025-08-11 13:16:05 +02:00
Jörg Krzeslak
eac22d53d3 test: prettify test for msgconvert.ts 2025-08-11 13:15:59 +02:00
Jörg Krzeslak
e5ac60c187 test: add unit test for msgconvert.ts 2025-08-11 13:15:52 +02:00
Jörg Krzeslak
4b42a5fbda test: add test if stderror and stdout get logged if both are present 2025-08-11 13:15:46 +02:00
Jörg Krzeslak
08a833f1cf test: add parameter options to usage of type ExecFileFn 2025-08-11 13:15:39 +02:00
Jörg Krzeslak
6452d0b357 test: add unit test for xelatex.ts 2025-08-11 13:15:23 +02:00
Jörg Krzeslak
9f6b815197 test: add unit test for vips.ts 2025-08-11 13:15:16 +02:00
Jörg Krzeslak
d8cbc0aaee test: add unit test for resvg.ts 2025-08-11 13:15:08 +02:00
Jörg Krzeslak
b1f70ec36c test: add unit test for potrace.ts 2025-08-11 13:15:02 +02:00
Jörg Krzeslak
311d2516ce test: add unit test for libjxl.ts 2025-08-11 13:14:55 +02:00
Jörg Krzeslak
5957873534 test: add unit test for libheif.ts 2025-08-11 13:14:48 +02:00
Jörg Krzeslak
7524f304fe test: add unit test for inkscape.ts 2025-08-11 13:14:39 +02:00
Jörg Krzeslak
f1730ede97 test: add unit test for imagemagick.ts 2025-08-11 13:14:30 +02:00
Jörg Krzeslak
7f9c8868fd test: add unit test for graphicsmagick.ts 2025-08-11 13:14:23 +02:00
Jörg Krzeslak
72b484a480 test: add unit test for ffmpeg.ts 2025-08-11 13:14:14 +02:00
Jörg Krzeslak
c47c1dd4f4 test: add unit test for dvisvgm.ts 2025-08-11 13:14:06 +02:00
Jörg Krzeslak
3975c70de7 test: move converters test helper to avoid confusion 2025-08-11 13:13:58 +02:00
Jörg Krzeslak
fd4e73e76c test: add unit test for calibre.ts 2025-08-11 13:13:49 +02:00
Jörg Krzeslak
301fab5c17 test: fix import in test 2025-08-11 13:13:30 +02:00
Jörg Krzeslak
2db99edeaf test: move test file into separate subfolder 2025-08-11 13:13:07 +02:00
Jörg Krzeslak
4fa471263f test: export type to be usable in test 2025-08-11 13:12:55 +02:00
Jörg Krzeslak
435f654cbe test: add unit test for assimp.ts 2025-08-11 13:12:39 +02:00