Commit Graph

3 Commits

Author SHA1 Message Date
znetsixe
f21e2aa8bb P11.3 + P11.4: BaseNodeAdapter query.units + wikiGen Unit column
P11.3 BaseNodeAdapter auto-wires query.units:
  Implicit query.units topic registered if subclass commands don't
  already declare one. Returns {node, units: {topic → {measure,
  default, accepted: [...]}}} via convert.possibilities. Subclass
  query.units overrides. 17/17 tests; BaseNodeAdapter.js 211 lines.

P11.4 wikiGen Unit column:
  Auto-generated topic-contract table grows a Unit column showing
  `<measure> (default <unit>)` for topics with units, '—' otherwise.
  Effect column now uses descriptor.description when present (P11.2
  field), falls back to generic per-prefix sentence. wikiGen.js 303
  → 315 lines. WIKI_TEMPLATE.md §5 sample updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 17:33:26 +02:00
znetsixe
7372d12088 fix(BaseNodeAdapter test): close intervals to unblock batch test runs
Tests 1, 4, 5 constructed an Adapter with the default
statusInterval=1000 and no mock for setInterval, leaking a real
status timer that held the event loop open past the assertions.
Single-file runs masked it; node --test test/basic/ blocked the
whole runner.

Fix: set static statusInterval = 0 + invoke node.handlers.close()
(or mock setInterval where the test asserts on registration timing).
113/113 basic tests pass in batch in ~400 ms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 19:32:31 +02:00
znetsixe
62f389a51f Phase 1 wave 3 + barrel: BaseNodeAdapter + index.js exports
- src/nodered/BaseNodeAdapter.js — base class for every nodeClass.js
  Lifecycle: config build → domain instantiate → child.register on
  Port 2 → tick (opt-in) or 'output-changed' subscription (default
  event-driven) → status updater → input dispatch via commandRegistry →
  close handler with clean teardown.
- index.js — additive exports of all Phase 1 modules:
  UnitPolicy, ChildRouter, LatestWinsGate, HealthStatus, BaseDomain,
  statusBadge, StatusUpdater, createRegistry, CommandRegistry,
  BaseNodeAdapter, stats. Existing exports unchanged.

113 unit tests pass under node:test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 18:59:50 +02:00