@cloudbase/framework-plugin-low-code 1.7.1 → 1.7.2

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