@frontmcp/di 0.0.1 → 0.7.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/decorators/async-with.decorator.d.ts +43 -0
- package/decorators/index.d.ts +4 -0
- package/esm/index.mjs +1173 -0
- package/esm/package.json +59 -0
- package/index.d.ts +18 -0
- package/index.js +1225 -0
- package/interfaces/base.interface.d.ts +119 -0
- package/interfaces/index.d.ts +6 -0
- package/interfaces/provider.interface.d.ts +57 -0
- package/interfaces/registry.interface.d.ts +66 -0
- package/metadata/index.d.ts +5 -0
- package/metadata/provider.metadata.d.ts +47 -0
- package/metadata/provider.schema.d.ts +32 -0
- package/package.json +1 -1
- package/records/index.d.ts +4 -0
- package/records/provider.record.d.ts +73 -0
- package/registry/container.d.ts +155 -0
- package/registry/index.d.ts +8 -0
- package/registry/indexed.registry.d.ts +140 -0
- package/registry/indexed.types.d.ts +87 -0
- package/registry/registry.base.d.ts +85 -0
- package/registry/simple.registry.d.ts +28 -0
- package/tokens/di.constants.d.ts +22 -0
- package/tokens/index.d.ts +9 -0
- package/tokens/token.factory.d.ts +55 -0
- package/utils/index.d.ts +6 -0
- package/utils/metadata.utils.d.ts +37 -0
- package/utils/provider.utils.d.ts +79 -0
- package/utils/token.utils.d.ts +74 -0
package/esm/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frontmcp/di",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "Generic dependency injection container and registry utilities for TypeScript applications",
|
|
5
|
+
"author": "AgentFront <info@agentfront.dev>",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"dependency-injection",
|
|
9
|
+
"di",
|
|
10
|
+
"ioc",
|
|
11
|
+
"container",
|
|
12
|
+
"registry",
|
|
13
|
+
"typescript",
|
|
14
|
+
"decorators",
|
|
15
|
+
"reflect-metadata",
|
|
16
|
+
"inversion-of-control"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/agentfront/frontmcp.git",
|
|
21
|
+
"directory": "libs/di"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/agentfront/frontmcp/issues"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/agentfront/frontmcp/blob/main/libs/di/README.md",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "../index.js",
|
|
29
|
+
"module": "./index.mjs",
|
|
30
|
+
"types": "../index.d.ts",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"exports": {
|
|
33
|
+
"./package.json": "../package.json",
|
|
34
|
+
".": {
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "../index.d.ts",
|
|
37
|
+
"default": "../index.js"
|
|
38
|
+
},
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "../index.d.ts",
|
|
41
|
+
"default": "./index.mjs"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"./esm": null
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"mitt": "^3.0.1"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"reflect-metadata": "^0.2.0",
|
|
51
|
+
"zod": "^4.0.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^24.0.0",
|
|
55
|
+
"reflect-metadata": "^0.2.2",
|
|
56
|
+
"typescript": "^5.0.0",
|
|
57
|
+
"zod": "^4.0.0"
|
|
58
|
+
}
|
|
59
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @frontmcp/di - Generic Dependency Injection Container
|
|
3
|
+
*
|
|
4
|
+
* This package provides a type-safe DI container with:
|
|
5
|
+
* - Token-based dependency resolution
|
|
6
|
+
* - Hierarchical provider registries
|
|
7
|
+
* - Scoped providers (GLOBAL, CONTEXT)
|
|
8
|
+
* - Indexed registry base class for fast lookups
|
|
9
|
+
* - Change event subscriptions for reactive updates
|
|
10
|
+
*/
|
|
11
|
+
export { createTokenFactory, DiTokens, type TokenFactory, type TokenFactoryOptions } from './tokens/token.factory.js';
|
|
12
|
+
export { DESIGN_PARAMTYPES, META_ASYNC_WITH, META_ASYNC_WITH_TOKENS } from './tokens/di.constants.js';
|
|
13
|
+
export { type Type, type FuncType, type PartialStagesType, type CtorType, type Ctor, type Abstract, type Reference, type Token, type ClassType, type ValueType, type ClassToken, type FactoryType, type RequiredByKey, type ProviderInterface, type ProviderClassTokenType, type ProviderClassType, type ProviderValueType, type ProviderFactoryType, type ProviderType, type AsyncProvider, type DiContainerInterface, type DiViews, } from './interfaces/index.js';
|
|
14
|
+
export { ProviderKind, type ProviderClassTokenRecord, type ProviderClassRecord, type ProviderValueRecord, type ProviderFactoryRecord, type ProviderInjectedRecord, type ProviderRecord, } from './records/index.js';
|
|
15
|
+
export { ProviderScope, type ProviderMetadata, providerMetadataSchema, type RawZodShape, type ValidatedProviderMetadata, } from './metadata/index.js';
|
|
16
|
+
export { getMetadata, setMetadata, hasAsyncWith, tokenName, isClass, isPromise, getAsyncWithTokens, readWithParamTypes, depsOfClass, depsOfFunc, createProviderNormalizer, providerDiscoveryDeps, providerInvocationTokens, type ProviderTokens, type ProviderNormalizerOptions, } from './utils/index.js';
|
|
17
|
+
export { RegistryAbstract, type RegistryBuildMapResult, type RegistryKind, DiContainer, type ProviderEntry, type DiContainerOptions, IndexedRegistry, type IndexedEntry, type EntryLineage, type EntryOwnerRef, type LineageSegment, type ChangeEvent, type ChangeKind, type ChangeScope, type SubscribeOptions, type RegistryEmitter, SimpleRegistry, } from './registry/index.js';
|
|
18
|
+
export { AsyncWith } from './decorators/index.js';
|