type-tests/root.ts opens with the invariant it exists to hold:
Every row of the README's "Key exported types" table must resolve from the root.
Four rows do not. Adding them to that file fails:
type-tests/root.ts(22,15): error TS2305: Module '"@hugoer/web-perf-cli"' has no exported member 'LabAuditOptions'.
type-tests/root.ts(22,32): error TS2305: Module '"@hugoer/web-perf-cli"' has no exported member 'LabWriteOptions'.
type-tests/root.ts(22,49): error TS2305: Module '"@hugoer/web-perf-cli"' has no exported member 'LabPlanControls'.
type-tests/root.ts(22,66): error TS2305: Module '"@hugoer/web-perf-cli"' has no exported member 'LabPlanOptions'.
This is the same defect #17 fixed for LabReport, CruxReport and the rest:
lib/index.js is a value-only façade of lazy getters, so a type is only
importable from the root if it is re-declared there. The four Lab*Options rows
were added to the README table without the matching @typedef in lib/index.js.
The guard did not catch it because root.ts enumerates the rows by hand, and
these four were never added to the list — so the file asserts an invariant it
only partially checks.
Fix
- Re-declare the four in
lib/index.js alongside the existing typedefs.
- Add them to both the import and the
Rows tuple in type-tests/root.ts.
- Regenerate
types/.
Worth deciding
The hand-maintained list in root.ts is the reason this drifted silently, and it
will drift again — the next README row added without a tuple entry is invisible.
Whether that is worth solving (a generated list, or a comment in the README table
pointing at the guard) is the open question; the three-step fix above is correct
either way.
Found while working #20, which added LabProfile, NetworkPreset and
DevicePreset to the same table and wired all three through both places.
type-tests/root.tsopens with the invariant it exists to hold:Four rows do not. Adding them to that file fails:
This is the same defect #17 fixed for
LabReport,CruxReportand the rest:lib/index.jsis a value-only façade of lazy getters, so a type is onlyimportable from the root if it is re-declared there. The four
Lab*Optionsrowswere added to the README table without the matching
@typedefinlib/index.js.The guard did not catch it because
root.tsenumerates the rows by hand, andthese four were never added to the list — so the file asserts an invariant it
only partially checks.
Fix
lib/index.jsalongside the existing typedefs.Rowstuple intype-tests/root.ts.types/.Worth deciding
The hand-maintained list in
root.tsis the reason this drifted silently, and itwill drift again — the next README row added without a tuple entry is invisible.
Whether that is worth solving (a generated list, or a comment in the README table
pointing at the guard) is the open question; the three-step fix above is correct
either way.
Found while working #20, which added
LabProfile,NetworkPresetandDevicePresetto the same table and wired all three through both places.