Files
suaveplan/openspec/archive/2026-05-25-enterprise-caddy-imgproxy/tasks.md
2026-05-27 23:29:53 +01:00

25 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Tasks — @suaveplan/caddy-imgproxy
1. Scaffold `packages/media/image/caddy-imgproxy/` (package.json @ 0.1.0, vite/vitest/tsconfig, tests/setup/polyfills.ts).
2. Implement `src/types/types.ts` (`ParsedImgproxyUrl`, `ImgproxyConfig`, `RewriteResult`).
3. Implement `src/error-codes/error-codes.ts` (`CADDY_IMGPROXY_CODES` + `CaddyImgproxyError`) — verify every code is reachable from `src/`.
4. Implement `src/telemetry/telemetry.ts` (3 counters + 1 histogram, meter `@suaveplan/caddy-imgproxy`).
5. Implement `src/parse/parse-url.ts` — verbatim port of Go regex + state machine, telemetry on every call.
6. Implement `src/dimensions/calculate-dimensions.ts` — aspect-ratio + hint resolution.
7. Implement `src/gravity/gravity.ts` — 9-direction map + `gravityToImgproxy`.
8. Implement `src/operation/operation.ts` — 5-op switch matching Go.
9. Implement `src/signing/sign-path.ts` — `signImgproxyPath`, injectable hash via `HashLike`-shaped seam (default = `@suaveplan/crypto-hash`).
10. Implement `src/url-builder/url-builder.ts` — composes signature + processing + `s3://...@<format>` segment.
11. Implement `src/domain/extract-domain.ts` — strips port, drops `images.` subdomain.
12. Implement `src/config/config.ts` — Zod schema + `parseConfig` raising `INVALID_OPTIONS`/`INVALID_KEY`/`INVALID_SALT`.
13. Implement `src/handler/handler.ts` — `ImgproxyHandler` orchestrator with injectable `Clock` + `LoggerLike`, span + histogram emission.
14. Author co-located `.md` for every implementation file (Purpose ≥2 sentences, Features, Usage Basic, Usage Advanced, API Reference, Implementation Notes, ≥200 words).
15. Author `src/index.ts` explicit named re-export barrel and per-feature `index.ts` barrels (no `export *`).
16. Author `README.md` at package root with H1, install, quick start, Modules section.
17. Run `bunx turbo lint typecheck test build --filter=@suaveplan/caddy-imgproxy` — green.
18. Run `bunx turbo test:coverage --filter=@suaveplan/caddy-imgproxy` — 100/100/100/100.
19. Run `bun scripts/folder-reorg/generate-manifest.ts` to refresh `MANIFEST.md`.
20. Flip the row in `STATUS.md` from `–` to `✅` with one-line README description.
21. Fold `specs/caddy-imgproxy/spec.md` into `openspec/specs/caddy-imgproxy/spec.md`.
22. Move `openspec/changes/enterprise-caddy-imgproxy/` → `openspec/archive/2026-05-25-enterprise-caddy-imgproxy/`.