chore: remove dead code, add test infrastructure, update docs

- Delete 3 dead files: use-batch-processor.ts, use-i18n.ts, smart-crop.ts (AI package)
- Remove dead getJobProgress function and unused runPythonScript wrapper
- Remove 6 unused imports across API and web apps
- Remove unused shared types (ImageFormat, AppConfig, ApiError, HealthResponse, JobProgress)
  and constants (SUPPORTED_INPUT_FORMATS/OUTPUT_FORMATS, DEFAULT_OUTPUT_FORMAT)
- Remove unused store method (setOriginalBlobUrl) and clean AI package re-exports
- Add test infrastructure: vitest config, unit/integration/e2e tests, fixtures, screenshots
- Add Docker test infrastructure: Dockerfile.test, docker-compose.test.yml
- Add download_models.py for pre-baking AI model weights in Docker
- Add filename sanitization utility (apps/api/src/lib/filename.ts)
- Update .gitignore to exclude coverage/, *.tsbuildinfo, .superpowers/, test artifacts
- Update .dockerignore to exclude test/coverage/IDE artifacts from builds
- Update docs: remove smart crop from AI docs (uses Sharp directly), update bridge docs
This commit is contained in:
Siddharth Kumar Sah
2026-03-23 11:46:45 +08:00
parent 8db84a753c
commit 80e536bcf8
74 changed files with 7247 additions and 487 deletions
+5 -1
View File
@@ -49,9 +49,13 @@ export function registerWatermarkText(app: FastifyInstance) {
const spacingX = settings.fontSize * 6;
const spacingY = settings.fontSize * 4;
let textElements = "";
for (let y = 0; y < height + spacingY; y += spacingY) {
const maxElements = 500;
let count = 0;
outer: for (let y = 0; y < height + spacingY; y += spacingY) {
for (let x = 0; x < width + spacingX; x += spacingX) {
if (count >= maxElements) break outer;
textElements += `<text x="${x}" y="${y}" font-size="${settings.fontSize}" fill="${rgba}" font-family="sans-serif" transform="rotate(${settings.rotation},${x},${y})">${escapedText}</text>`;
count++;
}
}
svgOverlay = `<svg width="${width}" height="${height}">${textElements}</svg>`;