pmcf 4.21.1 → 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 +11 -11
- package/package.json +1 -1
- package/src/host.mjs +2 -2
- package/src/initialization-context.mjs +4 -4
- package/src/service-owner.mjs +13 -1
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-
|
|
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)>** 
|
|
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
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.
|
|
464
|
+
for (const service of this.allServices) {
|
|
465
465
|
//console.log("SERVICE",service.name);
|
|
466
466
|
|
|
467
467
|
if (service.systemdConfigs) {
|
|
@@ -234,11 +234,11 @@ export class InitializationContext {
|
|
|
234
234
|
|
|
235
235
|
if (type.extends) {
|
|
236
236
|
this.read(object, data, type.extends);
|
|
237
|
-
}
|
|
238
237
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
if (data.extends) {
|
|
239
|
+
//console.log("EXTENDS", type.name, object.fullName, data.extends);
|
|
240
|
+
object.materializeExtends();
|
|
241
|
+
}
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
|
package/src/service-owner.mjs
CHANGED
|
@@ -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
|
}
|