@cloudbase/lowcode-builder 1.9.5 → 1.9.7
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/dependencies.js +2 -2
- package/lib/builder/h5/block2component.d.ts +4 -1
- package/lib/builder/h5/block2component.js +3 -2
- package/lib/builder/h5/generate.d.ts +1 -1
- package/lib/builder/h5/generate.js +2 -1
- package/lib/builder/mp/materials.d.ts +1 -1
- package/lib/builder/service/webpack.js +1 -1
- package/lib/builder/types/common.d.ts +1 -1
- package/lib/builder/util/common.d.ts +1 -1
- package/lib/builder.web.js +8 -8
- package/package.json +2 -2
- package/template/html/index.html.ejs +1 -1
- package/template/mp/common/util.js +1 -1
- package/template/mp/datasources/config.js.tpl +7 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateSystemPackageDependencies = exports.generateLibDependencies = exports.generatePackageDependencies = void 0;
|
|
4
4
|
const cals_1 = require("@cloudbase/cals");
|
|
5
|
-
const CLOUDBASE_VERSION = '2.8.
|
|
5
|
+
const CLOUDBASE_VERSION = '2.8.16-beta.0';
|
|
6
6
|
const BASE_DEPS = {
|
|
7
7
|
'miniprogram-gesture': '^1.0.6',
|
|
8
8
|
mobx: '^5',
|
|
@@ -13,7 +13,7 @@ const BASE_DEPS = {
|
|
|
13
13
|
* 注意锁版本
|
|
14
14
|
*/
|
|
15
15
|
const CLOUDBASE_DEPS = {
|
|
16
|
-
'@cloudbase/weda-client': '1.1.
|
|
16
|
+
'@cloudbase/weda-client': '1.1.8',
|
|
17
17
|
'@cloudbase/weda-cloud-sdk': '1.0.86',
|
|
18
18
|
};
|
|
19
19
|
const COMPONENT_DEPS = {
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { RUNTIME } from '../../types';
|
|
2
|
-
export declare function buildBlock(buildDir: any, dependencies: any, runtime?: RUNTIME): Promise<
|
|
2
|
+
export declare function buildBlock(buildDir: any, dependencies: any, runtime?: RUNTIME): Promise<{
|
|
3
|
+
buildDir: any;
|
|
4
|
+
componentsList: any;
|
|
5
|
+
}>;
|
|
@@ -43,8 +43,9 @@ async function buildBlock(buildDir, dependencies, runtime = types_1.RUNTIME.NONE
|
|
|
43
43
|
const officialDependence = dependencies.find((lib) => lib.name === config_1.OFFICIAL_LIB_KEY);
|
|
44
44
|
const componentDeps = (0, config_1.generateLibDependencies)('h5', officialDependence === null || officialDependence === void 0 ? void 0 : officialDependence.version);
|
|
45
45
|
processedDependencies.push(officialDependence);
|
|
46
|
+
let componentsList;
|
|
46
47
|
try {
|
|
47
|
-
await (0, generate_1.generateBlockFiles)({
|
|
48
|
+
componentsList = await (0, generate_1.generateBlockFiles)({
|
|
48
49
|
dependencies: processedDependencies,
|
|
49
50
|
appBuildDir: buildDir,
|
|
50
51
|
componentDeps,
|
|
@@ -53,6 +54,6 @@ async function buildBlock(buildDir, dependencies, runtime = types_1.RUNTIME.NONE
|
|
|
53
54
|
catch (error) {
|
|
54
55
|
throw error;
|
|
55
56
|
}
|
|
56
|
-
return buildDir;
|
|
57
|
+
return { buildDir, componentsList };
|
|
57
58
|
}
|
|
58
59
|
exports.buildBlock = buildBlock;
|
|
@@ -7,7 +7,7 @@ import { ICommonBuildContext } from '../mp/BuildContext';
|
|
|
7
7
|
* 该函数从 @govcloud/generate 取到需要的模版文件
|
|
8
8
|
*/
|
|
9
9
|
export declare function generateProjectFiles(buildData: BuildAppProps): Promise<void>;
|
|
10
|
-
export declare function generateBlockFiles(buildData: any): Promise<
|
|
10
|
+
export declare function generateBlockFiles(buildData: any): Promise<string[]>;
|
|
11
11
|
export declare function generateHTML({ buildContext, appId, envId, description, appBuildDir, externalResources, mode, devTool, isBuildApp, buildTypeList, cdnEndpoints,
|
|
12
12
|
/**
|
|
13
13
|
* 由于存量兜底逻辑存在
|
|
@@ -29,7 +29,7 @@ exports.generateProjectFiles = generateProjectFiles;
|
|
|
29
29
|
async function generateBlockFiles(buildData) {
|
|
30
30
|
const { dependencies, appBuildDir, componentDeps } = buildData;
|
|
31
31
|
const fileCodeMap = {};
|
|
32
|
-
await (0, lowcode_generator_1.generateCompositeComponent)(dependencies, './', fileCodeMap, componentDeps);
|
|
32
|
+
const componentsList = await (0, lowcode_generator_1.generateCompositeComponent)(dependencies, './', fileCodeMap, componentDeps);
|
|
33
33
|
try {
|
|
34
34
|
await Promise.all(Object.keys(fileCodeMap).map(async (filePath) => {
|
|
35
35
|
await (0, generateFiles_1.writeFile)(path_1.default.join(appBuildDir || '', filePath), fileCodeMap[filePath].code);
|
|
@@ -38,6 +38,7 @@ async function generateBlockFiles(buildData) {
|
|
|
38
38
|
catch (error) {
|
|
39
39
|
throw error;
|
|
40
40
|
}
|
|
41
|
+
return componentsList;
|
|
41
42
|
}
|
|
42
43
|
exports.generateBlockFiles = generateBlockFiles;
|
|
43
44
|
async function generateHTML({ buildContext, appId, envId, description = '', appBuildDir, externalResources = [], mode, devTool, isBuildApp, buildTypeList, cdnEndpoints,
|
|
@@ -3,7 +3,7 @@ import { IBuildContext, IMpCommonBuildContext } from './BuildContext';
|
|
|
3
3
|
import NameMangler from '@cloudbase/lowcode-generator/lib/generator/util/name-mangler';
|
|
4
4
|
import { IUsedComps } from '../types/common';
|
|
5
5
|
export declare function normalizeCompositeDependienciesForBuild(lib: any): any;
|
|
6
|
-
export
|
|
6
|
+
export type TInstallMaterialsType = 'lib' | 'inline';
|
|
7
7
|
export declare function installMaterials(ctx: IMpCommonBuildContext, outDir: string, usedMeta?: {
|
|
8
8
|
component: IUsedComps;
|
|
9
9
|
action: IUsedComps;
|
|
@@ -201,7 +201,7 @@ async function downloadDependencies(targetDir, srcZipUrl, useBash = false) {
|
|
|
201
201
|
const tag = `bash ${srcZipUrl}`;
|
|
202
202
|
console.time(tag);
|
|
203
203
|
await fs_extra_1.default.ensureDir(targetDir);
|
|
204
|
-
await spawnPromise(`wget -
|
|
204
|
+
await spawnPromise(`temp_dir=$(mktemp -d) && wget -O "$temp_dir/file.zip" "${srcZipUrl}" && unzip "$temp_dir/file.zip" -d ${targetDir} && rm -rf "$temp_dir"`, [], {
|
|
205
205
|
cwd: process.cwd(),
|
|
206
206
|
stdio: undefined,
|
|
207
207
|
});
|
|
@@ -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, 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;
|