@cloudbase/lowcode-builder 1.8.55 → 1.8.57

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.
@@ -6,12 +6,12 @@ export declare const materialsDirName = "materials";
6
6
  * src/template的代码,在IDE编辑器插件中构建builder
7
7
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
8
8
  */
9
- export declare const builderTemplateURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.55-alpha.0.zip";
9
+ export declare const builderTemplateURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.57.zip";
10
10
  /**
11
11
  * miniprogram的代码,IDE插件后续会提供端功能
12
12
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
13
13
  */
14
- export declare const miniprogramURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.43.zip";
14
+ export declare const miniprogramURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.57.zip";
15
15
  export declare const systemSubpackageMiniprogramURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/wd_system_miniprogram_npm.zip";
16
16
  /**
17
17
  * miniprogram_npm存放目录。IDE插件builder用到
@@ -45,12 +45,12 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
45
45
  * src/template的代码,在IDE编辑器插件中构建builder
46
46
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
47
47
  */
48
- exports.builderTemplateURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.55-alpha.0.zip';
48
+ exports.builderTemplateURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.57.zip';
49
49
  /**
50
50
  * miniprogram的代码,IDE插件后续会提供端功能
51
51
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
52
52
  */
53
- exports.miniprogramURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.43.zip';
53
+ exports.miniprogramURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.57.zip';
54
54
  exports.systemSubpackageMiniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/wd_system_miniprogram_npm.zip';
55
55
  /**
56
56
  * miniprogram_npm存放目录。IDE插件builder用到
@@ -61,7 +61,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
61
61
  isComposite: false,
62
62
  compProps: {},
63
63
  }, resourceAppId = undefined, domain = '', output, isBrowserMpBuilder = false, cdnEndpoints, isPrivateMode = false, endpointType = undefined, enableExpiredTag = false, account = {}, }, cb) {
64
- var _a, _b, _c, _d, _e;
64
+ var _a, _b, _c, _d, _e, _f;
65
65
  if (!cals) {
66
66
  console.error('无效的应用配置');
67
67
  return;
@@ -141,7 +141,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
141
141
  // 尽早下载物料
142
142
  await (0, net_1.downloadBrowserMaterial)(output === null || output === void 0 ? void 0 : output.path);
143
143
  }
144
- const { enablePageRoot, enableAsyncMaterials } = (0, cals_1.parseVersion)(cals === null || cals === void 0 ? void 0 : cals.schemaVersion, dependencies);
144
+ const { enablePageRoot } = (0, cals_1.parseVersion)(cals === null || cals === void 0 ? void 0 : cals.schemaVersion, dependencies);
145
145
  const mpBuildContext = {
146
146
  ...buildContext,
147
147
  projDir: (output === null || output === void 0 ? void 0 : output.path) || path_1.default.join(appBuildDir, 'mp'),
@@ -154,7 +154,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
154
154
  : 'rpx'),
155
155
  enablePageRoot,
156
156
  enableLoading: (_e = cals === null || cals === void 0 ? void 0 : cals.extra) === null || _e === void 0 ? void 0 : _e.enableLoading,
157
- enableAsyncMaterials,
157
+ enableAsyncMaterials: (_f = cals === null || cals === void 0 ? void 0 : cals.extra) === null || _f === void 0 ? void 0 : _f.enableAsyncMaterials,
158
158
  };
159
159
  const result = await (0, index_1.generateWxMp)({
160
160
  weapps: apps,
@@ -12,7 +12,7 @@ export declare function generateHTML({ buildContext, appId, envId, description,
12
12
  * 由于存量兜底逻辑存在
13
13
  * 默认值为 undefined 否则应为 false
14
14
  */
15
- enableLoading, }: {
15
+ enableLoading, publicPath, }: {
16
16
  buildContext: Omit<ICommonBuildContext, 'mainAppData'>;
17
17
  appId: string;
18
18
  envId: string;
@@ -25,6 +25,7 @@ enableLoading, }: {
25
25
  buildTypeList: BuildType[];
26
26
  cdnEndpoints?: ICDN_ENDPOINTS_COFIG;
27
27
  enableLoading?: boolean;
28
+ publicPath?: string;
28
29
  }): Promise<void>;
29
30
  export declare function handleAssets({ appBuildDir, buildTypeList, assets, }: {
30
31
  appBuildDir: string;
@@ -31,7 +31,7 @@ async function generateHTML({ buildContext, appId, envId, description = '', appB
31
31
  * 由于存量兜底逻辑存在
32
32
  * 默认值为 undefined 否则应为 false
33
33
  */
34
- enableLoading = undefined, }) {
34
+ enableLoading = undefined, publicPath = '/', }) {
35
35
  const { materialLibs, uin } = buildContext;
36
36
  const officialLib = materialLibs.find((item) => item.name === cals_1.OFFICIAL_LIB_KEY);
37
37
  const templatePath = path_1.default.join(config_1.appTemplateDir, 'html', 'index.html.ejs');
@@ -51,6 +51,21 @@ enableLoading = undefined, }) {
51
51
  }
52
52
  }
53
53
  }
54
+ let wedaPrivateConfigEndpoint = '';
55
+ /**
56
+ * 如果 public path 为 domain,
57
+ * 则文件要制定从静态托管桶加载
58
+ * 加载位置和webpack publicpath html规则一致
59
+ */
60
+ if (/^https?:/.test(publicPath)) {
61
+ try {
62
+ const url = new URL(publicPath);
63
+ if (url.origin) {
64
+ wedaPrivateConfigEndpoint = url.origin;
65
+ }
66
+ }
67
+ catch (e) { }
68
+ }
54
69
  await fs_extra_1.default.writeFile(dstFilePath, (0, lodash_1.template)(packageTpl)({
55
70
  appId,
56
71
  title: '',
@@ -62,6 +77,7 @@ enableLoading = undefined, }) {
62
77
  isBuildApp,
63
78
  isAdminPortal: (0, common_2.buildAsAdminPortalByBuildType)(buildTypeList),
64
79
  cdnEndpoints: (0, config_1.generateCdnEndpoints)(cdnEndpoints),
80
+ wedaPrivateConfigEndpoint,
65
81
  ext3: [envId, uin, index_1.version, officialLib === null || officialLib === void 0 ? void 0 : officialLib.version, '' /* mpappId */].join('|'),
66
82
  /**
67
83
  * @deprecated
@@ -36,6 +36,7 @@ async function runWebpackCore({ buildContext, cals, mainAppData, subAppDataList,
36
36
  isBuildApp: buildTypeList.includes(common_1.BuildType.APP),
37
37
  buildTypeList,
38
38
  cdnEndpoints,
39
+ publicPath,
39
40
  });
40
41
  if ((0, common_1.buildAsWebByBuildType)(buildTypeList)) {
41
42
  if (mode !== common_1.WebpackModeType.PRODUCTION) {