pmcf 6.39.4 → 6.39.6

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.6",
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,
@@ -41,15 +42,44 @@ export class content extends core {
41
42
  access: {
42
43
  ...string_attribute_writable,
43
44
  name: "access",
44
- default: "private"
45
+ default: "private",
46
+ packagingProperty: true
47
+ },
48
+ depends: {
49
+ ...string_set_attribute_writable,
50
+ name: "depends",
51
+ packagingProperty: true
52
+ },
53
+ provides: {
54
+ ...string_set_attribute_writable,
55
+ name: "provides",
56
+ packagingProperty: true
57
+ },
58
+ replaces: {
59
+ ...string_set_attribute_writable,
60
+ name: "replaces",
61
+ packagingProperty: true
62
+ },
63
+ optional: {
64
+ ...string_set_attribute_writable,
65
+ name: "optional",
66
+ packagingProperty: true
67
+ },
68
+ groups: {
69
+ ...string_set_attribute_writable,
70
+ name: "groups",
71
+ packagingProperty: true
72
+ },
73
+ backup: {
74
+ ...string_set_attribute_writable,
75
+ name: "backup",
76
+ packagingProperty: true
77
+ },
78
+ hooks: {
79
+ ...string_set_attribute_writable,
80
+ name: "hooks",
81
+ packagingProperty: true
45
82
  },
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" },
53
83
  packaging: { ...string_set_attribute_writable, name: "packaging" }
54
84
  };
55
85
 
@@ -219,8 +249,8 @@ export class content extends core {
219
249
  }
220
250
 
221
251
  /**
222
- *
223
- * @param {object} packageData
252
+ *
253
+ * @param {object} packageData
224
254
  */
225
255
  async loadHooks(packageData) {
226
256
  for (const node of this.walkDirections(["this", "extends"])) {
@@ -234,17 +264,12 @@ export class content extends core {
234
264
  const packageData = {
235
265
  sources: [],
236
266
  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
- }
267
+ properties: Object.fromEntries(
268
+ extendingAttributeIterator(
269
+ this.constructor,
270
+ attribute => attribute.packagingProperty
271
+ ).map(([path, attribute]) => [path[0], this[path[0]]])
272
+ )
248
273
  };
249
274
 
250
275
  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,