Skip to content

refactor: migrate foundation utilities and logging to TypeScript - #5665

Open
blue219 wants to merge 4 commits into
advplyr:masterfrom
blue219:refactor/backend-ts-01-foundation
Open

blue219 wants to merge 4 commits into
advplyr:masterfrom
blue219:refactor/backend-ts-01-foundation

Conversation

@blue219

@blue219 blue219 commented Oct 19, 2026 •

Copy link
Copy Markdown

Brief summary

Migrate foundation utilities, request helpers, and Logger to strict TypeScript while preserving their CommonJS exports and runtime behavior.

Depends on #5664. Merge order: #5664, this PR, then #5666. Until #5664 merges, GitHub's master-based diff includes its preparation commits. Review only this batch.

Which issue is fixed?

No linked issue. This is the first application-code batch of the incremental backend TypeScript migration.

In-depth Description

  • Type constants, extension lists, equivalence comparison, series-string parsing, request helpers, and the Logger singleton.
  • Preserve mutable exports, native coercion and error cases, ordinary logging return values, awaited fatal logging, and logging before manager initialization.
  • Add the Express development types and a small date-formatting boundary declaration outside the embedded library directory so its JavaScript entry remains compiled. Existing locked dependency versions and runtime dependencies are unchanged.
  • Add compile-only export contracts and targeted compatibility cases. The first commit only renames the six source files; every rename reports R100. The second commit adds types and tests.

How have you tested this?

Validated on Node.js 24.22.0:

npm ci --no-audit --no-fund
npm run typecheck:server
npm run lint
npm run clean:server
npm run build:server
npx --no-install mocha dist-server/test/server/Logger.test.js dist-server/test/server/utils/foundationUtils.test.js dist-server/test/server/utils/requestUtils.test.js

All 42 targeted tests passed. Native string coercion is preserved without weakening strict ESLint.

Verified the pure-rename commit with git diff-tree --no-commit-id --name-status -r -M 37dec873 and checked that documentation and unrelated migrations are excluded. No additional functional manual testing is required for this batch; full unit and packaging/startup checks run in the existing fork CI.

CI passed on the same commit in the fork:

  • Unit tests: lint, type checking, and all 380 tests passed.
  • Integration test: client build, server compilation, binary packaging, startup, and HTTP availability passed.

Upstream workflows currently require maintainer approval before running.

Screenshots

Not applicable; no web client changes.

@nichwall nichwall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks!

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.

2 participants