You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Publishing to pub.dev is automated via GitHub Actions (`.github/workflows/publish.yml`). It triggers when a git tag matching `v*.*.*` is pushed. **The tag version must exactly match `pubspec.yaml`** — CI enforces this and fails the pipeline if they differ.
33
+
34
+
Steps to release:
35
+
36
+
```bash
37
+
# 1. Update version in pubspec.yaml
38
+
# e.g., change: version: 1.0.0
39
+
# to: version: 1.1.0
40
+
41
+
# 2. Update CHANGELOG.md
42
+
# - Move all items from [Unreleased] into a new versioned section:
43
+
# ## [1.1.0] - 2026-03-01
44
+
# - Add the new version comparison link at the bottom:
`lib/astroapi.dart` is the barrel export. Everything a user (or AI) needs is re-exported from here: the main client, config, errors, HttpHelper, all 16 category clients, all 6 enums, all request and response models.
-**`RequestOptions`**: per-request `headers`, `queryParams`, `timeout` override, Dio `CancelToken`
135
+
136
+
### HTTP Layer (`lib/src/http/`)
137
+
138
+
-**`HttpHelper`** (abstract interface): `get`, `post`, `put`, `delete` — the only dependency injected into category clients; mock this in tests
139
+
-**`DioHttpClient`** (concrete Dio implementation):
140
+
- Injects `Authorization: Bearer <apiKey>` via Dio interceptor
141
+
- Auto-unwraps `data` or `result` envelope keys from API responses
142
+
- Implements retry logic based on `RetryConfig`
143
+
144
+
### Category Clients (`lib/src/categories/`)
145
+
146
+
- All extend `BaseCategoryClient` (holds the `HttpHelper` reference)
147
+
- Each exposes typed `async` methods returning response model instances
148
+
-`SvgClient` is the exception: returns raw `String` (SVG markup), not a model
149
+
150
+
### Request Models (`lib/src/models/requests/`)
151
+
152
+
Plain Dart classes with `toJson()` — **no code generation**. The main file `requests.dart` is an omnibus (~1750 lines) with all request classes. Shared building blocks live in separate files (`BirthData`, `Subject`, `ChartOptions`, etc.) and are exported from the barrel.
-**Fully typed** (commonly-accessed fields): `PlanetaryPositionsResponse`, `AspectsResponse`, `HouseCuspsResponse`, `ChartData` — have real `fromJson()` factories
158
+
-**`GenericResponse`** (variable/complex schemas): wraps `Map<String, dynamic>`; dozens of `typedef` aliases provide semantic names (e.g., `typedef HoroscopeResponse = GenericResponse`). This is intentional — not a TODO.
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,30 @@ try {
105
105
}
106
106
```
107
107
108
+
## Releasing a New Version
109
+
110
+
Publishing to pub.dev is automated via GitHub Actions and triggers when a git tag is pushed. The tag version **must match**`pubspec.yaml` exactly — CI enforces this.
111
+
112
+
```bash
113
+
# 1. Update version in pubspec.yaml (e.g. 1.0.0 → 1.1.0)
114
+
115
+
# 2. Update CHANGELOG.md — move [Unreleased] items to a new [1.1.0] section,
116
+
# update the comparison links at the bottom
117
+
118
+
# 3. Commit
119
+
git add pubspec.yaml CHANGELOG.md
120
+
git commit -m "chore: release v1.1.0"
121
+
122
+
# 4. Tag — must be "v" + exact pubspec version
123
+
git tag v1.1.0
124
+
125
+
# 5. Push commit and tag (tag push triggers publish to pub.dev)
126
+
git push origin main
127
+
git push origin v1.1.0
128
+
```
129
+
130
+
Semver rules: `PATCH` for bug fixes, `MINOR` for new backwards-compatible features, `MAJOR` for breaking changes.
0 commit comments