@abtnode/core 1.16.24-beta-30f58f8d → 1.16.24-beta-3d2e25fd
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.
|
@@ -8,7 +8,40 @@ const { filterDuplicateComponents, parseComponents } = require('./blocklet');
|
|
|
8
8
|
async function getDynamicComponents({ url }) {
|
|
9
9
|
const rawMeta = await axios.get(url).then((res) => res.data);
|
|
10
10
|
const { dynamicComponents } = await parseComponents({ meta: rawMeta });
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
const components = filterDuplicateComponents(dynamicComponents);
|
|
13
|
+
|
|
14
|
+
const requiredComponents = {};
|
|
15
|
+
rawMeta.components?.forEach((component) => {
|
|
16
|
+
if (component.required) {
|
|
17
|
+
requiredComponents[component.source?.name || component.name] = true;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const subRequiredComponents = {};
|
|
22
|
+
components.forEach((component) => {
|
|
23
|
+
component.required = !!requiredComponents[component.meta?.name || component.meta?.did];
|
|
24
|
+
if (component.required && component.meta?.components) {
|
|
25
|
+
component.meta.components.forEach((subComponent) => {
|
|
26
|
+
if (subComponent.required) {
|
|
27
|
+
if (subComponent.source?.name) {
|
|
28
|
+
subRequiredComponents[subComponent.source?.name] = true;
|
|
29
|
+
}
|
|
30
|
+
subRequiredComponents[subComponent.name] = true;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
components.forEach((component) => {
|
|
36
|
+
if (subRequiredComponents[component.meta?.name || component.meta?.did]) {
|
|
37
|
+
component.required = true;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// eslint-disable-next-line no-nested-ternary
|
|
42
|
+
components.sort((a, b) => (a.required === b.required ? 0 : a.required ? -1 : 1));
|
|
43
|
+
|
|
44
|
+
return components;
|
|
12
45
|
}
|
|
13
46
|
|
|
14
47
|
module.exports = getDynamicComponents;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.24-beta-
|
|
6
|
+
"version": "1.16.24-beta-3d2e25fd",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/analytics": "1.16.24-beta-
|
|
23
|
-
"@abtnode/auth": "1.16.24-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.24-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.24-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.24-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.24-beta-
|
|
28
|
-
"@abtnode/models": "1.16.24-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.24-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.24-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.24-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.24-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.24-beta-
|
|
34
|
-
"@abtnode/util": "1.16.24-beta-
|
|
22
|
+
"@abtnode/analytics": "1.16.24-beta-3d2e25fd",
|
|
23
|
+
"@abtnode/auth": "1.16.24-beta-3d2e25fd",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.24-beta-3d2e25fd",
|
|
25
|
+
"@abtnode/constant": "1.16.24-beta-3d2e25fd",
|
|
26
|
+
"@abtnode/cron": "1.16.24-beta-3d2e25fd",
|
|
27
|
+
"@abtnode/logger": "1.16.24-beta-3d2e25fd",
|
|
28
|
+
"@abtnode/models": "1.16.24-beta-3d2e25fd",
|
|
29
|
+
"@abtnode/queue": "1.16.24-beta-3d2e25fd",
|
|
30
|
+
"@abtnode/rbac": "1.16.24-beta-3d2e25fd",
|
|
31
|
+
"@abtnode/router-provider": "1.16.24-beta-3d2e25fd",
|
|
32
|
+
"@abtnode/static-server": "1.16.24-beta-3d2e25fd",
|
|
33
|
+
"@abtnode/timemachine": "1.16.24-beta-3d2e25fd",
|
|
34
|
+
"@abtnode/util": "1.16.24-beta-3d2e25fd",
|
|
35
35
|
"@arcblock/did": "1.18.110",
|
|
36
36
|
"@arcblock/did-auth": "1.18.110",
|
|
37
37
|
"@arcblock/did-ext": "^1.18.110",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
43
|
"@arcblock/validator": "^1.18.110",
|
|
44
44
|
"@arcblock/vc": "1.18.110",
|
|
45
|
-
"@blocklet/constant": "1.16.24-beta-
|
|
46
|
-
"@blocklet/env": "1.16.24-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.24-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.24-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.24-beta-
|
|
45
|
+
"@blocklet/constant": "1.16.24-beta-3d2e25fd",
|
|
46
|
+
"@blocklet/env": "1.16.24-beta-3d2e25fd",
|
|
47
|
+
"@blocklet/meta": "1.16.24-beta-3d2e25fd",
|
|
48
|
+
"@blocklet/resolver": "1.16.24-beta-3d2e25fd",
|
|
49
|
+
"@blocklet/sdk": "1.16.24-beta-3d2e25fd",
|
|
50
50
|
"@did-space/client": "^0.3.64",
|
|
51
51
|
"@fidm/x509": "^1.2.1",
|
|
52
52
|
"@ocap/mcrypto": "1.18.110",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"jest": "^29.7.0",
|
|
103
103
|
"unzipper": "^0.10.11"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "6dce348d0d02a6c0ef5735a0b73bfd8b2e1503fd"
|
|
106
106
|
}
|