@blocklet/meta 1.16.33-beta-20241014-122831-e6000fb8 → 1.16.33-beta-20241016-094817-da9da642

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/lib/schema.js CHANGED
@@ -351,7 +351,7 @@ const componentSourceSchema = Joi.alternatives().try(Joi.object({
351
351
  // 虽然 url 无法像 store 一样根据 version 获取指定版本的 component, 但是 version 仍然可以用于限制 component 版本
352
352
  version: Joi.alternatives().try(Joi.string().valid('latest'), Joi.semverRange().valid()),
353
353
  }), Joi.object({
354
- store: Joi.string().uri(),
354
+ store: Joi.string().uri({ scheme: ['http', 'https'] }),
355
355
  name: blockletNameSchema.required(),
356
356
  // TODO 目前只能支持锁死的版本号,接下载需要支持自适应的版本号,比如 4.x
357
357
  version: Joi.alternatives().try(Joi.string().valid('latest'), Joi.semverRange().valid()).default('latest'),
package/lib/util.js CHANGED
@@ -277,7 +277,7 @@ exports.isEnvShareableToClient = isEnvShareableToClient;
277
277
  * is env shareable between components
278
278
  */
279
279
  const isEnvShareable = (env) => {
280
- return (!!env && !!(env.key || env.name) && !env.secure && !!env.shared && !constant_2.BLOCKLET_CONFIGURABLE_KEY[env.key || env.name]);
280
+ return !!env && !!(env.key || env.name) && !!env.shared && !constant_2.BLOCKLET_CONFIGURABLE_KEY[env.key || env.name];
281
281
  };
282
282
  exports.isEnvShareable = isEnvShareable;
283
283
  const getSharedConfigObj = (app, component) => {
@@ -287,12 +287,8 @@ const getSharedConfigObj = (app, component) => {
287
287
  }
288
288
  if (Array.isArray(app.configs)) {
289
289
  app.configs.forEach(({ key, value: value0, secure }) => {
290
- if (!isEnvShareable({
291
- key,
292
- secure,
293
- // config in container is force shared to components
294
- shared: true,
295
- })) {
290
+ // config in container is force shared to components
291
+ if (!isEnvShareable({ key, secure, shared: true })) {
296
292
  return;
297
293
  }
298
294
  const value = (app.configObj || {})[key] || value0;
@@ -305,6 +301,23 @@ const getSharedConfigObj = (app, component) => {
305
301
  }
306
302
  });
307
303
  }
304
+ if (Array.isArray(app.children)) {
305
+ app.children
306
+ .filter((x) => x.meta?.did !== component.meta?.did)
307
+ .forEach((child) => {
308
+ (child.configs || [])
309
+ .filter(isEnvShareable) // only share shareable configs
310
+ .filter((x) => !(app.configs || []).find((y) => y.key === x.key)) // only share configs that app does not have
311
+ .forEach(({ key, value }) => {
312
+ const config = (component.configs || []).find((x) => x.key === key);
313
+ if (!config || // component does not have this config
314
+ (!config.value && !(component.configObj || {})[config.key]) // component config is empty
315
+ ) {
316
+ res[key] = value;
317
+ }
318
+ });
319
+ });
320
+ }
308
321
  // share blocklet app chain config
309
322
  (app.configs || []).forEach(({ key, value }) => {
310
323
  if (![
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.33-beta-20241014-122831-e6000fb8",
6
+ "version": "1.16.33-beta-20241016-094817-da9da642",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "./lib/index.js",
9
9
  "typings": "./lib/index.d.ts",
@@ -25,12 +25,12 @@
25
25
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
26
26
  "license": "Apache-2.0",
27
27
  "dependencies": {
28
- "@abtnode/constant": "1.16.33-beta-20241014-122831-e6000fb8",
28
+ "@abtnode/constant": "1.16.33-beta-20241016-094817-da9da642",
29
29
  "@arcblock/did": "1.18.135",
30
30
  "@arcblock/did-ext": "1.18.135",
31
31
  "@arcblock/did-util": "1.18.135",
32
32
  "@arcblock/jwt": "1.18.135",
33
- "@blocklet/constant": "1.16.33-beta-20241014-122831-e6000fb8",
33
+ "@blocklet/constant": "1.16.33-beta-20241016-094817-da9da642",
34
34
  "@ocap/asset": "1.18.135",
35
35
  "@ocap/mcrypto": "1.18.135",
36
36
  "@ocap/types": "1.18.135",
@@ -39,7 +39,7 @@
39
39
  "ajv": "^8.11.0",
40
40
  "axios": "^1.7.5",
41
41
  "cjk-length": "^1.0.0",
42
- "debug": "^4.3.6",
42
+ "debug": "^4.3.7",
43
43
  "fs-extra": "^11.2.0",
44
44
  "hosted-git-info": "3.0.8",
45
45
  "hpagent": "^1.1.0",
@@ -79,5 +79,5 @@
79
79
  "ts-node": "^10.9.1",
80
80
  "typescript": "^5.6.3"
81
81
  },
82
- "gitHead": "e0c74418f9349b237c189e8d7546dccd71309a38"
82
+ "gitHead": "a714300a967417cb3244e00eced42b844bf8e12f"
83
83
  }