Skip to content

Commit 2f9b5a2

Browse files
committed
fix(knex)!: move QueueSchemaService to the driver module
The root barrel re-exported QueueSchemaService, whose constructor takes a Knex instance. That single export made build/index.d.ts import 'knex', so every consumer type checking with skipLibCheck disabled had to install the optional peer, even when using the Kysely, Redis or Sync adapter. Export it from src/drivers/knex_adapter.ts instead, the way the Kysely module already exports KyselyQueueSchemaService, so the type stays reachable only from the subpath that owns the dependency. BREAKING CHANGE: QueueSchemaService is no longer exported from the package root. Import it from '@boringnode/queue/drivers/knex_adapter'.
1 parent 2ebc06e commit 2f9b5a2

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ const adapter = knex(config, 'custom_jobs_table')
366366
The Knex adapter requires tables to be created before use. Use `QueueSchemaService` to create them:
367367

368368
```typescript
369-
import { QueueSchemaService } from '@boringnode/queue'
369+
import { QueueSchemaService } from '@boringnode/queue/drivers/knex_adapter'
370370
import Knex from 'knex'
371371

372372
const connection = Knex({ client: 'pg', connection: '...' })
@@ -386,7 +386,7 @@ await schemaService.createJobsTable('queue_jobs', (table) => {
386386

387387
```typescript
388388
import { BaseSchema } from '@adonisjs/lucid/schema'
389-
import { QueueSchemaService } from '@boringnode/queue'
389+
import { QueueSchemaService } from '@boringnode/queue/drivers/knex_adapter'
390390

391391
export default class extends BaseSchema {
392392
async up() {

index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export { Locator } from './src/locator.js'
55
export { Schedule } from './src/schedule.js'
66
export { ScheduleBuilder } from './src/schedule_builder.js'
77
export { JobBatchDispatcher } from './src/job_batch_dispatcher.js'
8-
export { QueueSchemaService } from './src/services/queue_schema.js'
98
export {
109
customBackoff,
1110
linearBackoff,

src/drivers/knex_adapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import type {
1515
import { DEFAULT_PRIORITY } from '../constants.js'
1616
import { calculateScore, resolveRetention } from '../utils.js'
1717

18+
export { QueueSchemaService } from '../services/queue_schema.js'
19+
1820
export interface KnexAdapterOptions {
1921
connection: Knex
2022
tableName?: string

0 commit comments

Comments
 (0)