@pisell/common 0.0.20 → 0.0.21-bata

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.
@@ -71,7 +71,7 @@ var getVersionList = /*#__PURE__*/function () {
71
71
  case 0:
72
72
  env = _ref.env, project = _ref.project;
73
73
  _context.next = 3;
74
- return getServerConfig();
74
+ return getServerConfig(project.fileName);
75
75
  case 3:
76
76
  config = _context.sent;
77
77
  host = config[env].host;
@@ -43,7 +43,7 @@ var Release = /*#__PURE__*/function () {
43
43
  while (1) switch (_context.prev = _context.next) {
44
44
  case 0:
45
45
  _context.next = 2;
46
- return getServerConfig();
46
+ return getServerConfig(this.projectName);
47
47
  case 2:
48
48
  serverConfigMap = _context.sent;
49
49
  serverConfig = serverConfigMap[this.env]; // 选择release默认用国内cn服务器
@@ -66,7 +66,7 @@ var UploadCode = /*#__PURE__*/function () {
66
66
  while (1) switch (_context.prev = _context.next) {
67
67
  case 0:
68
68
  _context.next = 2;
69
- return getServerConfig();
69
+ return getServerConfig(this.projectName);
70
70
  case 2:
71
71
  serverConfigMap = _context.sent;
72
72
  if (serverConfigMap) {
@@ -62,27 +62,42 @@ var getGitCurrentBranch = /*#__PURE__*/function () {
62
62
  };
63
63
  }();
64
64
 
65
+ /**
66
+ * monorepo项目名称
67
+ * @type {string[]}
68
+ */
69
+ var monorepoProjectNameArr = ['admin'];
70
+
65
71
  /**
66
72
  * @Title: 获取本地lm_config.json配置信息
67
- * @Describe:
73
+ * @Describe
68
74
  * @Author: Zsj
69
75
  */
70
76
  var getServerConfig = /*#__PURE__*/function () {
71
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
77
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(project) {
72
78
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
73
79
  while (1) switch (_context3.prev = _context3.next) {
74
80
  case 0:
75
- _context3.next = 2;
81
+ if (!monorepoProjectNameArr.includes(project)) {
82
+ _context3.next = 4;
83
+ break;
84
+ }
85
+ _context3.next = 3;
86
+ return fs.readJson('../../lm_config.json');
87
+ case 3:
88
+ return _context3.abrupt("return", _context3.sent);
89
+ case 4:
90
+ _context3.next = 6;
76
91
  return fs.readJson('../lm_config.json');
77
- case 2:
92
+ case 6:
78
93
  return _context3.abrupt("return", _context3.sent);
79
- case 3:
94
+ case 7:
80
95
  case "end":
81
96
  return _context3.stop();
82
97
  }
83
98
  }, _callee3);
84
99
  }));
85
- return function getServerConfig() {
100
+ return function getServerConfig(_x) {
86
101
  return _ref3.apply(this, arguments);
87
102
  };
88
103
  }();
@@ -314,7 +329,7 @@ var sendWebhook = /*#__PURE__*/function () {
314
329
  }
315
330
  }, _callee5);
316
331
  }));
317
- return function sendWebhook(_x) {
332
+ return function sendWebhook(_x2) {
318
333
  return _ref9.apply(this, arguments);
319
334
  };
320
335
  }();
@@ -79,7 +79,7 @@ var inquirerResult = (versionList) => {
79
79
  };
80
80
  var ignoreName = ["master", ".git", "pre-master"];
81
81
  var getVersionList = async ({ env, project }) => {
82
- const config = await (0, import_utils.getServerConfig)();
82
+ const config = await (0, import_utils.getServerConfig)(project.fileName);
83
83
  let host = config[env].host;
84
84
  if (env === "release") {
85
85
  host = config.cn[env].host;
@@ -39,7 +39,7 @@ var Release = class {
39
39
  * @Author: Zsj
40
40
  */
41
41
  async setConfig() {
42
- const serverConfigMap = await (0, import_utils.getServerConfig)();
42
+ const serverConfigMap = await (0, import_utils.getServerConfig)(this.projectName);
43
43
  let serverConfig = serverConfigMap[this.env];
44
44
  if (this.env === "release") {
45
45
  serverConfig = serverConfigMap.cn[this.env];
@@ -66,7 +66,7 @@ var UploadCode = class {
66
66
  * @Author: Zsj
67
67
  */
68
68
  async check() {
69
- const serverConfigMap = await (0, import_utils.getServerConfig)();
69
+ const serverConfigMap = await (0, import_utils.getServerConfig)(this.projectName);
70
70
  if (!serverConfigMap) {
71
71
  console.log("未找到发布脚本!");
72
72
  return false;
@@ -54,7 +54,11 @@ var getGitCurrentBranch = async () => {
54
54
  const v = await $`git symbolic-ref --short HEAD`;
55
55
  return v.stdout;
56
56
  };
57
- var getServerConfig = async () => {
57
+ var monorepoProjectNameArr = ["admin"];
58
+ var getServerConfig = async (project) => {
59
+ if (monorepoProjectNameArr.includes(project)) {
60
+ return await fs.readJson("../../lm_config.json");
61
+ }
58
62
  return await fs.readJson("../lm_config.json");
59
63
  };
60
64
  var connectServer = (config2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/common",
3
- "version": "0.0.20",
3
+ "version": "0.0.21-bata",
4
4
  "description": "A collection of reusable UI components for web development",
5
5
  "license": "MIT",
6
6
  "sideEffects": [