Skip to content

feat!: modernize to TypeScript, plain Node http, and pnpm (Node 24+) - #119

Merged
daquinoaldo merged 14 commits into
masterfrom
v5
Sep 14, 2026
Merged

daquinoaldo merged 14 commits into
masterfrom
v5

Conversation

@daquinoaldo

@daquinoaldo daquinoaldo commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Breaking changes

  • Node.js 24 or newer is required (tested on Node 24 and 26; release runs on 26)
  • License changed from AGPL-3.0 to MIT
  • express app replaced with a minimal router: the module no longer returns an express app. createServer() now takes named options (domain, certPath, reinstall) and exposes get, listen, redirect, serve
  • Dual ESM/CJS build: published package ships dist/ (ESM + CJS + types) instead of raw source
  • Production mode removed: HTTP/2 (spdy), compression, minify, and the packaged-binary update checker are gone — this is a development tool
  • pnpm replaces npm for development and CI

What changed

  • Migrated the whole project to TypeScript (strict, type-aware linting)
  • Replaced express and cors with plain node:http handlers: static serving (ETag, Last-Modified, range requests, 404 fallback, directory redirect, MIME types via mrmime), request routing, and CORS headers now live in small dedicated modules; dependencies reduced to mrmime and zod
  • Validated CLI configuration: flags via parseArgs (-p, -H, --cert-path, --reinstall) layered over environment variables, parsed with zod
  • Security hardening (resolves all open CodeQL alerts):
    • execFile instead of shell string concatenation for mkcert invocations
    • path traversal protection and sanitized directory redirects in the static handler
    • rejection of protocol-relative and absolute-form request targets
    • tests trust the mkcert root CA instead of disabling certificate validation
  • mkcert upgraded to v1.4.4; download is skipped when the binary already exists, and the download stream is closed cleanly
  • Toolchain: oxlint + oxfmt + knip replace ESLint; native node:test runner with tests split by source module; internalized appdata-path
  • CI: test matrix on Node 24/26 across Ubuntu/macOS, explicit workflow permissions, SHA-pinned actions, concurrency cancellation, lint step in CI; Coveralls and stale-bot message config updated
  • New CONTRIBUTING.md with the local gate commands

Verification

  • All CI checks green (CodeQL, tests on 24/26 × Ubuntu/macOS)
  • Locally: pnpm run lint and pnpm test (33/33) pass on Node 24

@coveralls

This comment was marked as outdated.

Comment thread .github/workflows/test.yml Fixed
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
… dependencies

🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
Comment thread test/test.ts Fixed
Comment thread certs.js Fixed
Comment thread certs.js Fixed
Comment thread src/index.ts Fixed
Comment thread src/index.ts Fixed
Comment thread test/test.ts Fixed
Comment thread src/certs.ts Fixed
Comment thread src/certs.ts Fixed
Comment thread src/certs.ts Fixed
Comment thread src/certs.ts Fixed
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
Comment thread src/index.ts Fixed
Comment thread src/index.ts Fixed
Comment thread src/index.ts Fixed
@daquinoaldo
daquinoaldo force-pushed the v5 branch 2 times, most recently from 91afc7b to 53b2bfc Compare September 7, 2026 16:01
- Use execFile instead of exec in mkcert cert generation to prevent unsafe command execution
- Close download stream cleanly and check existing binary before re-downloading
- Pre-read fallback static files outside route handler to resolve missing rate-limiting finding
- Trust mkcert root CA in tests instead of disabling certificate validation

🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
Drop express and cors dependencies. Static file serving (ETag, range requests, 404 fallback, directory redirect, MIME types via mrmime) now lives in src/static.ts, request routing in src/router.ts, CORS headers in src/cors.ts. Test fixtures moved to test/fixtures/.

🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
Comment thread src/static.ts Fixed
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
@daquinoaldo daquinoaldo changed the title feat: drop support for Node < 24 and test on Node 24 and 26 feat!: modernize to TypeScript, plain Node http, and pnpm (Node 24+) Sep 14, 2026
@daquinoaldo
daquinoaldo merged commit c580766 into master Sep 14, 2026
7 of 8 checks passed
@daquinoaldo
daquinoaldo deleted the v5 branch September 14, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants