@travetto/di 2.2.3 → 3.0.0-rc.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/di",
|
|
3
3
|
"displayName": "Dependency Injection",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0-rc.1",
|
|
5
5
|
"description": "Dependency registration/management and injection support.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"ast-transformations",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"directory": "module/di"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@travetto/transformer": "^
|
|
33
|
-
"@travetto/registry": "^
|
|
32
|
+
"@travetto/transformer": "^3.0.0-rc.1",
|
|
33
|
+
"@travetto/registry": "^3.0.0-rc.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@travetto/config": "^
|
|
37
|
-
"@travetto/schema": "^
|
|
36
|
+
"@travetto/config": "^3.0.0-rc.1",
|
|
37
|
+
"@travetto/schema": "^3.0.0-rc.1"
|
|
38
38
|
},
|
|
39
39
|
"docDependencies": {
|
|
40
40
|
"@travetto/model-mongo": true,
|
package/src/registry.ts
CHANGED
|
@@ -120,13 +120,12 @@ class $DependencyRegistry extends MetadataRegistry<InjectableConfig> {
|
|
|
120
120
|
try {
|
|
121
121
|
return await this.getInstance(x.target, x.qualifier, x.resolution);
|
|
122
122
|
} catch (err) {
|
|
123
|
-
if (!err || !(err instanceof Error)) {
|
|
124
|
-
throw err;
|
|
125
|
-
}
|
|
126
123
|
if (x.optional && err instanceof InjectionError && err.category === 'notfound') {
|
|
127
124
|
return undefined;
|
|
128
125
|
} else {
|
|
129
|
-
err
|
|
126
|
+
if (err && err instanceof Error) {
|
|
127
|
+
err.message = `${err.message} via=${managed.class.ᚕid}`;
|
|
128
|
+
}
|
|
130
129
|
throw err;
|
|
131
130
|
}
|
|
132
131
|
}
|
|
@@ -74,7 +74,6 @@ export class InjectableTransformer {
|
|
|
74
74
|
})),
|
|
75
75
|
state.createDecorator(INJECTABLE_MOD, 'InjectArgs', injectArgs)
|
|
76
76
|
]),
|
|
77
|
-
node.modifiers,
|
|
78
77
|
node.name,
|
|
79
78
|
node.typeParameters,
|
|
80
79
|
node.heritageClauses,
|
|
@@ -95,7 +94,6 @@ export class InjectableTransformer {
|
|
|
95
94
|
DecoratorUtil.spliceDecorators(node, decl, [
|
|
96
95
|
state.createDecorator(INJECTABLE_MOD, 'Inject', ...this.processDeclaration(state, node)),
|
|
97
96
|
], 0),
|
|
98
|
-
node.modifiers,
|
|
99
97
|
node.name,
|
|
100
98
|
node.questionToken,
|
|
101
99
|
node.type,
|
|
@@ -116,7 +114,6 @@ export class InjectableTransformer {
|
|
|
116
114
|
DecoratorUtil.spliceDecorators(node, decl, [
|
|
117
115
|
state.createDecorator(INJECTABLE_MOD, 'Inject', ...this.processDeclaration(state, node)),
|
|
118
116
|
], 0),
|
|
119
|
-
node.modifiers,
|
|
120
117
|
node.name,
|
|
121
118
|
node.parameters,
|
|
122
119
|
node.body
|
|
@@ -160,7 +157,6 @@ export class InjectableTransformer {
|
|
|
160
157
|
DecoratorUtil.spliceDecorators(node, dec, [
|
|
161
158
|
state.createDecorator(INJECTABLE_MOD, 'InjectableFactory', ...args)
|
|
162
159
|
]),
|
|
163
|
-
node.modifiers,
|
|
164
160
|
node.asteriskToken,
|
|
165
161
|
node.name,
|
|
166
162
|
node.questionToken,
|