Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / format / AGENTS.md
| 1 | # AGENTS.md — library/format/ (':library:format') |
| 2 | |
| 3 | > Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/format/` + allowed shared modules. Do not root-scan. |
| 4 | |
| 5 | - Gradle: :library:format / dir: library/format/ |
| 6 | - Package: `com.vayunmathur.library.format` (single package, like :library:log) |
| 7 | - Entry files: RelativeAge.kt (no MainActivity/Route — base library) |
| 8 | |
| 9 | ## Overview |
| 10 | **Purpose:** Pure display formatting of relative ages: bucketing a timestamp into just-now / minutes / hours / days / older (`relativeAge`), plus the shared `"<amount>m ago"` wording (`formatRelativeAge`). Calendar dates and clock times are NOT here — they belong to `library/ui`'s `DateString`, which deliberately excludes relative time. |
| 11 | **How to use:** Depend on `:library:format` only from apps that format a relative age. Keep app-specific wording at the call site: labels ("now" vs "just now"), timestamp parsing, and any older-than fallback date stay in the app; the thresholds live here. |
| 12 | **Gotchas:** No Android/Compose/resources in the bucketing API — keep it plain-JVM testable. Do not turn this into a generic formatting bucket: byte sizes, durations, and numbers each need their own justified home or stay app-local until their cluster is migrated. |
| 13 | |
| 14 | ## Verify (this module only) |
| 15 | ``` |
| 16 | ./gradlew :library:format:testDebugUnitTest |
| 17 | ./gradlew :library:format:lint |
| 18 | ``` |