BREAKING CHANGE: Consumers must use ESM-compatible environments.
All import paths now include .js extensions.
CommonJS (require) is no longer supported.
* refactor: consolidate registration decorators
- Introduced `Register` decorator to handle class and instance registration in the DI container.
- Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration.
- Added support for marking dependencies as deprecated with a warning logged upon first resolution.
- Updated documentation with examples and notes on deprecation.
* tests: add mode parameter to RegisterInstanceDecorator
- Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes.
- Updated test cases to utilize the new `mode` parameter when registering an instance.
- Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings.
- Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode.
* docs: Reflect changes to changelog
* refactor: add region tags for overloads in Register.ts
* docs: Reflect changes to changelog
* refactor: consolidate registration decorators
- Introduced `Register` decorator to handle class and instance registration in the DI container.
- Deprecated `RegisterInstance` in favor of `Register`, which now internally handles instance registration.
- Added support for marking dependencies as deprecated with a warning logged upon first resolution.
- Updated documentation with examples and notes on deprecation.
* tests: add mode parameter to RegisterInstanceDecorator
- Introduced a `mode` parameter to the `test_RegisterInstanceDecorator` function allowing 'instance' or 'standalone' modes.
- Updated test cases to utilize the new `mode` parameter when registering an instance.
- Disabled specific ESLint rule in `Decorators.test.ts` for deprecation warnings.
- Added an additional test call to `test_RegisterInstanceDecorator` with 'instance' mode.
* docs: Reflect changes to changelog
* refactor: add region tags for overloads in Register.ts
* docs: Reflect changes to changelog
* docs: Reflect changes to changelog und push version
- Import additional exception classes from `src/interfaces/Exceptions`
- Modify `Inject` function to:
- Accept `init` parameter as a function or `true` for instantiation
- Throw specific errors: `DependencyResolutionError`, `InjectorError`, `NoInstantiationMethodError`
- Ensure necessary dependencies are handled properly
- Define property with `Object.defineProperty` for performance
- Add `hasConstructor` helper function to check if an object has a constructor
- Added `InjectorError` class for handling injector errors
- Added `NoInstantiationMethodError` class for missing instantiation methods
- Both classes extend `TSinjexError` and provide detailed error messages
- Import `Identifier` from `src/types/Identifier`
- Change `identifier` parameter type in `DependencyResolutionError` constructor from `string` to `Identifier`
- Update error message to call `identifier.toString()`