113 Commits

Author SHA1 Message Date
a70869a941 docs: reflect changes to changelog v1.2.0 2025-04-02 22:20:58 +02:00
7a6253a386 docs: Push version to 1.2.0 2025-04-02 22:20:58 +02:00
31de73db00 docs(api): add full JSDoc for all inject() overloads with examples 2025-04-02 22:20:58 +02:00
688a9d4ee4 docs: reflect changes to changelog v1.1.0 2025-04-02 22:01:10 +02:00
39dbd6d816 docs: Push version to 1.1.0 2025-04-02 22:01:10 +02:00
0718ff9d68 feat(api): expose inject() function via index.ts 2025-04-02 22:01:10 +02:00
115b3181e0 docs: reflect changes to changelog v1.0.0 2025-04-02 21:52:36 +02:00
c7fa78270c chore: update package-lock.json 2025-04-02 21:52:36 +02:00
3401656219 test(inject): add test suite to verify behavior of new inject() function 2025-04-02 21:52:36 +02:00
7e7fd996b3 feat(core): add inject() function to programmatically inject dependencies 2025-04-02 21:52:36 +02:00
a6fabc329b refactor(resolve): rename necessary parameter to isNecessary for clarity 2025-04-02 21:52:36 +02:00
81fb7f0071 refactor(inject): rename necessary parameter to isNecessary for clarity 2025-04-02 21:52:36 +02:00
2e89cdd619 test(config): modernize jest setup for ESM 2025-04-02 21:52:36 +02:00
b157f48261 fix: imports in tests 2025-04-02 21:52:36 +02:00
bbf68bff34 docs: reflect changes to changelog 2025-04-02 21:52:36 +02:00
b994a074c0 docs: Push version to 1.0.0 2025-04-02 21:52:36 +02:00
1da8efff94 feat(cli): add --without-extension flag to control import path formatting 2025-04-02 21:52:36 +02:00
c6e9fbd2a3 feat!: switch to native ESM with NodeNext module resolution and .js import paths
BREAKING CHANGE: Consumers must use ESM-compatible environments.
All import paths now include .js extensions.
CommonJS (require) is no longer supported.
2025-04-02 21:52:36 +02:00
9bd899581f docs: reflect new export to changelog v0.4.0 2025-04-02 20:22:07 +02:00
b43e4ee12f docs: push version to 0.4.0 2025-04-02 20:22:07 +02:00
ef4a2295bf feat: Export ImplementsStatic helper function 2025-04-02 20:22:07 +02:00
f4f8c7b78e docs: Fix changelog links 2025-03-14 13:52:53 +01:00
beaad4f65e docs: Fix changelog links 2025-03-14 13:51:17 +01:00
20Max01
95ef003e99 Feature/integrate register instance in register (#2)
* 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
v0.3.0
2025-03-14 13:43:10 +01:00
9660d77e0c docs: push version to 0.2.0 v0.2.0 2025-03-14 13:36:29 +01:00
dce76a5fb3 docs: reflect new cli command to changelog 2025-03-14 13:36:29 +01:00
23e6248299 feat: Introduced a new CLI command tsinjex-generate to automate the generation of import statements for registered dependencies. 2025-03-14 13:36:29 +01:00
d8fb82943f feat: Introduced a new script to automate the generation of import statements for registered dependencies 2025-03-14 13:36:29 +01:00
2942e15fcf docs: Reflect changes to changelog 2024-08-24 03:13:56 +02:00
1d94b33542 ci: Add a build option for pre release buils from dev/* branches 2024-08-24 03:13:56 +02:00
08d58b2d41 build: Add new complete prepare deploy command 2024-08-24 03:13:56 +02:00
19f7be1e3d ci: Disable branch validation workflow 2024-08-23 21:34:18 +02:00
Max P.
a490ea980a Revert "feat: Update Identifier documentation in TypeScript"
This reverts commit 6e6a521c1f.
2024-08-23 21:23:56 +02:00
Max P.
d69eacf9be Revert "docs: Add Identifiers Changelog entry"
This reverts commit 099c8dbfa3.
2024-08-23 21:23:56 +02:00
099c8dbfa3 docs: Add Identifiers Changelog entry 2024-08-23 19:24:47 +02:00
6e6a521c1f feat: Update Identifier documentation in TypeScript 2024-08-23 19:24:47 +02:00
ac99f7d306 ci: Fix release naming in workflow 2024-08-23 00:25:57 +02:00
58767b85f7 docs: Reflect Version change in Changelog 2024-08-23 00:23:56 +02:00
5e095d7b09 docs: Push version to 0.1.0 2024-08-23 00:17:14 +02:00
32126c0784 docs: Add changelog entrys 2024-08-23 00:17:14 +02:00
5df69c219e test: Add additional tests for Inject decorator 2024-08-23 00:17:14 +02:00
5bc9aef9ad feat: Add initialization error handling and refactor Inject 2024-08-23 00:17:14 +02:00
ae9f25fe94 feat: Add new Error InitializationError to reflect errors during initialization of a dependency 2024-08-23 00:17:14 +02:00
4a97a46aed docs: Added **ChangeLog** file 2024-08-23 00:17:14 +02:00
e0542214c0 docs: Add Identifiers and Jest Sections to the README.md file 2024-08-23 00:17:14 +02:00
e6e304dfc7 ci: changed version format to prefix the version wth v 2024-08-23 00:17:14 +02:00
75333b3310 Add error handling and constructor checks to Inject
- 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
2024-08-23 00:17:14 +02:00
ba9ec70c77 Add InjectorError and NoInstantiationMethodError classes
- Added `InjectorError` class for handling injector errors
- Added `NoInstantiationMethodError` class for missing instantiation methods
- Both classes extend `TSinjexError` and provide detailed error messages
2024-08-23 00:17:14 +02:00
6f20913e4a Update DependencyResolutionError to use Identifier type
- Import `Identifier` from `src/types/Identifier`
- Change `identifier` parameter type in `DependencyResolutionError` constructor from `string` to `Identifier`
- Update error message to call `identifier.toString()`
2024-08-23 00:17:14 +02:00
c5ea21356c Update Identifier type to include symbol
- Modified `Identifier` type in `src/types/Identifier.ts` from `string` to `string | symbol`
2024-08-23 00:17:14 +02:00