@codefast/di 0.3.16-canary.1 → 0.3.16-canary.2
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/CHANGELOG.md +10 -0
- package/README.md +4 -4
- package/dist/binding-select.d.mts +1 -1
- package/dist/binding-select.mjs +5 -5
- package/dist/binding.d.mts +6 -6
- package/dist/binding.mjs +8 -8
- package/dist/constraints.mjs +2 -2
- package/dist/container.mjs +70 -70
- package/dist/decorators/inject.d.mts +1 -1
- package/dist/decorators/inject.mjs +8 -8
- package/dist/dependency-graph.mjs +13 -13
- package/dist/environment.d.mts +15 -15
- package/dist/environment.mjs +21 -21
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/inspector.mjs +13 -13
- package/dist/module.d.mts +1 -1
- package/dist/module.mjs +2 -2
- package/dist/registry.d.mts +4 -4
- package/dist/registry.mjs +27 -27
- package/dist/resolve-options.d.mts +5 -5
- package/dist/resolve-options.mjs +8 -8
- package/dist/resolver.d.mts +10 -10
- package/dist/resolver.mjs +152 -152
- package/dist/token.d.mts +1 -1
- package/dist/token.mjs +4 -4
- package/dist/types.d.mts +5 -5
- package/package.json +9 -8
package/dist/token.d.mts
CHANGED
|
@@ -16,7 +16,7 @@ declare function token<Value>(name: string): Token<Value>;
|
|
|
16
16
|
/**
|
|
17
17
|
* @since 0.3.16-canary.0
|
|
18
18
|
*/
|
|
19
|
-
declare function tokenName(
|
|
19
|
+
declare function tokenName(dependency: Token<unknown> | Constructor): string;
|
|
20
20
|
/**
|
|
21
21
|
* @since 0.3.16-canary.0
|
|
22
22
|
*/
|
package/dist/token.mjs
CHANGED
|
@@ -8,15 +8,15 @@ function token(name) {
|
|
|
8
8
|
/**
|
|
9
9
|
* @since 0.3.16-canary.0
|
|
10
10
|
*/
|
|
11
|
-
function tokenName(
|
|
12
|
-
if (typeof
|
|
13
|
-
return
|
|
11
|
+
function tokenName(dependency) {
|
|
12
|
+
if (typeof dependency === "function") return dependency.name;
|
|
13
|
+
return dependency.name;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* @since 0.3.16-canary.0
|
|
17
17
|
*/
|
|
18
18
|
function isToken(value) {
|
|
19
|
-
return typeof value === "object" && value !== null && "name" in value && typeof value["name"] === "string"
|
|
19
|
+
return typeof value === "object" && value !== null && "name" in value && typeof value["name"] === "string";
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
export { isToken, token, tokenName };
|
package/dist/types.d.mts
CHANGED
|
@@ -46,7 +46,7 @@ interface ResolveOptions {
|
|
|
46
46
|
/**
|
|
47
47
|
* @since 0.3.16-canary.0
|
|
48
48
|
*/
|
|
49
|
-
interface
|
|
49
|
+
interface ResolutionFrame {
|
|
50
50
|
readonly tokenName: string;
|
|
51
51
|
readonly scope: BindingScope;
|
|
52
52
|
readonly bindingId: BindingIdentifier;
|
|
@@ -61,9 +61,9 @@ interface MaterializationFrame {
|
|
|
61
61
|
*/
|
|
62
62
|
interface ConstraintContext {
|
|
63
63
|
readonly resolutionPath: ReadonlyArray<string>;
|
|
64
|
-
readonly
|
|
65
|
-
readonly parent:
|
|
66
|
-
readonly ancestors: ReadonlyArray<
|
|
64
|
+
readonly resolutionStack: ReadonlyArray<ResolutionFrame>;
|
|
65
|
+
readonly parent: ResolutionFrame | undefined;
|
|
66
|
+
readonly ancestors: ReadonlyArray<ResolutionFrame>;
|
|
67
67
|
readonly currentResolveHint: ResolveOptions | undefined;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -83,4 +83,4 @@ interface ResolutionContext {
|
|
|
83
83
|
*/
|
|
84
84
|
type TokenValue<Type> = Type extends Token<infer Value> ? Value : Type extends Constructor<infer Value> ? Value : never;
|
|
85
85
|
//#endregion
|
|
86
|
-
export { ActivationHandler, BindingIdentifier, BindingKind, BindingScope, ConstraintContext, type Constructor, DeactivationHandler, DependencyKey,
|
|
86
|
+
export { ActivationHandler, BindingIdentifier, BindingKind, BindingScope, ConstraintContext, type Constructor, DeactivationHandler, DependencyKey, ResolutionContext, ResolutionFrame, ResolveOptions, TokenValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/di",
|
|
3
|
-
"version": "0.3.16-canary.
|
|
3
|
+
"version": "0.3.16-canary.2",
|
|
4
4
|
"description": "Lightweight dependency injection primitives for Codefast",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codefast",
|
|
@@ -170,16 +170,17 @@
|
|
|
170
170
|
"access": "public"
|
|
171
171
|
},
|
|
172
172
|
"devDependencies": {
|
|
173
|
-
"@
|
|
174
|
-
"@
|
|
175
|
-
"@
|
|
173
|
+
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
174
|
+
"@rolldown/plugin-babel": "^0.2.3",
|
|
175
|
+
"@types/node": "^25.7.0",
|
|
176
|
+
"@typescript/native-preview": "7.0.0-dev.20260514.1",
|
|
177
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
176
178
|
"expect-type": "^1.3.0",
|
|
177
179
|
"tsdown": "^0.22.0",
|
|
178
|
-
"tsx": "^4.
|
|
180
|
+
"tsx": "^4.22.0",
|
|
179
181
|
"typescript": "^6.0.3",
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"@codefast/typescript-config": "0.3.16-canary.1"
|
|
182
|
+
"vitest": "^4.1.6",
|
|
183
|
+
"@codefast/typescript-config": "0.3.16-canary.2"
|
|
183
184
|
},
|
|
184
185
|
"engines": {
|
|
185
186
|
"node": ">=22.0.0"
|