@art-ws/di-node 2.0.1 → 2.0.3
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/dist/es/decorators.d.ts +1 -1
- package/dist/es/decorators.js +2 -2
- package/dist/es/index.d.ts +7 -7
- package/dist/es/index.js +7 -7
- package/dist/es/injector-ref.d.ts +1 -3
- package/dist/es/injector-ref.js +4 -7
- package/dist/es/node-platform.d.ts +1 -1
- package/dist/es/node-platform.js +2 -2
- package/dist/es/registry.d.ts +1 -1
- package/dist/es/types.js +1 -1
- package/dist/es/utils/get-multi.d.ts +1 -1
- package/dist/es/utils/get-multi.js +1 -1
- package/dist/es/utils/get-safe.d.ts +1 -1
- package/dist/es/utils/index.d.ts +2 -2
- package/dist/es/utils/index.js +2 -2
- package/package.json +4 -3
package/dist/es/decorators.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import "reflect-metadata";
|
2
|
-
import type { DIModuleOptions, DITypeOptions } from "./types";
|
2
|
+
import type { DIModuleOptions, DITypeOptions } from "./types.js";
|
3
3
|
export declare function DIModule(options?: Partial<DIModuleOptions>): ClassDecorator;
|
4
4
|
export declare function Autowire(options: DITypeOptions): ClassDecorator;
|
5
5
|
export declare function Singleton(options?: Partial<DITypeOptions>): ClassDecorator;
|
package/dist/es/decorators.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import "reflect-metadata";
|
2
|
-
import { DIRegistry, METADATA_DI_MODULE_OPTIONS, METADATA_DI_TYPE_OPTIONS, } from "./registry";
|
3
|
-
import { DIScope as Scope } from "./types";
|
2
|
+
import { DIRegistry, METADATA_DI_MODULE_OPTIONS, METADATA_DI_TYPE_OPTIONS, } from "./registry.js";
|
3
|
+
import { DIScope as Scope } from "./types.js";
|
4
4
|
export function DIModule(options) {
|
5
5
|
const o = options ?? {};
|
6
6
|
o.scope = o.scope || Scope.SINGLETON;
|
package/dist/es/index.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
export * from "./utils";
|
2
|
-
export * from "./decorators";
|
3
|
-
export * from "./injector-ref";
|
4
|
-
export * from "./node-platform";
|
5
|
-
export * from "./re-export";
|
6
|
-
export * from "./registry";
|
7
|
-
export * from "./types";
|
1
|
+
export * from "./utils/index.js";
|
2
|
+
export * from "./decorators.js";
|
3
|
+
export * from "./injector-ref.js";
|
4
|
+
export * from "./node-platform.js";
|
5
|
+
export * from "./re-export.js";
|
6
|
+
export * from "./registry.js";
|
7
|
+
export * from "./types.js";
|
package/dist/es/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
|
-
export * from "./utils";
|
3
|
-
export * from "./decorators";
|
4
|
-
export * from "./injector-ref";
|
5
|
-
export * from "./node-platform";
|
6
|
-
export * from "./re-export";
|
7
|
-
export * from "./registry";
|
8
|
-
export * from "./types";
|
2
|
+
export * from "./utils/index.js";
|
3
|
+
export * from "./decorators.js";
|
4
|
+
export * from "./injector-ref.js";
|
5
|
+
export * from "./node-platform.js";
|
6
|
+
export * from "./re-export.js";
|
7
|
+
export * from "./registry.js";
|
8
|
+
export * from "./types.js";
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Injector } from "injection-js";
|
2
2
|
import type { Provider } from "injection-js";
|
3
|
-
import {
|
4
|
-
import type { CreateChildOptions, InjectableType, InjectorRef, ScopeStrategy, TInjectableToken } from "./types";
|
3
|
+
import type { CreateChildOptions, InjectableType, InjectorRef, ScopeStrategy, TInjectableToken } from "./types.js";
|
5
4
|
export declare function getScopeForInjectorRef(parent: InjectorRef | null, scopeStrategyFn: ScopeStrategy): string | null;
|
6
5
|
export declare class InjectorRefImpl implements InjectorRef {
|
7
6
|
private parentInjector;
|
@@ -15,7 +14,6 @@ export declare class InjectorRefImpl implements InjectorRef {
|
|
15
14
|
getByName<T>(tokenName: string): TInjectableToken<T> | undefined;
|
16
15
|
tryGet<T>(token: TInjectableToken<T>): T | undefined;
|
17
16
|
get<T>(token: TInjectableToken<T>): T;
|
18
|
-
get reflectiveInjector_(): ReflectiveInjector_;
|
19
17
|
getInstances(): any[];
|
20
18
|
dispose(cb: (ref?: unknown) => void): void;
|
21
19
|
injector(): Injector;
|
package/dist/es/injector-ref.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Injector, ReflectiveInjector } from "injection-js";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { resolveAndBootstrapModule } from "./types";
|
2
|
+
import { DIRegistry } from "./registry.js";
|
3
|
+
import { resolveAndBootstrapModule } from "./types.js";
|
5
4
|
export function getScopeForInjectorRef(parent, scopeStrategyFn) {
|
6
5
|
return scopeStrategyFn(parent ? parent.scope() : null);
|
7
6
|
}
|
@@ -82,11 +81,9 @@ export class InjectorRefImpl {
|
|
82
81
|
}
|
83
82
|
return result;
|
84
83
|
}
|
85
|
-
get reflectiveInjector_() {
|
86
|
-
return this.reflectiveInjector;
|
87
|
-
}
|
88
84
|
getInstances() {
|
89
|
-
|
85
|
+
// Note: This functionality may not be available in the current injection-js version
|
86
|
+
return [];
|
90
87
|
}
|
91
88
|
dispose(cb) {
|
92
89
|
if (!this.reflectiveInjector)
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type { ModuleLoader } from "./types";
|
1
|
+
import type { ModuleLoader } from "./types.js";
|
2
2
|
export declare function platform(): ModuleLoader;
|
package/dist/es/node-platform.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { InjectorRefImpl } from "./injector-ref";
|
2
|
-
import { APP_INITIALIZER, getDefaultScopeStrategy, ROOT_INJECTOR, } from "./types";
|
1
|
+
import { InjectorRefImpl } from "./injector-ref.js";
|
2
|
+
import { APP_INITIALIZER, getDefaultScopeStrategy, ROOT_INJECTOR, } from "./types.js";
|
3
3
|
class NodeModuleLoader {
|
4
4
|
diProviders;
|
5
5
|
providers(providers) {
|
package/dist/es/registry.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Provider, ResolvedReflectiveProvider } from "injection-js";
|
2
2
|
import "reflect-metadata";
|
3
|
-
import type { DIModuleOptions, DITypeOptions, InjectableToken, InjectableType } from "./types";
|
3
|
+
import type { DIModuleOptions, DITypeOptions, InjectableToken, InjectableType } from "./types.js";
|
4
4
|
export declare const METADATA_DI_ID: unique symbol;
|
5
5
|
export declare const METADATA_DI_MODULE_OPTIONS: unique symbol;
|
6
6
|
export declare const METADATA_DI_TYPE_OPTIONS: unique symbol;
|
package/dist/es/types.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { InjectionToken, Injector } from "injection-js";
|
2
|
-
import { getDIModuleOptions } from "./registry";
|
2
|
+
import { getDIModuleOptions } from "./registry.js";
|
3
3
|
// https://angular.io/api/core/APP_INITIALIZER
|
4
4
|
// https://github.com/angular/angular/blob/master/packages/core/src/application_init.ts
|
5
5
|
export const APP_INITIALIZER = new InjectionToken("APP_INITIALIZER");
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type { InjectorRef } from "../types";
|
1
|
+
import type { InjectorRef } from "../types.js";
|
2
2
|
export declare function getMultiInstances<T>(token: any, injector: InjectorRef): T[];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type { InjectorRef } from "../types";
|
1
|
+
import type { InjectorRef } from "../types.js";
|
2
2
|
export declare function getInstanceSafe<T>(token: any, injector: InjectorRef): T | null;
|
package/dist/es/utils/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from "./get-multi";
|
2
|
-
export * from "./get-safe";
|
1
|
+
export * from "./get-multi.js";
|
2
|
+
export * from "./get-safe.js";
|
package/dist/es/utils/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
// created from 'create-ts-index'
|
2
|
-
export * from "./get-multi";
|
3
|
-
export * from "./get-safe";
|
2
|
+
export * from "./get-multi.js";
|
3
|
+
export * from "./get-safe.js";
|
package/package.json
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "@art-ws/di-node",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.3",
|
4
4
|
"description": "Dependency Injection core",
|
5
|
+
"type": "module",
|
5
6
|
"keywords": [
|
6
7
|
"lib"
|
7
8
|
],
|
@@ -21,8 +22,8 @@
|
|
21
22
|
"eslint": "^9.34.0",
|
22
23
|
"typescript": "^5.9.2",
|
23
24
|
"vitest": "^3.2.4",
|
24
|
-
"@art-ws/config-
|
25
|
-
"@art-ws/config-
|
25
|
+
"@art-ws/config-eslint": "2.0.3",
|
26
|
+
"@art-ws/config-ts": "2.0.6"
|
26
27
|
},
|
27
28
|
"scripts": {
|
28
29
|
"build": "tsc",
|