Closed Romakita closed 1 day ago
[!IMPORTANT]
Review skipped
More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.
133 files out of 224 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits.
You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The pull request includes extensive updates to the documentation and codebase related to dependency injection in Ts.ED. Key changes involve clarifications in the documentation regarding injection scopes, modifications to method signatures and parameter handling in the code, particularly concerning how locals
are passed to various methods. Additionally, several tests have been adjusted to align with the new parameter structures, while some properties in interfaces have been removed or added, reflecting a more streamlined approach to dependency management.
File | Change Summary |
---|---|
docs/docs/injection-scopes.md |
Updated documentation on injection scopes, clarified behavior of singleton , request , and instance scopes, added examples for request scope, removed import statement for injector . |
packages/di/src/common/decorators/autoInjectable.ts |
Modified resolveAutoInjectableArgs to pass locals and parent as a single object instead of separate arguments. |
packages/di/src/common/fn/inject.ts |
Updated handling of opts parameter to integrate locals into the opts object using a spread operator. |
packages/di/src/common/fn/injectMany.ts |
Changed handling of locals to encapsulate it within a new options object. |
packages/di/src/common/integration/di.spec.ts |
Adjusted test cases to pass locals as an object instead of directly, added new test for class invocation with useClass . |
packages/di/src/common/integration/request.spec.ts |
Updated service invocation in tests to pass locals encapsulated in an object. |
packages/di/src/common/interfaces/InvokeOptions.ts |
Removed scope property from InvokeOptions interface. |
packages/di/src/common/interfaces/RegistrySettings.ts |
Removed locals parameter from onInvoke method signature. |
packages/di/src/common/interfaces/ResolvedInvokeOptions.ts |
Removed scope property and added locals property to ResolvedInvokeOptions interface. |
packages/di/src/common/registries/GlobalProviders.spec.ts |
Updated onInvoke test case to reflect changes in parameter structure. |
packages/di/src/common/registries/GlobalProviders.ts |
Removed locals parameter from onInvoke method signature. |
packages/di/src/common/services/InjectorService.spec.ts |
Modified invoke() method calls in tests to pass locals encapsulated in an object. |
packages/di/src/common/services/InjectorService.ts |
Removed locals parameter from getMany , invoke , and resolve methods, using options.locals instead. |
packages/di/src/node/domain/DIContext.ts |
Removed unused imports and maintained core functionality. |
packages/graphql/apollo/src/services/ApolloService.ts |
Updated createContextHandler to pass locals wrapped in an object. |
packages/orm/adapters/src/services/Adapters.ts |
Simplified invokeAdapter method by removing locals parameter from injector.invoke . |
packages/orm/ioredis/src/domain/IORedisStore.spec.ts |
Added mock implementation for Redis class for testing, enhancing cacheable value handling. |
packages/orm/ioredis/src/utils/registerConnectionProvider.spec.ts |
Modified mock return value to include default property for Redis class. |
packages/orm/mikro-orm/src/MikroOrmModule.ts |
Reformatted code for readability; simplified parameter structure in getUnmanagedSubscribers . |
packages/platform/platform-params/src/builder/PlatformParams.ts |
Updated compileHandler to pass locals as an object during injector invocation. |
packages/platform/platform-router/src/domain/PlatformRouters.ts |
Changed injector access from destructured parameter to function call. |
packages/platform/platform-router/test/routers-injection.integration.spec.ts |
Updated injector usage to invoke injector() directly instead of instantiating InjectorService . |
.gitignore |
Enhanced file ignoring configuration by adding entries for various temporary and build files. |
docs/docs/configuration/index.md |
Updated server configuration documentation, added rawBody option, removed scopes and resolvers , marked componentsScan as deprecated. |
docs/docs/configuration/snippets/module-resolvers.ts |
Deleted file containing module definition with custom resolver. |
docs/docs/configuration/snippets/server-resolvers.ts |
Deleted file containing server configuration with custom resolver. |
packages/di/src/common/decorators/module.ts |
Removed resolvers property from ModuleOptions interface. |
packages/di/src/common/domain/Provider.ts |
Updated get method with overloaded signature and introduced getArgOpts method. |
packages/di/src/common/fn/injectable.ts |
Removed resolvers property from PickedProps type and updated Props constant. |
packages/di/src/common/index.ts |
Removed exports for DIResolver , resolveControllers , and ProviderOpts . |
packages/di/src/common/integration/resolvers.spec.ts |
Deleted file containing tests for the DI system's resolver functionality. |
packages/di/src/common/interfaces/DIConfigurationOptions.ts |
Removed resolvers property from Configuration interface. |
packages/di/src/common/interfaces/DIResolver.ts |
Deleted file defining the DIResolver interface. |
packages/di/src/common/interfaces/ProviderOpts.ts |
Removed resolvers property from ProviderOpts interface. |
packages/di/src/common/services/DIConfiguration.spec.ts |
Removed tests for scopes() and resolvers() methods. |
packages/di/src/common/services/DIConfiguration.ts |
Removed scopes and resolvers properties and their associated methods from DIConfiguration class. |
packages/di/src/node/domain/DIContext.spec.ts |
Updated tests for DIContext class to include new properties and behaviors. |
packages/platform/platform-http/src/common/builder/PlatformBuilder.ts |
Refactored PlatformBuilder class to enhance dependency injection and lifecycle management. |
packages/platform/platform-http/src/common/index.ts |
Added export for resolveControllers utility. |
packages/platform/platform-http/src/common/utils/resolveControllers.spec.ts |
Updated import paths to reflect new directory structure. |
packages/platform/platform-http/src/common/utils/resolveControllers.ts |
Consolidated imports and modified visibility of getTokens and resolveControllers functions. |
packages/platform/platform-params/vitest.config.mts |
Updated coverage thresholds in Vitest configuration. |
packages/third-parties/components-scan/src/importProviders.spec.ts |
Changed import source for resolveControllers function. |
tools/vitest/presets/index.js |
Updated coverage exclusion patterns in Vitest presets configuration. |
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
Documentation
singleton
,request
, andinstance
scopes with expanded examples.rawBody
option.scopes
andresolvers
in the documentation.Refactor
locals
parameters, streamlining dependency resolution.scopes
andresolvers
.Tests
locals
are passed to theinjector
, ensuring consistency with new parameter structures.DIContext
class to cover synchronous and asynchronous caching behaviors.scopes
andresolvers
from the configuration.