@tsed/di 8.9.4 → 8.10.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/di.umd.cjs +8 -0
- package/lib/esm/common/decorators/autoInjectable.js +1 -1
- package/lib/esm/common/decorators/autoInjectable.js.map +1 -1
- package/lib/esm/common/decorators/configuration.js +2 -1
- package/lib/esm/common/decorators/configuration.js.map +1 -1
- package/lib/esm/common/decorators/constant.js +3 -2
- package/lib/esm/common/decorators/constant.js.map +1 -1
- package/lib/esm/common/decorators/controller.js +13 -4
- package/lib/esm/common/decorators/controller.js.map +1 -1
- package/lib/esm/common/decorators/inject.js +6 -1
- package/lib/esm/common/decorators/inject.js.map +1 -1
- package/lib/esm/common/decorators/intercept.js +5 -1
- package/lib/esm/common/decorators/intercept.js.map +1 -1
- package/lib/esm/common/decorators/lazyInject.js +2 -1
- package/lib/esm/common/decorators/lazyInject.js.map +1 -1
- package/lib/esm/common/decorators/module.js +1 -1
- package/lib/esm/common/decorators/module.js.map +1 -1
- package/lib/esm/common/decorators/opts.js +1 -1
- package/lib/esm/common/decorators/opts.js.map +1 -1
- package/lib/esm/common/decorators/scope.js +1 -1
- package/lib/esm/common/decorators/scope.js.map +1 -1
- package/lib/esm/common/decorators/useOpts.js +4 -1
- package/lib/esm/common/decorators/useOpts.js.map +1 -1
- package/lib/esm/common/decorators/value.js +2 -2
- package/lib/esm/common/decorators/value.js.map +1 -1
- package/lib/esm/common/domain/Provider.js +5 -1
- package/lib/esm/common/domain/Provider.js.map +1 -1
- package/lib/esm/common/errors/InjectionError.js +4 -1
- package/lib/esm/common/errors/InjectionError.js.map +1 -1
- package/lib/esm/common/errors/InvalidPropertyTokenError.js +2 -1
- package/lib/esm/common/errors/InvalidPropertyTokenError.js.map +1 -1
- package/lib/esm/common/fn/configuration.js +1 -1
- package/lib/esm/common/fn/configuration.js.map +1 -1
- package/lib/esm/common/fn/lazyInject.js +1 -1
- package/lib/esm/common/fn/lazyInject.js.map +1 -1
- package/lib/esm/common/registries/GlobalProviders.js +1 -1
- package/lib/esm/common/registries/GlobalProviders.js.map +1 -1
- package/lib/esm/common/services/DIConfiguration.js +2 -1
- package/lib/esm/common/services/DIConfiguration.js.map +1 -1
- package/lib/esm/common/services/InjectorService.js +10 -1
- package/lib/esm/common/services/InjectorService.js.map +1 -1
- package/lib/esm/common/utils/discoverHooks.js +1 -1
- package/lib/esm/common/utils/discoverHooks.js.map +1 -1
- package/lib/esm/common/utils/getConfiguration.js +1 -1
- package/lib/esm/common/utils/getConfiguration.js.map +1 -1
- package/lib/esm/common/utils/getConstructorDependencies.js +1 -1
- package/lib/esm/common/utils/getConstructorDependencies.js.map +1 -1
- package/lib/esm/common/utils/providerBuilder.js.map +1 -1
- package/lib/esm/node/decorators/injectContext.js +1 -1
- package/lib/esm/node/decorators/injectContext.js.map +1 -1
- package/lib/esm/node/services/DITest.js +4 -1
- package/lib/esm/node/services/DITest.js.map +1 -1
- package/lib/types/common/decorators/constant.d.ts +1 -1
- package/lib/types/common/decorators/controller.d.ts +1 -1
- package/lib/types/common/decorators/inject.d.ts +1 -1
- package/lib/types/common/decorators/intercept.d.ts +1 -1
- package/lib/types/common/decorators/overrideProvider.d.ts +1 -1
- package/lib/types/common/decorators/value.d.ts +1 -1
- package/lib/types/common/domain/Provider.d.ts +2 -1
- package/lib/types/common/fn/injectable.d.ts +1 -1
- package/lib/types/common/interfaces/RegistrySettings.d.ts +1 -1
- package/lib/types/common/registries/GlobalProviders.d.ts +1 -1
- package/lib/types/common/services/DIConfiguration.d.ts +1 -1
- package/lib/types/common/utils/createContainer.d.ts +1 -1
- package/lib/types/common/utils/discoverHooks.d.ts +1 -1
- package/lib/types/common/utils/getConfiguration.d.ts +1 -1
- package/lib/types/common/utils/providerBuilder.d.ts +2 -1
- package/package.json +17 -19
- package/readme.md +1 -1
- package/src/common/decorators/autoInjectable.ts +2 -1
- package/src/common/decorators/configuration.ts +4 -2
- package/src/common/decorators/constant.ts +3 -2
- package/src/common/decorators/controller.ts +18 -9
- package/src/common/decorators/inject.ts +7 -1
- package/src/common/decorators/intercept.ts +8 -1
- package/src/common/decorators/lazyInject.spec.ts +1 -1
- package/src/common/decorators/lazyInject.ts +2 -1
- package/src/common/decorators/module.ts +1 -1
- package/src/common/decorators/opts.ts +1 -1
- package/src/common/decorators/overrideProvider.ts +1 -1
- package/src/common/decorators/scope.ts +1 -1
- package/src/common/decorators/useOpts.ts +4 -1
- package/src/common/decorators/value.ts +2 -2
- package/src/common/domain/Provider.ts +6 -1
- package/src/common/errors/InjectionError.ts +4 -1
- package/src/common/errors/InvalidPropertyTokenError.ts +2 -1
- package/src/common/fn/configuration.ts +1 -1
- package/src/common/fn/lazyInject.ts +1 -1
- package/src/common/interfaces/RegistrySettings.ts +1 -1
- package/src/common/registries/GlobalProviders.ts +2 -1
- package/src/common/services/DIConfiguration.ts +3 -1
- package/src/common/services/InjectorService.ts +10 -1
- package/src/common/utils/createContainer.ts +1 -1
- package/src/common/utils/discoverHooks.ts +2 -1
- package/src/common/utils/getConfiguration.ts +2 -1
- package/src/common/utils/getConstructorDependencies.ts +1 -1
- package/src/common/utils/providerBuilder.ts +2 -1
- package/src/node/decorators/injectContext.ts +1 -1
- package/src/node/services/DITest.ts +4 -1
- package/vite.config.mts +19 -0
- package/lib/browser/di.umd.min.js +0 -2
- package/lib/browser/di.umd.min.js.map +0 -1
- package/webpack.config.cjs +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discoverHooks.js","sourceRoot":"","sources":["../../../../src/common/utils/discoverHooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discoverHooks.js","sourceRoot":"","sources":["../../../../src/common/utils/discoverHooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AAExD,MAAM,UAAU,aAAa,CAAC,KAA+B;IAC3D,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAC,WAAW,EAAC,EAAE,EAAE;QACtD,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,MAAM,QAAQ,GAAG,CAAC,QAAa,EAAE,GAAG,IAAW,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YAErF,OAAO;gBACL,GAAG,KAAK;gBACR,CAAC,WAAW,CAAC,EAAE,QAAQ;aACxB,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,EAAS,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../../../src/common/utils/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"getConfiguration.js","sourceRoot":"","sources":["../../../../src/common/utils/getConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,2BAA2B,CAAC;AAGhD,MAAM,UAAU,UAAU,CAAC,KAAU,EAAE,EAAE,KAAU,EAAE;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE;QAC7D,OAAO;YACL,GAAG,KAAK;YACR,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;SAC9C,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,gBAAqB,EAAE;IACzE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAE5D,OAAO;QACL,GAAG,KAAK;QACR,GAAG,aAAa;QAChB,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC;KACpD,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Metadata } from "@tsed/core";
|
|
1
|
+
import { Metadata } from "@tsed/core/types/Metadata.js";
|
|
2
2
|
export function getConstructorDependencies(target, propertyKey) {
|
|
3
3
|
return Metadata.getOwn("override:ctor:design:paramtypes", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)] || [];
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConstructorDependencies.js","sourceRoot":"","sources":["../../../../src/common/utils/getConstructorDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"getConstructorDependencies.js","sourceRoot":"","sources":["../../../../src/common/utils/getConstructorDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AAEtD,MAAM,UAAU,0BAA0B,CAAC,MAAW,EAAE,WAAyC;IAC/F,OAAO,QAAQ,CAAC,MAAM,CAAC,iCAAiC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3I,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAAW,EAAE,IAAW;IACjE,QAAQ,CAAC,GAAG,CAAC,iCAAiC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerBuilder.js","sourceRoot":"","sources":["../../../../src/common/utils/providerBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,m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AAC,eAAe,GAAG,YAAY,CAAC;gBACxC,OAAO,IAAI,CAAC;YACd,CAAC;YACD,KAAK,CAAC,KAAU;gBACd,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACjB,QAAQ,CAAC,QAAQ,GAAG,KAAK,CAAC;gBAC1B,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC;gBACnC,OAAO,IAAI,CAAC;YACd,CAAC;YACD,KAAK,CAAC,CAAM;gBACV,QAAQ,CAAC,KAAK,EAAE,CAAC;gBACjB,QAAQ,CAAC,QAAQ,GAAG,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,KAAK;gBACH,OAAO,QAAQ,CAAC,KAAK,CAAC;YACxB,CAAC;YACD,OAAO;gBACL,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,KAAK;gBACH,OAAO,QAAQ,CAAC,KAAe,CAAC;YAClC,CAAC;SAC2D,CAC/D,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectContext.js","sourceRoot":"","sources":["../../../../src/node/decorators/injectContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"injectContext.js","sourceRoot":"","sources":["../../../../src/node/decorators/injectContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,gCAAgC,CAAC;AAG1D,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,YAA0C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAc,EAAE;QACtD,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YAC1C,GAAG;gBACD,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YAC9B,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Env
|
|
1
|
+
import { Env } from "@tsed/core/types/Env.js";
|
|
2
|
+
import { getValue } from "@tsed/core/utils/getValue.js";
|
|
3
|
+
import { isClass } from "@tsed/core/utils/isClass.js";
|
|
4
|
+
import { isObject } from "@tsed/core/utils/isObject.js";
|
|
2
5
|
import { $log } from "@tsed/logger";
|
|
3
6
|
import { cleanAllLocalsContainer, detachLocalsContainer, localsContainer } from "../../common/fn/localsContainer.js";
|
|
4
7
|
import { createContainer, destroyInjector, DI_INJECTABLE_PROPS, inject, injector } from "../../common/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DITest.js","sourceRoot":"","sources":["../../../../src/node/services/DITest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"DITest.js","sourceRoot":"","sources":["../../../../src/node/services/DITest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,yBAAyB,CAAC;AAC5C,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAC,OAAO,EAAC,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAC;AAElC,OAAO,EAAC,uBAAuB,EAAE,qBAAqB,EAAE,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACnH,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,QAAQ,EAKT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;AACj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CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;aACjD;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -5,7 +5,7 @@ export declare function bindConstant(target: any, propertyKey: string | symbol,
|
|
|
5
5
|
* ## Example
|
|
6
6
|
*
|
|
7
7
|
* ```typescript
|
|
8
|
-
* import {Env} from "@tsed/core";
|
|
8
|
+
* import {Env} from "@tsed/core/domain/Env.js";
|
|
9
9
|
* import {Constant, Value} from "@tsed/di";
|
|
10
10
|
*
|
|
11
11
|
* export class MyClass {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
1
|
+
import { Type } from "@tsed/core/types/Type.js";
|
|
2
2
|
import type { ControllerMiddlewares } from "../domain/ControllerProvider.js";
|
|
3
3
|
import { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
4
4
|
export type PathType = string | RegExp | (string | RegExp)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Type } from "@tsed/core";
|
|
1
|
+
import { type Type } from "@tsed/core/types/Type.js";
|
|
2
2
|
import { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
3
3
|
export type TransformInjectedProviderCB<T, Klass = any> = (instance: T, { target, propertyKey }: {
|
|
4
4
|
self: Klass;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
1
|
+
import { Type } from "@tsed/core/types/Type.js";
|
|
2
2
|
import type { InterceptorMethods } from "../interfaces/InterceptorMethods.js";
|
|
3
3
|
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
4
4
|
export declare function getInterceptorOptions<T>(target: Type<any>, propertyKey: string | symbol): T;
|
|
@@ -5,7 +5,7 @@ export declare function bindValue(target: any, propertyKey: string | symbol, exp
|
|
|
5
5
|
* ## Example
|
|
6
6
|
*
|
|
7
7
|
* ```typescript
|
|
8
|
-
* import {Env} from "@tsed/core";
|
|
8
|
+
* import {Env} from "@tsed/core/domain/Env.js";
|
|
9
9
|
* import {Constant, Value} from "@tsed/di";
|
|
10
10
|
*
|
|
11
11
|
* export class MyClass {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Store } from "@tsed/core/types/Store.js";
|
|
2
|
+
import { type AbstractType, Type } from "@tsed/core/types/Type.js";
|
|
2
3
|
import type { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
3
4
|
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
4
5
|
import { ProviderScope } from "./ProviderScope.js";
|
|
@@ -3,5 +3,5 @@ import type { Provider } from "../domain/Provider.js";
|
|
|
3
3
|
type PickedProps = "scope" | "path" | "alias" | "hooks" | "deps" | "imports" | "configuration" | "priority";
|
|
4
4
|
export declare const injectable: import("../utils/providerBuilder.js").ProviderBuilderFn<Provider<any>, "type" | PickedProps>;
|
|
5
5
|
export declare const interceptor: import("../utils/providerBuilder.js").ProviderBuilderFn<Provider<any>, "type" | PickedProps>;
|
|
6
|
-
export declare const controller: import("../utils/providerBuilder.js").ProviderBuilderFn<ControllerProvider<any>, "
|
|
6
|
+
export declare const controller: import("../utils/providerBuilder.js").ProviderBuilderFn<ControllerProvider<any>, "children" | "middlewares" | PickedProps>;
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
1
|
+
import { Type } from "@tsed/core/types/Type.js";
|
|
2
2
|
import { Provider } from "../domain/Provider.js";
|
|
3
3
|
import { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
4
4
|
import { RegistrySettings } from "../interfaces/RegistrySettings.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Env } from "@tsed/core";
|
|
1
|
+
import { Env } from "@tsed/core/types/Env.js";
|
|
2
2
|
import type { DILoggerOptions } from "../interfaces/DILoggerOptions.js";
|
|
3
3
|
import type { ImportTokenProviderOpts } from "../interfaces/ImportTokenProviderOpts.js";
|
|
4
4
|
import type { TokenProvider } from "../interfaces/TokenProvider.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type AbstractType, type Type } from "@tsed/core";
|
|
1
|
+
import { type AbstractType, type Type } from "@tsed/core/types/Type.js";
|
|
2
2
|
export declare function discoverHooks(token: Type | AbstractType<any>): any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../registries/ProviderRegistry.js";
|
|
2
|
-
import { Store
|
|
2
|
+
import { Store } from "@tsed/core/types/Store.js";
|
|
3
|
+
import { type Type } from "@tsed/core/types/Type.js";
|
|
3
4
|
import type { ProviderOpts } from "../interfaces/ProviderOpts.js";
|
|
4
5
|
import type { FactoryTokenProvider, TokenProvider } from "../interfaces/TokenProvider.js";
|
|
5
6
|
type BaseMethodsProvider<TypeOf, BaseProvider, T extends object> = {
|
package/package.json
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"name": "@tsed/di",
|
|
3
3
|
"description": "DI module for Ts.ED Framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.10.0-rc.1",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
9
9
|
"typings": "./lib/types/index.d.ts",
|
|
10
|
-
"browser": "./lib/browser/di.umd.
|
|
10
|
+
"browser": "./lib/browser/di.umd.cjs",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"tsed-source": "./src/index.ts",
|
|
14
14
|
"types": "./lib/types/index.d.ts",
|
|
15
|
-
"browser": "./lib/browser/di.umd.
|
|
15
|
+
"browser": "./lib/browser/di.umd.cjs",
|
|
16
16
|
"import": "./lib/esm/index.js",
|
|
17
17
|
"default": "./lib/esm/index.js"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "yarn barrels && yarn build:ts && yarn run build:browser",
|
|
22
|
-
"build:browser": "
|
|
22
|
+
"build:browser": "vite build",
|
|
23
23
|
"barrels": "barrels",
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"build:ts": "tsc --build tsconfig.esm.json",
|
|
@@ -30,23 +30,21 @@
|
|
|
30
30
|
"uuid": "^10.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@tsed/barrels": "8.
|
|
34
|
-
"@tsed/core": "8.
|
|
35
|
-
"@tsed/hooks": "8.
|
|
33
|
+
"@tsed/barrels": "8.10.0-rc.1",
|
|
34
|
+
"@tsed/core": "8.10.0-rc.1",
|
|
35
|
+
"@tsed/hooks": "8.10.0-rc.1",
|
|
36
36
|
"@tsed/logger": "^7.0.1",
|
|
37
|
-
"@tsed/
|
|
38
|
-
"@tsed/typescript": "8.9.4",
|
|
37
|
+
"@tsed/typescript": "8.10.0-rc.1",
|
|
39
38
|
"cross-env": "7.0.3",
|
|
40
39
|
"eslint": "9.12.0",
|
|
41
40
|
"typescript": "5.4.5",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
41
|
+
"vite": "6.2.2",
|
|
42
|
+
"vitest": "3.1.4"
|
|
44
43
|
},
|
|
45
44
|
"peerDependencies": {
|
|
46
|
-
"@tsed/core": ">=8.
|
|
47
|
-
"@tsed/hooks": ">=8.
|
|
48
|
-
"@tsed/logger": ">=7.0.1"
|
|
49
|
-
"@tsed/schema": ">=8.9.4"
|
|
45
|
+
"@tsed/core": ">=8.0.0",
|
|
46
|
+
"@tsed/hooks": ">=8.0.0",
|
|
47
|
+
"@tsed/logger": ">=7.0.1"
|
|
50
48
|
},
|
|
51
49
|
"peerDependenciesMeta": {
|
|
52
50
|
"@tsed/core": {
|
|
@@ -57,9 +55,6 @@
|
|
|
57
55
|
},
|
|
58
56
|
"@tsed/logger": {
|
|
59
57
|
"optional": false
|
|
60
|
-
},
|
|
61
|
-
"@tsed/schema": {
|
|
62
|
-
"optional": false
|
|
63
58
|
}
|
|
64
59
|
},
|
|
65
60
|
"repository": "https://github.com/tsedio/tsed",
|
|
@@ -68,5 +63,8 @@
|
|
|
68
63
|
},
|
|
69
64
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/di",
|
|
70
65
|
"author": "Romain Lenzotti",
|
|
71
|
-
"license": "MIT"
|
|
66
|
+
"license": "MIT",
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"tag": "rc"
|
|
69
|
+
}
|
|
72
70
|
}
|
package/readme.md
CHANGED
|
@@ -36,7 +36,7 @@ A powerful and flexible Dependency Injection (DI) toolkit inspired by Angular, d
|
|
|
36
36
|
Install the latest release and required peer dependencies:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
npm install --save @tsed/di @tsed/core @tsed/hooks @tsed/logger
|
|
39
|
+
npm install --save @tsed/di @tsed/core @tsed/hooks @tsed/logger
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
> **Important!**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {DecoratorParameters
|
|
1
|
+
import {DecoratorParameters} from "@tsed/core/types/DecoratorParameters.js";
|
|
2
|
+
import {DecoratorTypes} from "@tsed/core/types/DecoratorTypes.js";
|
|
3
|
+
import {decoratorTypeOf} from "@tsed/core/utils/decoratorTypeOf.js";
|
|
2
4
|
|
|
3
5
|
import {configuration} from "../fn/configuration.js";
|
|
4
6
|
import {injectable} from "../fn/injectable.js";
|
|
5
7
|
import {injector} from "../fn/injector.js";
|
|
6
|
-
import {
|
|
8
|
+
import {DIConfiguration} from "../services/DIConfiguration.js";
|
|
7
9
|
import {Inject} from "./inject.js";
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {catchError
|
|
1
|
+
import {catchError} from "@tsed/core/utils/catchError.js";
|
|
2
|
+
import {deepClone} from "@tsed/core/utils/deepClone.js";
|
|
2
3
|
|
|
3
4
|
import {constant} from "../fn/constant.js";
|
|
4
5
|
|
|
@@ -36,7 +37,7 @@ export function bindConstant(target: any, propertyKey: string | symbol, expressi
|
|
|
36
37
|
* ## Example
|
|
37
38
|
*
|
|
38
39
|
* ```typescript
|
|
39
|
-
* import {Env} from "@tsed/core";
|
|
40
|
+
* import {Env} from "@tsed/core/domain/Env.js";
|
|
40
41
|
* import {Constant, Value} from "@tsed/di";
|
|
41
42
|
*
|
|
42
43
|
* export class MyClass {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
2
|
+
import {Type} from "@tsed/core/types/Type.js";
|
|
3
|
+
import {classOf} from "@tsed/core/utils/classOf.js";
|
|
4
|
+
import {isArrayOrArrayClass} from "@tsed/core/utils/isArray.js";
|
|
5
|
+
import {useDecorators} from "@tsed/core/utils/useDecorators.js";
|
|
3
6
|
|
|
4
7
|
import type {ControllerMiddlewares} from "../domain/ControllerProvider.js";
|
|
5
8
|
import {controller} from "../fn/injectable.js";
|
|
@@ -54,11 +57,17 @@ function mapOptions(options: any): ControllerOptions {
|
|
|
54
57
|
export function Controller(options: PathType | ControllerOptions): ClassDecorator {
|
|
55
58
|
const {children = [], path, ...opts} = mapOptions(options);
|
|
56
59
|
|
|
57
|
-
return useDecorators(
|
|
58
|
-
(target
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
return useDecorators((target: Type) => {
|
|
61
|
+
const factory = controller(target, opts);
|
|
62
|
+
|
|
63
|
+
if (path) {
|
|
64
|
+
factory.store().set("path", path);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
factory.store().set("childrenControllers", children);
|
|
68
|
+
|
|
69
|
+
children.forEach((childToken) => {
|
|
70
|
+
Store.from(childToken).set("parentController", classOf(target));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
64
73
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DecoratorTypes} from "@tsed/core/types/DecoratorTypes.js";
|
|
2
|
+
import {Metadata} from "@tsed/core/types/Metadata.js";
|
|
3
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
4
|
+
import {type Type} from "@tsed/core/types/Type.js";
|
|
5
|
+
import {catchError} from "@tsed/core/utils/catchError.js";
|
|
6
|
+
import {decoratorTypeOf} from "@tsed/core/utils/decoratorTypeOf.js";
|
|
7
|
+
import {isPromise} from "@tsed/core/utils/isPromise.js";
|
|
2
8
|
|
|
3
9
|
import {DI_INJECTABLE_PROPS, DI_INVOKE_OPTIONS, DI_USE_OPTIONS} from "../constants/constants.js";
|
|
4
10
|
import {InvalidPropertyTokenError} from "../errors/InvalidPropertyTokenError.js";
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DecoratorParameters} from "@tsed/core/types/DecoratorParameters.js";
|
|
2
|
+
import {DecoratorTypes} from "@tsed/core/types/DecoratorTypes.js";
|
|
3
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
4
|
+
import {Type} from "@tsed/core/types/Type.js";
|
|
5
|
+
import {classOf} from "@tsed/core/utils/classOf.js";
|
|
6
|
+
import {decorateMethodsOf} from "@tsed/core/utils/decorateMethodsOf.js";
|
|
7
|
+
import {decoratorTypeOf} from "@tsed/core/utils/decoratorTypeOf.js";
|
|
8
|
+
import {nameOf} from "@tsed/core/utils/nameOf.js";
|
|
2
9
|
|
|
3
10
|
import {DI_INTERCEPTOR_OPTIONS, DI_INVOKE_OPTIONS} from "../constants/constants.js";
|
|
4
11
|
import {inject} from "../fn/inject.js";
|
|
@@ -34,7 +34,7 @@ describe("LazyInject", () => {
|
|
|
34
34
|
const service = inject<MyInjectable>(MyInjectable);
|
|
35
35
|
const error = await catchAsyncError(() => service.lazy);
|
|
36
36
|
|
|
37
|
-
expect(error?.message).toContain("
|
|
37
|
+
expect(error?.message).toContain("'lazy-module' imported from");
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
it("should lazy load optionally a module", async () => {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {UnsupportedDecoratorType} from "@tsed/core/errors/UnsupportedDecoratorType.js";
|
|
2
|
+
import {DecoratorTypes} from "@tsed/core/types/DecoratorTypes.js";
|
|
3
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
4
|
+
import {decoratorTypeOf} from "@tsed/core/utils/decoratorTypeOf.js";
|
|
2
5
|
|
|
3
6
|
import {DI_USE_OPTIONS, DI_USE_PARAM_OPTIONS} from "../constants/constants.js";
|
|
4
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {catchError} from "@tsed/core";
|
|
1
|
+
import {catchError} from "@tsed/core/utils/catchError.js";
|
|
2
2
|
|
|
3
3
|
import {injector} from "../fn/injector.js";
|
|
4
4
|
|
|
@@ -24,7 +24,7 @@ export function bindValue(target: any, propertyKey: string | symbol, expression:
|
|
|
24
24
|
* ## Example
|
|
25
25
|
*
|
|
26
26
|
* ```typescript
|
|
27
|
-
* import {Env} from "@tsed/core";
|
|
27
|
+
* import {Env} from "@tsed/core/domain/Env.js";
|
|
28
28
|
* import {Constant, Value} from "@tsed/di";
|
|
29
29
|
*
|
|
30
30
|
* export class MyClass {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
2
|
+
import {type AbstractType, Type} from "@tsed/core/types/Type.js";
|
|
3
|
+
import {classOf} from "@tsed/core/utils/classOf.js";
|
|
4
|
+
import {getClassOrSymbol} from "@tsed/core/utils/getClassOrSymbol.js";
|
|
5
|
+
import {isClass} from "@tsed/core/utils/isClass.js";
|
|
6
|
+
import {nameOf} from "@tsed/core/utils/nameOf.js";
|
|
2
7
|
|
|
3
8
|
import {DI_USE_PARAM_OPTIONS} from "../constants/constants.js";
|
|
4
9
|
import type {ProviderOpts} from "../interfaces/ProviderOpts.js";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {getConstructorArgNames
|
|
1
|
+
import {getConstructorArgNames} from "@tsed/core/utils/getConstructorArgNames.js";
|
|
2
|
+
import {isClass} from "@tsed/core/utils/isClass.js";
|
|
3
|
+
import {isString} from "@tsed/core/utils/isString.js";
|
|
4
|
+
import {nameOf} from "@tsed/core/utils/nameOf.js";
|
|
2
5
|
|
|
3
6
|
import {TokenProvider} from "../interfaces/TokenProvider.js";
|
|
4
7
|
import {colors} from "../utils/colors.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Type} from "@tsed/core/types/Type.js";
|
|
2
|
+
import {getClassOrSymbol} from "@tsed/core/utils/getClassOrSymbol.js";
|
|
2
3
|
|
|
3
4
|
import {Provider} from "../domain/Provider.js";
|
|
4
5
|
import {ProviderType} from "../domain/ProviderType.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {Env
|
|
1
|
+
import {Env} from "@tsed/core/types/Env.js";
|
|
2
|
+
import {getValue} from "@tsed/core/utils/getValue.js";
|
|
3
|
+
import {setValue} from "@tsed/core/utils/setValue.js";
|
|
2
4
|
|
|
3
5
|
import type {DILoggerOptions} from "../interfaces/DILoggerOptions.js";
|
|
4
6
|
import type {ImportTokenProviderOpts} from "../interfaces/ImportTokenProviderOpts.js";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import {classOf
|
|
1
|
+
import {classOf} from "@tsed/core/utils/classOf.js";
|
|
2
|
+
import {deepClone} from "@tsed/core/utils/deepClone.js";
|
|
3
|
+
import {deepMerge} from "@tsed/core/utils/deepMerge.js";
|
|
4
|
+
import {isArray} from "@tsed/core/utils/isArray.js";
|
|
5
|
+
import {isClass} from "@tsed/core/utils/isClass.js";
|
|
6
|
+
import {isFunction} from "@tsed/core/utils/isFunction.js";
|
|
7
|
+
import {isInheritedFrom} from "@tsed/core/utils/isInheritedFrom.js";
|
|
8
|
+
import {isObject} from "@tsed/core/utils/isObject.js";
|
|
9
|
+
import {isPromise} from "@tsed/core/utils/isPromise.js";
|
|
10
|
+
import {nameOf} from "@tsed/core/utils/nameOf.js";
|
|
2
11
|
import {$alter, $asyncAlter, $asyncEmit, $emit, $off, $on} from "@tsed/hooks";
|
|
3
12
|
|
|
4
13
|
import {DI_INVOKE_OPTIONS, DI_USE_PARAM_OPTIONS} from "../constants/constants.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {type AbstractType,
|
|
1
|
+
import {type AbstractType, type Type} from "@tsed/core/types/Type.js";
|
|
2
|
+
import {methodsOf} from "@tsed/core/utils/methodsOf.js";
|
|
2
3
|
|
|
3
4
|
export function discoverHooks(token: Type | AbstractType<any>) {
|
|
4
5
|
return methodsOf(token).reduce((hooks, {propertyKey}) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Metadata} from "@tsed/core";
|
|
1
|
+
import {Metadata} from "@tsed/core/types/Metadata.js";
|
|
2
2
|
|
|
3
3
|
export function getConstructorDependencies(target: any, propertyKey?: string | symbol | undefined) {
|
|
4
4
|
return Metadata.getOwn("override:ctor:design:paramtypes", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)] || [];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../registries/ProviderRegistry.js";
|
|
2
2
|
|
|
3
|
-
import {Store
|
|
3
|
+
import {Store} from "@tsed/core/types/Store.js";
|
|
4
|
+
import {type Type} from "@tsed/core/types/Type.js";
|
|
4
5
|
|
|
5
6
|
import {ProviderType} from "../domain/ProviderType.js";
|
|
6
7
|
import {injector} from "../fn/injector.js";
|