Changelog - 2026-10-17
A repository with a type-only DataSource import loads under tsc
Bug FixIn 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
Functionis not judged. For a type-only class import, tsc recordsFunctionas the parameter's type, where bun recordsObject.@repositoryalready skipped its first-parameter check forObject. It now skipsFunctiontoo, 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-importswrites. It used to throw at import time withInvalid 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 recordsFunction. Neither names the class, so neither can be checked againstdataSource. - An explicit
@injectat parameter 0 is still checked, as before.