pmcf 6.11.3 → 6.13.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/bin/pmcf-info CHANGED
@@ -10,30 +10,67 @@ for (const expression of args) {
10
10
  show(result);
11
11
  }
12
12
 
13
- function show(value) {
13
+ function show(value, indent = 0) {
14
14
  if (value instanceof Iterator) {
15
15
  for (const v of value) {
16
16
  show(v);
17
17
  }
18
18
  } else {
19
- console.log(`${value.fullName}(${value.constructor.name}):`);
19
+ const type = value.constructor;
20
+ console.log(`${" ".repeat(indent)}${value.fullName}(${type.name}):`);
21
+
22
+ const ml = maxNameLength(type);
23
+ const name = attribute => " " + attribute.name.padEnd(ml) + ": ";
24
+
25
+ for (const [path, attribute] of extendingAttributeIterator(
26
+ type,
27
+ attribute =>
28
+ !attribute.key && !attribute.private && attribute.type.primitive
29
+ )) {
30
+ const v = value.attribute(attribute.name);
31
+ if (v !== undefined) {
32
+ if (attribute.collection) {
33
+ console.log(`${name(attribute)}${[...v]}`);
34
+ } else {
35
+ console.log(`${name(attribute)}${v}`);
36
+ }
37
+ }
38
+ }
20
39
 
21
40
  for (const [path, attribute] of extendingAttributeIterator(
22
- value,
23
- attribute => !attribute.private
41
+ type,
42
+ attribute => !attribute.private && !attribute.type.primitive
24
43
  )) {
25
- console.log(path);
44
+ const v = value[attribute.name];
45
+ if (v !== undefined) {
46
+ if (attribute.collection) {
47
+ console.log(name(attribute));
48
+
49
+ if (attribute.backpointer) {
50
+ for (const o of v.values()) {
51
+ show(o, indent + 2);
52
+ }
53
+ } else {
54
+ for (const o of v.values()) {
55
+ console.log(" ".repeat(indent + 2) + o.fullName);
56
+ }
57
+ }
58
+ } else {
59
+ console.log(`${name(attribute)}${v.fullName}`);
60
+ }
61
+ }
26
62
  }
27
- ex(value);
28
63
  }
29
64
  }
30
65
 
31
- function ex(node, indent = 1) {
32
- if (indent > 5) {
33
- return;
34
- }
35
- for (const e of node.extends) {
36
- console.log(" ".repeat(indent * 2) + e.fullName);
37
- ex(e, indent + 1);
66
+ function maxNameLength(type) {
67
+ let maxLength = 0;
68
+ for (const [path, attribute] of extendingAttributeIterator(
69
+ type,
70
+ attribute => !attribute.key && !attribute.private
71
+ )) {
72
+ maxLength = Math.max(maxLength, attribute.name.length);
38
73
  }
74
+
75
+ return maxLength;
39
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.11.3",
3
+ "version": "6.13.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,7 +42,6 @@ class bind_group extends Base {
42
42
  static priority = 1;
43
43
  static attributes = {
44
44
  name: name_attribute_writable,
45
- owner: owner_attribute,
46
45
  access: {
47
46
  type: bindNetworkAddressTypes,
48
47
  name: "access",
@@ -167,6 +166,10 @@ class bind_group extends Base {
167
166
  }
168
167
 
169
168
  async packageContent(outputControl) {
169
+ outputControl.packageData.sources.push(
170
+ ...(await Array.fromAsync(this.templateContent(...outputControl.permissions)))
171
+ );
172
+
170
173
  return (
171
174
  await Promise.all([
172
175
  this.generateACLs(outputControl),
@@ -553,7 +556,7 @@ export class bind extends ExtraSourceService {
553
556
  new FileContentProvider(dir + "/", ...permissions)
554
557
  );
555
558
 
556
- const outputControl = newOutputControl(packageData, dir);
559
+ const outputControl = newOutputControl(packageData, dir, permissions);
557
560
 
558
561
  for (const group of this.groups.values()) {
559
562
  const present = await group.packageContent(outputControl);
@@ -639,6 +642,6 @@ export class bind extends ExtraSourceService {
639
642
  }
640
643
  }
641
644
 
642
- function newOutputControl(packageData, dir) {
643
- return { configs: [], catalogs: new Map(), packageData, dir };
645
+ function newOutputControl(packageData, dir, permissions) {
646
+ return { configs: [], catalogs: new Map(), packageData, dir, permissions};
644
647
  }