Skip to content

chore: prepare strict backend TypeScript migration - #5664

Open
blue219 wants to merge 2 commits into
advplyr:masterfrom
blue219:chore/backend-ts-preparation
Open

blue219 wants to merge 2 commits into
advplyr:masterfrom
blue219:chore/backend-ts-preparation

Conversation

@blue219

@blue219 blue219 commented Oct 19, 2026 •

Copy link
Copy Markdown

Brief summary

Prepare incremental backend TypeScript migrations with strict type-aware ESLint, a no-output type-check command, and CI type checking. No application JavaScript is migrated in this PR.

Which issue is fixed?

No linked issue. This is preparatory tooling for incremental backend TypeScript migration.

In-depth Description

  • Add typecheck:server and clean:server commands and enable strict, type-aware ESLint for backend TypeScript and type contracts. Keep the existing JavaScript lint rules.
  • Include ambient declarations in the server compiler configuration. A compile-only contract verifies that the existing global.isWin declaration loads without an explicit import and remains boolean | undefined.
  • Keep the colocated server/libs/fluentFfmpeg/index.d.ts excluded from compiler roots. Including it shadows index.js during file discovery and omits the runtime entry from compiled output. All 462 existing JavaScript compiler roots are preserved.
  • Run type checking in CI before the existing test suite. Runtime dependencies, existing locked dependency versions, application behavior, and documentation remain unchanged. Unmigrated JavaScript is still outside strict type checking.

How have you tested this?

Validated locally 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
node -e "require('./dist-server/server/libs/fluentFfmpeg')"
npx --no-install mocha dist-server/test/server/controllers/LibraryController.test.js dist-server/test/server/utils/requestUtils.test.js

The targeted suites passed all 8 tests using in-memory databases. An in-memory compiler check confirmed that omitting the ambient declaration causes the type contract to fail. Comparing compiler roots against master confirmed that no existing JavaScript inputs were lost.

CI passed on the same commit in the fork:

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

No functional manual testing is required for this tooling-only change. The full test suite ran in CI rather than locally.

Screenshots

Not applicable; no web client changes.

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