@blocklet/resolver 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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -161,10 +161,14 @@ const parseBlocklet = async (url) => {
161
161
  };
162
162
  exports.parseBlocklet = parseBlocklet;
163
163
  const filterRequiredComponents = (component, children) => {
164
- const requiredNames = new Set(component.meta?.components?.filter((v) => v.required).map((v) => v.name) || []);
164
+ const requiredComponents = (component.meta?.components || []).filter((v) => v.required);
165
+ const requiredNameList = [
166
+ ...requiredComponents.map((v) => v.name),
167
+ ...requiredComponents.map((v) => v.source?.name),
168
+ ];
169
+ const requiredNames = new Set(requiredNameList);
165
170
  requiredNames.add(component.meta.name);
166
- const requiredChildren = children.filter((child) => requiredNames.has(child.meta.name));
167
- return requiredChildren;
171
+ return children.filter((child) => requiredNames.has(child.meta.name));
168
172
  };
169
173
  exports.filterRequiredComponents = filterRequiredComponents;
170
174
  const dynamicComponentsCache = new lru_cache_1.default({ max: 300, maxAge: 60 * 60 * 1000 * 3 }); // 3 hours
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.24-beta-30f58f8d",
6
+ "version": "1.16.24-beta-3d2e25fd",
7
7
  "description": "Blocklet meta resolver",
8
8
  "main": "index.js",
9
9
  "files": [
@@ -22,13 +22,13 @@
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
24
  "@arcblock/did": "^1.18.110",
25
- "@blocklet/constant": "1.16.24-beta-30f58f8d",
26
- "@blocklet/meta": "1.16.24-beta-30f58f8d",
25
+ "@blocklet/constant": "1.16.24-beta-3d2e25fd",
26
+ "@blocklet/meta": "1.16.24-beta-3d2e25fd",
27
27
  "lru-cache": "^6.0.0",
28
28
  "semver": "^7.3.8"
29
29
  },
30
30
  "devDependencies": {
31
- "@abtnode/types": "1.16.24-beta-30f58f8d",
31
+ "@abtnode/types": "1.16.24-beta-3d2e25fd",
32
32
  "@arcblock/eslint-config-ts": "^0.2.4",
33
33
  "@types/jest": "^29.5.11",
34
34
  "@types/node": "^18.11.0",
@@ -40,5 +40,5 @@
40
40
  "ts-jest": "^29.1.1",
41
41
  "typescript": "^5.0.4"
42
42
  },
43
- "gitHead": "95f8e79898d7901f0665f3883e3c014c36f16668"
43
+ "gitHead": "6dce348d0d02a6c0ef5735a0b73bfd8b2e1503fd"
44
44
  }