@teams-max/mwsp 1.0.0 → 1.0.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/es/cli/build.js +24 -23
- package/lib/cli/build.js +4 -9
- package/package.json +1 -1
package/es/cli/build.js
CHANGED
|
@@ -7,7 +7,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
7
7
|
import * as logger from '@umijs/utils/dist/logger';
|
|
8
8
|
import { assert } from "../internal/utils";
|
|
9
9
|
import 'zx/globals';
|
|
10
|
-
import buildNotify from
|
|
10
|
+
// import buildNotify from '../internal/buildNotify';
|
|
11
11
|
import yArgs from '@umijs/utils/compiled/yargs-parser';
|
|
12
12
|
import { join } from 'path';
|
|
13
13
|
var args = yArgs(process.argv.slice(2));
|
|
@@ -23,7 +23,7 @@ export default function build() {
|
|
|
23
23
|
// });
|
|
24
24
|
function _build() {
|
|
25
25
|
_build = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
26
|
-
var pnpmVersion, pkg, entryApp,
|
|
26
|
+
var pnpmVersion, pkg, entryApp, subApp, versionUrl, entryEnv;
|
|
27
27
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
28
|
while (1) switch (_context.prev = _context.next) {
|
|
29
29
|
case 0:
|
|
@@ -36,43 +36,44 @@ function _build() {
|
|
|
36
36
|
assert(!pnpmVersion.includes('not found'), 'pnpm: command not found please use npm install -g pnpm');
|
|
37
37
|
pkg = require(join(cwd, 'package.json'));
|
|
38
38
|
entryApp = args.app || args.App || args.APP || pkg.name;
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
subApp = args.subApp || args.SUB_APP || '';
|
|
40
|
+
versionUrl = args.versionUrl || args.RESOURCE_URL || '';
|
|
41
|
+
entryEnv = args.env || args.ENV || ''; // let entryJenkinsBuild =
|
|
42
|
+
// args.jenkinsBuild || args.JENKINSBUILD || args.jenkins_build || args.JENKINS_BUILD;
|
|
41
43
|
entryApp = entryApp;
|
|
42
44
|
entryEnv = entryEnv;
|
|
43
45
|
assert(entryApp, "Build failed, please select the application first.");
|
|
44
46
|
assert(entryEnv, "Build failed, A build environment is a must.");
|
|
45
47
|
logger.info("Start: APP:".concat(entryApp, " ENV:").concat(entryEnv));
|
|
46
48
|
process.env.MAX_APP_ENV = entryEnv;
|
|
49
|
+
process.env.MAX_SUB_APP = subApp;
|
|
50
|
+
process.env.RESOURCE_URL = versionUrl;
|
|
47
51
|
process.env.BABEL_ENV = entryEnv !== 'production' ? 'development' : 'production';
|
|
48
52
|
process.env.MAX_APP_TYPE = 'max', process.env.MAX_APP_KEY = pkg.appKey || "";
|
|
49
|
-
entryJenkinsBuild && buildNotify({
|
|
50
|
-
args: args,
|
|
51
|
-
appList: [entryApp],
|
|
52
|
-
environment: [entryEnv]
|
|
53
|
-
});
|
|
53
|
+
// entryJenkinsBuild && buildNotify({ args, appList: [entryApp], environment: [entryEnv] });
|
|
54
54
|
logger.event('max build');
|
|
55
55
|
if (!(entryEnv === 'development')) {
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.next = 26;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 24;
|
|
60
60
|
return $(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["max build"])));
|
|
61
|
-
case 22:
|
|
62
|
-
_context.next = 26;
|
|
63
|
-
break;
|
|
64
61
|
case 24:
|
|
65
|
-
_context.next =
|
|
66
|
-
|
|
62
|
+
_context.next = 28;
|
|
63
|
+
break;
|
|
67
64
|
case 26:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
args: args,
|
|
71
|
-
appList: [entryApp],
|
|
72
|
-
environment: [entryEnv],
|
|
73
|
-
buildStatus: 'success'
|
|
74
|
-
});
|
|
65
|
+
_context.next = 28;
|
|
66
|
+
return $(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["max build && rm -fr ./dist/*.map"])));
|
|
75
67
|
case 28:
|
|
68
|
+
logger.info("Success: APP:".concat(entryApp, " ENV:").concat(entryEnv));
|
|
69
|
+
// entryJenkinsBuild &&
|
|
70
|
+
// buildNotify({
|
|
71
|
+
// args,
|
|
72
|
+
// appList: [entryApp],
|
|
73
|
+
// environment: [entryEnv],
|
|
74
|
+
// buildStatus: 'success',
|
|
75
|
+
// });
|
|
76
|
+
case 29:
|
|
76
77
|
case "end":
|
|
77
78
|
return _context.stop();
|
|
78
79
|
}
|
package/lib/cli/build.js
CHANGED
|
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(build_exports);
|
|
|
35
35
|
var logger = __toESM(require("@umijs/utils/dist/logger"));
|
|
36
36
|
var import_utils = require("../internal/utils");
|
|
37
37
|
var import_globals = require("zx/globals");
|
|
38
|
-
var import_buildNotify = __toESM(require("../internal/buildNotify"));
|
|
39
38
|
var import_yargs_parser = __toESM(require("@umijs/utils/compiled/yargs-parser"));
|
|
40
39
|
var import_path = require("path");
|
|
41
40
|
var args = (0, import_yargs_parser.default)(process.argv.slice(2));
|
|
@@ -49,8 +48,9 @@ async function build() {
|
|
|
49
48
|
);
|
|
50
49
|
const pkg = require((0, import_path.join)(cwd, "package.json"));
|
|
51
50
|
let entryApp = args.app || args.App || args.APP || pkg.name;
|
|
51
|
+
let subApp = args.subApp || args.SUB_APP || "";
|
|
52
|
+
let versionUrl = args.versionUrl || args.RESOURCE_URL || "";
|
|
52
53
|
let entryEnv = args.env || args.ENV || "";
|
|
53
|
-
let entryJenkinsBuild = args.jenkinsBuild || args.JENKINSBUILD || args.jenkins_build || args.JENKINS_BUILD;
|
|
54
54
|
entryApp = entryApp;
|
|
55
55
|
entryEnv = entryEnv;
|
|
56
56
|
(0, import_utils.assert)(
|
|
@@ -63,9 +63,10 @@ async function build() {
|
|
|
63
63
|
);
|
|
64
64
|
logger.info(`Start: APP:${entryApp} ENV:${entryEnv}`);
|
|
65
65
|
process.env.MAX_APP_ENV = entryEnv;
|
|
66
|
+
process.env.MAX_SUB_APP = subApp;
|
|
67
|
+
process.env.RESOURCE_URL = versionUrl;
|
|
66
68
|
process.env.BABEL_ENV = entryEnv !== "production" ? "development" : "production";
|
|
67
69
|
process.env.MAX_APP_TYPE = "max", process.env.MAX_APP_KEY = pkg.appKey || "";
|
|
68
|
-
entryJenkinsBuild && (0, import_buildNotify.default)({ args, appList: [entryApp], environment: [entryEnv] });
|
|
69
70
|
logger.event("max build");
|
|
70
71
|
if (entryEnv === "development") {
|
|
71
72
|
await $`max build`;
|
|
@@ -73,12 +74,6 @@ async function build() {
|
|
|
73
74
|
await $`max build && rm -fr ./dist/*.map`;
|
|
74
75
|
}
|
|
75
76
|
logger.info(`Success: APP:${entryApp} ENV:${entryEnv}`);
|
|
76
|
-
entryJenkinsBuild && (0, import_buildNotify.default)({
|
|
77
|
-
args,
|
|
78
|
-
appList: [entryApp],
|
|
79
|
-
environment: [entryEnv],
|
|
80
|
-
buildStatus: "success"
|
|
81
|
-
});
|
|
82
77
|
}
|
|
83
78
|
// Annotate the CommonJS export names for ESM import in node:
|
|
84
79
|
0 && (module.exports = {});
|