@cloudbase/lowcode-builder 1.6.3 → 1.6.4-alpha.0
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/lib/builder/config/index.d.ts +1 -1
- package/lib/builder/h5/copy.d.ts +1 -1
- package/lib/builder/h5/material.d.ts +0 -1
- package/lib/builder/mp/index.d.ts +1 -1
- package/lib/builder/mp/materials.d.ts +2 -2
- package/lib/builder/mp/util.d.ts +2 -2
- package/lib/builder/service/webpack.d.ts +3 -3
- package/lib/builder/types/common.js +8 -1
- package/package.json +4 -4
- package/template/html/index.html.ejs +50 -45
- package/template/mp/common/util.js +1 -1
- package/dist/builder.web.js +0 -71
- package/lib/.turbo/turbo-build.log +0 -0
- package/lib/.turbo/turbo-develop.log +0 -0
- package/lib/builder.web.js +0 -71
- package/lib/test.d.ts +0 -11
- package/lib/test.js +0 -717
package/lib/builder/h5/copy.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IWebRuntimeAppData, II18nConfig
|
|
1
|
+
import { IWebRuntimeAppData, II18nConfig } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
export declare function runCopy(appBuildDir: string, webRuntimeAppData: IWebRuntimeAppData, i18nConfig?: II18nConfig): Promise<void>;
|
|
3
3
|
export declare function copyMaterialLibraries(dependencies: IMaterialItem[] | undefined, materialsDir: string, appBuildDir: string): Promise<void[]>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IMaterialItem } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
1
|
import { RUNTIME } from '../../types';
|
|
3
2
|
export declare function runHandleMaterial(appBuildDir: string, dependencies: IMaterialItem[] | undefined, materialsDir: string, runtime?: RUNTIME, ignoreInstall?: boolean): Promise<any[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IWeAppData, IPlugin } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IBuildContext } from './BuildContext';
|
|
3
|
-
import { BuildType
|
|
3
|
+
import { BuildType } from '../types/common';
|
|
4
4
|
import { IBuildWedaApp } from '../core';
|
|
5
5
|
export declare function generateWxMp({ buildContext, weapps, plugins, deployOptions, options, buildTypeList, ignoreInstall, }: {
|
|
6
6
|
buildContext: IBuildContext;
|
|
@@ -19,9 +19,9 @@ export declare function extractUsedCompsRecursively(comps: IUsedComps, checkedCo
|
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
21
|
export declare function getWxmlTag(ctx: IBuildContext, cmp: Required<IWeAppComponentInstance>['xComponent'], nameMangler?: NameMangler): {
|
|
22
|
-
tagName:
|
|
22
|
+
tagName: any;
|
|
23
23
|
path?: undefined;
|
|
24
24
|
} | {
|
|
25
|
-
tagName:
|
|
25
|
+
tagName: any;
|
|
26
26
|
path: any;
|
|
27
27
|
};
|
package/lib/builder/mp/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDynamicValue, IWeAppComponentInstance,
|
|
1
|
+
import { IDynamicValue, IWeAppComponentInstance, ICompositedComponent, IWeAppPage } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IBuildContext } from './BuildContext';
|
|
3
3
|
export declare function generatedDynamicData(data: {
|
|
4
4
|
[key: string]: IDynamicValue;
|
|
@@ -16,7 +16,7 @@ export declare function generateSyncListeners(syncConfigs: any): IEventListener[
|
|
|
16
16
|
export declare function generateDataContainerListeners(): {
|
|
17
17
|
trigger: string;
|
|
18
18
|
jsCode: string;
|
|
19
|
-
type:
|
|
19
|
+
type: any;
|
|
20
20
|
data: {};
|
|
21
21
|
}[];
|
|
22
22
|
export declare function createDataBinds(ctx: IBuildContext, widgets: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IWebRuntimeAppData } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { BuildType, WebpackModeType } from '../types/common';
|
|
3
3
|
import { RUNTIME } from '../../types';
|
|
4
4
|
export declare const PERSISTENT_DEPENDIENCES_MAP: {};
|
|
@@ -50,11 +50,11 @@ export declare function downloadAndWriteTabBarIcon(iconPath: any, pagePath: any,
|
|
|
50
50
|
export declare function generateKbonePageConfig(mpConfig: Record<string, any>, mainAppData: IWebRuntimeAppData, subAppDataList?: IWebRuntimeAppData[]): Record<string, any>;
|
|
51
51
|
export declare function generateKboneAppConfig(mpConfig: Record<string, any>, mainAppData: IWebRuntimeAppData): void;
|
|
52
52
|
export declare function generateMpJsonConfigFile(allAppDataList: IWebRuntimeAppData[], userConfig: any, appBuildDir: string, options: IGenerateMpJsonConfigFileOpts): Promise<void>;
|
|
53
|
-
export declare function getMainAppDataByList(allAppDataList: IWebRuntimeAppData[]):
|
|
53
|
+
export declare function getMainAppDataByList(allAppDataList: IWebRuntimeAppData[]): any;
|
|
54
54
|
export declare function getHomePageInstance(pageInstanceList: any): any;
|
|
55
55
|
export declare function getPageName(name: string): string;
|
|
56
56
|
export declare function getMpAllRouterConfig(allAppDataList: IWebRuntimeAppData[], getHome?: boolean): any;
|
|
57
|
-
export declare function getWebpackWebBuildParams(appId: string, appBuildDir: string, publicPath?: string, mode?:
|
|
57
|
+
export declare function getWebpackWebBuildParams(appId: string, appBuildDir: string, publicPath?: string, mode?: any, buildTypeList?: any[], extraDefine?: {}, assets?: string[]): any;
|
|
58
58
|
export declare function getWebpackMpBuildParams(appBuildDir: string, materialsDir: string, dependencies: IMaterialItem[] | undefined, nodeModulesPath: string, allAppDataList: IWebRuntimeAppData[], mode: string, watch: boolean, options: IGenerateMpJsonConfigFileOpts): any;
|
|
59
59
|
export declare function getAllPageMpEntryPath(allAppDataList: IWebRuntimeAppData[], appBuildDir: string): Record<string, any>;
|
|
60
60
|
export declare function downloadAndInstallDependencies(dependencies: IMaterialItem[] | undefined, materialsDir: string, installOptions?: IInstallOpts): Promise<void>;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildAsXPageByBuildType = exports.buildAsAdminPortalByBuildType = exports.buildAsWebByBuildType = exports.WebpackModeType = exports.GenerateMpType = exports.BuildType = void 0;
|
|
3
|
+
exports.IFileCodeMap = exports.IComponentInputProps = exports.ISyncProp = exports.IUsedComps = exports.IAppUsedComp = exports.buildAsXPageByBuildType = exports.buildAsAdminPortalByBuildType = exports.buildAsWebByBuildType = exports.IPackageJson = exports.WebpackBuildCallBack = exports.WebpackModeType = exports.GenerateMpType = exports.BuildType = void 0;
|
|
4
4
|
var common_1 = require("@cloudbase/lowcode-generator/lib/generator/types/common");
|
|
5
5
|
Object.defineProperty(exports, "BuildType", { enumerable: true, get: function () { return common_1.BuildType; } });
|
|
6
6
|
Object.defineProperty(exports, "GenerateMpType", { enumerable: true, get: function () { return common_1.GenerateMpType; } });
|
|
7
7
|
Object.defineProperty(exports, "WebpackModeType", { enumerable: true, get: function () { return common_1.WebpackModeType; } });
|
|
8
|
+
Object.defineProperty(exports, "WebpackBuildCallBack", { enumerable: true, get: function () { return common_1.WebpackBuildCallBack; } });
|
|
9
|
+
Object.defineProperty(exports, "IPackageJson", { enumerable: true, get: function () { return common_1.IPackageJson; } });
|
|
8
10
|
Object.defineProperty(exports, "buildAsWebByBuildType", { enumerable: true, get: function () { return common_1.buildAsWebByBuildType; } });
|
|
9
11
|
Object.defineProperty(exports, "buildAsAdminPortalByBuildType", { enumerable: true, get: function () { return common_1.buildAsAdminPortalByBuildType; } });
|
|
10
12
|
Object.defineProperty(exports, "buildAsXPageByBuildType", { enumerable: true, get: function () { return common_1.buildAsXPageByBuildType; } });
|
|
13
|
+
Object.defineProperty(exports, "IAppUsedComp", { enumerable: true, get: function () { return common_1.IAppUsedComp; } });
|
|
14
|
+
Object.defineProperty(exports, "IUsedComps", { enumerable: true, get: function () { return common_1.IUsedComps; } });
|
|
15
|
+
Object.defineProperty(exports, "ISyncProp", { enumerable: true, get: function () { return common_1.ISyncProp; } });
|
|
16
|
+
Object.defineProperty(exports, "IComponentInputProps", { enumerable: true, get: function () { return common_1.IComponentInputProps; } });
|
|
17
|
+
Object.defineProperty(exports, "IFileCodeMap", { enumerable: true, get: function () { return common_1.IFileCodeMap; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.4-alpha.0",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@cloudbase/cals": "
|
|
42
|
-
"@cloudbase/lowcode-generator": "
|
|
41
|
+
"@cloudbase/cals": "workspace:^",
|
|
42
|
+
"@cloudbase/lowcode-generator": "workspace:^",
|
|
43
43
|
"axios": "^0.21.0",
|
|
44
44
|
"browserfs": "^1.4.3",
|
|
45
45
|
"browserify-zlib": "^0.2.0",
|
|
@@ -81,4 +81,4 @@
|
|
|
81
81
|
"webpack-dev-server": "^4.7.3",
|
|
82
82
|
"worker-loader": "^3.0.8"
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|
|
@@ -18,35 +18,14 @@
|
|
|
18
18
|
/>
|
|
19
19
|
<% cssStyles.forEach(function(styleUrl){%>
|
|
20
20
|
<link type="text/css" rel="stylesheet" href="<%=styleUrl %>" />
|
|
21
|
-
<% })%>
|
|
22
|
-
|
|
23
|
-
<script>
|
|
24
|
-
<% if(!isAdminPortal){ %>
|
|
25
|
-
const _aegis = new Aegis({
|
|
26
|
-
id: 'lXHFsBpTjIzNADiczY', // 项目ID,即上报key
|
|
27
|
-
reportApiSpeed: true, // 接口测速
|
|
28
|
-
reportAssetSpeed: true, // 静态资源测速
|
|
29
|
-
spa: true,
|
|
30
|
-
ext1: '<%=appId%>',
|
|
31
|
-
});
|
|
32
|
-
<% } else {%>
|
|
33
|
-
const _aegis = new Aegis({
|
|
34
|
-
id: 'lXHFsBpTrKcnOMqTRQ', // 项目ID,即上报key
|
|
35
|
-
reportApiSpeed: false, // 接口测速
|
|
36
|
-
reportAssetSpeed: false, // 静态资源测速
|
|
37
|
-
spa: true,
|
|
38
|
-
ext1: '<%=appId%>',
|
|
39
|
-
});
|
|
40
|
-
<% }%>
|
|
41
|
-
window._aegis = _aegis;
|
|
42
|
-
window._aegis_inited = Date.now()
|
|
43
|
-
</script>
|
|
44
|
-
<% }%>
|
|
21
|
+
<% })%>
|
|
22
|
+
|
|
45
23
|
<title><%= title %></title>
|
|
46
|
-
|
|
47
|
-
<!--
|
|
48
|
-
<script
|
|
49
|
-
|
|
24
|
+
|
|
25
|
+
<!-- <% if(mode !== 'production'){ %>
|
|
26
|
+
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script>
|
|
27
|
+
<script>new VConsole()</script>
|
|
28
|
+
<% }%> -->
|
|
50
29
|
|
|
51
30
|
<!-- 重置浏览器样式 -->
|
|
52
31
|
<style type="text/css">
|
|
@@ -455,13 +434,39 @@
|
|
|
455
434
|
</div>
|
|
456
435
|
<% }%>
|
|
457
436
|
</div>
|
|
458
|
-
<%
|
|
437
|
+
<% if(cdnEndpoints.aegis){ %>
|
|
438
|
+
<script crossorigin="anonymous" src="<%= cdnEndpoints.aegis %>/aegis-sdk/latest/aegis.min.js"></script>
|
|
439
|
+
<script>
|
|
440
|
+
<% if(!isAdminPortal){ %>
|
|
441
|
+
const _aegis = new Aegis({
|
|
442
|
+
id: 'lXHFsBpTjIzNADiczY', // 项目ID,即上报key
|
|
443
|
+
reportApiSpeed: true, // 接口测速
|
|
444
|
+
reportAssetSpeed: true, // 静态资源测速
|
|
445
|
+
spa: true,
|
|
446
|
+
ext1: '<%=appId%>',
|
|
447
|
+
});
|
|
448
|
+
<% } else {%>
|
|
449
|
+
const _aegis = new Aegis({
|
|
450
|
+
id: 'lXHFsBpTrKcnOMqTRQ', // 项目ID,即上报key
|
|
451
|
+
reportApiSpeed: false, // 接口测速
|
|
452
|
+
reportAssetSpeed: false, // 静态资源测速
|
|
453
|
+
spa: true,
|
|
454
|
+
ext1: '<%=appId%>',
|
|
455
|
+
});
|
|
456
|
+
<% }%>
|
|
457
|
+
window._aegis = _aegis;
|
|
458
|
+
window._aegis_inited = Date.now()
|
|
459
|
+
</script>
|
|
460
|
+
<% }%> <% jsApis.forEach(function(jsApi){%>
|
|
459
461
|
<script src="<%=jsApi %>"></script>
|
|
460
462
|
<% })%> <% if(canUseVite){ %>
|
|
461
463
|
<script type="module" src="/src/index.jsx"></script>
|
|
462
464
|
<% } %> <% if(!isAdminPortal){ %>
|
|
463
465
|
<script src="/weda-config/weda-private.js"></script>
|
|
464
|
-
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.4.7-beta.0/cloudbase.
|
|
466
|
+
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.4.7-beta.0/cloudbase.js?v=1"></script>
|
|
467
|
+
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.4.7-beta.0/cloudbase.auth.js?v=1"></script>
|
|
468
|
+
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.4.7-beta.0/cloudbase.functions.js?v=1"></script>
|
|
469
|
+
<script src="<%= cdnEndpoints.cloudbase %>/cloudbase-js-sdk/2.4.7-beta.0/cloudbase.storage.js?v=1"></script>
|
|
465
470
|
<% }%>
|
|
466
471
|
<script>
|
|
467
472
|
if (window.cloudbase && window._aegis) {
|
|
@@ -509,19 +514,17 @@
|
|
|
509
514
|
></script>
|
|
510
515
|
<script
|
|
511
516
|
crossorigin
|
|
512
|
-
src="<%=
|
|
513
|
-
cdnEndpoints.cdngo
|
|
514
|
-
%>/lcap/lcap-resource-cdngo/-/release/_npm/react-dom@16.14.0/umd/react-dom.production.min.js"
|
|
517
|
+
src="<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/release/_npm/react-dom@16.14.0/umd/react-dom.production.min.js"
|
|
515
518
|
></script>
|
|
516
519
|
<script
|
|
517
|
-
src="<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/
|
|
520
|
+
src="<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/602f2de5/_url/ajax/libs/mobx/5.15.7/mobx.umd.min.js"
|
|
518
521
|
crossorigin="anonymous"
|
|
519
522
|
></script>
|
|
520
523
|
<script
|
|
521
524
|
crossorigin="anonymous"
|
|
522
525
|
src="<%=
|
|
523
526
|
cdnEndpoints.cdngo
|
|
524
|
-
%>/lcap/lcap-resource-cdngo/-/
|
|
527
|
+
%>/lcap/lcap-resource-cdngo/-/83ec8058/_npm/@cloudbase/weda-cloud-sdk@1.0.30-alpha.0/dist/h5.browser.js"
|
|
525
528
|
></script>
|
|
526
529
|
<script>
|
|
527
530
|
// zxing polifill
|
|
@@ -529,21 +532,23 @@
|
|
|
529
532
|
this.globalThis = this;
|
|
530
533
|
}
|
|
531
534
|
</script>
|
|
532
|
-
<script
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
535
|
+
<script>
|
|
536
|
+
var script = document.createElement('script');
|
|
537
|
+
script.type = 'text/javascript';
|
|
538
|
+
script.crossorigin = 'anonymous';
|
|
539
|
+
script.src =
|
|
540
|
+
'<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/0.1.2/_url/npm/@zxing/library@0.18.6/umd/index.min.js';
|
|
541
|
+
setTimeout(function () {
|
|
542
|
+
document.getElementsByTagName('body')[0].appendChild(script);
|
|
543
|
+
}, 1000);
|
|
544
|
+
</script>
|
|
536
545
|
<script
|
|
537
546
|
crossorigin
|
|
538
|
-
src="<%=
|
|
539
|
-
cdnEndpoints.cdngo
|
|
540
|
-
%>/lcap/lcap-resource-cdngo/-/release/_url/qcloud/lowcode/static/ide/assets/js/babel.min.js"
|
|
547
|
+
src="<%= cdnEndpoints.cdngo %>/lcap/lcap-resource-cdngo/-/f8115605/_npm/@cloudbase/cals@1.0.3-alpha.8/lib/cloudbase.cals.umd.min.js"
|
|
541
548
|
></script>
|
|
542
549
|
<script
|
|
543
550
|
crossorigin
|
|
544
|
-
src="<%=
|
|
545
|
-
cdnEndpoints.cdngo
|
|
546
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.413fc7788ab27e709449.bundle.js"
|
|
551
|
+
src="<%= cdnEndpoints.cdngo %>lcap/lcap-resource-cdngo/-/189f87d7/_files/static/weda-render/main.da12d9cfd372eee26888.bundle.js"
|
|
547
552
|
></script>
|
|
548
553
|
</body>
|
|
549
554
|
</html>
|
|
@@ -95,12 +95,12 @@ export function createEventHandlers(
|
|
|
95
95
|
} catch (e) {
|
|
96
96
|
let eventName = l.key ? `${prefix}$${l.key}_fail` : '';
|
|
97
97
|
if (self[eventName]) {
|
|
98
|
-
console.error(`Action error: [${trigger}:${l.key}]`, e);
|
|
99
98
|
await self[eventName]({
|
|
100
99
|
...event,
|
|
101
100
|
detail: e,
|
|
102
101
|
});
|
|
103
102
|
} else {
|
|
103
|
+
console.error(`Action error: [${trigger}:${l.key}]`, e);
|
|
104
104
|
if (!looseError) {
|
|
105
105
|
app.showToast({
|
|
106
106
|
icon: 'error',
|