backend-base example in the OrionJS repository.
1. Upgrade OrionJS and TypeScript
Keep all OrionJS packages on the same minor version and install TypeScript 7: Update each installed@orion-js/* dependency to ^4.4.0 in package.json, then install TypeScript 7 and refresh the lockfile:
package.json directly, the relevant entries should look like this:
2. Replace baseUrl aliases with paths
TypeScript 7 removes the deprecated baseUrl option. A common OrionJS configuration used it to import from app/*:
tsconfig.json file:
3. Mark decorator-injected properties as initialized
OrionJS assigns properties decorated with@Inject at runtime. The compiler cannot observe that assignment, so use a definite assignment assertion:
! for properties that the framework is guaranteed to initialize. Initialize ordinary class properties normally.
4. Narrow caught errors
Caught values are not guaranteed to beError instances. Narrow them before accessing .message:
5. Run the compiler and build
Add explicit scripts so the same checks can run locally and in CI:What changed in OrionJS 4.4
All published@orion-js/* packages are aligned at version 4.4.0. Their declarations are emitted with TypeScript 7, and OrionJS’s development watcher no longer depends on the legacy compiler API removed in TypeScript 7.
You can inspect the complete working migration in the backend-base example.