@cloudbase/lowcode-builder 1.0.21 → 1.0.24
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/config/index.js +2 -1
- package/lib/builder/h5/index.js +3 -1
- package/lib/builder/mp/index.js +1 -1
- package/lib/builder/mp/util.js +2 -1
- package/lib/builder/util/common.js +2 -2
- package/package.json +3 -3
- package/template/html/index.html.ejs +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { REPLACE_SIGN, MP_CONFIG_MODULE_NAME, KBONE_PAGE_KEYS, npmRegistry, remConfig, rpxConfig, } from '@cloudbase/lowcode-generator/lib/generator/config/index';
|
|
1
|
+
export { REPLACE_SIGN, MP_CONFIG_MODULE_NAME, KBONE_PAGE_KEYS, npmRegistry, remConfig, rpxConfig, OFFICIAL_LIB_KEY, } from '@cloudbase/lowcode-generator/lib/generator/config/index';
|
|
2
2
|
export declare const sharedMaterialsDir: string;
|
|
3
3
|
export declare const appTemplateDir: string;
|
|
4
4
|
export declare const materialsDirName = "materials";
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.miniprogramDir = exports.miniprogramURL = exports.builderTemplateURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
|
|
29
|
+
exports.miniprogramDir = exports.miniprogramURL = exports.builderTemplateURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.OFFICIAL_LIB_KEY = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
31
|
const os_1 = __importDefault(require("os"));
|
|
32
32
|
var index_1 = require("@cloudbase/lowcode-generator/lib/generator/config/index");
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "KBONE_PAGE_KEYS", { enumerable: true, get: funct
|
|
|
36
36
|
Object.defineProperty(exports, "npmRegistry", { enumerable: true, get: function () { return index_1.npmRegistry; } });
|
|
37
37
|
Object.defineProperty(exports, "remConfig", { enumerable: true, get: function () { return index_1.remConfig; } });
|
|
38
38
|
Object.defineProperty(exports, "rpxConfig", { enumerable: true, get: function () { return index_1.rpxConfig; } });
|
|
39
|
+
Object.defineProperty(exports, "OFFICIAL_LIB_KEY", { enumerable: true, get: function () { return index_1.OFFICIAL_LIB_KEY; } });
|
|
39
40
|
exports.sharedMaterialsDir = path.join(os_1.default.homedir(), '.weapps-materials');
|
|
40
41
|
exports.appTemplateDir = path.resolve(__dirname, '../../../template');
|
|
41
42
|
exports.materialsDirName = 'materials'; // materials diretory of current project
|
package/lib/builder/h5/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const util_1 = require("../util");
|
|
|
18
18
|
const types_1 = require("../../types");
|
|
19
19
|
const mp_1 = require("../mp");
|
|
20
20
|
const common_2 = require("../../utils/common");
|
|
21
|
+
const config_1 = require("../config");
|
|
21
22
|
async function buildH5App({ appKey, buildDir, dependencies, i18nConfig, extraData, cals, buildTypeList = [common_1.BuildType.WEB], subAppCalsList, mode, devTool, runtime = types_1.RUNTIME.NONE, deployMode = types_1.DEPLOY_MODE.PREVIEW, ignoreInstall = false, domain = '', }) {
|
|
22
23
|
var _a, _b;
|
|
23
24
|
try {
|
|
@@ -64,7 +65,8 @@ async function buildH5App({ appKey, buildDir, dependencies, i18nConfig, extraDat
|
|
|
64
65
|
console.time(runHandleMaterialTag);
|
|
65
66
|
// 精简只使用用到的组件库,并获取补齐json格式
|
|
66
67
|
const processedDependiencies = await (0, material_1.runHandleMaterial)(h5BuildDir, dependencies.filter((lib) => {
|
|
67
|
-
|
|
68
|
+
// 注意需要包涵官方的(gsd),部分平台方法需要由其补充
|
|
69
|
+
return lib.name === config_1.OFFICIAL_LIB_KEY || !!allAppUsedComps[lib.name];
|
|
68
70
|
}), materialsDir, runtime, ignoreInstall);
|
|
69
71
|
console.timeEnd(runHandleMaterialTag);
|
|
70
72
|
// // 获取 generate 需要的构建文件
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -338,7 +338,7 @@ async function generatePkg(weapp, appRoot, ctx, pageConfigs) {
|
|
|
338
338
|
subWxss: rootPath && !((_b = ctx.mainAppData) === null || _b === void 0 ? void 0 : _b.mpPkgUrl)
|
|
339
339
|
? `@import "${path_1.default.relative(`/${rootPath}/pages/${page.id}`, '/lowcode')}/style.wxss";`
|
|
340
340
|
: '',
|
|
341
|
-
content: (0, weapps_core_1.toCssText)((0,
|
|
341
|
+
content: (0, weapps_core_1.toCssText)((0, cals_1.processCommonStyle2CSSProperties)(page.commonStyle, {
|
|
342
342
|
toRem: false,
|
|
343
343
|
toRpx: true,
|
|
344
344
|
}), 'page'),
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -5,11 +5,12 @@ const weapps_core_1 = require("@cloudbase/lowcode-generator/lib/weapps-core");
|
|
|
5
5
|
const weapp_1 = require("@cloudbase/lowcode-generator/lib/generator/util/weapp");
|
|
6
6
|
const wxml_1 = require("./wxml");
|
|
7
7
|
const mp_1 = require("@cloudbase/lowcode-generator/lib/generator/config/mp");
|
|
8
|
+
const cals_1 = require("@cloudbase/cals");
|
|
8
9
|
function extractWidgetProps(props, compInfo) {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
const { classList } = props;
|
|
11
12
|
const staticProps = {
|
|
12
|
-
style: (0,
|
|
13
|
+
style: (0, cals_1.processCommonStyle2CSSProperties)(props.commonStyle, {
|
|
13
14
|
toRpx: true,
|
|
14
15
|
toRem: false,
|
|
15
16
|
}),
|
|
@@ -11,6 +11,7 @@ const style_1 = require("@cloudbase/lowcode-generator/lib/generator/util/style")
|
|
|
11
11
|
const generateFiles_1 = require("./generateFiles");
|
|
12
12
|
const cals_1 = require("@cloudbase/cals");
|
|
13
13
|
const compare_versions_1 = __importDefault(require("compare-versions"));
|
|
14
|
+
const config_1 = require("../config");
|
|
14
15
|
const os_1 = __importDefault(require("os"));
|
|
15
16
|
var common_1 = require("@cloudbase/lowcode-generator/lib/generator/util/common");
|
|
16
17
|
Object.defineProperty(exports, "getMetaInfoBySourceKey", { enumerable: true, get: function () { return common_1.getMetaInfoBySourceKey; } });
|
|
@@ -200,7 +201,6 @@ function readComponentLibMata(libDir) {
|
|
|
200
201
|
if (!isExistsMeta) {
|
|
201
202
|
return null;
|
|
202
203
|
}
|
|
203
|
-
console.log('meta path', metaPath);
|
|
204
204
|
let meta = fs_extra_1.default.readJSONSync(metaPath);
|
|
205
205
|
let [major] = ((_a = meta === null || meta === void 0 ? void 0 : meta.schemaVersion) === null || _a === void 0 ? void 0 : _a.split('.')) || [];
|
|
206
206
|
const originComponentMetaMap = meta.components;
|
|
@@ -218,7 +218,7 @@ function readComponentLibMata(libDir) {
|
|
|
218
218
|
}
|
|
219
219
|
exports.readComponentLibMata = readComponentLibMata;
|
|
220
220
|
const _OFFICIAL_COMPONENT_LIB = {
|
|
221
|
-
|
|
221
|
+
[config_1.OFFICIAL_LIB_KEY]: ['*'],
|
|
222
222
|
CLOUDBASE_BUSSINESS: ['1627377179261'],
|
|
223
223
|
};
|
|
224
224
|
function isOfficialComponentLib(name, version) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
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": "^0.4.
|
|
42
|
-
"@cloudbase/lowcode-generator": "^1.0.
|
|
41
|
+
"@cloudbase/cals": "^0.4.4",
|
|
42
|
+
"@cloudbase/lowcode-generator": "^1.0.10",
|
|
43
43
|
"axios": "^0.21.0",
|
|
44
44
|
"browserfs": "^1.4.3",
|
|
45
45
|
"browserify-zlib": "^0.2.0",
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
></script>
|
|
462
462
|
<script
|
|
463
463
|
crossorigin
|
|
464
|
-
src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
464
|
+
src="https://qbase.cdn-go.cn/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.19da26e1c1fbee5e0bc4.bundle.js"
|
|
465
465
|
></script>
|
|
466
466
|
</body>
|
|
467
467
|
</html>
|