@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.
Files changed (238) hide show
  1. package/lib/builder/config/common.d.ts +2 -0
  2. package/lib/builder/config/common.d.ts.map +1 -0
  3. package/lib/builder/config/common.js +13 -0
  4. package/lib/builder/config/index.d.ts +3 -0
  5. package/lib/builder/config/index.d.ts.map +1 -0
  6. package/lib/builder/config/index.js +29 -0
  7. package/lib/builder/config/mp.d.ts +2 -0
  8. package/lib/builder/config/mp.d.ts.map +1 -0
  9. package/lib/builder/config/mp.js +13 -0
  10. package/lib/builder/core/copy.d.ts +5 -0
  11. package/lib/builder/core/copy.d.ts.map +1 -0
  12. package/lib/builder/core/copy.js +62 -0
  13. package/lib/builder/core/generate.d.ts +9 -0
  14. package/lib/builder/core/generate.d.ts.map +1 -0
  15. package/lib/builder/core/generate.js +128 -0
  16. package/lib/builder/core/index.d.ts +32 -0
  17. package/lib/builder/core/index.d.ts.map +1 -0
  18. package/lib/builder/core/index.js +149 -0
  19. package/lib/builder/core/material.d.ts +4 -0
  20. package/lib/builder/core/material.d.ts.map +1 -0
  21. package/lib/builder/core/material.js +80 -0
  22. package/lib/builder/core/plugin.d.ts +4 -0
  23. package/lib/builder/core/plugin.d.ts.map +1 -0
  24. package/lib/builder/core/plugin.js +30 -0
  25. package/lib/builder/core/prepare.d.ts +8 -0
  26. package/lib/builder/core/prepare.d.ts.map +1 -0
  27. package/lib/builder/core/prepare.js +108 -0
  28. package/lib/builder/core/webpack.d.ts +15 -0
  29. package/lib/builder/core/webpack.d.ts.map +1 -0
  30. package/lib/builder/core/webpack.js +58 -0
  31. package/lib/builder/mp/BuildContext.d.ts +13 -0
  32. package/lib/builder/mp/BuildContext.d.ts.map +1 -0
  33. package/lib/builder/mp/BuildContext.js +2 -0
  34. package/lib/builder/mp/index.d.ts +33 -0
  35. package/lib/builder/mp/index.d.ts.map +1 -0
  36. package/lib/builder/mp/index.js +450 -0
  37. package/lib/builder/mp/lowcode.d.ts +8 -0
  38. package/lib/builder/mp/lowcode.d.ts.map +1 -0
  39. package/lib/builder/mp/lowcode.js +54 -0
  40. package/lib/builder/mp/materials.d.ts +15 -0
  41. package/lib/builder/mp/materials.d.ts.map +1 -0
  42. package/lib/builder/mp/materials.js +338 -0
  43. package/lib/builder/mp/mixMode.d.ts +10 -0
  44. package/lib/builder/mp/mixMode.d.ts.map +1 -0
  45. package/lib/builder/mp/mixMode.js +215 -0
  46. package/lib/builder/mp/mp_config.d.ts +18 -0
  47. package/lib/builder/mp/mp_config.d.ts.map +1 -0
  48. package/lib/builder/mp/mp_config.js +206 -0
  49. package/lib/builder/mp/util.d.ts +20 -0
  50. package/lib/builder/mp/util.d.ts.map +1 -0
  51. package/lib/builder/mp/util.js +243 -0
  52. package/lib/builder/mp/wxml.d.ts +16 -0
  53. package/lib/builder/mp/wxml.d.ts.map +1 -0
  54. package/lib/builder/mp/wxml.js +300 -0
  55. package/lib/builder/service/builder/copy.d.ts +14 -0
  56. package/lib/builder/service/builder/copy.d.ts.map +1 -0
  57. package/lib/builder/service/builder/copy.js +189 -0
  58. package/lib/builder/service/builder/generate.d.ts +52 -0
  59. package/lib/builder/service/builder/generate.d.ts.map +1 -0
  60. package/lib/builder/service/builder/generate.js +792 -0
  61. package/lib/builder/service/builder/index.d.ts +16 -0
  62. package/lib/builder/service/builder/index.d.ts.map +1 -0
  63. package/lib/builder/service/builder/index.js +69 -0
  64. package/lib/builder/service/builder/plugin.d.ts +8 -0
  65. package/lib/builder/service/builder/plugin.d.ts.map +1 -0
  66. package/lib/builder/service/builder/plugin.js +149 -0
  67. package/lib/builder/service/builder/webpack.d.ts +91 -0
  68. package/lib/builder/service/builder/webpack.d.ts.map +1 -0
  69. package/lib/builder/service/builder/webpack.js +589 -0
  70. package/lib/builder/types/common.d.ts +12 -0
  71. package/lib/builder/types/common.d.ts.map +1 -0
  72. package/lib/builder/types/common.js +7 -0
  73. package/lib/builder/util/common.d.ts +36 -0
  74. package/lib/builder/util/common.d.ts.map +1 -0
  75. package/lib/builder/util/common.js +257 -0
  76. package/lib/builder/util/console.d.ts +2 -0
  77. package/lib/builder/util/console.d.ts.map +1 -0
  78. package/lib/builder/util/console.js +13 -0
  79. package/lib/builder/util/generateFiles.d.ts +6 -0
  80. package/lib/builder/util/generateFiles.d.ts.map +1 -0
  81. package/lib/builder/util/generateFiles.js +94 -0
  82. package/lib/builder/util/index.d.ts +2 -0
  83. package/lib/builder/util/index.d.ts.map +1 -0
  84. package/lib/builder/util/index.js +13 -0
  85. package/lib/builder/util/junk.d.ts +3 -0
  86. package/lib/builder/util/junk.d.ts.map +1 -0
  87. package/lib/builder/util/junk.js +25 -0
  88. package/lib/builder/util/mp.d.ts +5 -0
  89. package/lib/builder/util/mp.d.ts.map +1 -0
  90. package/lib/builder/util/mp.js +99 -0
  91. package/lib/builder/util/name-mangler.d.ts +3 -0
  92. package/lib/builder/util/name-mangler.d.ts.map +1 -0
  93. package/lib/builder/util/name-mangler.js +7 -0
  94. package/lib/builder/util/net.d.ts +3 -0
  95. package/lib/builder/util/net.d.ts.map +1 -0
  96. package/lib/builder/util/net.js +54 -0
  97. package/lib/builder/util/process.d.ts +9 -0
  98. package/lib/builder/util/process.d.ts.map +1 -0
  99. package/lib/builder/util/process.js +28 -0
  100. package/lib/builder/util/style.d.ts +2 -0
  101. package/lib/builder/util/style.d.ts.map +1 -0
  102. package/lib/builder/util/style.js +13 -0
  103. package/lib/builder/util/weapp.d.ts +2 -0
  104. package/lib/builder/util/weapp.d.ts.map +1 -0
  105. package/lib/builder/util/weapp.js +13 -0
  106. package/lib/config/private.d.ts +3 -0
  107. package/lib/config/private.d.ts.map +1 -0
  108. package/lib/config/private.js +14 -0
  109. package/lib/generate.d.ts +2 -0
  110. package/lib/generate.d.ts.map +1 -0
  111. package/lib/generate.js +49 -0
  112. package/lib/generator/config/common.d.ts +6 -0
  113. package/lib/generator/config/common.d.ts.map +1 -0
  114. package/lib/generator/config/common.js +25 -0
  115. package/lib/generator/config/index.d.ts +18 -0
  116. package/lib/generator/config/index.d.ts.map +1 -0
  117. package/lib/generator/config/index.js +43 -0
  118. package/lib/generator/config/mp.d.ts +56 -0
  119. package/lib/generator/config/mp.d.ts.map +1 -0
  120. package/lib/generator/config/mp.js +104 -0
  121. package/lib/generator/core/generate.d.ts +59 -0
  122. package/lib/generator/core/generate.d.ts.map +1 -0
  123. package/lib/generator/core/generate.js +663 -0
  124. package/lib/generator/core/index.d.ts +25 -0
  125. package/lib/generator/core/index.d.ts.map +1 -0
  126. package/lib/generator/core/index.js +102 -0
  127. package/lib/generator/core/material.d.ts +14 -0
  128. package/lib/generator/core/material.d.ts.map +1 -0
  129. package/lib/generator/core/material.js +230 -0
  130. package/lib/generator/template.d.ts +3 -0
  131. package/lib/generator/template.d.ts.map +1 -0
  132. package/lib/generator/template.js +3 -0
  133. package/lib/generator/types/common.d.ts +69 -0
  134. package/lib/generator/types/common.d.ts.map +1 -0
  135. package/lib/generator/types/common.js +21 -0
  136. package/lib/generator/util/common.d.ts +36 -0
  137. package/lib/generator/util/common.d.ts.map +1 -0
  138. package/lib/generator/util/common.js +238 -0
  139. package/lib/generator/util/console.d.ts +3 -0
  140. package/lib/generator/util/console.d.ts.map +1 -0
  141. package/lib/generator/util/console.js +17 -0
  142. package/lib/generator/util/index.d.ts +2 -0
  143. package/lib/generator/util/index.d.ts.map +1 -0
  144. package/lib/generator/util/index.js +13 -0
  145. package/lib/generator/util/name-mangler.d.ts +17 -0
  146. package/lib/generator/util/name-mangler.d.ts.map +1 -0
  147. package/lib/generator/util/name-mangler.js +63 -0
  148. package/lib/generator/util/postcss-rpx.d.ts +11 -0
  149. package/lib/generator/util/postcss-rpx.d.ts.map +1 -0
  150. package/lib/generator/util/postcss-rpx.js +16 -0
  151. package/lib/generator/util/style.d.ts +6 -0
  152. package/lib/generator/util/style.d.ts.map +1 -0
  153. package/lib/generator/util/style.js +92 -0
  154. package/lib/generator/util/weapp.d.ts +5 -0
  155. package/lib/generator/util/weapp.d.ts.map +1 -0
  156. package/lib/generator/util/weapp.js +17 -0
  157. package/lib/index.d.ts +0 -0
  158. package/lib/index.d.ts.map +0 -0
  159. package/lib/index.js +0 -0
  160. package/lib/types.d.ts +14 -0
  161. package/lib/types.d.ts.map +1 -0
  162. package/lib/types.js +19 -0
  163. package/lib/utils/common.d.ts +0 -0
  164. package/lib/utils/common.d.ts.map +0 -0
  165. package/lib/utils/common.js +0 -0
  166. package/lib/utils/dataSource.d.ts +28 -0
  167. package/lib/utils/dataSource.d.ts.map +1 -0
  168. package/lib/utils/dataSource.js +171 -0
  169. package/lib/utils/index.d.ts +0 -0
  170. package/lib/utils/index.d.ts.map +0 -0
  171. package/lib/utils/index.js +0 -0
  172. package/lib/utils/postProcess.d.ts +3 -0
  173. package/lib/utils/postProcess.d.ts.map +1 -0
  174. package/lib/utils/postProcess.js +48 -0
  175. package/lib/weapps-core/config/index.d.ts +2 -0
  176. package/lib/weapps-core/config/index.d.ts.map +1 -0
  177. package/lib/weapps-core/config/index.js +13 -0
  178. package/lib/weapps-core/config/style.d.ts +7 -0
  179. package/lib/weapps-core/config/style.d.ts.map +1 -0
  180. package/lib/weapps-core/config/style.js +70 -0
  181. package/lib/weapps-core/index.d.ts +6 -0
  182. package/lib/weapps-core/index.d.ts.map +1 -0
  183. package/lib/weapps-core/index.js +31 -0
  184. package/lib/weapps-core/types/action.d.ts +25 -0
  185. package/lib/weapps-core/types/action.d.ts.map +1 -0
  186. package/lib/weapps-core/types/action.js +28 -0
  187. package/lib/weapps-core/types/app.d.ts +142 -0
  188. package/lib/weapps-core/types/app.d.ts.map +1 -0
  189. package/lib/weapps-core/types/app.js +21 -0
  190. package/lib/weapps-core/types/appbuild.d.ts +63 -0
  191. package/lib/weapps-core/types/appbuild.d.ts.map +1 -0
  192. package/lib/weapps-core/types/appbuild.js +78 -0
  193. package/lib/weapps-core/types/code_types.d.ts +26 -0
  194. package/lib/weapps-core/types/code_types.d.ts.map +1 -0
  195. package/lib/weapps-core/types/code_types.js +2 -0
  196. package/lib/weapps-core/types/git.d.ts +7 -0
  197. package/lib/weapps-core/types/git.d.ts.map +1 -0
  198. package/lib/weapps-core/types/git.js +2 -0
  199. package/lib/weapps-core/types/index.d.ts +11 -0
  200. package/lib/weapps-core/types/index.d.ts.map +1 -0
  201. package/lib/weapps-core/types/index.js +22 -0
  202. package/lib/weapps-core/types/lowcode.d.ts +26 -0
  203. package/lib/weapps-core/types/lowcode.d.ts.map +1 -0
  204. package/lib/weapps-core/types/lowcode.js +25 -0
  205. package/lib/weapps-core/types/material.d.ts +90 -0
  206. package/lib/weapps-core/types/material.d.ts.map +1 -0
  207. package/lib/weapps-core/types/material.js +9 -0
  208. package/lib/weapps-core/types/plugins.d.ts +17 -0
  209. package/lib/weapps-core/types/plugins.d.ts.map +1 -0
  210. package/lib/weapps-core/types/plugins.js +2 -0
  211. package/lib/weapps-core/types/style.d.ts +93 -0
  212. package/lib/weapps-core/types/style.d.ts.map +1 -0
  213. package/lib/weapps-core/types/style.js +2 -0
  214. package/lib/weapps-core/types/web.d.ts +120 -0
  215. package/lib/weapps-core/types/web.d.ts.map +1 -0
  216. package/lib/weapps-core/types/web.js +2 -0
  217. package/lib/weapps-core/utils/appbuild.d.ts +6 -0
  218. package/lib/weapps-core/utils/appbuild.d.ts.map +1 -0
  219. package/lib/weapps-core/utils/appbuild.js +40 -0
  220. package/lib/weapps-core/utils/common.d.ts +16 -0
  221. package/lib/weapps-core/utils/common.d.ts.map +1 -0
  222. package/lib/weapps-core/utils/common.js +90 -0
  223. package/lib/weapps-core/utils/file.d.ts +12 -0
  224. package/lib/weapps-core/utils/file.d.ts.map +1 -0
  225. package/lib/weapps-core/utils/file.js +142 -0
  226. package/lib/weapps-core/utils/formily.d.ts +5 -0
  227. package/lib/weapps-core/utils/formily.d.ts.map +1 -0
  228. package/lib/weapps-core/utils/formily.js +416 -0
  229. package/lib/weapps-core/utils/index.d.ts +7 -0
  230. package/lib/weapps-core/utils/index.d.ts.map +1 -0
  231. package/lib/weapps-core/utils/index.js +18 -0
  232. package/lib/weapps-core/utils/lowcdoe.d.ts +4 -0
  233. package/lib/weapps-core/utils/lowcdoe.d.ts.map +1 -0
  234. package/lib/weapps-core/utils/lowcdoe.js +69 -0
  235. package/lib/weapps-core/utils/style.d.ts +17 -0
  236. package/lib/weapps-core/utils/style.d.ts.map +1 -0
  237. package/lib/weapps-core/utils/style.js +330 -0
  238. 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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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"}