pmcf 1.52.0 → 1.52.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "1.52.0",
3
+ "version": "1.52.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -131,13 +131,17 @@ export class Base {
131
131
  case "string":
132
132
  {
133
133
  value = this.expand(value);
134
- const object = this.typeNamed(property.type.name, value);
134
+ let object = this.typeNamed(property.type.name, value);
135
135
 
136
136
  if (object) {
137
137
  assign(property, object);
138
138
  } else {
139
139
  if (property.type.constructWithIdentifierOnly) {
140
- new property.type.clazz(this.ownerFor(property, value), value);
140
+ object = new property.type.clazz(
141
+ this.ownerFor(property, value),
142
+ value
143
+ );
144
+ this.addObject(object);
141
145
  } else {
142
146
  this.finalize(() => {
143
147
  value = this.expand(value);
package/src/host.mjs CHANGED
@@ -79,14 +79,21 @@ export class Host extends Base {
79
79
  if (data.extends) {
80
80
  this.finalize(() => {
81
81
  for (const host of this.extends) {
82
+ host.execFinalize();
82
83
  this.depends = host.depends;
83
84
  this.provides = host.provides;
84
85
  this.replaces = host.replaces;
85
86
 
86
- for (const service of host.findServices()) {
87
+ for (const service of host.services) {
87
88
  this.services = service.forOwner(this);
88
89
  }
89
90
  }
91
+
92
+ if (!this.isTemplate) {
93
+ this.#depends = this.expand(this.depends);
94
+ this.#provides = this.expand(this.provides);
95
+ this.#replaces = this.expand(this.replaces);
96
+ }
90
97
  });
91
98
  }
92
99
  }
@@ -260,6 +267,12 @@ export class Host extends Base {
260
267
  return ni;
261
268
  }
262
269
  }
270
+ if (typeName === "service") {
271
+ const service = this.services.find(s => s.name === name);
272
+ if (service) {
273
+ return service;
274
+ }
275
+ }
263
276
 
264
277
  return super.typeNamed(typeName, name);
265
278
  }
package/src/owner.mjs CHANGED
@@ -46,7 +46,6 @@ export class Owner extends Base {
46
46
  constructor(owner, data) {
47
47
  super(owner, data);
48
48
  this.read(data, OwnerTypeDefinition);
49
- owner?.addObject(this);
50
49
  }
51
50
 
52
51
  _traverse(...args) {
package/src/service.mjs CHANGED
@@ -51,7 +51,6 @@ export class Service extends Base {
51
51
  constructor(owner, data) {
52
52
  super(owner, data);
53
53
  this.read(data, ServiceTypeDefinition);
54
- // owner.addService(this);
55
54
  }
56
55
 
57
56
  forOwner(owner) {