Skip to content

Releases: Naviary-Sanctuary/navi-di

v1.2.0

30 Mar 04:09

Choose a tag to compare

v1.1.2

27 Mar 03:30

Choose a tag to compare

What's Changed

Full Changelog: v1.1.1...v1.1.2

v1.1.1

24 Mar 11:31

Choose a tag to compare

What's Changed

Full Changelog: v1.1.0...v1.1.1

v1.1.0

24 Mar 11:30

Choose a tag to compare

What's Changed

Full Changelog: v0.1.0...v1.1.0

v1.0.0

22 Mar 07:04

Choose a tag to compare

navi-di v1.0.0

This is the first public release of navi-di.
navi-di is a compact dependency injection library built for standard ECMAScript decorators. It focuses on a small, explicit core for registration, injection, and resolution without introducing framework-heavy abstractions.

Highlights

  • Simple container-based resolution with Container.of().get(id)
  • Decorator-driven registration and injection with @Service() and @Inject()
  • Support for class-based and Token-based service identifiers
  • Named containers for isolated resolution contexts
  • Three built-in lifetimes:
    • container
    • singleton
    • transient
  • Reset and low-level registration APIs for tests and advanced use cases

Public API

Root runtime exports:

  • Container
  • Service
  • Inject
  • Token
    Root type exports:
  • Constructable
  • AbstractConstructable
  • ServiceIdentifier
    The root export surface is intentionally small to keep the package easier to learn and more stable over time.

Runtime and behavior

  • Property injection via @Inject()
  • Service registration via @Service()
  • Named container support through Container.of(id)
  • Default-container fallback for named containers
  • Explicit runtime failures for missing services and circular dependencies
  • container.reset() for cache or registration resets
  • container.set() as a low-level manual registration API

Requirements

  • Node.js >=18.18
  • ESM environment
  • TypeScript 5-style standard decorators

Notes

  • Injection is property-based, not constructor-based.
  • Services are instantiated with new Class(), so they must be resolvable without constructor arguments.
  • Injected fields are assigned after construction, which means they are not available inside constructors or field initializers.
  • container.set() is available for low-level manual registration, but @Service() is the recommended default for normal usage.

Reliability

This release was verified with:

  • lint
  • format check
  • typecheck
  • test
  • build
  • package pack validation
  • direct built-package import
  • packed-package install and import smoke test

Contributor workflow

  • Optional repo-local Lefthook hooks
  • PR CI for lint, format, typecheck, test, and build

v0.1.0

20 Mar 08:45

Choose a tag to compare

Initial public release of navi-di, a lightweight dependency injection library built for standard ECMAScript decorators.

Highlights

  • Register services with @service()
  • Inject dependencies with @Inject()
  • Resolve services through Container.of() with default and named containers
  • Support singleton, container, and transient lifecycles
  • Detect circular dependencies and missing services with explicit runtime errors
  • Ship ESM output with TypeScript declarations

Included in this release

  • Core container and named container registry
  • Property-based injection flow using standard decorator metadata
  • Default-container fallback behavior for named containers
  • Cache reset and service reset support for testing and scoped usage
  • Bun-based test, typecheck, lint, format, and build workflow

Current scope

  • Focused on a small DI core
  • Property injection only, not constructor injection
  • Services are resolved with no-argument construction

Full Changelog: https://github.com/Naviary-Sanctuary/navi-di/commits/v0.1.0