@cloudbase/framework-plugin-low-code 1.7.0 → 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.
- package/package.json +3 -3
- package/lib/builder/config/common.d.ts +0 -2
- package/lib/builder/config/common.d.ts.map +0 -1
- package/lib/builder/config/common.js +0 -13
- package/lib/builder/config/index.d.ts +0 -3
- package/lib/builder/config/index.d.ts.map +0 -1
- package/lib/builder/config/index.js +0 -29
- package/lib/builder/config/mp.d.ts +0 -2
- package/lib/builder/config/mp.d.ts.map +0 -1
- package/lib/builder/config/mp.js +0 -13
- package/lib/builder/core/copy.d.ts +0 -5
- package/lib/builder/core/copy.d.ts.map +0 -1
- package/lib/builder/core/copy.js +0 -62
- package/lib/builder/core/generate.d.ts +0 -9
- package/lib/builder/core/generate.d.ts.map +0 -1
- package/lib/builder/core/generate.js +0 -128
- package/lib/builder/core/index.d.ts +0 -32
- package/lib/builder/core/index.d.ts.map +0 -1
- package/lib/builder/core/index.js +0 -149
- package/lib/builder/core/material.d.ts +0 -4
- package/lib/builder/core/material.d.ts.map +0 -1
- package/lib/builder/core/material.js +0 -80
- package/lib/builder/core/plugin.d.ts +0 -4
- package/lib/builder/core/plugin.d.ts.map +0 -1
- package/lib/builder/core/plugin.js +0 -30
- package/lib/builder/core/prepare.d.ts +0 -8
- package/lib/builder/core/prepare.d.ts.map +0 -1
- package/lib/builder/core/prepare.js +0 -108
- package/lib/builder/core/webpack.d.ts +0 -15
- package/lib/builder/core/webpack.d.ts.map +0 -1
- package/lib/builder/core/webpack.js +0 -58
- package/lib/builder/mp/BuildContext.d.ts +0 -13
- package/lib/builder/mp/BuildContext.d.ts.map +0 -1
- package/lib/builder/mp/BuildContext.js +0 -2
- package/lib/builder/mp/index.d.ts +0 -33
- package/lib/builder/mp/index.d.ts.map +0 -1
- package/lib/builder/mp/index.js +0 -450
- package/lib/builder/mp/lowcode.d.ts +0 -8
- package/lib/builder/mp/lowcode.d.ts.map +0 -1
- package/lib/builder/mp/lowcode.js +0 -54
- package/lib/builder/mp/materials.d.ts +0 -15
- package/lib/builder/mp/materials.d.ts.map +0 -1
- package/lib/builder/mp/materials.js +0 -338
- package/lib/builder/mp/mixMode.d.ts +0 -10
- package/lib/builder/mp/mixMode.d.ts.map +0 -1
- package/lib/builder/mp/mixMode.js +0 -215
- package/lib/builder/mp/mp_config.d.ts +0 -18
- package/lib/builder/mp/mp_config.d.ts.map +0 -1
- package/lib/builder/mp/mp_config.js +0 -206
- package/lib/builder/mp/util.d.ts +0 -20
- package/lib/builder/mp/util.d.ts.map +0 -1
- package/lib/builder/mp/util.js +0 -243
- package/lib/builder/mp/wxml.d.ts +0 -16
- package/lib/builder/mp/wxml.d.ts.map +0 -1
- package/lib/builder/mp/wxml.js +0 -300
- package/lib/builder/service/builder/copy.d.ts +0 -14
- package/lib/builder/service/builder/copy.d.ts.map +0 -1
- package/lib/builder/service/builder/copy.js +0 -189
- package/lib/builder/service/builder/generate.d.ts +0 -52
- package/lib/builder/service/builder/generate.d.ts.map +0 -1
- package/lib/builder/service/builder/generate.js +0 -792
- package/lib/builder/service/builder/index.d.ts +0 -16
- package/lib/builder/service/builder/index.d.ts.map +0 -1
- package/lib/builder/service/builder/index.js +0 -69
- package/lib/builder/service/builder/plugin.d.ts +0 -8
- package/lib/builder/service/builder/plugin.d.ts.map +0 -1
- package/lib/builder/service/builder/plugin.js +0 -149
- package/lib/builder/service/builder/webpack.d.ts +0 -91
- package/lib/builder/service/builder/webpack.d.ts.map +0 -1
- package/lib/builder/service/builder/webpack.js +0 -589
- package/lib/builder/types/common.d.ts +0 -12
- package/lib/builder/types/common.d.ts.map +0 -1
- package/lib/builder/types/common.js +0 -7
- package/lib/builder/util/common.d.ts +0 -36
- package/lib/builder/util/common.d.ts.map +0 -1
- package/lib/builder/util/common.js +0 -257
- package/lib/builder/util/console.d.ts +0 -2
- package/lib/builder/util/console.d.ts.map +0 -1
- package/lib/builder/util/console.js +0 -13
- package/lib/builder/util/generateFiles.d.ts +0 -6
- package/lib/builder/util/generateFiles.d.ts.map +0 -1
- package/lib/builder/util/generateFiles.js +0 -94
- package/lib/builder/util/index.d.ts +0 -2
- package/lib/builder/util/index.d.ts.map +0 -1
- package/lib/builder/util/index.js +0 -13
- package/lib/builder/util/junk.d.ts +0 -3
- package/lib/builder/util/junk.d.ts.map +0 -1
- package/lib/builder/util/junk.js +0 -25
- package/lib/builder/util/mp.d.ts +0 -5
- package/lib/builder/util/mp.d.ts.map +0 -1
- package/lib/builder/util/mp.js +0 -99
- package/lib/builder/util/name-mangler.d.ts +0 -3
- package/lib/builder/util/name-mangler.d.ts.map +0 -1
- package/lib/builder/util/name-mangler.js +0 -7
- package/lib/builder/util/net.d.ts +0 -3
- package/lib/builder/util/net.d.ts.map +0 -1
- package/lib/builder/util/net.js +0 -54
- package/lib/builder/util/process.d.ts +0 -9
- package/lib/builder/util/process.d.ts.map +0 -1
- package/lib/builder/util/process.js +0 -28
- package/lib/builder/util/style.d.ts +0 -2
- package/lib/builder/util/style.d.ts.map +0 -1
- package/lib/builder/util/style.js +0 -13
- package/lib/builder/util/weapp.d.ts +0 -2
- package/lib/builder/util/weapp.d.ts.map +0 -1
- package/lib/builder/util/weapp.js +0 -13
- package/lib/config/private.d.ts +0 -3
- package/lib/config/private.d.ts.map +0 -1
- package/lib/config/private.js +0 -14
- package/lib/generate.d.ts +0 -2
- package/lib/generate.d.ts.map +0 -1
- package/lib/generate.js +0 -49
- package/lib/generator/config/common.d.ts +0 -6
- package/lib/generator/config/common.d.ts.map +0 -1
- package/lib/generator/config/common.js +0 -25
- package/lib/generator/config/index.d.ts +0 -18
- package/lib/generator/config/index.d.ts.map +0 -1
- package/lib/generator/config/index.js +0 -43
- package/lib/generator/config/mp.d.ts +0 -56
- package/lib/generator/config/mp.d.ts.map +0 -1
- package/lib/generator/config/mp.js +0 -104
- package/lib/generator/core/generate.d.ts +0 -59
- package/lib/generator/core/generate.d.ts.map +0 -1
- package/lib/generator/core/generate.js +0 -663
- package/lib/generator/core/index.d.ts +0 -25
- package/lib/generator/core/index.d.ts.map +0 -1
- package/lib/generator/core/index.js +0 -102
- package/lib/generator/core/material.d.ts +0 -14
- package/lib/generator/core/material.d.ts.map +0 -1
- package/lib/generator/core/material.js +0 -230
- package/lib/generator/template.d.ts +0 -3
- package/lib/generator/template.d.ts.map +0 -1
- package/lib/generator/template.js +0 -3
- package/lib/generator/types/common.d.ts +0 -69
- package/lib/generator/types/common.d.ts.map +0 -1
- package/lib/generator/types/common.js +0 -21
- package/lib/generator/util/common.d.ts +0 -36
- package/lib/generator/util/common.d.ts.map +0 -1
- package/lib/generator/util/common.js +0 -238
- package/lib/generator/util/console.d.ts +0 -3
- package/lib/generator/util/console.d.ts.map +0 -1
- package/lib/generator/util/console.js +0 -17
- package/lib/generator/util/index.d.ts +0 -2
- package/lib/generator/util/index.d.ts.map +0 -1
- package/lib/generator/util/index.js +0 -13
- package/lib/generator/util/name-mangler.d.ts +0 -17
- package/lib/generator/util/name-mangler.d.ts.map +0 -1
- package/lib/generator/util/name-mangler.js +0 -63
- package/lib/generator/util/postcss-rpx.d.ts +0 -11
- package/lib/generator/util/postcss-rpx.d.ts.map +0 -1
- package/lib/generator/util/postcss-rpx.js +0 -16
- package/lib/generator/util/style.d.ts +0 -6
- package/lib/generator/util/style.d.ts.map +0 -1
- package/lib/generator/util/style.js +0 -92
- package/lib/generator/util/weapp.d.ts +0 -5
- package/lib/generator/util/weapp.d.ts.map +0 -1
- package/lib/generator/util/weapp.js +0 -17
- package/lib/types.d.ts +0 -14
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -19
- package/lib/utils/dataSource.d.ts +0 -28
- package/lib/utils/dataSource.d.ts.map +0 -1
- package/lib/utils/dataSource.js +0 -171
- package/lib/utils/postProcess.d.ts +0 -3
- package/lib/utils/postProcess.d.ts.map +0 -1
- package/lib/utils/postProcess.js +0 -48
- package/lib/weapps-core/config/index.d.ts +0 -2
- package/lib/weapps-core/config/index.d.ts.map +0 -1
- package/lib/weapps-core/config/index.js +0 -13
- package/lib/weapps-core/config/style.d.ts +0 -7
- package/lib/weapps-core/config/style.d.ts.map +0 -1
- package/lib/weapps-core/config/style.js +0 -70
- package/lib/weapps-core/index.d.ts +0 -6
- package/lib/weapps-core/index.d.ts.map +0 -1
- package/lib/weapps-core/index.js +0 -31
- package/lib/weapps-core/types/action.d.ts +0 -25
- package/lib/weapps-core/types/action.d.ts.map +0 -1
- package/lib/weapps-core/types/action.js +0 -28
- package/lib/weapps-core/types/app.d.ts +0 -142
- package/lib/weapps-core/types/app.d.ts.map +0 -1
- package/lib/weapps-core/types/app.js +0 -21
- package/lib/weapps-core/types/appbuild.d.ts +0 -63
- package/lib/weapps-core/types/appbuild.d.ts.map +0 -1
- package/lib/weapps-core/types/appbuild.js +0 -78
- package/lib/weapps-core/types/code_types.d.ts +0 -26
- package/lib/weapps-core/types/code_types.d.ts.map +0 -1
- package/lib/weapps-core/types/code_types.js +0 -2
- package/lib/weapps-core/types/git.d.ts +0 -7
- package/lib/weapps-core/types/git.d.ts.map +0 -1
- package/lib/weapps-core/types/git.js +0 -2
- package/lib/weapps-core/types/index.d.ts +0 -11
- package/lib/weapps-core/types/index.d.ts.map +0 -1
- package/lib/weapps-core/types/index.js +0 -22
- package/lib/weapps-core/types/lowcode.d.ts +0 -26
- package/lib/weapps-core/types/lowcode.d.ts.map +0 -1
- package/lib/weapps-core/types/lowcode.js +0 -25
- package/lib/weapps-core/types/material.d.ts +0 -90
- package/lib/weapps-core/types/material.d.ts.map +0 -1
- package/lib/weapps-core/types/material.js +0 -9
- package/lib/weapps-core/types/plugins.d.ts +0 -17
- package/lib/weapps-core/types/plugins.d.ts.map +0 -1
- package/lib/weapps-core/types/plugins.js +0 -2
- package/lib/weapps-core/types/style.d.ts +0 -93
- package/lib/weapps-core/types/style.d.ts.map +0 -1
- package/lib/weapps-core/types/style.js +0 -2
- package/lib/weapps-core/types/web.d.ts +0 -120
- package/lib/weapps-core/types/web.d.ts.map +0 -1
- package/lib/weapps-core/types/web.js +0 -2
- package/lib/weapps-core/utils/appbuild.d.ts +0 -6
- package/lib/weapps-core/utils/appbuild.d.ts.map +0 -1
- package/lib/weapps-core/utils/appbuild.js +0 -40
- package/lib/weapps-core/utils/common.d.ts +0 -16
- package/lib/weapps-core/utils/common.d.ts.map +0 -1
- package/lib/weapps-core/utils/common.js +0 -90
- package/lib/weapps-core/utils/file.d.ts +0 -12
- package/lib/weapps-core/utils/file.d.ts.map +0 -1
- package/lib/weapps-core/utils/file.js +0 -142
- package/lib/weapps-core/utils/formily.d.ts +0 -5
- package/lib/weapps-core/utils/formily.d.ts.map +0 -1
- package/lib/weapps-core/utils/formily.js +0 -416
- package/lib/weapps-core/utils/index.d.ts +0 -7
- package/lib/weapps-core/utils/index.d.ts.map +0 -1
- package/lib/weapps-core/utils/index.js +0 -18
- package/lib/weapps-core/utils/lowcdoe.d.ts +0 -4
- package/lib/weapps-core/utils/lowcdoe.d.ts.map +0 -1
- package/lib/weapps-core/utils/lowcdoe.js +0 -69
- package/lib/weapps-core/utils/style.d.ts +0 -17
- package/lib/weapps-core/utils/style.d.ts.map +0 -1
- package/lib/weapps-core/utils/style.js +0 -330
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/framework-plugin-low-code",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@cloudbase/cals": "^1.0.
|
|
38
|
+
"@cloudbase/cals": "^1.0.7",
|
|
39
39
|
"@cloudbase/framework-core": "^1.8.16",
|
|
40
40
|
"@cloudbase/framework-plugin-auth": "^1.8.16",
|
|
41
41
|
"@cloudbase/framework-plugin-website": "^1.8.17",
|
|
42
|
-
"@cloudbase/lowcode-builder": "1.8.
|
|
42
|
+
"@cloudbase/lowcode-builder": "1.8.2",
|
|
43
43
|
"@cloudbase/lowcode-deployer": "^1.3.0",
|
|
44
44
|
"@formily/react-schema-renderer": "1.1.7",
|
|
45
45
|
"archiver": "^4.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/builder/config/common.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,13 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("../../generator/config/common"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/config/index.ts"],"names":[],"mappings":"AAGA,cAAc,8BAA8B,CAAC;AAC7C,eAAO,MAAM,kBAAkB,QAA+C,CAAC"}
|
|
@@ -1,29 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
22
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.sharedMaterialsDir = void 0;
|
|
26
|
-
const path = __importStar(require("path"));
|
|
27
|
-
const os = __importStar(require("os"));
|
|
28
|
-
__exportStar(require("../../generator/config/index"), exports);
|
|
29
|
-
exports.sharedMaterialsDir = path.join(os.homedir(), '.weapps-materials');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mp.d.ts","sourceRoot":"","sources":["../../../src/builder/config/mp.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
package/lib/builder/config/mp.js
DELETED
|
@@ -1,13 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("../../generator/config/mp"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/builder/core/copy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAM7D,wBAAsB,OAAO,CAC3B,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,kBAAkB,EACrC,OAAO,EAAE;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,iBAwBpC"}
|
package/lib/builder/core/copy.js
DELETED
|
@@ -1,62 +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.runCopy = void 0;
|
|
35
|
-
const path = __importStar(require("path"));
|
|
36
|
-
const fs_extra_1 = require("fs-extra");
|
|
37
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
38
|
-
const copy_1 = require("../service/builder/copy");
|
|
39
|
-
const config_1 = require("../config");
|
|
40
|
-
function runCopy(appBuildDir, webRuntimeAppData, options) {
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const timeTag = '-------------------- runCopy ';
|
|
43
|
-
console.time(timeTag);
|
|
44
|
-
const srcFiles = [
|
|
45
|
-
'src/index.less',
|
|
46
|
-
'src/handlers',
|
|
47
|
-
'src/utils',
|
|
48
|
-
'html',
|
|
49
|
-
'webpack',
|
|
50
|
-
'src/libraries',
|
|
51
|
-
];
|
|
52
|
-
console.log(chalk_1.default.blue.bold('Copying files:'));
|
|
53
|
-
for (const entry of srcFiles) {
|
|
54
|
-
const dstFile = path.join(appBuildDir, entry);
|
|
55
|
-
console.log(dstFile);
|
|
56
|
-
yield (0, fs_extra_1.copy)(path.join(config_1.appTemplateDir, entry), dstFile);
|
|
57
|
-
}
|
|
58
|
-
yield (0, copy_1.copyEntryFile)(appBuildDir, webRuntimeAppData, options.adminPortalKey);
|
|
59
|
-
console.timeEnd(timeTag);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
exports.runCopy = runCopy;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IMaterialItem, IWebRuntimeAppData } from '../../weapps-core';
|
|
2
|
-
import { BuildType } from '../types/common';
|
|
3
|
-
import { DEPLOY_MODE, RUNTIME } from '../../types';
|
|
4
|
-
export declare function runGenerateCore(appBuildDir: string, appData: IWebRuntimeAppData, subAppDataList: IWebRuntimeAppData[] | undefined, dependencies: IMaterialItem[] | undefined, appKey: string, basename: string, buildTypeList: BuildType[], deployMode: DEPLOY_MODE, runtime: RUNTIME | undefined, ignoreInstall: boolean | undefined, extraData: {
|
|
5
|
-
isComposite: boolean;
|
|
6
|
-
compProps: any;
|
|
7
|
-
} | undefined, domain: string): Promise<void>;
|
|
8
|
-
export declare function generatePackageJSON(dependencies: object | undefined, appBuildDir: string, appKey: any): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/builder/core/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAgBnD,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,EAC3B,cAAc,kCAA2B,EACzC,YAAY,6BAAsB,EAClC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,SAAS,EAAE,EAC1B,UAAU,EAAE,WAAW,EACvB,OAAO,qBAAwB,EAC/B,aAAa,qBAAQ,EACrB,SAAS;iBACM,OAAO;eACT,GAAG;aAIf,EACD,MAAM,EAAE,MAAM,iBAwEf;AACD,wBAAsB,mBAAmB,CAAC,YAAY,oBAAa,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,KAAA,iBAM/F"}
|
|
@@ -1,128 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.generatePackageJSON = exports.runGenerateCore = void 0;
|
|
16
|
-
const generate_1 = require("../service/builder/generate");
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const webpack_1 = require("../service/builder/webpack");
|
|
19
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
20
|
-
const console_1 = require("../util/console");
|
|
21
|
-
const config_1 = require("../config");
|
|
22
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
23
|
-
const types_1 = require("../../types");
|
|
24
|
-
const lodash_template_1 = __importDefault(require("lodash.template"));
|
|
25
|
-
const util_1 = require("../util");
|
|
26
|
-
let lastDeps = null;
|
|
27
|
-
function isInLastDeps(deps) {
|
|
28
|
-
for (const i in deps) {
|
|
29
|
-
if (!lastDeps || !(lastDeps === null || lastDeps === void 0 ? void 0 : lastDeps[i]) || (lastDeps === null || lastDeps === void 0 ? void 0 : lastDeps[i]) !== deps[i]) {
|
|
30
|
-
(0, console_1.log)(`package.json ${i}:${deps[i]} 和 上一次依赖${lastDeps === null || lastDeps === void 0 ? void 0 : lastDeps[i]} 不一致, 重新安装依赖...`);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
function runGenerateCore(appBuildDir, appData, subAppDataList = [], dependencies = [], appKey, basename, buildTypeList, deployMode, runtime = types_1.RUNTIME.NONE, ignoreInstall = false, extraData = {
|
|
37
|
-
isComposite: false,
|
|
38
|
-
compProps: {},
|
|
39
|
-
}, domain) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const timeTag = '-------------------- runGenerateCore';
|
|
42
|
-
console.time(timeTag);
|
|
43
|
-
const allAppDataList = subAppDataList.concat(appData);
|
|
44
|
-
const deps = {};
|
|
45
|
-
allAppDataList.forEach((app) => {
|
|
46
|
-
Object.entries(app.npmDependencies).forEach(([name, version]) => {
|
|
47
|
-
deps[name] = version;
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
dependencies.forEach((compLb) => {
|
|
51
|
-
if (compLb.isComposite && compLb.compLibCommonResource) {
|
|
52
|
-
Object.assign(deps, compLb.compLibCommonResource.npm);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
yield Promise.all(allAppDataList.map((data) => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
const { pageInstanceList, rootPath = '' } = data;
|
|
58
|
-
const appName = rootPath ? `Sub app ${rootPath}` : 'Main app';
|
|
59
|
-
console.log(chalk_1.default.blue.bold(`Generating files for ${appName}`));
|
|
60
|
-
const dstDir = path_1.default.join(appBuildDir, 'src', rootPath ? `${rootPath}` : '');
|
|
61
|
-
yield copy(['app/mountMpApis.js', 'app/mountAppApis.js', 'datasources'], dstDir);
|
|
62
|
-
const tplStr = yield fs_extra_1.default.readFile(path_1.default.join(config_1.appTemplateDir, 'src/app/global-api.js'), {
|
|
63
|
-
encoding: 'utf8',
|
|
64
|
-
});
|
|
65
|
-
const globalApiContent = (0, lodash_template_1.default)(tplStr, { interpolate: /<%=([\s\S]+?)%>/g })({
|
|
66
|
-
appId: appKey,
|
|
67
|
-
subPackageName: rootPath,
|
|
68
|
-
domain,
|
|
69
|
-
appConfig: (0, util_1.JsonToStringWithVariableName)({
|
|
70
|
-
id: appKey,
|
|
71
|
-
envId: appData.envId,
|
|
72
|
-
clientId: (_a = appData.extra) === null || _a === void 0 ? void 0 : _a.clientId,
|
|
73
|
-
loginConfigVersion: (_b = appData.extra) === null || _b === void 0 ? void 0 : _b.loginConfigVersion,
|
|
74
|
-
staticResourceDomain: domain || '',
|
|
75
|
-
envVersion: deployMode === types_1.DEPLOY_MODE.UPLOAD ? 'production' : 'preview',
|
|
76
|
-
pages: pageInstanceList
|
|
77
|
-
.sort((item) => (item.isHome ? -1 : 1))
|
|
78
|
-
.map((item) => {
|
|
79
|
-
var _a;
|
|
80
|
-
return ({
|
|
81
|
-
id: item.id,
|
|
82
|
-
type: ((_a = item.data) === null || _a === void 0 ? void 0 : _a.isCustomLoginPage) ? 'login' : '',
|
|
83
|
-
});
|
|
84
|
-
}),
|
|
85
|
-
}),
|
|
86
|
-
});
|
|
87
|
-
yield fs_extra_1.default.writeFile(path_1.default.join(dstDir, 'app/global-api.js'), globalApiContent);
|
|
88
|
-
yield (0, generate_1.generateAllPageJsxFile)(pageInstanceList, dstDir, rootPath, dependencies, extraData, buildTypeList);
|
|
89
|
-
yield (0, generate_1.generateCodeFromTpl)(data, dstDir, dependencies, appKey, rootPath, deployMode, buildTypeList, extraData);
|
|
90
|
-
yield (0, generate_1.writeLowCodeFiles)(data, dstDir);
|
|
91
|
-
})));
|
|
92
|
-
yield (0, generate_1.generateRouterFile)(allAppDataList, appBuildDir, basename, buildTypeList);
|
|
93
|
-
yield (0, generate_1.generateAppStyleLessFile)(allAppDataList, appBuildDir);
|
|
94
|
-
yield (0, generate_1.generateThemeVarsFile)(appData.themeVars, appBuildDir);
|
|
95
|
-
if (lastDeps && isInLastDeps(deps)) {
|
|
96
|
-
(0, console_1.notice)('package.json dependencies 已经安装,如出现未安装成功或找不到依赖,请重启wa watch');
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
yield generatePackageJSON(deps, appBuildDir, appKey);
|
|
100
|
-
yield (0, webpack_1.installDependencies)(appBuildDir, {
|
|
101
|
-
runtime,
|
|
102
|
-
ignoreInstall,
|
|
103
|
-
});
|
|
104
|
-
lastDeps = deps;
|
|
105
|
-
}
|
|
106
|
-
console.timeEnd(timeTag);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
exports.runGenerateCore = runGenerateCore;
|
|
110
|
-
function generatePackageJSON(dependencies = {}, appBuildDir, appKey) {
|
|
111
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
const packageInfo = fs_extra_1.default.readJSONSync(path_1.default.join(config_1.appTemplateDir, 'package.json'));
|
|
113
|
-
packageInfo.dependencies = Object.assign(Object.assign({}, packageInfo.dependencies), dependencies);
|
|
114
|
-
packageInfo.name = `WeDa-${appKey}`;
|
|
115
|
-
const dstFilePath = path_1.default.join(appBuildDir, 'package.json');
|
|
116
|
-
yield fs_extra_1.default.writeFile(dstFilePath, JSON.stringify(packageInfo, null, '\t'));
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
exports.generatePackageJSON = generatePackageJSON;
|
|
120
|
-
function copy(srcFiles, dstDir) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
for (const entry of srcFiles) {
|
|
123
|
-
const dstFile = path_1.default.join(dstDir, entry);
|
|
124
|
-
console.log(dstFile);
|
|
125
|
-
yield fs_extra_1.default.copy(path_1.default.join(config_1.appTemplateDir, 'src', entry), dstFile);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IMaterialItem, IWeAppData, IPlugin } from '../../weapps-core';
|
|
2
|
-
import { BuildType, GenerateMpType, WebpackBuildCallBack, WebpackModeType } from '../types/common';
|
|
3
|
-
import { DEPLOY_MODE, RUNTIME } from '../../types';
|
|
4
|
-
export declare type BuildAppProps = {
|
|
5
|
-
dependencies: IMaterialItem[];
|
|
6
|
-
mainAppSerializeData?: IWeAppData;
|
|
7
|
-
subAppSerializeDataList?: IWeAppData[];
|
|
8
|
-
appKey: string;
|
|
9
|
-
nodeModulesPath: string;
|
|
10
|
-
publicPath?: string;
|
|
11
|
-
buildTypeList: BuildType[];
|
|
12
|
-
mode?: WebpackModeType;
|
|
13
|
-
watch?: boolean;
|
|
14
|
-
generateMpType: GenerateMpType;
|
|
15
|
-
generateMpPath?: string;
|
|
16
|
-
isCleanDistDir?: boolean;
|
|
17
|
-
plugins?: IPlugin[];
|
|
18
|
-
extraData?: {
|
|
19
|
-
isComposite: boolean;
|
|
20
|
-
compProps: any;
|
|
21
|
-
};
|
|
22
|
-
domain: string;
|
|
23
|
-
};
|
|
24
|
-
export declare function buildWebApp({ mainAppSerializeData, subAppSerializeDataList, dependencies, appKey, nodeModulesPath, runtime, ignoreInstall, buildTypeList, mode, deployMode, watch, generateMpType, generateMpPath, isCleanDistDir, plugins, extraData, isCrossAccount, resourceAppid, domain, }: BuildAppProps & {
|
|
25
|
-
deployMode: DEPLOY_MODE;
|
|
26
|
-
runtime: RUNTIME;
|
|
27
|
-
ignoreInstall: boolean;
|
|
28
|
-
isCrossAccount: boolean;
|
|
29
|
-
resourceAppid?: string;
|
|
30
|
-
}, cb?: WebpackBuildCallBack): Promise<string | undefined>;
|
|
31
|
-
export default buildWebApp;
|
|
32
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/builder/core/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAe,UAAU,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAQnG,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAInD,oBAAY,aAAa,GAAG;IAC1B,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,uBAAuB,CAAC,EAAE,UAAU,EAAE,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE;QACV,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,GAAG,CAAC;KAChB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,WAAW,CAC/B,EACE,oBAAoB,EACpB,uBAA4B,EAC5B,YAAY,EACZ,MAAe,EACf,eAAe,EACf,OAAsB,EACtB,aAAqB,EACrB,aAA+B,EAC/B,IAAiC,EACjC,UAAgC,EAChC,KAAa,EACb,cAAmC,EACnC,cAAmB,EACnB,cAAsB,EACtB,OAAY,EACZ,SAGC,EACD,cAAsB,EACtB,aAAyB,EACzB,MAAW,GACZ,EAAE,aAAa,GAAG;IACjB,UAAU,EAAE,WAAW,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,EACD,EAAE,CAAC,EAAE,oBAAoB,+BA0J1B;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,149 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.buildWebApp = void 0;
|
|
16
|
-
const webpack_1 = require("../service/builder/webpack");
|
|
17
|
-
const builder_1 = require("../service/builder");
|
|
18
|
-
const weapps_core_1 = require("../../weapps-core");
|
|
19
|
-
const generate_1 = require("./generate");
|
|
20
|
-
const material_1 = require("./material");
|
|
21
|
-
const copy_1 = require("./copy");
|
|
22
|
-
const prepare_1 = require("./prepare");
|
|
23
|
-
const webpack_2 = require("./webpack");
|
|
24
|
-
const index_1 = require("../mp/index");
|
|
25
|
-
const path_1 = __importDefault(require("path"));
|
|
26
|
-
const types_1 = require("../../types");
|
|
27
|
-
const mixMode_1 = require("../mp/mixMode");
|
|
28
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
29
|
-
function buildWebApp({ mainAppSerializeData, subAppSerializeDataList = [], dependencies, appKey = 'test', nodeModulesPath, runtime = types_1.RUNTIME.NONE, ignoreInstall = false, buildTypeList = ["web"], mode = "production", deployMode = types_1.DEPLOY_MODE.PREVIEW, watch = false, generateMpType = "app", generateMpPath = '', isCleanDistDir = false, plugins = [], extraData = {
|
|
30
|
-
isComposite: false,
|
|
31
|
-
compProps: {},
|
|
32
|
-
}, isCrossAccount = false, resourceAppid = undefined, domain = '', }, cb) {
|
|
33
|
-
var _a;
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
if (!mainAppSerializeData) {
|
|
36
|
-
console.error('无效的应用配置');
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
console.log('domain', domain);
|
|
40
|
-
console.log('应用名', appKey);
|
|
41
|
-
console.log('生成模式', generateMpType);
|
|
42
|
-
if (generateMpType === "subpackage") {
|
|
43
|
-
console.log('主包项目路径', generateMpPath);
|
|
44
|
-
}
|
|
45
|
-
let { appBuildDir, materialsDir } = runtime === types_1.RUNTIME.CI ? (0, builder_1.getCompileDirs)('app') : (0, builder_1.getCompileDirs)(appKey);
|
|
46
|
-
const startTime = Date.now();
|
|
47
|
-
if (buildTypeList.includes("mp")) {
|
|
48
|
-
appBuildDir = path_1.default.join(appBuildDir, 'mp');
|
|
49
|
-
const isMixMode = generateMpType === "subpackage";
|
|
50
|
-
const apps = [mainAppSerializeData, ...subAppSerializeDataList];
|
|
51
|
-
try {
|
|
52
|
-
const result = yield (0, index_1.generateWxMp)({
|
|
53
|
-
weapps: apps,
|
|
54
|
-
projDir: appBuildDir,
|
|
55
|
-
appId: appKey,
|
|
56
|
-
domain: domain,
|
|
57
|
-
materials: dependencies,
|
|
58
|
-
plugins,
|
|
59
|
-
isProduction: mode === "production",
|
|
60
|
-
deployMode,
|
|
61
|
-
extraData,
|
|
62
|
-
isMixMode,
|
|
63
|
-
options: { isCrossAccount: !!isCrossAccount, resourceAppid },
|
|
64
|
-
buildTypeList,
|
|
65
|
-
});
|
|
66
|
-
if (isMixMode) {
|
|
67
|
-
generateMpPath = appBuildDir;
|
|
68
|
-
console.log(chalk_1.default.green('【混合模式】'), generateMpPath);
|
|
69
|
-
yield (0, mixMode_1.handleMixMode)({
|
|
70
|
-
apps,
|
|
71
|
-
generateMpPath,
|
|
72
|
-
miniprogramRoot: result.miniprogramRoot,
|
|
73
|
-
plugins,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
cb === null || cb === void 0 ? void 0 : cb(null, Object.assign(Object.assign({}, result), { outDir: isMixMode && generateMpPath ? generateMpPath : appBuildDir, timeElapsed: Date.now() - startTime }));
|
|
77
|
-
return appBuildDir;
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
console.log('generateWxMp error', e);
|
|
81
|
-
cb && cb(e);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
appBuildDir = path_1.default.join(appBuildDir, 'h5');
|
|
87
|
-
const mainAppData = (0, weapps_core_1.deserialize)(mainAppSerializeData);
|
|
88
|
-
const subAppDataList = subAppSerializeDataList.map((sub) => (0, weapps_core_1.deserialize)(sub));
|
|
89
|
-
const buildContext = {
|
|
90
|
-
projDir: appBuildDir,
|
|
91
|
-
appId: appKey,
|
|
92
|
-
isProduction: mode === "production",
|
|
93
|
-
materialLibs: dependencies,
|
|
94
|
-
isMixMode: false,
|
|
95
|
-
domain,
|
|
96
|
-
mainAppData: mainAppSerializeData,
|
|
97
|
-
};
|
|
98
|
-
const { allAppUsedComps } = (0, index_1.handleUsedComponents)({
|
|
99
|
-
buildContext,
|
|
100
|
-
weapps: [mainAppSerializeData, ...subAppSerializeDataList],
|
|
101
|
-
materials: dependencies,
|
|
102
|
-
});
|
|
103
|
-
const { publicPath, basename, assets = '' } = ((_a = mainAppData.appConfig) === null || _a === void 0 ? void 0 : _a.window) || {};
|
|
104
|
-
const projectConfig = yield (0, prepare_1.runPrepare)(buildTypeList, appBuildDir, isCleanDistDir);
|
|
105
|
-
const mpConfig = yield (0, webpack_1.extractAndRemoveKbConfig)(mainAppData, subAppDataList, appBuildDir);
|
|
106
|
-
const jsAssets = assets.split(',').map((item) => { var _a; return (_a = (item || '')) === null || _a === void 0 ? void 0 : _a.trim(); });
|
|
107
|
-
yield (0, copy_1.runCopy)(appBuildDir, mainAppData, {
|
|
108
|
-
adminPortalKey: deployMode === types_1.DEPLOY_MODE.PREVIEW ? `${appKey}-preview` : appKey,
|
|
109
|
-
});
|
|
110
|
-
const runHandleMaterialTag = '======= buildWebApp-runHandleMaterial';
|
|
111
|
-
console.time(runHandleMaterialTag);
|
|
112
|
-
const filteredDependiences = dependencies.filter((lib) => {
|
|
113
|
-
if (!allAppUsedComps[lib.name]) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
yield (0, material_1.runHandleMaterial)(appBuildDir, filteredDependiences, materialsDir, runtime, ignoreInstall);
|
|
121
|
-
console.timeEnd(runHandleMaterialTag);
|
|
122
|
-
yield (0, generate_1.runGenerateCore)(appBuildDir, mainAppData, subAppDataList, filteredDependiences, appKey, basename, buildTypeList, deployMode, runtime, ignoreInstall, extraData, domain);
|
|
123
|
-
const doneCallback = (0, prepare_1.createDoneCallBack)({ appBuildDir, projectConfig }, cb);
|
|
124
|
-
yield (0, webpack_2.runWebpackCore)({
|
|
125
|
-
appBuildDir,
|
|
126
|
-
mainAppData,
|
|
127
|
-
subAppDataList,
|
|
128
|
-
materialsDir,
|
|
129
|
-
dependencies: filteredDependiences,
|
|
130
|
-
nodeModulesPath,
|
|
131
|
-
publicPath,
|
|
132
|
-
mode,
|
|
133
|
-
watch,
|
|
134
|
-
appKey,
|
|
135
|
-
cb: doneCallback,
|
|
136
|
-
mpConfig,
|
|
137
|
-
buildTypeList,
|
|
138
|
-
generateMpType,
|
|
139
|
-
generateMpPath,
|
|
140
|
-
plugins,
|
|
141
|
-
assets: jsAssets,
|
|
142
|
-
domain,
|
|
143
|
-
});
|
|
144
|
-
return appBuildDir;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
exports.buildWebApp = buildWebApp;
|
|
149
|
-
exports.default = buildWebApp;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IMaterialItem } from '../../weapps-core';
|
|
2
|
-
import { RUNTIME } from '../../types';
|
|
3
|
-
export declare function runHandleMaterial(appBuildDir: string, dependencies: IMaterialItem[] | undefined, materialsDir: string, runtime?: RUNTIME, ignoreInstall?: boolean): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=material.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material.d.ts","sourceRoot":"","sources":["../../../src/builder/core/material.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQlD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,YAAY,6BAAsB,EAClC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,OAAsB,EAC/B,aAAa,GAAE,OAAe,iBAU/B"}
|
|
@@ -1,80 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.runHandleMaterial = void 0;
|
|
32
|
-
const path = __importStar(require("path"));
|
|
33
|
-
const webpack_1 = require("../service/builder/webpack");
|
|
34
|
-
const copy_1 = require("../service/builder/copy");
|
|
35
|
-
const generate_1 = require("../service/builder/generate");
|
|
36
|
-
const util_1 = require("../util");
|
|
37
|
-
const types_1 = require("../../types");
|
|
38
|
-
function runHandleMaterial(appBuildDir, dependencies = [], materialsDir, runtime = types_1.RUNTIME.NONE, ignoreInstall = false) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
yield handleNormalMaterial({
|
|
41
|
-
dependencies,
|
|
42
|
-
materialsDir,
|
|
43
|
-
appBuildDir,
|
|
44
|
-
runtime,
|
|
45
|
-
ignoreInstall,
|
|
46
|
-
});
|
|
47
|
-
yield handleCompositeComponent({ dependencies, appBuildDir });
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
exports.runHandleMaterial = runHandleMaterial;
|
|
51
|
-
function handleNormalMaterial({ dependencies, materialsDir, appBuildDir, runtime, ignoreInstall, }) {
|
|
52
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const timeTag = '-------------------- handleNormalMaterial';
|
|
54
|
-
console.time(timeTag);
|
|
55
|
-
const normalDependencies = dependencies.filter((item) => !item.isComposite);
|
|
56
|
-
yield (0, webpack_1.downloadAndInstallDependencies)(normalDependencies, materialsDir, {
|
|
57
|
-
runtime,
|
|
58
|
-
ignoreInstall,
|
|
59
|
-
});
|
|
60
|
-
yield (0, copy_1.copyMaterialLibraries)(normalDependencies, materialsDir, appBuildDir);
|
|
61
|
-
console.timeEnd(timeTag);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function handleCompositeComponent({ dependencies, appBuildDir }) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
console.time('handleCompositeComponent');
|
|
67
|
-
const compositeDependencies = dependencies.filter((item) => item.isComposite);
|
|
68
|
-
const materialGroupInfoMap = {};
|
|
69
|
-
dependencies.forEach((item) => (materialGroupInfoMap[item.name] = {
|
|
70
|
-
isComposite: item.isComposite,
|
|
71
|
-
version: item.version,
|
|
72
|
-
entries: item.entries,
|
|
73
|
-
schemaVersion: item.schemaVersion,
|
|
74
|
-
}));
|
|
75
|
-
const componentsMeta = yield (0, util_1.getComponentsInfo)(path.join(appBuildDir, 'src'), dependencies);
|
|
76
|
-
yield (0, generate_1.writeLowCodeFilesForCompositeComp)(compositeDependencies, appBuildDir);
|
|
77
|
-
yield (0, copy_1.genCompositeComponentLibraries)(compositeDependencies, appBuildDir, materialGroupInfoMap, componentsMeta);
|
|
78
|
-
console.timeEnd('handleCompositeComponent');
|
|
79
|
-
});
|
|
80
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { IPlugin } from '../../weapps-core';
|
|
2
|
-
export declare function runHandleMpPlugin(appBuildDir: string, plugins: IPlugin[]): Promise<void>;
|
|
3
|
-
export declare function runHandleKbonePlugin(appBuildDir: string, plugins: IPlugin[], mpConfig: any): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/builder/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAY3C,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,iBAI9E;AAGD,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,GAAG,iBAKhG"}
|
|
@@ -1,30 +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.runHandleKbonePlugin = exports.runHandleMpPlugin = void 0;
|
|
13
|
-
const plugin_1 = require("../service/builder/plugin");
|
|
14
|
-
function runHandleMpPlugin(appBuildDir, plugins) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
console.time('runHandleMpPlugin');
|
|
17
|
-
yield (0, plugin_1.installMpPlugin)(appBuildDir, plugins);
|
|
18
|
-
console.timeEnd('runHandleMpPlugin');
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.runHandleMpPlugin = runHandleMpPlugin;
|
|
22
|
-
function runHandleKbonePlugin(appBuildDir, plugins, mpConfig) {
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
console.time('runHandleKbonePlugin');
|
|
25
|
-
yield (0, plugin_1.installKbonePlugin)(appBuildDir, plugins);
|
|
26
|
-
yield (0, plugin_1.mergeKbonePluginConfig)(appBuildDir, plugins, mpConfig);
|
|
27
|
-
console.timeEnd('runHandleKbonePlugin');
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
exports.runHandleKbonePlugin = runHandleKbonePlugin;
|