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:
// 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 acceptsCounterOptions | stringwithnameonly (removedinitialValue,enableLogging)docs/modules/gears/README.md: correctedcounter.get()→counter.getValue()in example codemkdocs.yml: removed brokenutilities-counter.mdnav entryREADME.md/CLAUDE.md: updated to reflect current version and workflow
Removed¶
Counter.decrement()— no internal usageCounter.add()— no internal usage (complex overloaded API)Counter.setCounter()— no internal usage (complex overloaded API)Counter.remove()— no internal usageCounter.getAllCounters()— no internal usageCounter.clear()— no internal usageCounter.setLogging()— no internal usageCounterOptions.initialValue— unused fieldCounterOptions.enableLogging— unused field
Is It Safe to Upgrade?¶
- Breaking Changes: Yes (if using
Counterdirectly) - Backward Compatible: Yes (for
AfterGlowusers — 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:
4400a18bump: version 0.28.3 → 0.28.4c64fd75docs(mkdocs): remove broken utilities-counter.md nav entryd070ca3docs(gears): update Counter docs after API simplification0ccfbcbrefactor(gears): simplify Counter to minimal API used by AfterGlow4f04cf1build(bundle): rebuild bundle for v0.28.32b0978fdocs: update README.md and CLAUDE.md
Known Issues¶
- None
Next Steps¶
- Add dedicated unit tests for
ClockSmithandClock - Review
counter.tsmodule documentation (docs/modules/counter.md)