pmcf 6.39.4 → 6.39.5

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.39.4",
3
+ "version": "6.39.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/content.mjs CHANGED
@@ -1,10 +1,11 @@
1
- import { join } from "node:path";
1
+ import path, { join } from "node:path";
2
2
  import {
3
3
  name_attribute_writable,
4
4
  string_attribute_writable,
5
5
  string_set_attribute_writable,
6
6
  default_collection_attribute_writable,
7
- description_attribute_writable
7
+ description_attribute_writable,
8
+ extendingAttributeIterator
8
9
  } from "pacc";
9
10
  import { allOutputs } from "npm-pkgbuild";
10
11
  import { core, addType } from "pmcf";
@@ -31,8 +32,8 @@ export class permission extends core {
31
32
 
32
33
  export class content extends core {
33
34
  static attributes = {
34
- name: name_attribute_writable,
35
- description: description_attribute_writable,
35
+ name: { ...name_attribute_writable, packagingProperty: true },
36
+ description: { ...description_attribute_writable, packagingProperty: true },
36
37
  permissions: {
37
38
  ...default_collection_attribute_writable,
38
39
  type: permission,
@@ -43,13 +44,41 @@ export class content extends core {
43
44
  name: "access",
44
45
  default: "private"
45
46
  },
46
- depends: { ...string_set_attribute_writable, name: "depends" },
47
- provides: { ...string_set_attribute_writable, name: "provides" },
48
- replaces: { ...string_set_attribute_writable, name: "replaces" },
49
- optional: { ...string_set_attribute_writable, name: "optional" },
50
- groups: { ...string_set_attribute_writable, name: "groups" },
51
- backup: { ...string_set_attribute_writable, name: "backup" },
52
- hooks: { ...string_set_attribute_writable, name: "hooks" },
47
+ depends: {
48
+ ...string_set_attribute_writable,
49
+ name: "depends",
50
+ packagingProperty: true
51
+ },
52
+ provides: {
53
+ ...string_set_attribute_writable,
54
+ name: "provides",
55
+ packagingProperty: true
56
+ },
57
+ replaces: {
58
+ ...string_set_attribute_writable,
59
+ name: "replaces",
60
+ packagingProperty: true
61
+ },
62
+ optional: {
63
+ ...string_set_attribute_writable,
64
+ name: "optional",
65
+ packagingProperty: true
66
+ },
67
+ groups: {
68
+ ...string_set_attribute_writable,
69
+ name: "groups",
70
+ packagingProperty: true
71
+ },
72
+ backup: {
73
+ ...string_set_attribute_writable,
74
+ name: "backup",
75
+ packagingProperty: true
76
+ },
77
+ hooks: {
78
+ ...string_set_attribute_writable,
79
+ name: "hooks",
80
+ packagingProperty: true
81
+ },
53
82
  packaging: { ...string_set_attribute_writable, name: "packaging" }
54
83
  };
55
84
 
@@ -219,8 +248,8 @@ export class content extends core {
219
248
  }
220
249
 
221
250
  /**
222
- *
223
- * @param {object} packageData
251
+ *
252
+ * @param {object} packageData
224
253
  */
225
254
  async loadHooks(packageData) {
226
255
  for (const node of this.walkDirections(["this", "extends"])) {
@@ -234,17 +263,12 @@ export class content extends core {
234
263
  const packageData = {
235
264
  sources: [],
236
265
  outputs: this.outputs,
237
- properties: {
238
- name: this.name,
239
- description: this.description,
240
- access: this.access,
241
- groups: [...this.groups],
242
- depends: [...this.depends],
243
- provides: [...this.provides],
244
- replaces: [...this.replaces],
245
- optional: [...this.optional],
246
- backup: [...this.backup]
247
- }
266
+ properties: Object.fromEntries(
267
+ extendingAttributeIterator(
268
+ this.constructor,
269
+ attribute => attribute.packagingProperty
270
+ ).map(([path, attribute]) => [path[0], this[path[0]]])
271
+ )
248
272
  };
249
273
 
250
274
  await this.loadHooks(packageData);
package/src/core.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AggregatedMap } from "aggregated-map";
2
-
3
2
  import {
4
3
  toExternal,
5
4
  filterPublic,