@next-core/brick-kit 2.188.1 → 2.188.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/dist/index.esm.js CHANGED
@@ -703,7 +703,7 @@ function imagesFactory(appId, isBuildPush, version) {
703
703
  return {
704
704
  get(name) {
705
705
  var getSuffix = () => {
706
- var suffix = window.APP_ROOT ? "".concat(window.APP_ROOT).concat(window.PUBLIC_DEPS ? "" : "-/") : "";
706
+ var suffix = window.APP_ROOT ? "".concat(window.APP_ROOT).concat(window.BOOTSTRAP_UNION_FILE && window.PUBLIC_DEPS ? "" : "-/") : "";
707
707
  if (!suffix.startsWith("/")) {
708
708
  suffix = getBasePath() + suffix;
709
709
  }
@@ -717,7 +717,7 @@ function imagesFactory(appId, isBuildPush, version) {
717
717
  }
718
718
  return suffix;
719
719
  };
720
- return isBuildPush ? "".concat(getBasePath(), "api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/").concat(name) : window.PUBLIC_DEPS ? "".concat(getSuffix(), "images/").concat(name) : "".concat(getSuffix(), "micro-apps/").concat(appId, "/images/").concat(name);
720
+ return isBuildPush ? "".concat(getBasePath(), "api/gateway/object_store.object_store.GetObject/api/v1/objectStore/bucket/next-builder/object/").concat(name) : window.BOOTSTRAP_UNION_FILE && window.PUBLIC_DEPS ? "".concat(getSuffix(), "images/").concat(name) : "".concat(getSuffix(), "micro-apps/").concat(appId, "/images/").concat(name);
721
721
  }
722
722
  };
723
723
  }
@@ -9028,9 +9028,22 @@ class Kernel {
9028
9028
  });
9029
9029
  })();
9030
9030
  }
9031
+ processPublicDepsPackages() {
9032
+ var brickPackages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9033
+ var pubDeps = arguments.length > 1 ? arguments[1] : undefined;
9034
+ if (!(pubDeps !== null && pubDeps !== void 0 && pubDeps.length)) return brickPackages;
9035
+ var bricksMap = new Map();
9036
+
9037
+ // bootstrapData 数据和 pubDeps 中可能同时存在同一个包名,需要过滤去重, 以 pubDeps 中的包为准
9038
+ [...brickPackages, ...pubDeps].forEach(pkg => {
9039
+ var pkgName = pkg.filePath.split("/")[1];
9040
+ bricksMap.set(pkgName, pkg);
9041
+ });
9042
+ return Array.from(bricksMap.values());
9043
+ }
9031
9044
  getBrickPackages() {
9032
- var _this$bootstrapData, _this$bootstrapData$b, _window$PUBLIC_DEPS;
9033
- return (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$b = _this$bootstrapData.brickPackages) === null || _this$bootstrapData$b === void 0 ? void 0 : _this$bootstrapData$b.concat((_window$PUBLIC_DEPS = window.PUBLIC_DEPS) !== null && _window$PUBLIC_DEPS !== void 0 ? _window$PUBLIC_DEPS : []);
9045
+ var _this$bootstrapData;
9046
+ return this.processPublicDepsPackages((_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : _this$bootstrapData.brickPackages, window.PUBLIC_DEPS);
9034
9047
  }
9035
9048
  reloadMicroApps(params, interceptorParams) {
9036
9049
  // There is no need to reload standalone micro-apps.