@cloudbase/framework-plugin-low-code 1.7.2 → 1.7.3
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/common.d.ts +2 -0
- package/lib/builder/config/common.d.ts.map +1 -0
- package/lib/builder/config/common.js +13 -0
- package/lib/builder/config/index.d.ts +3 -0
- package/lib/builder/config/index.d.ts.map +1 -0
- package/lib/builder/config/index.js +29 -0
- package/lib/builder/config/mp.d.ts +2 -0
- package/lib/builder/config/mp.d.ts.map +1 -0
- package/lib/builder/config/mp.js +13 -0
- package/lib/builder/core/copy.d.ts +5 -0
- package/lib/builder/core/copy.d.ts.map +1 -0
- package/lib/builder/core/copy.js +62 -0
- package/lib/builder/core/generate.d.ts +9 -0
- package/lib/builder/core/generate.d.ts.map +1 -0
- package/lib/builder/core/generate.js +128 -0
- package/lib/builder/core/index.d.ts +32 -0
- package/lib/builder/core/index.d.ts.map +1 -0
- package/lib/builder/core/index.js +149 -0
- package/lib/builder/core/material.d.ts +4 -0
- package/lib/builder/core/material.d.ts.map +1 -0
- package/lib/builder/core/material.js +80 -0
- package/lib/builder/core/plugin.d.ts +4 -0
- package/lib/builder/core/plugin.d.ts.map +1 -0
- package/lib/builder/core/plugin.js +30 -0
- package/lib/builder/core/prepare.d.ts +8 -0
- package/lib/builder/core/prepare.d.ts.map +1 -0
- package/lib/builder/core/prepare.js +108 -0
- package/lib/builder/core/webpack.d.ts +15 -0
- package/lib/builder/core/webpack.d.ts.map +1 -0
- package/lib/builder/core/webpack.js +58 -0
- package/lib/builder/mp/BuildContext.d.ts +13 -0
- package/lib/builder/mp/BuildContext.d.ts.map +1 -0
- package/lib/builder/mp/BuildContext.js +2 -0
- package/lib/builder/mp/index.d.ts +33 -0
- package/lib/builder/mp/index.d.ts.map +1 -0
- package/lib/builder/mp/index.js +450 -0
- package/lib/builder/mp/lowcode.d.ts +8 -0
- package/lib/builder/mp/lowcode.d.ts.map +1 -0
- package/lib/builder/mp/lowcode.js +54 -0
- package/lib/builder/mp/materials.d.ts +15 -0
- package/lib/builder/mp/materials.d.ts.map +1 -0
- package/lib/builder/mp/materials.js +338 -0
- package/lib/builder/mp/mixMode.d.ts +10 -0
- package/lib/builder/mp/mixMode.d.ts.map +1 -0
- package/lib/builder/mp/mixMode.js +215 -0
- package/lib/builder/mp/mp_config.d.ts +18 -0
- package/lib/builder/mp/mp_config.d.ts.map +1 -0
- package/lib/builder/mp/mp_config.js +206 -0
- package/lib/builder/mp/util.d.ts +20 -0
- package/lib/builder/mp/util.d.ts.map +1 -0
- package/lib/builder/mp/util.js +243 -0
- package/lib/builder/mp/wxml.d.ts +16 -0
- package/lib/builder/mp/wxml.d.ts.map +1 -0
- package/lib/builder/mp/wxml.js +300 -0
- package/lib/builder/service/builder/copy.d.ts +14 -0
- package/lib/builder/service/builder/copy.d.ts.map +1 -0
- package/lib/builder/service/builder/copy.js +189 -0
- package/lib/builder/service/builder/generate.d.ts +52 -0
- package/lib/builder/service/builder/generate.d.ts.map +1 -0
- package/lib/builder/service/builder/generate.js +792 -0
- package/lib/builder/service/builder/index.d.ts +16 -0
- package/lib/builder/service/builder/index.d.ts.map +1 -0
- package/lib/builder/service/builder/index.js +69 -0
- package/lib/builder/service/builder/plugin.d.ts +8 -0
- package/lib/builder/service/builder/plugin.d.ts.map +1 -0
- package/lib/builder/service/builder/plugin.js +149 -0
- package/lib/builder/service/builder/webpack.d.ts +91 -0
- package/lib/builder/service/builder/webpack.d.ts.map +1 -0
- package/lib/builder/service/builder/webpack.js +589 -0
- package/lib/builder/types/common.d.ts +12 -0
- package/lib/builder/types/common.d.ts.map +1 -0
- package/lib/builder/types/common.js +7 -0
- package/lib/builder/util/common.d.ts +36 -0
- package/lib/builder/util/common.d.ts.map +1 -0
- package/lib/builder/util/common.js +257 -0
- package/lib/builder/util/console.d.ts +2 -0
- package/lib/builder/util/console.d.ts.map +1 -0
- package/lib/builder/util/console.js +13 -0
- package/lib/builder/util/generateFiles.d.ts +6 -0
- package/lib/builder/util/generateFiles.d.ts.map +1 -0
- package/lib/builder/util/generateFiles.js +94 -0
- package/lib/builder/util/index.d.ts +2 -0
- package/lib/builder/util/index.d.ts.map +1 -0
- package/lib/builder/util/index.js +13 -0
- package/lib/builder/util/junk.d.ts +3 -0
- package/lib/builder/util/junk.d.ts.map +1 -0
- package/lib/builder/util/junk.js +25 -0
- package/lib/builder/util/mp.d.ts +5 -0
- package/lib/builder/util/mp.d.ts.map +1 -0
- package/lib/builder/util/mp.js +99 -0
- package/lib/builder/util/name-mangler.d.ts +3 -0
- package/lib/builder/util/name-mangler.d.ts.map +1 -0
- package/lib/builder/util/name-mangler.js +7 -0
- package/lib/builder/util/net.d.ts +3 -0
- package/lib/builder/util/net.d.ts.map +1 -0
- package/lib/builder/util/net.js +54 -0
- package/lib/builder/util/process.d.ts +9 -0
- package/lib/builder/util/process.d.ts.map +1 -0
- package/lib/builder/util/process.js +28 -0
- package/lib/builder/util/style.d.ts +2 -0
- package/lib/builder/util/style.d.ts.map +1 -0
- package/lib/builder/util/style.js +13 -0
- package/lib/builder/util/weapp.d.ts +2 -0
- package/lib/builder/util/weapp.d.ts.map +1 -0
- package/lib/builder/util/weapp.js +13 -0
- package/lib/config/private.d.ts +3 -0
- package/lib/config/private.d.ts.map +1 -0
- package/lib/config/private.js +14 -0
- package/lib/generate.d.ts +2 -0
- package/lib/generate.d.ts.map +1 -0
- package/lib/generate.js +49 -0
- package/lib/generator/config/common.d.ts +6 -0
- package/lib/generator/config/common.d.ts.map +1 -0
- package/lib/generator/config/common.js +25 -0
- package/lib/generator/config/index.d.ts +18 -0
- package/lib/generator/config/index.d.ts.map +1 -0
- package/lib/generator/config/index.js +43 -0
- package/lib/generator/config/mp.d.ts +56 -0
- package/lib/generator/config/mp.d.ts.map +1 -0
- package/lib/generator/config/mp.js +104 -0
- package/lib/generator/core/generate.d.ts +59 -0
- package/lib/generator/core/generate.d.ts.map +1 -0
- package/lib/generator/core/generate.js +663 -0
- package/lib/generator/core/index.d.ts +25 -0
- package/lib/generator/core/index.d.ts.map +1 -0
- package/lib/generator/core/index.js +102 -0
- package/lib/generator/core/material.d.ts +14 -0
- package/lib/generator/core/material.d.ts.map +1 -0
- package/lib/generator/core/material.js +230 -0
- package/lib/generator/template.d.ts +3 -0
- package/lib/generator/template.d.ts.map +1 -0
- package/lib/generator/template.js +3 -0
- package/lib/generator/types/common.d.ts +69 -0
- package/lib/generator/types/common.d.ts.map +1 -0
- package/lib/generator/types/common.js +21 -0
- package/lib/generator/util/common.d.ts +36 -0
- package/lib/generator/util/common.d.ts.map +1 -0
- package/lib/generator/util/common.js +238 -0
- package/lib/generator/util/console.d.ts +3 -0
- package/lib/generator/util/console.d.ts.map +1 -0
- package/lib/generator/util/console.js +17 -0
- package/lib/generator/util/index.d.ts +2 -0
- package/lib/generator/util/index.d.ts.map +1 -0
- package/lib/generator/util/index.js +13 -0
- package/lib/generator/util/name-mangler.d.ts +17 -0
- package/lib/generator/util/name-mangler.d.ts.map +1 -0
- package/lib/generator/util/name-mangler.js +63 -0
- package/lib/generator/util/postcss-rpx.d.ts +11 -0
- package/lib/generator/util/postcss-rpx.d.ts.map +1 -0
- package/lib/generator/util/postcss-rpx.js +16 -0
- package/lib/generator/util/style.d.ts +6 -0
- package/lib/generator/util/style.d.ts.map +1 -0
- package/lib/generator/util/style.js +92 -0
- package/lib/generator/util/weapp.d.ts +5 -0
- package/lib/generator/util/weapp.d.ts.map +1 -0
- package/lib/generator/util/weapp.js +17 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +0 -0
- package/lib/types.d.ts +14 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +19 -0
- package/lib/utils/common.d.ts +0 -0
- package/lib/utils/common.d.ts.map +0 -0
- package/lib/utils/common.js +0 -0
- package/lib/utils/dataSource.d.ts +28 -0
- package/lib/utils/dataSource.d.ts.map +1 -0
- package/lib/utils/dataSource.js +171 -0
- package/lib/utils/index.d.ts +0 -0
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/postProcess.d.ts +3 -0
- package/lib/utils/postProcess.d.ts.map +1 -0
- package/lib/utils/postProcess.js +48 -0
- package/lib/weapps-core/config/index.d.ts +2 -0
- package/lib/weapps-core/config/index.d.ts.map +1 -0
- package/lib/weapps-core/config/index.js +13 -0
- package/lib/weapps-core/config/style.d.ts +7 -0
- package/lib/weapps-core/config/style.d.ts.map +1 -0
- package/lib/weapps-core/config/style.js +70 -0
- package/lib/weapps-core/index.d.ts +6 -0
- package/lib/weapps-core/index.d.ts.map +1 -0
- package/lib/weapps-core/index.js +31 -0
- package/lib/weapps-core/types/action.d.ts +25 -0
- package/lib/weapps-core/types/action.d.ts.map +1 -0
- package/lib/weapps-core/types/action.js +28 -0
- package/lib/weapps-core/types/app.d.ts +142 -0
- package/lib/weapps-core/types/app.d.ts.map +1 -0
- package/lib/weapps-core/types/app.js +21 -0
- package/lib/weapps-core/types/appbuild.d.ts +63 -0
- package/lib/weapps-core/types/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/types/appbuild.js +78 -0
- package/lib/weapps-core/types/code_types.d.ts +26 -0
- package/lib/weapps-core/types/code_types.d.ts.map +1 -0
- package/lib/weapps-core/types/code_types.js +2 -0
- package/lib/weapps-core/types/git.d.ts +7 -0
- package/lib/weapps-core/types/git.d.ts.map +1 -0
- package/lib/weapps-core/types/git.js +2 -0
- package/lib/weapps-core/types/index.d.ts +11 -0
- package/lib/weapps-core/types/index.d.ts.map +1 -0
- package/lib/weapps-core/types/index.js +22 -0
- package/lib/weapps-core/types/lowcode.d.ts +26 -0
- package/lib/weapps-core/types/lowcode.d.ts.map +1 -0
- package/lib/weapps-core/types/lowcode.js +25 -0
- package/lib/weapps-core/types/material.d.ts +90 -0
- package/lib/weapps-core/types/material.d.ts.map +1 -0
- package/lib/weapps-core/types/material.js +9 -0
- package/lib/weapps-core/types/plugins.d.ts +17 -0
- package/lib/weapps-core/types/plugins.d.ts.map +1 -0
- package/lib/weapps-core/types/plugins.js +2 -0
- package/lib/weapps-core/types/style.d.ts +93 -0
- package/lib/weapps-core/types/style.d.ts.map +1 -0
- package/lib/weapps-core/types/style.js +2 -0
- package/lib/weapps-core/types/web.d.ts +120 -0
- package/lib/weapps-core/types/web.d.ts.map +1 -0
- package/lib/weapps-core/types/web.js +2 -0
- package/lib/weapps-core/utils/appbuild.d.ts +6 -0
- package/lib/weapps-core/utils/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/utils/appbuild.js +40 -0
- package/lib/weapps-core/utils/common.d.ts +16 -0
- package/lib/weapps-core/utils/common.d.ts.map +1 -0
- package/lib/weapps-core/utils/common.js +90 -0
- package/lib/weapps-core/utils/file.d.ts +12 -0
- package/lib/weapps-core/utils/file.d.ts.map +1 -0
- package/lib/weapps-core/utils/file.js +142 -0
- package/lib/weapps-core/utils/formily.d.ts +5 -0
- package/lib/weapps-core/utils/formily.d.ts.map +1 -0
- package/lib/weapps-core/utils/formily.js +416 -0
- package/lib/weapps-core/utils/index.d.ts +7 -0
- package/lib/weapps-core/utils/index.d.ts.map +1 -0
- package/lib/weapps-core/utils/index.js +18 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts +4 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts.map +1 -0
- package/lib/weapps-core/utils/lowcdoe.js +69 -0
- package/lib/weapps-core/utils/style.d.ts +17 -0
- package/lib/weapps-core/utils/style.d.ts.map +1 -0
- package/lib/weapps-core/utils/style.js +330 -0
- package/package.json +3 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
32
|
+
};
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
exports.createDoneCallBack = exports.saveProjectConfigJson = exports.runPrepare = void 0;
|
|
35
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
36
|
+
const path_1 = __importDefault(require("path"));
|
|
37
|
+
const common_1 = require("../types/common");
|
|
38
|
+
const junk = __importStar(require("../util/junk"));
|
|
39
|
+
function runPrepare(buildTypeList, appBuildDir, isCleanDistDir) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
console.time('runPrepare');
|
|
42
|
+
const projectConfig = yield saveProjectConfigJson(appBuildDir);
|
|
43
|
+
try {
|
|
44
|
+
if (buildTypeList.includes("mp")) {
|
|
45
|
+
const mpDirPath = path_1.default.resolve(appBuildDir, './dist/mp');
|
|
46
|
+
if (projectConfig && projectConfig.cloudfunctionRoot) {
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
yield fs_extra_1.default.emptyDir(mpDirPath);
|
|
50
|
+
}
|
|
51
|
+
const dirs = fs_extra_1.default.readdirSync(mpDirPath).filter(junk.not);
|
|
52
|
+
yield Promise.all(dirs.map((dir) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
if (projectConfig && projectConfig.cloudfunctionRoot) {
|
|
54
|
+
if (projectConfig.cloudfunctionRoot.startsWith(dir)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (dir === 'miniprogram_npm') {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
yield fs_extra_1.default.remove(path_1.default.resolve(mpDirPath, dir));
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
if ((0, common_1.buildAsWebByBuildType)(buildTypeList)) {
|
|
65
|
+
yield fs_extra_1.default.emptyDir(path_1.default.resolve(appBuildDir, './preview'));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
console.error('清空 dist/preview 目录失败', e);
|
|
70
|
+
}
|
|
71
|
+
if (isCleanDistDir) {
|
|
72
|
+
yield fs_extra_1.default.remove(path_1.default.resolve(appBuildDir, './src'));
|
|
73
|
+
yield fs_extra_1.default.remove(path_1.default.resolve(appBuildDir, './webpack'));
|
|
74
|
+
yield fs_extra_1.default.remove(path_1.default.resolve(appBuildDir, './package-lock.json'));
|
|
75
|
+
yield fs_extra_1.default.remove(path_1.default.resolve(appBuildDir, './yarn.lock'));
|
|
76
|
+
}
|
|
77
|
+
yield fs_extra_1.default.ensureDir(appBuildDir);
|
|
78
|
+
console.timeEnd('runPrepare');
|
|
79
|
+
return projectConfig;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
exports.runPrepare = runPrepare;
|
|
83
|
+
function saveProjectConfigJson(appBuildDir) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const projectConfigJsonPath = path_1.default.resolve(appBuildDir, './dist/mp/project.config.json');
|
|
86
|
+
if (fs_extra_1.default.existsSync(projectConfigJsonPath)) {
|
|
87
|
+
return yield fs_extra_1.default.readJSON(projectConfigJsonPath);
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
exports.saveProjectConfigJson = saveProjectConfigJson;
|
|
93
|
+
function createDoneCallBack({ projectConfig, appBuildDir }, cb) {
|
|
94
|
+
return (...params) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
if (projectConfig) {
|
|
96
|
+
const newProjectConfig = yield saveProjectConfigJson(appBuildDir);
|
|
97
|
+
if (newProjectConfig) {
|
|
98
|
+
newProjectConfig.condition = projectConfig.condition;
|
|
99
|
+
const projectConfigJsonPath = path_1.default.resolve(appBuildDir, './dist/mp/project.config.json');
|
|
100
|
+
yield fs_extra_1.default.writeFile(projectConfigJsonPath, JSON.stringify(newProjectConfig, null, 4), {
|
|
101
|
+
encoding: 'utf8',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
cb && cb(...params);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
exports.createDoneCallBack = createDoneCallBack;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { WebpackBuildCallBack } from '../types/common';
|
|
2
|
+
import { IWebRuntimeAppData } from '../../weapps-core';
|
|
3
|
+
import { BuildAppProps } from './index';
|
|
4
|
+
interface IWebpackCoreProps extends BuildAppProps {
|
|
5
|
+
appBuildDir: string;
|
|
6
|
+
materialsDir: string;
|
|
7
|
+
cb: WebpackBuildCallBack;
|
|
8
|
+
mpConfig: any;
|
|
9
|
+
mainAppData: IWebRuntimeAppData;
|
|
10
|
+
subAppDataList: IWebRuntimeAppData[];
|
|
11
|
+
assets: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function runWebpackCore({ mainAppData, subAppDataList, appBuildDir, materialsDir, cb, mpConfig, dependencies, nodeModulesPath, publicPath, mode, watch, appKey, buildTypeList, generateMpType, generateMpPath, plugins, assets, }: IWebpackCoreProps): Promise<void>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=webpack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../../../src/builder/core/webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAW,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAOhE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,oBAAoB,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,EAAE,kBAAkB,CAAC;IAChC,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,cAAc,CAAC,EACnC,WAAW,EACX,cAAc,EACd,WAAW,EACX,YAAY,EACZ,EAAE,EACF,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,UAAU,EACV,IAAI,EACJ,KAAK,EACL,MAAM,EACN,aAAa,EACb,cAAc,EACd,cAAc,EACd,OAAO,EACP,MAAW,GACZ,EAAE,iBAAiB,iBAsDnB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.runWebpackCore = void 0;
|
|
13
|
+
const common_1 = require("../types/common");
|
|
14
|
+
const webpack_1 = require("../service/builder/webpack");
|
|
15
|
+
function runWebpackCore({ mainAppData, subAppDataList, appBuildDir, materialsDir, cb, mpConfig, dependencies, nodeModulesPath, publicPath, mode, watch, appKey, buildTypeList, generateMpType, generateMpPath, plugins, assets = [], }) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
console.time('runWebpackCore');
|
|
18
|
+
console.time('webpackGenerate');
|
|
19
|
+
const allAppDataList = subAppDataList.concat(mainAppData);
|
|
20
|
+
const webWebpackConfigPath = yield (0, webpack_1.generateWebpackWebBuildParamsFile)({
|
|
21
|
+
appId: mainAppData.id || appKey,
|
|
22
|
+
allAppDataList,
|
|
23
|
+
appBuildDir,
|
|
24
|
+
materialsDir,
|
|
25
|
+
dependencies,
|
|
26
|
+
nodeModulesPath,
|
|
27
|
+
publicPath,
|
|
28
|
+
mode,
|
|
29
|
+
watch,
|
|
30
|
+
buildTypeList,
|
|
31
|
+
assets,
|
|
32
|
+
});
|
|
33
|
+
console.timeEnd('webpackGenerate');
|
|
34
|
+
const taskList = [];
|
|
35
|
+
console.time('generateMpJsonConfigFile');
|
|
36
|
+
yield (0, webpack_1.generateMpJsonConfigFile)(allAppDataList, mpConfig, appBuildDir, plugins, {
|
|
37
|
+
appKey,
|
|
38
|
+
generateMpType,
|
|
39
|
+
});
|
|
40
|
+
console.timeEnd('generateMpJsonConfigFile');
|
|
41
|
+
if ((0, common_1.buildAsWebByBuildType)(buildTypeList)) {
|
|
42
|
+
yield (0, webpack_1.generateWebpackWebDevServerFile)({
|
|
43
|
+
appBuildDir,
|
|
44
|
+
buildTypeList,
|
|
45
|
+
});
|
|
46
|
+
(0, webpack_1.startCompile)({
|
|
47
|
+
appBuildDir,
|
|
48
|
+
configPath: webWebpackConfigPath,
|
|
49
|
+
appKey,
|
|
50
|
+
}, cb);
|
|
51
|
+
}
|
|
52
|
+
console.time('webpackCompile');
|
|
53
|
+
yield Promise.all(taskList);
|
|
54
|
+
console.timeEnd('webpackCompile');
|
|
55
|
+
console.timeEnd('runWebpackCore');
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.runWebpackCore = runWebpackCore;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IMaterialItem, IWeAppData, IMiniprogramPlugin } from '../../weapps-core';
|
|
2
|
+
export interface IBuildContext {
|
|
3
|
+
appId: string;
|
|
4
|
+
domain: string;
|
|
5
|
+
projDir: string;
|
|
6
|
+
materialLibs: IMaterialItem[];
|
|
7
|
+
isProduction: boolean;
|
|
8
|
+
mainAppData: IWeAppData;
|
|
9
|
+
isMixMode: boolean;
|
|
10
|
+
rootPath?: string;
|
|
11
|
+
miniprogramPlugins?: IMiniprogramPlugin[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=BuildContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildContext.d.ts","sourceRoot":"","sources":["../../../src/builder/mp/BuildContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAK3B,MAAM,WAAW,aAAa;IAE5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC3C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IMaterialItem, IWeAppData, IPlugin } from '../../weapps-core';
|
|
2
|
+
import { IBuildContext } from './BuildContext';
|
|
3
|
+
import { DEPLOY_MODE } from '../../types';
|
|
4
|
+
import { BuildType, IAppUsedComp, IUsedComps } from '../types/common';
|
|
5
|
+
export declare function generateWxMp({ weapps, projDir, appId, domain, materials, plugins, isProduction, deployMode, extraData, isMixMode, options, buildTypeList, }: {
|
|
6
|
+
weapps: IWeAppData[];
|
|
7
|
+
projDir: string;
|
|
8
|
+
appId: string;
|
|
9
|
+
domain: string;
|
|
10
|
+
materials: IMaterialItem[];
|
|
11
|
+
plugins: IPlugin[];
|
|
12
|
+
isProduction: boolean;
|
|
13
|
+
deployMode: DEPLOY_MODE;
|
|
14
|
+
extraData: any;
|
|
15
|
+
isMixMode: boolean;
|
|
16
|
+
options: {
|
|
17
|
+
resourceAppid?: string;
|
|
18
|
+
isCrossAccount: boolean;
|
|
19
|
+
};
|
|
20
|
+
buildTypeList: BuildType[];
|
|
21
|
+
}): Promise<{
|
|
22
|
+
miniprogramRoot: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function writeLowCodeFiles(appData: IWeAppData, outDir: string, ctx: IBuildContext): Promise<void>;
|
|
25
|
+
export declare function handleUsedComponents({ buildContext, weapps, materials, }: {
|
|
26
|
+
buildContext: IBuildContext;
|
|
27
|
+
weapps: IWeAppData[];
|
|
28
|
+
materials: IMaterialItem[];
|
|
29
|
+
}): {
|
|
30
|
+
appUsedComps: IAppUsedComp[];
|
|
31
|
+
allAppUsedComps: IUsedComps;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/mp/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,aAAa,EACb,UAAU,EAEV,OAAO,EAIR,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAW/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAiC,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQrG,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EACT,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE;IACD,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,GAAG,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B,GAAG,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC,CAgPvC;AAsJD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,iBAuB9F;AAiBD,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,MAAM,EACN,SAAS,GACV,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;;;EA6BA"}
|