@nx-ddd/core 4.21.1 → 5.0.0
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.
|
@@ -9,7 +9,7 @@ import { Type } from './interface/type';
|
|
|
9
9
|
/**
|
|
10
10
|
* Definition of what a factory function should look like.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type FactoryFn<T> = {
|
|
13
13
|
/**
|
|
14
14
|
* Subclasses without an explicit constructor call through to the factory of their base
|
|
15
15
|
* definition, providing it with their own constructor to instantiate.
|
|
@@ -236,7 +236,7 @@ export interface FactoryProvider extends FactorySansProvider {
|
|
|
236
236
|
*
|
|
237
237
|
* @publicApi
|
|
238
238
|
*/
|
|
239
|
-
export
|
|
239
|
+
export type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
|
|
240
240
|
/**
|
|
241
241
|
* Configures the `Injector` to return an instance of `Type` when `Type' is used as the token.
|
|
242
242
|
*
|
|
@@ -304,12 +304,12 @@ export interface ClassProvider extends ClassSansProvider {
|
|
|
304
304
|
*
|
|
305
305
|
* @publicApi
|
|
306
306
|
*/
|
|
307
|
-
export
|
|
307
|
+
export type Provider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | any[];
|
|
308
308
|
/**
|
|
309
309
|
* Describes a function that is used to process provider lists (such as provider
|
|
310
310
|
* overrides).
|
|
311
311
|
*/
|
|
312
|
-
export
|
|
312
|
+
export type ProcessProvidersFunction = (providers: Provider[]) => Provider[];
|
|
313
313
|
/**
|
|
314
314
|
* A wrapper around an NgModule that associates it with [providers](guide/glossary#provider
|
|
315
315
|
* "Definition"). Usage without a generic type is deprecated.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from './interface/type';
|
|
2
2
|
import { InjectorTypeWithProviders } from './interface/defs';
|
|
3
3
|
import { ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, ModuleWithProviders, Provider, StaticClassProvider, TypeProvider, ValueProvider } from './interface/provider';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type ImportProvidersSource = Type<unknown> | ModuleWithProviders<unknown> | Array<ImportProvidersSource>;
|
|
5
|
+
export type SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider | StaticClassProvider;
|
|
6
6
|
export declare function internalImportProvidersFrom(...sources: ImportProvidersSource[]): SingleProvider[];
|
|
7
7
|
export declare function walkProviderTree(sources: (Type<unknown> | InjectorTypeWithProviders<unknown>)[], parents: Type<unknown>[], callback: (providers: Provider[]) => void, dedup?: Set<Type<unknown>>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injector } from 'injection-js';
|
|
2
|
-
export
|
|
2
|
+
export type Type<T> = any;
|
|
3
3
|
export declare function createNxModuleRef<T>(moduleType: Type<T>, injector?: Injector): NxModuleRef<T>;
|
|
4
4
|
export declare class NxModuleRef<T = any> {
|
|
5
5
|
nxModuleType: Type<T>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-ddd/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"injection-js": "
|
|
8
|
-
"reflect-metadata": "
|
|
9
|
-
"tslib": "
|
|
10
|
-
}
|
|
11
|
-
"peerDependencies": {}
|
|
7
|
+
"injection-js": "2.4.0",
|
|
8
|
+
"reflect-metadata": "0.1.13",
|
|
9
|
+
"tslib": "2.5.0"
|
|
10
|
+
}
|
|
12
11
|
}
|
package/testing/index.js
CHANGED
|
@@ -4,10 +4,6 @@ exports.TestBed = void 0;
|
|
|
4
4
|
const nx_module_1 = require("@nx-ddd/core/nx-module");
|
|
5
5
|
const di_1 = require("../di");
|
|
6
6
|
class TestBed {
|
|
7
|
-
constructor(nxModule) {
|
|
8
|
-
this.nxModule = nxModule;
|
|
9
|
-
this.injector = (0, di_1.createInjector)(this.nxModule);
|
|
10
|
-
}
|
|
11
7
|
static get instance() {
|
|
12
8
|
var _a;
|
|
13
9
|
return (_a = this._instance) !== null && _a !== void 0 ? _a : (this._instance = new TestBed(this.NxModule));
|
|
@@ -24,6 +20,10 @@ class TestBed {
|
|
|
24
20
|
static inject(token) {
|
|
25
21
|
return this.instance.inject(token);
|
|
26
22
|
}
|
|
23
|
+
constructor(nxModule) {
|
|
24
|
+
this.nxModule = nxModule;
|
|
25
|
+
this.injector = (0, di_1.createInjector)(this.nxModule);
|
|
26
|
+
}
|
|
27
27
|
inject(token) {
|
|
28
28
|
return this.injector.get(token);
|
|
29
29
|
}
|
package/testing/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/testing/index.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAClD,8BAAuD;AAYvD,MAAa,OAAO;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/@nx-ddd/core/src/testing/index.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAClD,8BAAuD;AAYvD,MAAa,OAAO;IAElB,MAAM,KAAK,QAAQ;;QACjB,aAAO,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC;IACvD,CAAC;IAID,MAAM,CAAC,sBAAsB,CAAC,SAA6B;;QACzD,OAAO,CAAC,QAAQ,GAAG,IAAA,oBAAQ,EAAC;YAC1B,OAAO,EAAE,CAAC,GAAG,CAAC,MAAA,SAAS,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC;YACvC,SAAS,EAAE,CAAC,GAAG,CAAC,MAAA,SAAS,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC;SAC5C,CAAC,CAAC,MAAM,QAAQ;SAAI,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,MAAM,CAAI,KAAkC;QACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAID,YAAmB,QAAmB;QAAnB,aAAQ,GAAR,QAAQ,CAAW;QAF/B,aAAQ,GAAG,IAAA,mBAAc,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEN,CAAC;IAEpC,MAAM,CAAI,KAAkC;QACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF;AA3BD,0BA2BC"}
|