@nwire/container 0.12.0 → 0.13.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.
- package/dist/awilix.js +0 -9
- package/dist/index.d.ts +0 -2
- package/package.json +2 -2
package/dist/awilix.js
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* that only need the type contract stay on `@nwire/container`.
|
|
11
11
|
*/
|
|
12
12
|
import { createContainer as createAwilixContainer, asValue, asFunction, asClass, InjectionMode, Lifetime, } from "awilix";
|
|
13
|
-
import { captureSourceLocation } from "@nwire/messages";
|
|
14
13
|
const LIFETIME_MAP = {
|
|
15
14
|
singleton: Lifetime.SINGLETON,
|
|
16
15
|
transient: Lifetime.TRANSIENT,
|
|
@@ -50,12 +49,6 @@ class NwireContainer {
|
|
|
50
49
|
if (this.disposed) {
|
|
51
50
|
throw new Error(`@nwire/container: cannot register "${name}" on a disposed container`);
|
|
52
51
|
}
|
|
53
|
-
// Skip two frames: this `register` itself plus the synthetic `Error`
|
|
54
|
-
// frame `captureSourceLocation` already accounts for. The regex inside
|
|
55
|
-
// `captureSourceLocation` walks past any remaining `packages/nwire-*`
|
|
56
|
-
// frames (forge's app capability registration, plugin .provide(), etc.)
|
|
57
|
-
// until it lands on user code.
|
|
58
|
-
const source = captureSourceLocation(2);
|
|
59
52
|
const requestedLifetime = opts?.lifetime ?? "singleton";
|
|
60
53
|
const lifetime = LIFETIME_MAP[requestedLifetime];
|
|
61
54
|
if (isClass(factory)) {
|
|
@@ -77,7 +70,6 @@ class NwireContainer {
|
|
|
77
70
|
name,
|
|
78
71
|
order: this.order++,
|
|
79
72
|
kind: requestedLifetime,
|
|
80
|
-
source,
|
|
81
73
|
dispose: opts?.dispose,
|
|
82
74
|
check: opts?.check,
|
|
83
75
|
});
|
|
@@ -102,7 +94,6 @@ class NwireContainer {
|
|
|
102
94
|
kind: m?.kind ?? classifyByLifetime(localRegistered[name]),
|
|
103
95
|
hasDispose: m?.dispose !== undefined,
|
|
104
96
|
hasCheck: m?.check !== undefined,
|
|
105
|
-
source: m?.source,
|
|
106
97
|
};
|
|
107
98
|
});
|
|
108
99
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* The split keeps awilix out of the dependency tree of any consumer
|
|
17
17
|
* that just needs to type a container parameter.
|
|
18
18
|
*/
|
|
19
|
-
import type { SourceLocation } from "@nwire/messages";
|
|
20
19
|
/**
|
|
21
20
|
* One row per active registration, surfaced by `container.list()`. Studio
|
|
22
21
|
* reads this through `.nwire/di.json` (emitted by `@nwire/scan`) to render
|
|
@@ -27,7 +26,6 @@ export interface BindingEntry {
|
|
|
27
26
|
readonly kind: "singleton" | "transient" | "scoped";
|
|
28
27
|
readonly hasDispose: boolean;
|
|
29
28
|
readonly hasCheck: boolean;
|
|
30
|
-
readonly source?: SourceLocation;
|
|
31
29
|
}
|
|
32
30
|
/**
|
|
33
31
|
* Opt-in per-binding lifecycle + lifetime metadata. Plugins pass these
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nwire/container",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Nwire — DI container contract + Awilix-backed default. Generic over TCradle; ships scope hierarchy, lazy cradle proxy, lifetimes, disposers via Awilix.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"container",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"awilix": "^12.0.4",
|
|
35
|
-
"@nwire/messages": "0.
|
|
35
|
+
"@nwire/messages": "0.13.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.19.9",
|