Bring floret-kit up to the family's repo conventions: - CHANGELOG.md (Keep a Changelog) — what each module added. - README.md — full module table (core-time/core-crash/identity/components) + consumption notes and a docs index. - docs/README.md (index), docs/ARCHITECTURE.md (module layering, the submodule + composite-build consumption model, JVM vs android-library, the reproducibility rules, the share-mechanics-not-look contract), docs/ROADMAP.md (extracted vs deferred vs deliberately-not-shared, from the cross-app survey). - CONTRIBUTING.md — the no-app-coupling rules, how to add a module, how an app adopts the kit. - LICENSE (MIT, matching the apps). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3.7 KiB
3.7 KiB
Contributing to floret-kit
floret-kit is the shared Material 3 Expressive design system + plumbing for the
Floret app family. Before changing it, skim
docs/ARCHITECTURE.md (how it's built and consumed) and
docs/ROADMAP.md (what's in scope). This file is the
practical how.
The rules
- Share mechanics, not look. Extract the machinery; leave seed colours, palettes, identity chips, and wording to the apps. If a piece can't be made app-agnostic without contortion, it doesn't belong here yet.
- No app coupling. A kit module never imports an app package, an app's
R, or a domain type. App-specific values arrive as constructor/config parameters or callbacks (seecore-crash'sCrashConfig,InlineTextField'scapitalization). - String resources are fallbacks. Kit strings are English defaults an app overrides via resource merge. Don't put app-specific or per-app-divergent wording in the kit.
- Bake divergence into parameters, don't pick a silent winner. Where two apps differ, expose the difference. When a shared primitive adopts one app's version as canonical, that's a deliberate, documented convergence.
- No
foojaytoolchain resolver — not in any*.gradle.kts, not even as a token in a comment. It breaks reproducible / official F-Droid builds. SetjvmTargetdirectly. Seedocs/ARCHITECTURE.md§5.
Prerequisites
- JDK 17
- Android SDK (compileSdk 37) for the Android modules — set
ANDROID_HOMEor add a gitignoredlocal.propertieswithsdk.dir. Pure-JVM modules need neither.
Build & test
./gradlew :core-time:test # JVM module (JUnit 5 + Truth)
./gradlew :core-crash:testDebugUnitTest
./gradlew :identity:assembleDebug
./gradlew build # everything
In practice the kit is exercised through a consuming app's composite build (e.g.
agendula's ./gradlew assembleDebug), which compiles the included modules from
source.
Adding a module
- Create
:<module>and addinclude(":<module>")tosettings.gradle.kts. - Add a
<module>/build.gradle.kts:- JVM:
plugins { alias(libs.plugins.kotlin.jvm) }, akotlin { compilerOptions { jvmTarget = JVM_17 } }block, JUnit 5 test deps. - Android:
plugins { alias(libs.plugins.android.library); alias(libs.plugins.kotlin.compose) }(nokotlin.android— AGP 9.x is built-in),namespace = "de.jeanlucmakiola.floret.<area>",compileSdk 37/minSdk 29,jvmTarget = JVM_17.
- JVM:
- Put sources under
src/main/kotlin/de/jeanlucmakiola/floret/<area>/. The root build'ssubprojects {}sets the sharedgroup/version, so no per-module coordinates are needed. - Add an entry to
CHANGELOG.md, the README module table, and (if status-worthy)docs/ROADMAP.md.
Adopting the kit in an app
git submodule add <kit-url> floret-kit.includeBuild("floret-kit")in the app'ssettings.gradle.kts.implementation("de.jeanlucmakiola.floret:<module>")in the app module.- Ensure CI checks out submodules (
submodules: recursive) and the included build can find the SDK (ANDROID_HOME). For official F-Droid reproducible builds, addsubmodules: trueto the fdroiddata recipe and have the repro guard scan the submodule. - The app pins a kit commit via the submodule; bump it deliberately to adopt kit changes.
Validate before pushing
python3 -c "import yaml; yaml.safe_load(open('<workflow>.yml'))"after any workflow edit — indentation bites.- A consuming app's
lintDebug+testDebugUnitTest+assembleDebugshould be green after a kit change you mean to land.