Skip to content

release: v1.0.0 — stable API + bunker port type fix (#26, #29)#30

Merged
karlwaldman merged 1 commit into
mainfrom
release/v1.0.0
Jul 3, 2026
Merged

release: v1.0.0 — stable API + bunker port type fix (#26, #29)#30
karlwaldman merged 1 commit into
mainfrom
release/v1.0.0

Conversation

@karlwaldman

Copy link
Copy Markdown
Member

Summary

Cuts v1.0.0 — the first stable release (#26) — and fixes the bunker port response types (#29).

Closes #29. Closes #26 (the quick-start half already landed in #28; this delivers the 1.0.0 versioning half).

Bunker type fix (#29) — Breaking

Verified against the backend V1::BunkerFuelsController (oilpriceapi-api): the port endpoint returns

{ "data": {
    "port":     { "code": "SIN", "name": "Singapore", "country": "...", "timezone": "...", "volume_rank": 1 },
    "prices":   [ { "grade": "VLSFO", "grade_name": "...", "price": 650.5, "currency": "USD", "unit": "MT",
                    "change_24h": -2.25, "change_pct_24h": -0.35, "supplier_count": 12,
                    "availability": "Good", "last_updated": "..." }, ... ],
    "spreads":  { "to_rtm": { "vlsfo": { "value": ..., "percentage": ... } },
                  "vlsfo_hsfo_spread": { "value": ..., "percentage": ..., "scrubber_benefit_daily": ... } },
    "metadata": { "request_id": "...", "timestamp": "...", "cache_ttl": 300, "data_source": "Ship & Bunker", ... }
} }

i.e. prices is an array of per-grade entries (one per fuel grade) and port is an info object — not the { prices: { VLSFO: number } } keyed shape the pre-1.0 types claimed.

While fixing #29 against the controller, the audit showed the other bunker methods had the same class of mismatch — all() and historical() even returned undefined at runtime because they read .prices/.data off envelopes that never existed. All bunker response types are now modeled from the controller source:

  • all(){ ports: Record<portCode, { port, prices[] }>, metadata }
  • compare(){ comparison: Record<portCode, { port, prices[] }>, spreads, metadata }
  • spreads(){ from_port, to_port, fuel_grade, spreads, metadata }
  • historical(){ port, historical_data[], period, metadata }
  • export()BunkerExportRow[]

README bunker examples fixed too (SIN not SGSIN — the route constraint is [A-Z]{3}, and compare() takes a port-code array).

v1.0.0 (#26)

  • package.json + SDK_VERSION → 1.0.0
  • CHANGELOG ## [1.0.0] - 2026-07-03 with the type fix under Breaking and a first-stable-release note
  • README: stale NEW in v0.x markers removed

Test evidence

  • npm test429 passed | 1 skipped (430), 28 files, 0 failures
  • npm run build (tsc ESM + CJS) → clean; npx tsc --noEmit → clean
  • npx eslint src/ → 0 errors, 10 pre-existing warnings (main has 12 — this PR removes two)
  • Prettier check on all touched files → clean

Release procedure (after merge — Karl cuts this)

Publishing is driven by .github/workflows/publish.yml, which triggers on a published GitHub Release and publishes to npm via OIDC trusted publishing (no token needed; provenance automatic). After merging:

  1. git tag v1.0.0 && git push origin v1.0.0 (or create the tag in the UI)
  2. Create a GitHub Release for v1.0.0 (paste the CHANGELOG entry) and publish it
  3. The workflow runs tsc --noEmit, tests, build, then npm publish --provenance --access public
  4. Verify: npm view oilpriceapi version1.0.0

🤖 Generated with Claude Code

Fix #29: bunker fuels response types now match the live backend
(V1::BunkerFuelsController). port() prices is an ARRAY of per-grade
entries, not a keyed object; all()/compare()/spreads()/historical()
shapes corrected (all() and historical() previously returned undefined
at runtime because the declared envelope never matched the API).

- Rewrite bunker-fuels types against the backend controller: new
  BunkerPortInfo, BunkerSpreadValue, BunkerResponseMetadata,
  PortPricesEntry, AllBunkerPrices, PortToPortSpreadDetail,
  HistoricalBunkerData, BunkerExportRow exports
- Extend unit tests to cover the array shape and all response
  envelopes (429 passing)
- README: fix bunker examples (SIN not SGSIN — route requires
  [A-Z]{3}; compare takes a port-code array), drop stale 0.x
  "NEW in vX" markers
- Bump to 1.0.0 (package.json + SDK_VERSION), add CHANGELOG entry
  with breaking-change notes (#26 first stable release)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@karlwaldman, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cb0050fd-81af-482c-8702-b3a308cd40d3

📥 Commits

Reviewing files that changed from the base of the PR and between 162e6d4 and 2927336.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • README.md
  • package.json
  • src/index.ts
  • src/resources/bunker-fuels.ts
  • src/version.ts
  • tests/resources/bunker-fuels.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v1.0.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@karlwaldman karlwaldman merged commit 2915808 into main Jul 3, 2026
6 checks passed
@karlwaldman karlwaldman deleted the release/v1.0.0 branch July 3, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant