Skip to content

Commit e2e585f

Browse files
committed
Initial release: DebugBar 0.1.0
0 parents  commit e2e585f

56 files changed

Lines changed: 3935 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
concurrency:
10+
group: build-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
name: Build & test
19+
runs-on: macos-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: temurin
28+
java-version: '17'
29+
30+
- name: Set up Gradle
31+
uses: gradle/actions/setup-gradle@v4
32+
33+
- name: Build
34+
run: ./gradlew build --stacktrace
35+
36+
- name: All tests
37+
run: ./gradlew allTests --stacktrace
38+
39+
- name: Upload test reports
40+
if: failure()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: test-reports
44+
path: '**/build/reports/tests/'
45+
retention-days: 7

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags: [ 'v*' ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
publish:
12+
name: Publish to Maven Central
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: '17'
23+
24+
- name: Set up Gradle
25+
uses: gradle/actions/setup-gradle@v4
26+
27+
- name: Publish to Maven Central
28+
env:
29+
RELEASE_VERSION: ${{ github.ref_name }}
30+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
31+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
34+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
35+
run: ./gradlew :debug-bar:publishAndReleaseToMavenCentral --no-configuration-cache --stacktrace
36+
37+
- name: Create GitHub Release
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
run: gh release create "${{ github.ref_name }}" --generate-notes --verify-tag

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Gradle
2+
.gradle/
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
6+
# IntelliJ / Android Studio
7+
.idea/
8+
*.iml
9+
*.iws
10+
*.ipr
11+
out/
12+
local.properties
13+
14+
# Kotlin
15+
.kotlin/
16+
17+
# macOS
18+
.DS_Store
19+
20+
# Android
21+
captures/
22+
*.apk
23+
*.aab
24+
*.ap_
25+
26+
# Xcode / iOS
27+
xcuserdata/
28+
*.xcworkspace/xcuserdata/
29+
*.xcuserstate
30+
DerivedData/
31+
*.hmap
32+
*.ipa
33+
*.dSYM.zip
34+
*.dSYM
35+
Pods/
36+
37+
# Node / Wasm
38+
node_modules/
39+
.kotlin-js-store/
40+
41+
# Logs / temp
42+
*.log
43+
*.hprof
44+
*.tmp

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2026-05-18
11+
12+
### Added
13+
- Initial release of `DebugBar` for Compose Multiplatform.
14+
- `DebugBar` composable — wraps your app content with a debug drawer overlay. Disabled-mode is a
15+
pass-through (zero runtime overhead in release builds).
16+
- `DebugBarState` + `rememberDebugBarState` — open/close/toggle/selectSection/openSection.
17+
- `DebugBarActivation``LongPressCorner`, `KeyboardShortcut`, `Programmatic`, `Combine`. Default
18+
is `LongPressCorner() + KeyboardShortcut()` which works on mobile and desktop.
19+
- `DebugBarSection` — the plugin interface (`title`, `icon`, `badgeCount`, `@Composable Content`).
20+
- Built-in sections:
21+
- `NetworkLogSection` + `NetworkLogStore` — bounded list of HTTP entries with expandable
22+
request/response bodies. Color-coded by status (2xx/3xx/4xx-5xx). Wire from your Ktor/OkHttp
23+
interceptor via `networkStore.record(...)`.
24+
- `LogViewerSection` + `LogStore` — bounded, filterable log buffer with min-level chip + free-text
25+
filter. Wire from Kermit/Napier via `logStore.record(...)`.
26+
- `EnvSwitcherSection` + `EnvStore` — radio-list of named environments; reactive `selected`
27+
flow for your networking layer to observe.
28+
- `ScreenshotBundleSection` — collects network + logs + env + flags + device info into a
29+
`DebugBundle` previewable inline (ZIP packaging + native share coming in v0.2).
30+
- `DeviceInfoSection` — Compose density + font scale + caller-supplied `extraInfo` rows.
31+
- `CustomSection` — generic escape hatch wrapping any `@Composable` as a tab.
32+
- Tab strip with active highlighting + optional badge count per tab.
33+
- Tree-shaken in release builds when `enabled = false`.
34+
- 23 pure-logic tests (state, activation, network store, log store, env store) + 5 Compose UI
35+
tests (drawer open/close, section selection, close button).
36+
- Targets: Android (minSdk 24), iOS (x64, arm64, simulatorArm64), Desktop (JVM 11), Web (wasmJs).
37+
38+
[Unreleased]: https://github.com/NadeemIqbal/debug-bar/compare/v0.1.0...HEAD
39+
[0.1.0]: https://github.com/NadeemIqbal/debug-bar/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributing to DebugBar
2+
3+
Thanks for your interest! Contributions of all kinds are welcome — bug reports, feature
4+
requests, docs, code.
5+
6+
## Project layout
7+
8+
```
9+
debug-bar/ The published Kotlin Multiplatform library.
10+
src/commonMain/
11+
DebugBar.kt Main wrapper composable + drawer surface.
12+
DebugBarState.kt Open/close + active section index.
13+
DebugBarSection.kt Plugin interface.
14+
DebugBarActivation.kt LongPressCorner / KeyboardShortcut / Combine / Programmatic.
15+
DebugBarDefaults.kt Defaults — shape, padding, colors.
16+
sections/ Built-in sections.
17+
src/commonTest/ Pure-logic tests (state, activation, stores).
18+
src/skikoTest/ Compose UI tests (drawer open/close, sections).
19+
sample/composeApp/ Shared sample with fake e-commerce screen + all sections wired.
20+
sample/androidApp/ Android launcher.
21+
sample/desktopApp/ Desktop (JVM) launcher.
22+
sample/webApp/ Web (wasmJs) launcher.
23+
sample/iosApp/ iOS launcher (Xcode project).
24+
```
25+
26+
## Build & test
27+
28+
```bash
29+
./gradlew build # build + test everything
30+
./gradlew :debug-bar:desktopTest # fastest feedback
31+
./gradlew :sample:desktopApp:run # run the sample
32+
```
33+
34+
## Design invariants — please preserve
35+
36+
- **Tree-shake when disabled.** When `enabled = false`, the wrapper is a pure pass-through —
37+
no listeners installed, no allocations. Don't add work that runs unconditionally.
38+
- **Section plugins are independent.** Built-in sections only depend on `DebugBarSection` and
39+
their own store. They never reach into the drawer's state. Third-party sections (like
40+
`FlagBarSection` from flag-bar) work the same way.
41+
- **No platform reach-arounds in commonMain.** No `expect`/`actual` for v0.1. Shake detection,
42+
native ZIP+share, FPS HUD all defer to v0.2 where they'll live in platform source sets.
43+
- **Stores are headless and shareable.** `NetworkLogStore` / `LogStore` / `EnvStore` work
44+
without composition — instantiable in `Application.onCreate`, observed from any layer.
45+
46+
## Conventions
47+
48+
- Public API gets KDoc.
49+
- Add/update tests for every behavior change.
50+
- Update the sample when you change a public API.
51+
- Add a `CHANGELOG.md` entry under `## Unreleased`.
52+
53+
## Releasing
54+
55+
Releases are tag-driven via `publish.yml` (configure secrets in your repo settings first), or
56+
local via `./gradlew :debug-bar:publishAndReleaseToMavenCentral`.

0 commit comments

Comments
 (0)