pmcf 4.21.2 → 4.22.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/README.md CHANGED
@@ -69,11 +69,11 @@ generates config packages for:
69
69
  * [Parameters](#parameters-10)
70
70
  * [port](#port-1)
71
71
  * [id](#id)
72
- * [InitializationContext](#initializationcontext)
73
- * [Parameters](#parameters-11)
74
72
  * [SkeletonNetworkInterface](#skeletonnetworkinterface)
75
73
  * [networkAddresses](#networkaddresses)
76
- * [Parameters](#parameters-12)
74
+ * [Parameters](#parameters-11)
75
+ * [InitializationContext](#initializationcontext)
76
+ * [Parameters](#parameters-12)
77
77
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
78
78
  * [Properties](#properties)
79
79
  * [systemdConfigs](#systemdconfigs)
@@ -237,14 +237,6 @@ Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
237
237
 
238
238
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
239
239
 
240
- ## InitializationContext
241
-
242
- Keeps track of all in flight object creations and loose ends during config initialization.
243
-
244
- ### Parameters
245
-
246
- * `directory` (optional, default `"/"`)
247
-
248
240
  ## SkeletonNetworkInterface
249
241
 
250
242
  **Extends ServiceOwner**
@@ -257,6 +249,14 @@ Keeps track of all in flight object creations and loose ends during config initi
257
249
 
258
250
  Returns **Iterable<[NetworkAddress](#networkaddress)>**&#x20;
259
251
 
252
+ ## InitializationContext
253
+
254
+ Keeps track of all in flight object creations and loose ends during config initialization.
255
+
256
+ ### Parameters
257
+
258
+ * `directory` (optional, default `"/"`)
259
+
260
260
  ## SystemdJournalRemoteService
261
261
 
262
262
  **Extends Service**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "4.21.2",
3
+ "version": "4.22.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -459,9 +459,9 @@ export class Host extends ServiceOwner {
459
459
 
460
460
  await generateKnownHosts(this.owner.hosts, join(dir, "root", ".ssh"));
461
461
 
462
- console.log([...this.walkDirections(["extends"])].map(e => e.fullName));
462
+ //console.log([...this.walkDirections(["extends"])].map(e => e.fullName));
463
463
 
464
- for (const service of this.services) {
464
+ for (const service of this.allServices) {
465
465
  //console.log("SERVICE",service.name);
466
466
 
467
467
  if (service.systemdConfigs) {
@@ -3,6 +3,17 @@ import { Base, Service } from "pmcf";
3
3
  export class ServiceOwner extends Base {
4
4
  services = [];
5
5
 
6
+ get allServices()
7
+ {
8
+ return this._allServices();
9
+ }
10
+
11
+ *_allServices() {
12
+ for (const node of this.walkDirections(["this", "extends"])) {
13
+ yield* node.services;
14
+ }
15
+ }
16
+
6
17
  materializeExtends() {
7
18
  super.materializeExtends();
8
19
 
@@ -17,9 +28,10 @@ export class ServiceOwner extends Base {
17
28
  const present = this.services.find(s => s.name === service.name);
18
29
 
19
30
  if (present) {
20
- //console.log("LINK", present.fullName, service.fullName);
31
+ //console.log("LINK SERVICE", this.fullName, present.fullName, service.fullName);
21
32
  present.extends.add(service);
22
33
  } else {
34
+ //console.log("ADD SERVICE", this.fullName, service.fullName);
23
35
  this.services.push(service.forOwner(this));
24
36
  }
25
37
  }