pmcf 6.32.0 → 6.32.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": "6.32.0",
3
+ "version": "6.32.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -110,7 +110,10 @@ export class Base {
110
110
 
111
111
  for (const [path, attribute] of extendingAttributeIterator(
112
112
  this.constructor,
113
- attribute => attribute.collection && !attribute.type.primitive
113
+ attribute =>
114
+ attribute.collection &&
115
+ !attribute.type.primitive &&
116
+ !attribute.deferredExpression
114
117
  )) {
115
118
  const collection = this[attribute.name];
116
119
  if (typeof collection?.get === "function") {
@@ -119,32 +122,41 @@ export class Base {
119
122
  attribute.name
120
123
  )) {
121
124
  const present = collection.get(extending.name);
122
- //console.log("ME",this.fullName,attribute.name,extending.name);
125
+
123
126
  if (present) {
127
+ /*if (attribute.name === "services") {
128
+ console.log(
129
+ this.fullName,
130
+ present.fullName,
131
+ "<-",
132
+ extending.fullName
133
+ );
134
+ }*/
135
+
124
136
  present.extends.add(extending);
125
137
  present.materializeExtends();
126
138
  } else {
139
+ /*if (attribute.name === "services") {
140
+ console.log(this.fullName, extending.fullName);
141
+ }*/
127
142
  collection.set(extending.name, extending.forOwner(this));
128
143
  }
129
144
  }
130
- }
131
- /*
132
- else {
133
- if (collection instanceof Set) {
134
- for (const all of this.unionFromDirections(["extends"], attribute.name)) {
135
- if (all instanceof Set) {
136
- const d = collection.difference(all);
137
-
138
- // if (d.size) {
139
- console.log("ME", this.fullName, attribute.name, d);
140
- // }
141
- }
142
- else {
143
- // console.error("NO SET",this.fullName, attribute.name, typeof all, all.constructor.name);
145
+ } /*else {
146
+ if (Array.isArray(collection)) {
147
+ // TODO
148
+ } else {
149
+ //console.log("EXTENDS", this.fullName, attribute.name);
150
+
151
+ for (const extending of this.unionFromDirections(
152
+ ["extends"],
153
+ attribute.name
154
+ )) {
155
+ if (!collection.has(extending)) {
156
+ //console.log("ADD", this.fullName, extending.fullName);
157
+ collection.add(extending);
144
158
  }
145
159
  }
146
- } else {
147
- //console.log("NO MAP OR SET", this.fullName, name);
148
160
  }
149
161
  }*/
150
162
  }
@@ -180,7 +192,9 @@ export class Base {
180
192
  */
181
193
  mapFromDirections(directions, property) {
182
194
  return new AggregatedMap(
183
- [...this.walkDirections(directions)].map(node => node[property])
195
+ [...this.walkDirections(directions)]
196
+ .map(node => node[property])
197
+ .filter(node => node !== undefined)
184
198
  );
185
199
  }
186
200
 
@@ -195,6 +209,9 @@ export class Base {
195
209
  for (const node of this.walkDirections(directions)) {
196
210
  const value = node[property];
197
211
  if (value !== undefined) {
212
+ if (!(value instanceof Set)) {
213
+ console.log("NO SET", value, node.fullName, property);
214
+ }
198
215
  collected = collected.union(value);
199
216
  }
200
217
  }
@@ -29,6 +29,12 @@ export class InitializationContext {
29
29
  const resolved = this.named(value, node);
30
30
  if (resolved) {
31
31
  assign(attribute, object, resolved);
32
+
33
+ if (attribute.name === "extends") {
34
+ // TODO attribute action ?
35
+ object.materializeExtends();
36
+ }
37
+
32
38
  continue nextOutstanding;
33
39
  }
34
40
  }
@@ -36,6 +42,12 @@ export class InitializationContext {
36
42
  const resolved = object.expression(value);
37
43
  if (resolved) {
38
44
  assign(attribute, object, resolved);
45
+
46
+ if (attribute.name === "extends") {
47
+ // TODO attribute action ?
48
+ object.materializeExtends();
49
+ }
50
+
39
51
  continue nextOutstanding;
40
52
  }
41
53
 
@@ -783,6 +783,12 @@ export class bind extends CoreService {
783
783
 
784
784
  async writeForwarders(outputControl) {
785
785
  // TODO formulate everything as pacc expression
786
+
787
+ /*
788
+ console.log("F",this.extends);
789
+ console.log("F0",this.fullName);
790
+ console.log("F1",this.forwarders);
791
+ */
786
792
  const forwarders = [...this.forwarders]
787
793
  .map(e => e.endpoints())
788
794
  .flat()