@cloudbase/lowcode-builder 1.8.32 → 1.8.34
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 +10 -10
- package/lib/builder/config/index.d.ts +2 -2
- package/lib/builder/config/index.js +2 -2
- package/lib/builder/core/index.d.ts +2 -1
- package/lib/builder/core/index.js +2 -1
- package/lib/builder/h5/index.js +2 -1
- package/lib/builder/mp/BuildContext.d.ts +4 -0
- package/lib/builder/mp/index.js +6 -2
- package/lib/builder/mp/wxml.js +20 -4
- package/lib/builder.web.js +10 -10
- package/lib/utils/transform.js +19 -2
- package/package.json +4 -6
- package/template/.DS_Store +0 -0
- package/template/html/index.html.ejs +1 -1
- package/template/mp/.DS_Store +0 -0
- package/template/mp/common/.DS_Store +0 -0
- package/template/mp/common/event-emitter.js +3 -0
- package/template/mp/common/flow.js +2 -2
- package/template/mp/common/{loading → info}/index.js +8 -1
- package/template/mp/common/info/index.wxml +13 -0
- package/template/mp/common/util.js +52 -2
- package/template/mp/common/weapp-page.js +21 -1
- package/template/mp/common/loading/index.wxml +0 -8
- /package/template/mp/common/{loading → info}/index.json +0 -0
- /package/template/mp/common/{loading → info}/index.wxss +0 -0
|
@@ -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.
|
|
9
|
+
export declare const builderTemplateURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.33.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.
|
|
14
|
+
export declare const miniprogramURL = "https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.33.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.
|
|
48
|
+
exports.builderTemplateURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/template.1.8.33.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.
|
|
53
|
+
exports.miniprogramURL = 'https://comp-public-1303824488.file.myqcloud.com/lcap-builder/miniprogram_npm.1.8.33.zip';
|
|
54
54
|
/**
|
|
55
55
|
* miniprogram_npm存放目录。IDE插件builder用到
|
|
56
56
|
*/
|
|
@@ -40,6 +40,7 @@ export interface IBuildWedaApp extends IBaseAppProps {
|
|
|
40
40
|
cdnEndpoints?: ICDN_ENDPOINTS_COFIG;
|
|
41
41
|
isPrivateMode?: boolean;
|
|
42
42
|
endpointType?: 'tcb-api' | 'wechat-service';
|
|
43
|
+
enableExpiredTag?: boolean;
|
|
43
44
|
}
|
|
44
45
|
export declare function buildWedaConfig({ output, domain, isPrivateMode, endpointType, buildTypeList, }: {
|
|
45
46
|
output: Required<IBuildWedaApp['output']>;
|
|
@@ -48,7 +49,7 @@ export declare function buildWedaConfig({ output, domain, isPrivateMode, endpoin
|
|
|
48
49
|
endpointType?: IBuildWedaApp['endpointType'];
|
|
49
50
|
buildTypeList?: IBuildWedaApp['buildTypeList'];
|
|
50
51
|
}): 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<any>;
|
|
52
|
+
export declare function buildWedaApp({ cals, subAppCalsList, dependencies, appKey, runtime, ignoreInstall, buildTypeList, mode, devTool, deployOptions, generateMpType, plugins, extraData, resourceAppId, domain, output, isBrowserMpBuilder, cdnEndpoints, isPrivateMode, endpointType, enableExpiredTag, }: IBuildWedaApp, cb?: WebpackBuildCallBack): Promise<any>;
|
|
52
53
|
export declare function cleanComponentDir(): Promise<void>;
|
|
53
54
|
export declare const version: any;
|
|
54
55
|
export { getFiles, fileToZip, strToBuf } from '../util/generateFiles';
|
|
@@ -60,7 +60,7 @@ exports.buildWedaConfig = buildWedaConfig;
|
|
|
60
60
|
async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appKey = 'test', runtime = types_1.RUNTIME.NONE, ignoreInstall = false, buildTypeList = [common_1.BuildType.WEB], mode = common_1.WebpackModeType.PRODUCTION, devTool = 'webpack', deployOptions = { mode: types_1.DEPLOY_MODE.PREVIEW }, generateMpType = common_1.GenerateMpType.APP, plugins = [], extraData = {
|
|
61
61
|
isComposite: false,
|
|
62
62
|
compProps: {},
|
|
63
|
-
}, resourceAppId = undefined, domain = '', output, isBrowserMpBuilder = false, cdnEndpoints, isPrivateMode = false, endpointType = undefined, }, cb) {
|
|
63
|
+
}, resourceAppId = undefined, domain = '', output, isBrowserMpBuilder = false, cdnEndpoints, isPrivateMode = false, endpointType = undefined, enableExpiredTag = false, }, cb) {
|
|
64
64
|
var _a, _b, _c;
|
|
65
65
|
if (!cals) {
|
|
66
66
|
console.error('无效的应用配置');
|
|
@@ -81,6 +81,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
|
|
|
81
81
|
isBrowserMpBuilder,
|
|
82
82
|
isPrivateMode,
|
|
83
83
|
endpointType,
|
|
84
|
+
enableExpiredTag,
|
|
84
85
|
};
|
|
85
86
|
console.log('domain', domain);
|
|
86
87
|
console.log('应用名', appKey);
|
package/lib/builder/h5/index.js
CHANGED
|
@@ -48,7 +48,7 @@ const url_1 = require("url");
|
|
|
48
48
|
const transform_1 = require("../../utils/transform");
|
|
49
49
|
async function buildH5App({ buildContext, i18nConfig, extraData, cals: _cals, buildTypeList = [common_1.BuildType.WEB], subAppCalsList, mode, devTool, runtime = types_1.RUNTIME.NONE, deployOptions = { mode: types_1.DEPLOY_MODE.PREVIEW }, ignoreInstall = false, cdnEndpoints, }) {
|
|
50
50
|
var _a, _b, _c;
|
|
51
|
-
const { projDir: buildDir, domain, materialLibs: dependencies, appId: appKey, isPrivateMode } = buildContext;
|
|
51
|
+
const { projDir: buildDir, domain, materialLibs: dependencies, appId: appKey, isPrivateMode, enableExpiredTag, } = buildContext;
|
|
52
52
|
if (!deployOptions.mode) {
|
|
53
53
|
deployOptions.mode = types_1.DEPLOY_MODE.PREVIEW;
|
|
54
54
|
}
|
|
@@ -119,6 +119,7 @@ async function buildH5App({ buildContext, i18nConfig, extraData, cals: _cals, bu
|
|
|
119
119
|
deployOptions,
|
|
120
120
|
_indexPage,
|
|
121
121
|
isPrivateMode,
|
|
122
|
+
expirationStartTimesnap: enableExpiredTag ? Date.now() : undefined,
|
|
122
123
|
});
|
|
123
124
|
console.timeEnd(runGenerateTag);
|
|
124
125
|
// // 构建 NPM 包
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -99,14 +99,18 @@ async function generateWxMp({ buildContext, weapps, plugins, deployOptions, opti
|
|
|
99
99
|
isPrivateMode,
|
|
100
100
|
endpointType,
|
|
101
101
|
}, miniprogramRoot);
|
|
102
|
+
const expirationStartTimesnap = buildContext.enableExpiredTag ? Date.now() : 0;
|
|
102
103
|
appFileData = {
|
|
103
104
|
...appFileData,
|
|
104
105
|
'common/style.js': {},
|
|
105
106
|
'common/util.js': {
|
|
106
107
|
isAdminPortal: (0, common_1.buildAsAdminPortalByBuildType)(buildTypeList),
|
|
108
|
+
expirationStartTimesnap,
|
|
107
109
|
},
|
|
108
110
|
'common/widget.js': {},
|
|
109
|
-
'common/weapp-page.js': {
|
|
111
|
+
'common/weapp-page.js': {
|
|
112
|
+
expirationStartTimesnap,
|
|
113
|
+
},
|
|
110
114
|
'common/weapp-component.js': {},
|
|
111
115
|
'common/merge-renderer.js': {
|
|
112
116
|
dataPropNames: wxmlDataPrefix,
|
|
@@ -120,7 +124,7 @@ async function generateWxMp({ buildContext, weapps, plugins, deployOptions, opti
|
|
|
120
124
|
},
|
|
121
125
|
'common/query.js': {},
|
|
122
126
|
'common/flow.js': {},
|
|
123
|
-
'common/
|
|
127
|
+
'common/info': {},
|
|
124
128
|
/**
|
|
125
129
|
* 调试用
|
|
126
130
|
*/
|
package/lib/builder/mp/wxml.js
CHANGED
|
@@ -29,7 +29,7 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
|
|
|
29
29
|
name: enablePageRoot ? 'view' : 'block',
|
|
30
30
|
attributes: {
|
|
31
31
|
id: 'wd-page-root',
|
|
32
|
-
['wx:if']: '{{weDaHasLogin}}',
|
|
32
|
+
['wx:if']: '{{weDaHasLogin && !_expiredMessage}}',
|
|
33
33
|
['data-weui-theme']: 'light',
|
|
34
34
|
},
|
|
35
35
|
elements: [
|
|
@@ -54,13 +54,29 @@ function generateWxml(ctx, widgets, docTag, wxmlDataPrefix, usingComponents, com
|
|
|
54
54
|
_parent: null,
|
|
55
55
|
},
|
|
56
56
|
];
|
|
57
|
+
if (ctx.enableExpiredTag) {
|
|
58
|
+
usingComponents['wd-info'] = '/common/info/index';
|
|
59
|
+
xmlJson.elements.push({
|
|
60
|
+
type: 'element',
|
|
61
|
+
name: 'wd-info',
|
|
62
|
+
attributes: {
|
|
63
|
+
['wx:if']: '{{_expiredMessage}}',
|
|
64
|
+
message: '{{_expiredMessage}}',
|
|
65
|
+
type: 'info',
|
|
66
|
+
},
|
|
67
|
+
elements: [],
|
|
68
|
+
_order: Infinity,
|
|
69
|
+
_parent: null,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
57
72
|
if (ctx.enableLoading) {
|
|
58
|
-
usingComponents['wd-
|
|
73
|
+
usingComponents['wd-info'] = '/common/info/index';
|
|
59
74
|
xmlJson.elements.push({
|
|
60
75
|
type: 'element',
|
|
61
|
-
name: 'wd-
|
|
76
|
+
name: 'wd-info',
|
|
62
77
|
attributes: {
|
|
63
|
-
['wx:if']: '{{_isCheckingAtuh}}',
|
|
78
|
+
['wx:if']: '{{_isCheckingAtuh && !_expiredMessage}}',
|
|
79
|
+
type: 'loading',
|
|
64
80
|
},
|
|
65
81
|
elements: [],
|
|
66
82
|
_order: Infinity,
|