Releases: Naviary-Sanctuary/navi-di
Releases · Naviary-Sanctuary/navi-di
v1.2.0
Full Changelog: v1.1.2...v1.2.0
v1.1.2
What's Changed
- Feat: factory/class/value provider by @changchanghwang in #5
- fix:
hascheck binding map first and fallback metadata by @changchanghwang in #6 - feat: try get and dispose by @changchanghwang in #7
Full Changelog: v1.1.1...v1.1.2
v1.1.1
v1.1.0
What's Changed
- feat: add token by @changchanghwang in #1
- Chore: settings by @changchanghwang in #2
- Feat: add convenience methods by @changchanghwang in #3
Full Changelog: v0.1.0...v1.1.0
v1.0.0
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:
containersingletontransient
- Reset and low-level registration APIs for tests and advanced use cases
Public API
Root runtime exports:
ContainerServiceInjectToken
Root type exports:ConstructableAbstractConstructableServiceIdentifier
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 resetscontainer.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
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