docs: polish README for accuracy and clarity#12
Merged
Conversation
The README documented an API that no longer matches the code. Corrected the inaccuracies and tightened the prose. - Use the instance-based API throughout; there are no static CurrencyFormatter.format* methods (only getFractionDigits* are on the companion) - Currency -> Kurrency: no public constructor and no fromCode(code, locale) / Currency(code, fractionDigits) overloads; show fromCode + predefined constants - Compose locale interop is KurrencyLocale.fromComposeLocale(...), not toKurrencyLocale() - Fix the CurrencyFormat interface (String-returning methods, getFractionDigitsOrDefault) - Bump versions: artifacts 0.2.3 -> 0.3.1, Kotlin badge 2.2.0 -> 2.4.0 - Trim redundant inline comments and changelog-style wording; tables for errors/platforms Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the project documentation to better reflect the current public API, but it also includes several non-doc changes: formatter behavior adjustments, Android currency validation changes, build configuration updates, and test suite restructuring/expansion.
Changes:
- Refined
README.mdto match the current API surface (instance-based formatting,Kurrencytype, Compose interop, updated versions). - Adjusted formatter implementations (notably JVM fraction-digit handling; Android currency code normalization/validation logic).
- Reworked/added tests (new common regression test, new Android device tests, removed older Android instrumented test) and updated build tooling/versions.
Reviewed changes
Copilot reviewed 13 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sample/shared/src/commonMain/kotlin/org/kimplify/kurrency/sample/KurrencySample.kt | Updates import to compose.rememberCurrencyState after package/API organization changes. |
| sample/shared/src/commonMain/kotlin/org/kimplify/kurrency/sample/CurrencyListScreen.kt | Updates import to compose.rememberCurrencyState for consistency with compose package. |
| README.md | Large doc refresh to align examples and API reference with current code and versions. |
| kurrency-core/src/jvmMain/kotlin/org/kimplify/kurrency/CurrencyFormatterImpl.kt | Ensures JVM currency formatting uses the currency’s own fraction digits. |
| kurrency-core/src/commonTest/kotlin/org/kimplify/kurrency/JpyFractionDigitsTest.kt | Adds regression coverage for JPY having 0 fraction digits outside JP locale. |
| kurrency-core/src/androidTest/kotlin/org/kimplify/kurrency/CurrencyStateTestInstrumented.kt | Removes prior Android instrumented tests for CurrencyState. |
| kurrency-core/src/androidMain/kotlin/org/kimplify/kurrency/CurrencyFormatterImpl.kt | Switches Android formatting/validation pieces toward ICU types and adds cached validity check. |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/LocaleFormattingTestInstrumented.kt | Adds device-level locale formatting tests (symbol/ISO/fraction digits). |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/KurrencyLocaleTestInstrumented.kt | Adds device tests for locale parsing/system/predefined constants. |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/KurrencyErrorTestInstrumented.kt | Adds device tests for KurrencyError behavior and messages. |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/JpyFractionDigitsTestInstrumented.kt | Adds Android device regression test for JPY decimals. |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/CurrencyTestInstrumented.kt | Adds broader Android device tests for Kurrency formatting/validation edge cases. |
| kurrency-core/src/androidDeviceTest/kotlin/org/kimplify/kurrency/CurrencyMetadataTestInstrumented.kt | Adds Android device tests for CurrencyMetadata. |
| kurrency-core/build.gradle.kts | Updates KMP/Android and JS target configuration and test source set dependency wiring. |
| kurrency-compose/src/commonTest/kotlin/org/kimplify/kurrency/compose/CurrencyStateTest.kt | Fixes test package to org.kimplify.kurrency.compose and updates imports accordingly. |
| kurrency-compose/src/commonMain/kotlin/org/kimplify/kurrency/compose/CurrencyState.kt | Moves CurrencyState into the compose package and removes debug logging lines. |
| kotlin-js-store/yarn.lock | Updates JS dependency lockfile (large dependency churn). |
| gradle/wrapper/gradle-wrapper.properties | Updates Gradle wrapper version. |
| gradle/libs.versions.toml | Updates Kotlin/AGP/Compose and other dependency versions; bumps SDK targets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #9. The README documented an API surface that has drifted from the code, so this corrects the inaccuracies and tightens the prose. Verified every signature against the source before editing.
Accuracy fixes
CurrencyFormatter.format*(...)as static calls, butCurrencyFormatteris a locale-bound class; onlygetFractionDigits/getFractionDigitsOrDefaultare on the companion.Currency→Kurrency— there is no publicCurrencytype, noCurrency(code, fractionDigits)constructor, and nofromCode(code, locale)overload. DocumentedKurrency.fromCode+ predefined constants.KurrencyLocale.fromComposeLocale(locale), notlocale.toKurrencyLocale().CurrencyFormatinterface — corrected to the real members (String-returningformat*methods +getFractionDigitsOrDefault).0.2.3 → 0.3.1; Kotlin badge2.2.0 → 2.4.0.Polish
No code changes.
🤖 Generated with Claude Code