Skip to content

v0.28.4 - Counter Simplification (2026-03-21)

What Changed?

This release simplifies the Counter class in the gears module by removing methods that were never used by AfterGlow — the only internal consumer of Counter. The API is now reduced to the three operations that AfterGlow actually needs: increment, getValue, and reset. CounterOptions was also simplified by removing the initialValue and enableLogging fields.


What's New

Main Feature: Counter API Simplification

What it does: Strips Counter down to its essential purpose — supporting AfterGlow.count(), AfterGlow.countReset(), and AfterGlow.getCount().

How to use it: No changes needed for users of AfterGlow. Direct Counter users should migrate to the minimal API.

Code example:

TypeScript
// Before (removed methods no longer available)
const counter = new Counter({ name: "metrics", initialValue: 0, enableLogging: true });
counter.add(5);
counter.decrement();
counter.setCounter("errors", 0);
counter.getAllCounters();

// After (minimal API)
const counter = new Counter("metrics");
counter.increment("errors");
counter.getValue("errors");   // 1
counter.reset("errors");
counter.getValue("errors");   // 0

Added

  • None

Changed

  • Counter: constructor now accepts CounterOptions | string with name only (removed initialValue, enableLogging)
  • docs/modules/gears/README.md: corrected counter.get()counter.getValue() in example code
  • mkdocs.yml: removed broken utilities-counter.md nav entry
  • README.md / CLAUDE.md: updated to reflect current version and workflow

Removed

  • Counter.decrement() — no internal usage
  • Counter.add() — no internal usage (complex overloaded API)
  • Counter.setCounter() — no internal usage (complex overloaded API)
  • Counter.remove() — no internal usage
  • Counter.getAllCounters() — no internal usage
  • Counter.clear() — no internal usage
  • Counter.setLogging() — no internal usage
  • CounterOptions.initialValue — unused field
  • CounterOptions.enableLogging — unused field

Is It Safe to Upgrade?

  • Breaking Changes: Yes (if using Counter directly)
  • Backward Compatible: Yes (for AfterGlow users — no API change)

If your code calls Counter directly and uses any of the removed methods, you will need to migrate. Users who only interact with AfterGlow.count() / countReset() / getCount() are unaffected.


Release Details

  • Date: 2026-03-21
  • Version: v0.28.4
  • gaslamp: (unchanged)
  • pilotlamp: (unchanged)
  • Files Changed: 108
  • Commits:
    • 4400a18 bump: version 0.28.3 → 0.28.4
    • c64fd75 docs(mkdocs): remove broken utilities-counter.md nav entry
    • d070ca3 docs(gears): update Counter docs after API simplification
    • 0ccfbcb refactor(gears): simplify Counter to minimal API used by AfterGlow
    • 4f04cf1 build(bundle): rebuild bundle for v0.28.3
    • 2b0978f docs: update README.md and CLAUDE.md

Known Issues

  • None

Next Steps

  • Add dedicated unit tests for ClockSmith and Clock
  • Review counter.ts module documentation (docs/modules/counter.md)