@cloudbase/lowcode-builder 1.7.1 → 1.7.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/builder.web.js +21 -13
- package/lib/builder/config/index.d.ts +2 -2
- package/lib/builder/config/index.js +2 -2
- package/lib/builder/core/index.d.ts +1 -1
- package/lib/builder/core/index.js +22 -19
- package/lib/builder/h5/index.js +4 -4
- package/lib/builder/types/common.d.ts +1 -1
- package/lib/builder/util/common.d.ts +1 -1
- package/lib/builder.web.js +21 -13
- package/package.json +3 -3
- package/template/mp/common/util.js +7 -1
- package/lib/.turbo/turbo-build.log +0 -0
- package/lib/.turbo/turbo-develop.log +0 -0
- package/lib/event-emitter.d.ts +0 -32
- package/lib/event-emitter.js +0 -88
- package/lib/flow.d.ts +0 -30
- package/lib/flow.js +0 -63
- package/lib/query.d.ts +0 -47
- package/lib/query.js +0 -175
- package/lib/test.d.ts +0 -11
- package/lib/test.js +0 -717
|
@@ -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®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
8
8
|
*/
|
|
9
|
-
export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/
|
|
9
|
+
export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230606.zip";
|
|
10
10
|
/**
|
|
11
11
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
12
12
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
13
13
|
*/
|
|
14
|
-
export declare const miniprogramURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/
|
|
14
|
+
export declare const miniprogramURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230606.zip";
|
|
15
15
|
/**
|
|
16
16
|
* miniprogram_npm存放目录。IDE插件builder用到
|
|
17
17
|
*/
|
|
@@ -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®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
47
47
|
*/
|
|
48
|
-
exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/
|
|
48
|
+
exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20230606.zip';
|
|
49
49
|
/**
|
|
50
50
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
51
51
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
52
52
|
*/
|
|
53
|
-
exports.miniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/
|
|
53
|
+
exports.miniprogramURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/miniprogram_npm_20230606.zip';
|
|
54
54
|
/**
|
|
55
55
|
* miniprogram_npm存放目录。IDE插件builder用到
|
|
56
56
|
*/
|
|
@@ -48,7 +48,7 @@ export declare function buildWedaConfig({ output, domain, isPrivateMode, endpoin
|
|
|
48
48
|
endpointType?: IBuildWedaApp['endpointType'];
|
|
49
49
|
buildTypeList?: IBuildWedaApp['buildTypeList'];
|
|
50
50
|
}): Promise<void>;
|
|
51
|
-
export declare function buildWedaApp({ cals, subAppCalsList, dependencies, appKey, runtime, ignoreInstall, buildTypeList, mode, devTool, deployOptions, generateMpType, plugins, extraData, resourceAppId, domain, output, isBrowserMpBuilder, cdnEndpoints, isPrivateMode, endpointType, }: IBuildWedaApp, cb?: WebpackBuildCallBack): Promise<
|
|
51
|
+
export declare function buildWedaApp({ cals, subAppCalsList, dependencies, appKey, runtime, ignoreInstall, buildTypeList, mode, devTool, deployOptions, generateMpType, plugins, extraData, resourceAppId, domain, output, isBrowserMpBuilder, cdnEndpoints, isPrivateMode, endpointType, }: IBuildWedaApp, cb?: WebpackBuildCallBack): Promise<any>;
|
|
52
52
|
export declare function cleanComponentDir(): Promise<void>;
|
|
53
53
|
export declare const version: any;
|
|
54
54
|
export { getFiles, fileToZip, strToBuf } from '../util/generateFiles';
|
|
@@ -12,7 +12,6 @@ const common_1 = require("../types/common");
|
|
|
12
12
|
const index_1 = require("../mp/index");
|
|
13
13
|
const types_1 = require("../../types");
|
|
14
14
|
const mixMode_1 = require("../mp/mixMode");
|
|
15
|
-
const index_2 = require("../h5/index");
|
|
16
15
|
const common_2 = require("../../utils/common");
|
|
17
16
|
const postProcess_1 = require("../../utils/postProcess");
|
|
18
17
|
const cals_1 = require("@cloudbase/cals");
|
|
@@ -182,24 +181,28 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
|
|
|
182
181
|
return outDir;
|
|
183
182
|
}
|
|
184
183
|
else {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
184
|
+
// web worker build 构建时注入, H5构建目前不支持web worker,web worker build时过滤掉
|
|
185
|
+
if (!process.env.IS_WEB_WORKER) {
|
|
186
|
+
const { buildH5App } = require('../h5/index');
|
|
187
|
+
const h5BuildDir = await buildH5App({
|
|
188
|
+
buildContext: { ...buildContext, isMixMode: false },
|
|
189
|
+
cals,
|
|
190
|
+
subAppCalsList,
|
|
191
|
+
extraData,
|
|
192
|
+
buildTypeList,
|
|
193
|
+
mode,
|
|
194
|
+
devTool,
|
|
195
|
+
runtime,
|
|
196
|
+
deployOptions,
|
|
197
|
+
ignoreInstall,
|
|
198
|
+
cdnEndpoints,
|
|
199
|
+
});
|
|
200
|
+
await (cb === null || cb === void 0 ? void 0 : cb(null, {
|
|
201
|
+
outDir: h5BuildDir,
|
|
202
|
+
timeElapsed: Date.now() - startTime,
|
|
203
|
+
}));
|
|
204
|
+
return h5BuildDir;
|
|
205
|
+
}
|
|
203
206
|
}
|
|
204
207
|
}
|
|
205
208
|
catch (err) {
|
package/lib/builder/h5/index.js
CHANGED
|
@@ -177,16 +177,16 @@ async function buildH5App({ buildContext, i18nConfig, extraData, cals, buildType
|
|
|
177
177
|
return `${url.origin}${path_1.default.posix.join(url.pathname, file)}`;
|
|
178
178
|
}
|
|
179
179
|
catch (e) {
|
|
180
|
-
return path_1.default.posix.join(publicPath, file);
|
|
180
|
+
return path_1.default.posix.join(publicPath || '', file);
|
|
181
181
|
}
|
|
182
182
|
})
|
|
183
183
|
.filter((item) => !!item);
|
|
184
184
|
// 普通 web 模式,且非hash模式,根据页面生成多份入口
|
|
185
185
|
if (!((_c = cals.extra) === null || _c === void 0 ? void 0 : _c.historyType) || cals.extra.historyType === types_1.HISTORY_TYPE.BROWSER) {
|
|
186
|
-
preHeatUrls.push(path_1.default.posix.join(basename));
|
|
186
|
+
preHeatUrls.push(path_1.default.posix.join(basename || ''));
|
|
187
187
|
await Promise.all((cals.items || []).map((page) => {
|
|
188
|
-
preHeatUrls.push(path_1.default.posix.join(basename, page.id));
|
|
189
|
-
preHeatUrls.push(path_1.default.posix.join(basename, page.id, '/'));
|
|
188
|
+
preHeatUrls.push(path_1.default.posix.join(basename || '', page.id));
|
|
189
|
+
preHeatUrls.push(path_1.default.posix.join(basename || '', page.id, '/'));
|
|
190
190
|
return fs_extra_1.default.copy(path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, 'index.html'), path_1.default.resolve(h5BuildDir, webpack_2.OUTPUT_DIR, page.id, 'index.html'));
|
|
191
191
|
}));
|
|
192
192
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { BuildType, GenerateMpType, WebpackModeType, WebpackBuildCallBack, IPackageJson, buildAsWebByBuildType, buildAsAdminPortalByBuildType, buildAsXPageByBuildType, IAppUsedComp, IUsedComps, ISyncProp, IComponentInputProps, IFileCodeMap, } from '@cloudbase/lowcode-generator/lib/generator/types/common';
|
|
2
2
|
import { IComponentMeta, ICompositedComponent } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
3
|
-
export
|
|
3
|
+
export type IComponentsInfoMap = {
|
|
4
4
|
[componentSourceKey: string]: ({
|
|
5
5
|
meta: IComponentMeta;
|
|
6
6
|
} & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IComponentInputProps, IComponentsInfoMap, IPackageJson } from '../types/common';
|
|
2
2
|
import { IMaterialItem, IWeAppComponentInstance, IWeAppCode } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
3
3
|
export { getMetaInfoBySourceKey, isArray, isPlainObject, deepDeal, simpleDeepClone, deepDealSchema, getFileNameByUrl, } from '@cloudbase/lowcode-generator/lib/generator/util/common';
|
|
4
|
-
|
|
4
|
+
type PromiseResult<T> = Promise<[null, T] | [Error, null]>;
|
|
5
5
|
export declare function promiseWrapper<T>(p: Promise<T>): PromiseResult<T>;
|
|
6
6
|
export declare function getCurrentPackageJson(): {
|
|
7
7
|
name: any;
|