@wix/services-manager 0.1.1 → 0.1.3
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.
|
@@ -10,15 +10,8 @@ export function createServicesManager(servicesBindings) {
|
|
|
10
10
|
const manager = {
|
|
11
11
|
getService(definition) {
|
|
12
12
|
if (!initializedServices.has(definition)) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// this needs meaningful error message
|
|
16
|
-
throw new Error(`Service ${definition} is not provided`);
|
|
17
|
-
}
|
|
18
|
-
initializedServices.set(definition, service.impl({
|
|
19
|
-
config: service.config,
|
|
20
|
-
getService: manager.getService,
|
|
21
|
-
}));
|
|
13
|
+
// this needs meaningful error message
|
|
14
|
+
throw new Error(`Service ${definition} is not provided`);
|
|
22
15
|
}
|
|
23
16
|
return initializedServices.get(definition);
|
|
24
17
|
},
|
|
@@ -35,6 +28,12 @@ export function createServicesManager(servicesBindings) {
|
|
|
35
28
|
}
|
|
36
29
|
},
|
|
37
30
|
};
|
|
31
|
+
bindingsByDefinition.forEach(({ definition, impl, config }) => {
|
|
32
|
+
initializedServices.set(definition, impl({
|
|
33
|
+
config,
|
|
34
|
+
getService: manager.getService,
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
38
37
|
return manager;
|
|
39
38
|
}
|
|
40
39
|
export function createServicesMap(registeredServices = []) {
|
|
@@ -14,15 +14,8 @@ function createServicesManager(servicesBindings) {
|
|
|
14
14
|
const manager = {
|
|
15
15
|
getService(definition) {
|
|
16
16
|
if (!initializedServices.has(definition)) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// this needs meaningful error message
|
|
20
|
-
throw new Error(`Service ${definition} is not provided`);
|
|
21
|
-
}
|
|
22
|
-
initializedServices.set(definition, service.impl({
|
|
23
|
-
config: service.config,
|
|
24
|
-
getService: manager.getService,
|
|
25
|
-
}));
|
|
17
|
+
// this needs meaningful error message
|
|
18
|
+
throw new Error(`Service ${definition} is not provided`);
|
|
26
19
|
}
|
|
27
20
|
return initializedServices.get(definition);
|
|
28
21
|
},
|
|
@@ -39,6 +32,12 @@ function createServicesManager(servicesBindings) {
|
|
|
39
32
|
}
|
|
40
33
|
},
|
|
41
34
|
};
|
|
35
|
+
bindingsByDefinition.forEach(({ definition, impl, config }) => {
|
|
36
|
+
initializedServices.set(definition, impl({
|
|
37
|
+
config,
|
|
38
|
+
getService: manager.getService,
|
|
39
|
+
}));
|
|
40
|
+
});
|
|
42
41
|
return manager;
|
|
43
42
|
}
|
|
44
43
|
function createServicesMap(registeredServices = []) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/services-manager",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./cjs/build/services-manager.js",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|
|
7
8
|
"import": "./build/services-manager.js",
|
|
@@ -24,7 +25,10 @@
|
|
|
24
25
|
"sideEffects": false,
|
|
25
26
|
"files": [
|
|
26
27
|
"build",
|
|
27
|
-
"cjs"
|
|
28
|
+
"cjs",
|
|
29
|
+
"core-services",
|
|
30
|
+
"helpers",
|
|
31
|
+
"types"
|
|
28
32
|
],
|
|
29
33
|
"publishConfig": {
|
|
30
34
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -45,15 +49,15 @@
|
|
|
45
49
|
},
|
|
46
50
|
"devDependencies": {
|
|
47
51
|
"@types/is-ci": "^3.0.4",
|
|
48
|
-
"@types/node": "^20.17.
|
|
49
|
-
"@vitest/ui": "^1.6.
|
|
52
|
+
"@types/node": "^20.17.22",
|
|
53
|
+
"@vitest/ui": "^1.6.1",
|
|
50
54
|
"eslint": "^8.57.1",
|
|
51
55
|
"eslint-config-sdk": "0.0.0",
|
|
52
56
|
"is-ci": "^3.0.1",
|
|
53
57
|
"jsdom": "^22.1.0",
|
|
54
|
-
"msw": "^2.
|
|
55
|
-
"typescript": "^5.
|
|
56
|
-
"vitest": "^1.6.
|
|
58
|
+
"msw": "^2.7.3",
|
|
59
|
+
"typescript": "^5.8.2",
|
|
60
|
+
"vitest": "^1.6.1",
|
|
57
61
|
"vitest-teamcity-reporter": "^0.3.1"
|
|
58
62
|
},
|
|
59
63
|
"eslintConfig": {
|
|
@@ -73,5 +77,5 @@
|
|
|
73
77
|
]
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
|
-
"falconPackageHash": "
|
|
80
|
+
"falconPackageHash": "62828888ea953fdaee9af301e1096a05fc516acecd25cd099e699c97"
|
|
77
81
|
}
|