@cloudbase/lowcode-builder 1.1.7 → 1.1.9
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 +97 -0
- package/lib/builder/config/index.d.ts +1 -1
- package/lib/builder/config/index.js +1 -1
- package/lib/builder/core/index.js +1 -0
- package/lib/builder/mp/mixMode.d.ts +2 -1
- package/lib/builder/mp/mixMode.js +2 -2
- package/lib/builder/mp/util.js +1 -1
- package/lib/builder/service/webpack.js +4 -1
- package/lib/builder/types/common.d.ts +1 -1
- package/lib/builder/util/common.d.ts +1 -1
- package/lib/builder.web.js +39 -13
- package/package.json +5 -5
- package/template/html/index.html.ejs +1 -1
- package/template/template_20221202.zip +0 -0
|
@@ -6,7 +6,7 @@ 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_20221202.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
|
|
@@ -44,7 +44,7 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
|
|
|
44
44
|
* src/template的代码,在IDE编辑器插件中构建builder
|
|
45
45
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
46
46
|
*/
|
|
47
|
-
exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/
|
|
47
|
+
exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20221202.zip';
|
|
48
48
|
/**
|
|
49
49
|
* miniprogram的代码,IDE插件后续会提供端功能
|
|
50
50
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IWeAppData, IPlugin, IMaterialItem } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IAppUsedComp } from '../types/common';
|
|
3
|
-
export declare function handleMixMode({ apps, generateMpPath, miniprogramRoot, plugins, }: {
|
|
3
|
+
export declare function handleMixMode({ apps, generateMpPath, miniprogramRoot, plugins, ignoreInstall, }: {
|
|
4
4
|
apps: IWeAppData[];
|
|
5
5
|
generateMpPath: string;
|
|
6
6
|
miniprogramRoot: string;
|
|
7
7
|
plugins: IPlugin[];
|
|
8
|
+
ignoreInstall: boolean;
|
|
8
9
|
}): Promise<void>;
|
|
9
10
|
export declare function handleMixMaterials(projDir: string, apps: IWeAppData[], appUsedComps: IAppUsedComp[], compositedLibs: IMaterialItem[]): Promise<void[]>;
|
|
@@ -36,13 +36,13 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
36
36
|
const generateFiles_1 = require("../util/generateFiles");
|
|
37
37
|
const webpack_1 = require("../service/webpack");
|
|
38
38
|
// 将 BUILD 目录往混合模式移动
|
|
39
|
-
async function handleMixMode({ apps = [], generateMpPath, miniprogramRoot, plugins = [], }) {
|
|
39
|
+
async function handleMixMode({ apps = [], generateMpPath, miniprogramRoot, plugins = [], ignoreInstall, }) {
|
|
40
40
|
// await handleMainApp()
|
|
41
41
|
// await handleAppPages()
|
|
42
42
|
await handleSubApps();
|
|
43
43
|
// await handleAppJson()
|
|
44
44
|
// await handlePkgJson()
|
|
45
|
-
await (0, webpack_1.installDependencies)(miniprogramRoot);
|
|
45
|
+
await (0, webpack_1.installDependencies)(miniprogramRoot, { ignoreInstall });
|
|
46
46
|
await handlePlugins();
|
|
47
47
|
// 复制框架公用内容
|
|
48
48
|
async function handleMainApp() {
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -99,7 +99,7 @@ function generateDataBindMeta(bind) {
|
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
expr = value
|
|
102
|
-
.replace(/^\w
|
|
102
|
+
.replace(/^\w+([.[])/, (_, $1) => `${isGlobal ? 'app' : '$page'}.${PREFIX_MAP[type]}${$1}`)
|
|
103
103
|
.replace(/^comp-\w+/, `$comp.${PREFIX_MAP[type]}`)
|
|
104
104
|
.replace(/^\$comp_\w+/, `$comp.${PREFIX_MAP[type]}`);
|
|
105
105
|
}
|
|
@@ -462,7 +462,7 @@ async function installDependencies(targetDir, options = {}) {
|
|
|
462
462
|
* 否则认为文件发生了更改,应该忽略参数强制安装
|
|
463
463
|
*/
|
|
464
464
|
const cacheMeta = generateFiles_1.generatedFileContents[packageJsonPath];
|
|
465
|
-
const isPkgModify = !cacheMeta || cacheMeta.once ? false :
|
|
465
|
+
const isPkgModify = !cacheMeta || cacheMeta.once ? false : cacheMeta.modify;
|
|
466
466
|
if ((options === null || options === void 0 ? void 0 : options.ignoreInstall) && fs_extra_1.default.existsSync(path_1.default.join(targetDir, 'node_modules')) && !isPkgModify) {
|
|
467
467
|
console.log(`ignore install dependencies in ${targetDir}`);
|
|
468
468
|
return;
|
|
@@ -503,6 +503,9 @@ async function installDependencies(targetDir, options = {}) {
|
|
|
503
503
|
else {
|
|
504
504
|
installProcess = cross_spawn_1.default.sync('npm', ['install', packageName, ...npmOptions], installlProcessOptions);
|
|
505
505
|
}
|
|
506
|
+
if (installProcess.status) {
|
|
507
|
+
throw new Error(`安装依赖失败 ${installProcess.error || ''}`);
|
|
508
|
+
}
|
|
506
509
|
fixNodeModules(targetDir);
|
|
507
510
|
try {
|
|
508
511
|
await fs_extra_1.default.remove(path_1.default.join(path_1.default.join(targetDir, 'package-lock.json')));
|
|
@@ -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
|
-
export
|
|
4
|
+
export 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;
|