@next-core/brick-container 2.98.18 → 2.98.20

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.c2e611ee.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.0927d3d3d39ba5c74a07.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.ca42c8669e4d14c0eabd.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.c2e611ee.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.2f496a85c7e2b2d33b51.js"></script></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/brick-container",
3
- "version": "2.98.18",
3
+ "version": "2.98.20",
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": "2d684f77b69ce98eb8b0abf3e483afb279f865a8"
76
+ "gitHead": "2c77dc2ec553ea33e1f31c0874e010d286fb3271"
77
77
  }
package/serve/getEnv.js CHANGED
@@ -8,6 +8,7 @@ const {
8
8
  getNamesOfBrickPackages,
9
9
  getNamesOfTemplatePackages,
10
10
  checkLocalPackages,
11
+ tryFiles,
11
12
  } = require("./utils");
12
13
 
13
14
  function getServerPath(server) {
@@ -325,7 +326,12 @@ module.exports = (runtimeFlags) => {
325
326
  nextRepoDir,
326
327
  `node_modules/${usePublicScope ? "@next-micro-apps" : "@micro-apps"}`
327
328
  );
328
- const alternativeMicroAppsDir = path.join(nextRepoDir, "micro-apps");
329
+ // 优先使用 micro-apps 目录,如果不存在则使用 apps 目录
330
+ const alternativeMicroAppsDir =
331
+ tryFiles([
332
+ path.join(nextRepoDir, "micro-apps"),
333
+ path.join(nextRepoDir, "apps"),
334
+ ]) || path.join(nextRepoDir, "micro-apps");
329
335
 
330
336
  const brickPackagesDir = path.join(
331
337
  nextRepoDir,
@@ -428,7 +434,10 @@ module.exports = (runtimeFlags) => {
428
434
  env.localBrickPackages = getNamesOfBrickPackages(env).concat(
429
435
  env.localBrickPackages
430
436
  );
431
- env.localMicroApps = getNamesOfMicroApps(env).concat(env.localMicroApps);
437
+ // 只有在用户没有显式指定时,才自动检测所有 app
438
+ if (!flags.localMicroApps) {
439
+ env.localMicroApps = getNamesOfMicroApps(env).concat(env.localMicroApps);
440
+ }
432
441
  env.localTemplates = getNamesOfTemplatePackages(env).concat(
433
442
  env.localTemplates
434
443
  );
@@ -120,10 +120,13 @@ module.exports = (env, getRawIndexHtml) => {
120
120
 
121
121
  const unionRegex =
122
122
  /^\/next\/sa-static\/.*\/bootstrap-union\.[^.]+\.json$/;
123
+ const isBootstrapMini =
124
+ /^\/next\/sa-static\/.*\/bootstrap-mini\.[^.]+\.json$/.test(req.path);
123
125
  if (
124
126
  regex.test(req.path) ||
125
127
  regexLegacy.test(req.path) ||
126
- unionRegex.test(req.path)
128
+ unionRegex.test(req.path) ||
129
+ isBootstrapMini
127
130
  ) {
128
131
  reqIsBootstrap = true;
129
132
  isStandalone = true;
@@ -238,7 +241,7 @@ module.exports = (env, getRawIndexHtml) => {
238
241
  .map((id) => getSingleTemplatePackage(env, id))
239
242
  .filter(Boolean)
240
243
  .concat(
241
- data[templatePackages].filter(
244
+ (data[templatePackages] || []).filter(
242
245
  (item) =>
243
246
  !localTemplates.includes(item.filePath.split("/")[1])
244
247
  )