pmcf 3.10.2 → 3.10.3
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 +2 -2
- package/src/base.mjs +3 -1
- package/src/root.mjs +6 -4
- package/src/types.mjs +13 -16
- package/types/types.d.mts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"ip-utilties": "^1.4.9",
|
|
55
55
|
"npm-pkgbuild": "^18.2.30",
|
|
56
|
-
"pacc": "^4.
|
|
56
|
+
"pacc": "^4.17.0",
|
|
57
57
|
"package-directory": "^8.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
package/src/base.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { allOutputs } from "npm-pkgbuild";
|
|
|
3
3
|
import {
|
|
4
4
|
getAttribute,
|
|
5
5
|
baseTypes,
|
|
6
|
+
attributeIterator,
|
|
6
7
|
name_attribute_writable,
|
|
7
8
|
string_attribute,
|
|
8
9
|
string_attribute_writable,
|
|
@@ -228,8 +229,9 @@ export class Base {
|
|
|
228
229
|
this._properties = data.properties;
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
for (const [
|
|
232
|
+
for (const [path, attribute] of attributeIterator(type.attributes)) {
|
|
232
233
|
if (attribute.writable) {
|
|
234
|
+
const name = path.join(".");
|
|
233
235
|
const value = this.expand(data[name]);
|
|
234
236
|
|
|
235
237
|
if (attribute.collection) {
|
package/src/root.mjs
CHANGED
|
@@ -80,10 +80,12 @@ export class Root extends Location {
|
|
|
80
80
|
for (const type of Object.values(types).sort(
|
|
81
81
|
(a, b) => b.priority - a.priority
|
|
82
82
|
)) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
if (type.clazz) {
|
|
84
|
+
for await (const name of glob(type.clazz.fileNameGlob, {
|
|
85
|
+
cwd: this.directory
|
|
86
|
+
})) {
|
|
87
|
+
await this.load(name, { type });
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
package/src/types.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { baseTypes } from "pacc";
|
|
1
|
+
import { baseTypes, attributeIterator, types } from "pacc";
|
|
2
2
|
import { asArray } from "./utils.mjs";
|
|
3
3
|
import { addServiceTypes } from "./service-types.mjs";
|
|
4
|
-
|
|
5
|
-
export const types = {};
|
|
6
|
-
|
|
4
|
+
export { types };
|
|
7
5
|
export function addType(clazz) {
|
|
8
6
|
const type = clazz.typeDefinition;
|
|
9
7
|
|
|
@@ -22,12 +20,16 @@ export function addType(clazz) {
|
|
|
22
20
|
|
|
23
21
|
export function resolveTypeLinks() {
|
|
24
22
|
for (const type of Object.values(types)) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
if (type.owners) {
|
|
24
|
+
type.owners = type.owners.map(owner =>
|
|
25
|
+
typeof owner === "string" ? types[owner] : owner
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
type.owners = [];
|
|
30
|
+
}
|
|
31
|
+
for (const [path, attribute] of attributeIterator(type.attributes)) {
|
|
32
|
+
attribute.name = path.join(".");
|
|
31
33
|
if (attribute.isKey) {
|
|
32
34
|
type.identifier = attribute;
|
|
33
35
|
}
|
|
@@ -43,12 +45,7 @@ export function resolveTypeLinks() {
|
|
|
43
45
|
if (t) {
|
|
44
46
|
ts.push(t);
|
|
45
47
|
} else {
|
|
46
|
-
console.error(
|
|
47
|
-
"Unknown type",
|
|
48
|
-
attribute.type,
|
|
49
|
-
type.name,
|
|
50
|
-
name
|
|
51
|
-
);
|
|
48
|
+
console.error("Unknown type", attribute.type, type.name, name);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
} else {
|
package/types/types.d.mts
CHANGED