Skip to content

Changelog - 2026-10-17 ​

A repository with a type-only DataSource import loads under tsc ​

Bug Fix

In one line. A @repository whose constructor takes dataSource: BasePostgresDataSource, imported with import { type ... }, now loads from a tsc-built dist the same way it already loaded under bun.

What changed ​

  • Function is not judged. For a type-only class import, tsc records Function as the parameter's type, where bun records Object. @repository already skipped its first-parameter check for Object. It now skips Function too, and injects the configured DataSource as before.

Who is affected ​

  • Code built with tsc that types the repository's DataSource parameter with a type-only import. That is the import the house lint rule consistent-type-imports writes. It used to throw at import time with Invalid constructor | First parameter must extend AbstractDataSource | Received: 'Function'. Upgrade and remove any lint disable that kept a value import there.
  • Everyone else. No action needed. A first parameter of a real class that is not a DataSource is still rejected.

Details ​

typescript
import { model, repository } from '@venizia/ignis';
import { type BasePostgresDataSource } from '@venizia/ignis-connectors/postgres';

@repository({ model: Product, dataSource: PostgresDataSource })
export class ProductRepository {
  constructor(public dataSource: BasePostgresDataSource) {}
}
  • An interface records Object, and a type-only class import records Function. Neither names the class, so neither can be checked against dataSource.
  • An explicit @inject at parameter 0 is still checked, as before.

Files: packages/kernel/src/base/metadata/persistents.ts