@blocklet/meta 1.16.22 → 1.16.23-beta-f85576a6

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/util.d.ts CHANGED
@@ -90,7 +90,7 @@ declare const isEnvShareableToClient: (env?: TConfig) => boolean;
90
90
  * is env shareable between components
91
91
  */
92
92
  declare const isEnvShareable: (env?: Partial<TConfig>) => boolean;
93
- declare const getSharedConfigObj: (app?: BlockletState, component?: BlockletState) => any;
93
+ declare const getSharedConfigObj: (app?: TComponentPro, component?: TComponentPro) => any;
94
94
  declare const isPreferenceKey: (x: Partial<TConfig>) => Boolean;
95
95
  declare const getAppMissingConfigs: (app?: any) => any[];
96
96
  declare const getComponentMissingConfigs: (component?: any, app?: any) => any[];
@@ -178,7 +178,7 @@ declare const _default: {
178
178
  }) => Promise<unknown>;
179
179
  forEachComponentV2Sync: (blocklet: any, cb: Function) => Promise<unknown>;
180
180
  isDeletableBlocklet: (blocklet?: BlockletState) => boolean;
181
- getSharedConfigObj: (app?: BlockletState, component?: BlockletState) => any;
181
+ getSharedConfigObj: (app?: TComponentPro, component?: TComponentPro) => any;
182
182
  getAppMissingConfigs: (app?: any) => any[];
183
183
  getComponentMissingConfigs: (component?: any, app?: any) => any[];
184
184
  isEnvShareableToClient: (env?: TConfig) => boolean;
package/lib/util.js CHANGED
@@ -283,7 +283,7 @@ const getSharedConfigObj = (app, component) => {
283
283
  return res;
284
284
  }
285
285
  if (Array.isArray(app.configs)) {
286
- app.configs.forEach(({ key, value, secure }) => {
286
+ app.configs.forEach(({ key, value: value0, secure }) => {
287
287
  if (!isEnvShareable({
288
288
  key,
289
289
  secure,
@@ -292,10 +292,11 @@ const getSharedConfigObj = (app, component) => {
292
292
  })) {
293
293
  return;
294
294
  }
295
+ const value = (app.configObj || {})[key] || value0;
295
296
  const config = (component.configs || []).find((x) => x.key === key);
296
297
  if (!config || // component does not have this config
297
298
  isEnvShareable(config) || // component config is shareable
298
- !config.value // component config is empty
299
+ (!config.value && !(component.configObj || {})[config.key]) // component config is empty
299
300
  ) {
300
301
  res[key] = value;
301
302
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.22",
6
+ "version": "1.16.23-beta-f85576a6",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "./lib/index.js",
9
9
  "typings": "./lib/index.d.ts",
@@ -24,12 +24,12 @@
24
24
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@abtnode/constant": "1.16.22",
27
+ "@abtnode/constant": "1.16.23-beta-f85576a6",
28
28
  "@arcblock/did": "1.18.108",
29
29
  "@arcblock/did-ext": "1.18.108",
30
30
  "@arcblock/did-util": "1.18.108",
31
31
  "@arcblock/jwt": "1.18.108",
32
- "@blocklet/constant": "1.16.22",
32
+ "@blocklet/constant": "1.16.23-beta-f85576a6",
33
33
  "@ocap/asset": "1.18.108",
34
34
  "@ocap/mcrypto": "1.18.108",
35
35
  "@ocap/types": "1.18.108",
@@ -78,5 +78,5 @@
78
78
  "ts-node": "^10.9.1",
79
79
  "typescript": "^5.0.4"
80
80
  },
81
- "gitHead": "eba523c2d8f62f2a1c742b23e3280774bf9bc4cf"
81
+ "gitHead": "bac83a74944b4cef3ccb386277023caf0e1d5cd4"
82
82
  }