Skip to content

Update dependency awilix to v13#1597

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/awilix-13.x
Open

Update dependency awilix to v13#1597
renovate[bot] wants to merge 1 commit intomainfrom
renovate/awilix-13.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 18, 2026

This PR contains the following updates:

Package Change Age Confidence
awilix 12.1.113.0.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

jeffijoe/awilix (awilix)

v13.0.0

Compare Source

No runtime changes — all breaking changes are TypeScript-only.

  • BREAKING (types): Default cradle type changed from any to {}
  • BREAKING (types): register() returns a new container type that includes the registered resolvers
  • BREAKING (types): asValue() now preserves literal types and deep readonly for objects
BREAKING CHANGES
Default cradle type changed from any to {}

createContainer() without an explicit generic now returns AwilixContainer<{}> instead of AwilixContainer<any>. This enables type accumulation via register() chaining (any & T collapses to any, while {} & T produces T).

If you have existing code that relies on the any default (e.g. accessing container.cradle.something without type annotations), pass any explicitly:

// Before (v12) — implicit any
const container = createContainer()
container.cradle.anything // OK

// After (v13) — explicit any to preserve old behavior
const container = createContainer<any>()
container.cradle.anything // OK

// After (v13) — recommended: use register() for type inference
const container = createContainer().register({
  anything: asValue('hello'),
})
container.cradle.anything // OK, typed as 'hello'
register() returns a new container type

register() now returns AwilixContainer<Cradle & InferCradleFromResolvers<R>> instead of this. Types accumulate across chained calls:

const container = createContainer()
  .register({ port: asValue(3000) })       // AwilixContainer<{ port: 3000 }>
  .register({ host: asValue('localhost') }) // AwilixContainer<{ port: 3000; host: 'localhost' }>

container.resolve('port') // 3000
container.resolve('host') // 'localhost'
asValue() preserves literal types and deep readonly

asValue() now uses a const type parameter, which means it preserves literal types for primitives and infers deep readonly for objects:

// Before (v12)
asValue(3000)              // Resolver<number>
asValue('localhost')       // Resolver<string>
asValue({ debug: true })   // Resolver<{ debug: boolean }>

// After (v13)
asValue(3000)              // Resolver<3000>
asValue('localhost')       // Resolver<'localhost'>
asValue({ debug: true })   // Resolver<{ readonly debug: true }>

Resolved object values are now correctly typed as readonly, reflecting the fact that mutating container-owned values was never a safe practice:

const container = createContainer().register({
  config: asValue({ debug: true }),
})

const config = container.resolve('config')
config.debug = false // Error: Cannot assign to 'debug' because it is a read-only property

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - Between 07:00 AM and 04:59 PM, only on Monday, Tuesday, Wednesday, and Thursday ( * 7-16 * * 1,2,3,4 ) (UTC).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Never, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants