@teams-max/mwsp 2.0.9 → 2.0.10

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 CHANGED
@@ -15,13 +15,13 @@ export default function build() {
15
15
  }
16
16
  function _build() {
17
17
  _build = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
18
- var cfg, infra, ASG_DIR, appKey, APP_ENV, JENKINS_BUILD, MAX_SUB_APP, RESOURCE_URL, environment, questions, env;
18
+ var cfg, infra, ASG_DIR, appKey, subAppKey, APP_ENV, JENKINS_BUILD, MAX_SUB_APP, RESOURCE_URL, environment, questions, env;
19
19
  return _regeneratorRuntime().wrap(function _callee$(_context) {
20
20
  while (1) switch (_context.prev = _context.next) {
21
21
  case 0:
22
22
  // 配置检测 (package.json)
23
23
  cfg = getCfg();
24
- infra = cfg.infra, ASG_DIR = cfg.ASG_DIR, appKey = cfg.appKey, APP_ENV = cfg.APP_ENV, JENKINS_BUILD = cfg.JENKINS_BUILD, MAX_SUB_APP = cfg.MAX_SUB_APP, RESOURCE_URL = cfg.RESOURCE_URL;
24
+ infra = cfg.infra, ASG_DIR = cfg.ASG_DIR, appKey = cfg.appKey, subAppKey = cfg.subAppKey, APP_ENV = cfg.APP_ENV, JENKINS_BUILD = cfg.JENKINS_BUILD, MAX_SUB_APP = cfg.MAX_SUB_APP, RESOURCE_URL = cfg.RESOURCE_URL;
25
25
  _context.next = 4;
26
26
  return fetchRemoteRepository();
27
27
  case 4:
@@ -47,41 +47,43 @@ function _build() {
47
47
  env.ASG_DIR = ASG_DIR;
48
48
  logStep("Build ".concat(appKey), "ENV:".concat(environment));
49
49
  if (!((infra === null || infra === void 0 ? void 0 : infra.arch) === 'PRO')) {
50
- _context.next = 23;
50
+ _context.next = 24;
51
51
  break;
52
52
  }
53
53
  env.VUE_APP_ENV = environment;
54
54
  env.VUE_APP_TYPE = 'pro';
55
55
  env.VUE_JENKINS_BUILD = JENKINS_BUILD;
56
56
  env.VUE_APP_KEY = appKey;
57
- _context.next = 21;
57
+ env.VUE_SUB_APP_KEY = subAppKey;
58
+ _context.next = 22;
58
59
  return exec('vue-cli-service', ['build'], {
59
60
  env: env
60
61
  });
61
- case 21:
62
- _context.next = 32;
62
+ case 22:
63
+ _context.next = 34;
63
64
  break;
64
- case 23:
65
+ case 24:
65
66
  if (!((infra === null || infra === void 0 ? void 0 : infra.arch) === 'MAX')) {
66
- _context.next = 32;
67
+ _context.next = 34;
67
68
  break;
68
69
  }
69
70
  env.MAX_APP_ENV = environment;
70
71
  env.MAX_APP_TYPE = 'max';
71
72
  env.MAX_JENKINS_BUILD = JENKINS_BUILD;
72
73
  env.MAX_APP_KEY = appKey;
74
+ env.MAX_SUB_APP_KEY = subAppKey;
73
75
  env.MAX_SUB_APP = MAX_SUB_APP;
74
76
  env.RESOURCE_URL = RESOURCE_URL;
75
- _context.next = 32;
77
+ _context.next = 34;
76
78
  return exec('max', ['build'], {
77
79
  env: env
78
80
  });
79
- case 32:
80
- _context.next = 34;
81
+ case 34:
82
+ _context.next = 36;
81
83
  return exec('find', ['./dist', '-type', 'f', '-name', '*.map', '-exec', 'rm', '-f', '{}', '+'], {
82
84
  env: env
83
85
  });
84
- case 34:
86
+ case 36:
85
87
  case "end":
86
88
  return _context.stop();
87
89
  }
package/es/cli/start.js CHANGED
@@ -16,22 +16,24 @@ export default function start() {
16
16
  // });
17
17
  function _start() {
18
18
  _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
19
- var cfg, infra, appKey, ASG_DIR, env;
19
+ var cfg, infra, appKey, subAppKey, ASG_DIR, env;
20
20
  return _regeneratorRuntime().wrap(function _callee$(_context) {
21
21
  while (1) switch (_context.prev = _context.next) {
22
22
  case 0:
23
23
  // 配置检测 (package.json)
24
24
  cfg = getCfg();
25
- infra = cfg.infra, appKey = cfg.appKey, ASG_DIR = cfg.ASG_DIR;
25
+ infra = cfg.infra, appKey = cfg.appKey, subAppKey = cfg.subAppKey, ASG_DIR = cfg.ASG_DIR;
26
26
  env = Object.create(process.env); // Do this as the first thing so that any code reading it knows the right env.
27
27
  if ((infra === null || infra === void 0 ? void 0 : infra.arch) === 'PRO') {
28
28
  env.VUE_APP_TYPE = 'pro';
29
29
  env.VUE_APP_ENV = 'development';
30
30
  env.VUE_APP_KEY = appKey;
31
+ env.VUE_SUB_APP_KEY = subAppKey;
31
32
  } else if ((infra === null || infra === void 0 ? void 0 : infra.arch) === 'MAX') {
32
33
  env.MAX_APP_TYPE = 'max';
33
34
  env.MAX_APP_ENV = 'development';
34
35
  env.MAX_APP_KEY = appKey;
36
+ env.MAX_SUB_APP_KEY = subAppKey;
35
37
  }
36
38
  env.BABEL_ENV = 'development';
37
39
  env.ASG_DIR = ASG_DIR;
package/es/utils/index.js CHANGED
@@ -243,7 +243,8 @@ function getCfg() {
243
243
  var pkgs = require(join(cwd, 'package.json'));
244
244
  var _pkgs$infra = pkgs.infra,
245
245
  infra = _pkgs$infra === void 0 ? {} : _pkgs$infra,
246
- appKey = pkgs.appKey;
246
+ appKey = pkgs.appKey,
247
+ subAppKey = pkgs.subAppKey;
247
248
  var projectUrl = '';
248
249
  if (JENKINS_BUILD) {
249
250
  projectUrl = infra.ssh || infra.url;
@@ -267,6 +268,7 @@ function getCfg() {
267
268
  }
268
269
  return {
269
270
  appKey: appKey,
271
+ subAppKey: subAppKey,
270
272
  infra: {
271
273
  url: projectUrl,
272
274
  arch: archStr
package/lib/cli/build.js CHANGED
@@ -33,6 +33,7 @@ async function build() {
33
33
  infra,
34
34
  ASG_DIR,
35
35
  appKey,
36
+ subAppKey,
36
37
  APP_ENV,
37
38
  JENKINS_BUILD,
38
39
  MAX_SUB_APP,
@@ -61,6 +62,7 @@ async function build() {
61
62
  env.VUE_APP_TYPE = "pro";
62
63
  env.VUE_JENKINS_BUILD = JENKINS_BUILD;
63
64
  env.VUE_APP_KEY = appKey;
65
+ env.VUE_SUB_APP_KEY = subAppKey;
64
66
  await exec("vue-cli-service", ["build"], {
65
67
  env
66
68
  });
@@ -69,6 +71,7 @@ async function build() {
69
71
  env.MAX_APP_TYPE = "max";
70
72
  env.MAX_JENKINS_BUILD = JENKINS_BUILD;
71
73
  env.MAX_APP_KEY = appKey;
74
+ env.MAX_SUB_APP_KEY = subAppKey;
72
75
  env.MAX_SUB_APP = MAX_SUB_APP;
73
76
  env.RESOURCE_URL = RESOURCE_URL;
74
77
  await exec("max", ["build"], {
package/lib/cli/start.js CHANGED
@@ -26,16 +26,18 @@ var exec = require("../utils/exec");
26
26
  var { getCfg, fetchRemoteRepository } = require("../utils");
27
27
  async function start() {
28
28
  const cfg = getCfg();
29
- const { infra, appKey, ASG_DIR } = cfg;
29
+ const { infra, appKey, subAppKey, ASG_DIR } = cfg;
30
30
  const env = Object.create(process.env);
31
31
  if ((infra == null ? void 0 : infra.arch) === "PRO") {
32
32
  env.VUE_APP_TYPE = "pro";
33
33
  env.VUE_APP_ENV = "development";
34
34
  env.VUE_APP_KEY = appKey;
35
+ env.VUE_SUB_APP_KEY = subAppKey;
35
36
  } else if ((infra == null ? void 0 : infra.arch) === "MAX") {
36
37
  env.MAX_APP_TYPE = "max";
37
38
  env.MAX_APP_ENV = "development";
38
39
  env.MAX_APP_KEY = appKey;
40
+ env.MAX_SUB_APP_KEY = subAppKey;
39
41
  }
40
42
  env.BABEL_ENV = "development";
41
43
  env.ASG_DIR = ASG_DIR;
@@ -113,7 +113,7 @@ function getCfg() {
113
113
  const args = yParser(process.argv.slice(2));
114
114
  const JENKINS_BUILD = args.jenkinsBuild || args.JENKINSBUILD || args.jenkins_build || args.JENKINS_BUILD;
115
115
  const pkgs = require(join(cwd, "package.json"));
116
- const { infra = {}, appKey } = pkgs;
116
+ const { infra = {}, appKey, subAppKey } = pkgs;
117
117
  let projectUrl = "";
118
118
  if (JENKINS_BUILD) {
119
119
  projectUrl = infra.ssh || infra.url;
@@ -137,6 +137,7 @@ function getCfg() {
137
137
  }
138
138
  return {
139
139
  appKey,
140
+ subAppKey,
140
141
  infra: {
141
142
  url: projectUrl,
142
143
  arch: archStr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teams-max/mwsp",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "@teams-max/mwsp",
5
5
  "homepage": "https://gitlab.daikuan.qihoo.net/efficacy-fe/teams-max/-/tree/master/packages/mwsp",
6
6
  "repository": {