Skip to content

TypeScript Support #9

@ashbhati26

Description

@ashbhati26

TypeScript Support

Problem Description

authpool is currently written in JavaScript, which limits type safety, editor support, and long-term scalability. This can lead to runtime errors and makes it harder to onboard contributors or consumers using TypeScript-based projects.

Proposed Solution

  • Refactor the codebase to TypeScript (.ts files).
  • Add appropriate types for:
    • Express request/response
    • User model
    • Config options (startAuthServer)
  • Include tsconfig.json and update NPM build scripts accordingly.
  • Ensure backwards compatibility for JS users (via compiled output).

Why this matter

TypeScript increases developer confidence, improves DX, and enables easier maintenance. Most modern Node.js libraries now offer or prefer TypeScript support.

Acceptance Criteria

  • Codebase successfully migrated to TypeScript.
  • No runtime errors after build.
  • Types are exported for external usage (e.g., types for startAuthServer() config).
  • Instructions updated in README for building the package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovements to existing features or code quality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions