smartnetwork/readme.plan.md

2.4 KiB

Plan to Enhance Code Quality, Feature Set & Documentation

This plan focuses on three pillars to elevate @push.rocks/smartnetwork: 1) Code Quality, 2) Feature Enhancements, and 3) Documentation.

1. Code Quality Improvements

  • Enable strict TypeScript (strict, noImplicitAny, strictNullChecks).
  • Enforce linting (ESLint) and formatting (Prettier) with pre-commit hooks.
  • Audit and refactor core modules for:
    • Clear separation of concerns (IO, business logic, helpers).
    • Removal of duplicated logic and dead code.
    • Consistent use of async/await and error propagation.
  • Introduce custom error classes (e.g., NetworkError, TimeoutError) for predictable failure handling.
  • Augment logging support via injectable logger interface.
  • Establish a baseline of ≥90% unit-test coverage and enforce via CI.

2. Feature Enhancements

  • Expand diagnostics:
    • Traceroute functionality with hop-by-hop latency.
    • DNS lookup (A, AAAA, MX records).
    • HTTP(s) endpoint health check (status codes, headers, latency).
  • Improve existing methods:
    • getSpeed: allow configurable test duration and parallel streams.
    • ping: add statistical summary (min, max, stddev) and continuous mode.
    • isRemotePortAvailable: support TCP/UDP checks with timeout and retry.
  • Introduce plugin architecture:
    • Define Plugin interface for third-party extensions.
    • Enable runtime registration/unregistration.
    • Provide sample plugins (e.g., custom ping strategies, alternate speed providers).
  • Optional in-memory caching with TTL for expensive calls (getPublicIps, getGateways).

3. Documentation & Examples

  • Upgrade README:
    • Detailed API reference with method signatures and option parameters.
    • Real-world usage snippets and full example projects.
  • Add TSDoc comments to all public classes, methods, and types.
  • Create a docs/ folder with:
    • Getting Started guide.
    • Advanced topics (plugin development, custom error handling).
    • FAQ and troubleshooting section.
  • Integrate TypeDoc for automated documentation site generation.
  • Update CONTRIBUTING.md and CHANGELOG.md to reflect development and release practices.

Next Steps

  1. Review and prioritize high-impact items per pillar.
  2. Kick off Phase 1 (Code Quality) with linting, TS config, and core refactor.
  3. Schedule sprints for Feature and Documentation phases.
  4. Configure CI pipeline to enforce quality gates and publish docs.