fix: inject the ledger into MigrationRunner (type-only import) so probes load the committed module under type stripping
CI / Frozen lockfile install (pull_request) Successful in 45s
CI / Secrets not embedded (E00-S02-T08) (pull_request) Successful in 29s
CI / Database-postgres import isolation (E00-S03-T02) (pull_request) Successful in 28s
CI / Migration ledger (E00-S03-T03) (pull_request) Successful in 42s
CI / Migration advisory lock (E00-S03-T04) (pull_request) Successful in 44s
CI / Migration failure diagnostic (E00-S03-T05) (pull_request) Successful in 41s
CI / Compose config (E00-S03-T01) (pull_request) Successful in 25s
CI / Frozen lockfile install (pull_request) Successful in 45s
CI / Secrets not embedded (E00-S02-T08) (pull_request) Successful in 29s
CI / Database-postgres import isolation (E00-S03-T02) (pull_request) Successful in 28s
CI / Migration ledger (E00-S03-T03) (pull_request) Successful in 42s
CI / Migration advisory lock (E00-S03-T04) (pull_request) Successful in 44s
CI / Migration failure diagnostic (E00-S03-T05) (pull_request) Successful in 41s
CI / Compose config (E00-S03-T01) (pull_request) Successful in 25s
Node's type stripping does not rewrite './ledger.js' to './ledger.ts', so the runner's runtime import of the ledger could not resolve when the behavioral probes execute the committed runner.ts directly (CI failure on Node 24). The ledger is now imported type-only and the caller passes the instance (new MigrationLedger(pool)) — the probes already do. runner.ts has no runtime imports left, so type stripping erases them and the committed module loads as-is.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
*/
|
||||
|
||||
import type { Pool } from 'pg';
|
||||
import { MigrationLedger } from './ledger.js';
|
||||
import type { MigrationLedger } from './ledger.js';
|
||||
|
||||
/**
|
||||
* A single migration step: an identifier (recorded in the ledger once the
|
||||
@@ -136,14 +136,17 @@ export class MigrationRunner {
|
||||
private readonly migrations: readonly Migration[];
|
||||
|
||||
/**
|
||||
* @param pool The package-owned PostgreSQL pool (`pg.Pool`).
|
||||
* @param pool The package-owned PostgreSQL pool (`pg.Pool`), handed to each
|
||||
* migration's `up`.
|
||||
* @param migrations The migrations to run, in apply order (oldest first).
|
||||
* @param ledger The migration ledger; defaults to one sharing `pool`.
|
||||
* @param ledger The migration ledger (E00-S03-T03) the runner reads applied
|
||||
* versions from and records applied migrations into; constructed by the
|
||||
* caller from the same pool (`new MigrationLedger(pool)`).
|
||||
*/
|
||||
constructor(pool: Pool, migrations: readonly Migration[], ledger?: MigrationLedger) {
|
||||
constructor(pool: Pool, migrations: readonly Migration[], ledger: MigrationLedger) {
|
||||
this.pool = pool;
|
||||
this.migrations = migrations;
|
||||
this.ledger = ledger ?? new MigrationLedger(pool);
|
||||
this.ledger = ledger;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user