@next-core/brick-container 2.99.0 → 2.99.2

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/preview.html CHANGED
@@ -1 +1 @@
1
- <!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.42523c4f.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.793b87ea20dd67a8a1e7.js"></script></body></html>
1
+ <!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.e8fb3a8f.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.0658c6713bcaed9fd6fc.js"></script></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/brick-container",
3
- "version": "2.99.0",
3
+ "version": "2.99.2",
4
4
  "description": "Brick Container Server",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/brick-container",
6
6
  "license": "GPL-3.0",
@@ -73,5 +73,5 @@
73
73
  "webpack-dev-server": "^4.11.1",
74
74
  "webpack-merge": "^5.8.0"
75
75
  },
76
- "gitHead": "dd3c7ae18c87b52d96c60732ff7f957dfd46862e"
76
+ "gitHead": "052429b41cf2af5c5e6ef093bad935d661efc032"
77
77
  }
@@ -456,7 +456,7 @@ module.exports = (env, getRawIndexHtml) => {
456
456
  data.injectMenus = data.injectMenus.map((remoteMenu) => {
457
457
  const remoteAppId = remoteMenu.app?.[0]?.appId;
458
458
  const menuId = remoteMenu.menuId;
459
- const menuType = remoteMenu.type;
459
+ const remoteGroupId = remoteMenu.injectMenuGroupId;
460
460
 
461
461
  if (!remoteAppId || !menuId) {
462
462
  return remoteMenu;
@@ -469,10 +469,17 @@ module.exports = (env, getRawIndexHtml) => {
469
469
  localStoryboard.meta.menus &&
470
470
  localAppId === remoteAppId
471
471
  ) {
472
- // 从本地 storyboard 查找匹配的 menu
473
- const localMenu = localStoryboard.meta.menus.find(
474
- (menu) => menu.menuId === menuId && menu.type === menuType
475
- );
472
+ // 同一个 menuId 可能存在多个 inject 菜单(按 injectMenuGroupId 区分注入目标),
473
+ // menuId + injectMenuGroupId 精确匹配。无 group 时仅按 menuId 匹配。
474
+ const localMenu = localStoryboard.meta.menus.find((menu) => {
475
+ if (menu.menuId !== menuId) {
476
+ return false;
477
+ }
478
+ if (remoteGroupId) {
479
+ return menu.injectMenuGroupId === remoteGroupId;
480
+ }
481
+ return true;
482
+ });
476
483
 
477
484
  if (localMenu) {
478
485
  console.log(
package/serve/serve.js CHANGED
@@ -164,10 +164,25 @@ module.exports = function serve(runtimeFlags) {
164
164
  }
165
165
 
166
166
  if (env.https) {
167
+ const keyPath = path.join(env.rootDir, "dev-https.key");
168
+ const certPath = path.join(env.rootDir, "dev-https.cert");
169
+
170
+ if (!fs.existsSync(keyPath) || !fs.existsSync(certPath)) {
171
+ const { execSync } = require("child_process");
172
+ const san = `DNS:localhost${
173
+ env.host !== "localhost" ? ",IP:" + env.host : ""
174
+ }`;
175
+ console.log(chalk.cyan("Auto-generating self-signed certificate..."));
176
+ execSync(
177
+ `openssl req -x509 -newkey rsa:2048 -keyout "${keyPath}" -out "${certPath}" -days 365 -nodes -subj "/CN=localhost" -addext "subjectAltName=${san}"`,
178
+ { stdio: "inherit" }
179
+ );
180
+ }
181
+
167
182
  const server = https.createServer(
168
183
  {
169
- key: fs.readFileSync(path.join(env.rootDir, "dev-https.key"), "utf8"),
170
- cert: fs.readFileSync(path.join(env.rootDir, "dev-https.cert"), "utf8"),
184
+ key: fs.readFileSync(keyPath, "utf8"),
185
+ cert: fs.readFileSync(certPath, "utf8"),
171
186
  },
172
187
  app
173
188
  );