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.
TypeScript Support
Problem Description
authpoolis 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
.tsfiles).startAuthServer)tsconfig.jsonand update NPM build scripts accordingly.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
startAuthServer()config).