5htp 0.6.2-9 → 0.6.2-95
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/compiler/index.ts +6 -6
- package/package.json +1 -1
package/compiler/index.ts
CHANGED
|
@@ -34,7 +34,7 @@ type TRegisteredService = {
|
|
|
34
34
|
id?: string,
|
|
35
35
|
name: string,
|
|
36
36
|
className: string,
|
|
37
|
-
instanciation: (parentRef
|
|
37
|
+
instanciation: (parentRef?: string) => string,
|
|
38
38
|
priority: number,
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -198,7 +198,7 @@ export default class Compiler {
|
|
|
198
198
|
const refTo = serviceConfig.refTo;
|
|
199
199
|
return {
|
|
200
200
|
name: serviceName,
|
|
201
|
-
instanciation: (
|
|
201
|
+
instanciation: () => `this.${refTo}`,
|
|
202
202
|
priority: 0
|
|
203
203
|
}
|
|
204
204
|
}
|
|
@@ -228,7 +228,7 @@ export default class Compiler {
|
|
|
228
228
|
|
|
229
229
|
// Reference to a service
|
|
230
230
|
else if (value.type === 'service.setup' || value.type === 'service.ref') // TODO: more reliable way to detect a service reference
|
|
231
|
-
propsStr += `${key}:`+ refService(key, value, level + 1).instanciation(
|
|
231
|
+
propsStr += `${key}:`+ refService(key, value, level + 1).instanciation() + ',\n'
|
|
232
232
|
|
|
233
233
|
// Recursion
|
|
234
234
|
else if (level <= 4 && !Array.isArray(value))
|
|
@@ -244,10 +244,10 @@ export default class Compiler {
|
|
|
244
244
|
const config = processConfig(serviceConfig.config || {});
|
|
245
245
|
|
|
246
246
|
// Generate the service instance
|
|
247
|
-
const instanciation = (parentRef
|
|
247
|
+
const instanciation = (parentRef?: string) =>
|
|
248
248
|
`new ${serviceMetas.name}(
|
|
249
|
-
${parentRef}
|
|
250
|
-
|
|
249
|
+
${parentRef ? `${parentRef},` : ''}
|
|
250
|
+
${config},
|
|
251
251
|
this
|
|
252
252
|
)`
|
|
253
253
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.6.2-
|
|
4
|
+
"version": "0.6.2-95",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp.git",
|
|
7
7
|
"license": "MIT",
|