@webhandle/initialize-webhandle-component 1.0.0 → 1.0.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/README.md +1 -1
- package/component-manager.mjs +12 -4
- package/package.json +2 -2
package/README.md
CHANGED
package/component-manager.mjs
CHANGED
|
@@ -2,19 +2,20 @@ import EventEmitter from 'events'
|
|
|
2
2
|
|
|
3
3
|
export default class ComponentManager {
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
viewsPaths;
|
|
6
6
|
templateLoaders;
|
|
7
7
|
staticPaths;
|
|
8
8
|
staticServers;
|
|
9
9
|
sinks;
|
|
10
10
|
services;
|
|
11
11
|
routers;
|
|
12
|
+
drecks;
|
|
12
13
|
events;
|
|
13
14
|
|
|
14
15
|
constructor(options) {
|
|
15
16
|
Object.assign(this, options)
|
|
16
17
|
|
|
17
|
-
this.setIfUnset('
|
|
18
|
+
this.setIfUnset('viewsPaths', [])
|
|
18
19
|
|
|
19
20
|
/* functions which load templates */
|
|
20
21
|
this.setIfUnset('templateLoaders', [])
|
|
@@ -32,7 +33,10 @@ export default class ComponentManager {
|
|
|
32
33
|
this.setIfUnset('services', {})
|
|
33
34
|
|
|
34
35
|
/* handlers for user requests */
|
|
35
|
-
this.setIfUnset('routers',
|
|
36
|
+
this.setIfUnset('routers', {})
|
|
37
|
+
|
|
38
|
+
/* information manangement guis */
|
|
39
|
+
this.setIfUnset('drecks', {})
|
|
36
40
|
|
|
37
41
|
/* event emitters for communications between decoupled components */
|
|
38
42
|
this.setIfUnset('events', {
|
|
@@ -41,9 +45,13 @@ export default class ComponentManager {
|
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
setIfUnset(attr, value) {
|
|
44
|
-
if (
|
|
48
|
+
if (!this[attr]) {
|
|
45
49
|
this[attr] = value
|
|
46
50
|
}
|
|
47
51
|
}
|
|
52
|
+
|
|
53
|
+
addExternalResources(externalResourceManager) {
|
|
48
54
|
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webhandle/initialize-webhandle-component",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Boilerplate code for a module to add itself to a webhandle instance",
|
|
5
5
|
"main": "create-initialize-webhandle-component.mjs",
|
|
6
6
|
"scripts": {
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
, "*.mjs"
|
|
27
27
|
]
|
|
28
|
-
}
|
|
28
|
+
}
|