@pisell/common 1.0.57 → 1.0.58
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/CHANGELOG.md +7 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js +28 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/defineProperty.js +14 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js +27 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPrimitive.js +16 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPropertyKey.js +11 -0
- package/es/_virtual/_@oxc-project_runtime@0.108.0/helpers/typeof.js +12 -0
- package/es/bin/pisell.js +5 -1
- package/es/index.d.ts +3 -1
- package/es/index.js +5 -1
- package/es/script/aws/index.js +127 -210
- package/es/script/constants/index.js +84 -69
- package/es/script/deploy.js +33 -44
- package/es/script/index.js +43 -37
- package/es/script/release/index.js +83 -150
- package/es/script/release/release.js +82 -167
- package/es/script/uploadCode/index.js +238 -308
- package/es/script/uploadCode/uploadCode.js +219 -432
- package/es/script/utils/index.js +255 -369
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js +29 -0
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/defineProperty.js +14 -0
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/objectSpread2.js +27 -0
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPrimitive.js +16 -0
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/toPropertyKey.js +11 -0
- package/lib/_virtual/_@oxc-project_runtime@0.108.0/helpers/typeof.js +18 -0
- package/lib/_virtual/rolldown_runtime.js +29 -0
- package/lib/bin/pisell.js +4 -24
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -23
- package/lib/script/aws/index.js +139 -124
- package/lib/script/constants/index.js +85 -104
- package/lib/script/deploy.js +34 -55
- package/lib/script/index.js +41 -56
- package/lib/script/release/index.js +90 -108
- package/lib/script/release/release.js +82 -85
- package/lib/script/uploadCode/index.js +244 -229
- package/lib/script/uploadCode/uploadCode.js +222 -224
- package/lib/script/utils/index.js +270 -264
- package/package.json +2 -2
- package/src/script/constants/index.js +6 -0
- package/src/script/uploadCode/index.js +1 -0
- package/src/script/uploadCode/uploadCode.js +1 -0
- package/src/script/utils/index.js +3 -1
|
@@ -1,171 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
|
+
import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.108.0/helpers/asyncToGenerator.js";
|
|
2
|
+
import { connectServer, getServerConfig, releaseProject } from "../utils/index.js";
|
|
10
3
|
import { isSsrMap, outPathMap } from "../constants/index.js";
|
|
11
|
-
import { connectServer as _connectServer, getServerConfig, releaseProject } from "../utils/index.js";
|
|
12
4
|
|
|
5
|
+
//#region src/script/release/release.js
|
|
13
6
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var Release =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
* @Title: 执行发布类
|
|
8
|
+
* @Describe:
|
|
9
|
+
* @Author: Zsj
|
|
10
|
+
*/
|
|
11
|
+
var Release = class {
|
|
12
|
+
constructor(props) {
|
|
13
|
+
const { project, env, version, conn } = props;
|
|
14
|
+
this.projectName = project.fileName;
|
|
15
|
+
this.env = env;
|
|
16
|
+
this.version = version;
|
|
17
|
+
this.conn = conn;
|
|
18
|
+
this.outPath = outPathMap[this.projectName][this.env];
|
|
19
|
+
this.isSSR = isSsrMap[this.projectName];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @Title: 设置连接服务器配置
|
|
23
|
+
* @Describe:
|
|
24
|
+
* @Author: Zsj
|
|
25
|
+
*/
|
|
26
|
+
setConfig() {
|
|
27
|
+
var _this = this;
|
|
28
|
+
return _asyncToGenerator(function* () {
|
|
29
|
+
const serverConfigMap = yield getServerConfig(_this.projectName);
|
|
30
|
+
let serverConfig = serverConfigMap[_this.env];
|
|
31
|
+
if (_this.env === "release") serverConfig = serverConfigMap.cn[_this.env];
|
|
32
|
+
if (_this.env === "prod") {
|
|
33
|
+
serverConfig = serverConfigMap.aws.service[_this.env];
|
|
34
|
+
serverConfig.privateKey = fs.readFileSync("../../../pem/pisell-pro.pem");
|
|
35
|
+
}
|
|
36
|
+
_this.serverConfig = serverConfig;
|
|
37
|
+
})();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @Title: 连接服务器
|
|
41
|
+
* @Describe:
|
|
42
|
+
* @Author: Zsj
|
|
43
|
+
*/
|
|
44
|
+
connectServer() {
|
|
45
|
+
var _this2 = this;
|
|
46
|
+
return _asyncToGenerator(function* () {
|
|
47
|
+
if (!_this2.serverConfig) {
|
|
48
|
+
console.log("未找到发布配置!");
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
_this2.conn = yield connectServer(_this2.serverConfig);
|
|
52
|
+
return _this2.conn;
|
|
53
|
+
})();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @Title: 执行发布操作
|
|
57
|
+
* @Describe:
|
|
58
|
+
* @Author: Zsj
|
|
59
|
+
*/
|
|
60
|
+
release() {
|
|
61
|
+
var _this3 = this;
|
|
62
|
+
return _asyncToGenerator(function* () {
|
|
63
|
+
return yield releaseProject(_this3.conn, {
|
|
64
|
+
path: _this3.outPath,
|
|
65
|
+
fileName: `${_this3.version}`,
|
|
66
|
+
isSSR: _this3.isSSR,
|
|
67
|
+
env: _this3.env
|
|
68
|
+
});
|
|
69
|
+
})();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @Title: 断开服务连接
|
|
73
|
+
* @Describe:
|
|
74
|
+
* @Author: Zsj
|
|
75
|
+
*/
|
|
76
|
+
disconnectServer() {
|
|
77
|
+
var _this4 = this;
|
|
78
|
+
return _asyncToGenerator(function* () {
|
|
79
|
+
return yield _this4.conn.end();
|
|
80
|
+
})();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var release_default = Release;
|
|
33
84
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* @Describe:
|
|
37
|
-
* @Author: Zsj
|
|
38
|
-
*/
|
|
39
|
-
_createClass(Release, [{
|
|
40
|
-
key: "setConfig",
|
|
41
|
-
value: (function () {
|
|
42
|
-
var _setConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
43
|
-
var serverConfigMap, serverConfig;
|
|
44
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
45
|
-
while (1) switch (_context.prev = _context.next) {
|
|
46
|
-
case 0:
|
|
47
|
-
_context.next = 2;
|
|
48
|
-
return getServerConfig(this.projectName);
|
|
49
|
-
case 2:
|
|
50
|
-
serverConfigMap = _context.sent;
|
|
51
|
-
serverConfig = serverConfigMap[this.env]; // 选择release默认用国内cn服务器
|
|
52
|
-
if (this.env === 'release') {
|
|
53
|
-
serverConfig = serverConfigMap.cn[this.env];
|
|
54
|
-
}
|
|
55
|
-
if (this.env === 'prod') {
|
|
56
|
-
serverConfig = serverConfigMap.aws.service[this.env];
|
|
57
|
-
serverConfig.privateKey = fs.readFileSync("../../../pem/pisell-pro.pem");
|
|
58
|
-
}
|
|
59
|
-
this.serverConfig = serverConfig;
|
|
60
|
-
case 7:
|
|
61
|
-
case "end":
|
|
62
|
-
return _context.stop();
|
|
63
|
-
}
|
|
64
|
-
}, _callee, this);
|
|
65
|
-
}));
|
|
66
|
-
function setConfig() {
|
|
67
|
-
return _setConfig.apply(this, arguments);
|
|
68
|
-
}
|
|
69
|
-
return setConfig;
|
|
70
|
-
}()
|
|
71
|
-
/**
|
|
72
|
-
* @Title: 连接服务器
|
|
73
|
-
* @Describe:
|
|
74
|
-
* @Author: Zsj
|
|
75
|
-
*/
|
|
76
|
-
)
|
|
77
|
-
}, {
|
|
78
|
-
key: "connectServer",
|
|
79
|
-
value: (function () {
|
|
80
|
-
var _connectServer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
81
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
82
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
83
|
-
case 0:
|
|
84
|
-
if (this.serverConfig) {
|
|
85
|
-
_context2.next = 3;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
console.log('未找到发布配置!');
|
|
89
|
-
return _context2.abrupt("return", null);
|
|
90
|
-
case 3:
|
|
91
|
-
_context2.next = 5;
|
|
92
|
-
return _connectServer(this.serverConfig);
|
|
93
|
-
case 5:
|
|
94
|
-
this.conn = _context2.sent;
|
|
95
|
-
return _context2.abrupt("return", this.conn);
|
|
96
|
-
case 7:
|
|
97
|
-
case "end":
|
|
98
|
-
return _context2.stop();
|
|
99
|
-
}
|
|
100
|
-
}, _callee2, this);
|
|
101
|
-
}));
|
|
102
|
-
function connectServer() {
|
|
103
|
-
return _connectServer2.apply(this, arguments);
|
|
104
|
-
}
|
|
105
|
-
return connectServer;
|
|
106
|
-
}()
|
|
107
|
-
/**
|
|
108
|
-
* @Title: 执行发布操作
|
|
109
|
-
* @Describe:
|
|
110
|
-
* @Author: Zsj
|
|
111
|
-
*/
|
|
112
|
-
)
|
|
113
|
-
}, {
|
|
114
|
-
key: "release",
|
|
115
|
-
value: (function () {
|
|
116
|
-
var _release = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
117
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
118
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
119
|
-
case 0:
|
|
120
|
-
_context3.next = 2;
|
|
121
|
-
return releaseProject(this.conn, {
|
|
122
|
-
path: this.outPath,
|
|
123
|
-
fileName: "".concat(this.version),
|
|
124
|
-
isSSR: this.isSSR,
|
|
125
|
-
env: this.env
|
|
126
|
-
});
|
|
127
|
-
case 2:
|
|
128
|
-
return _context3.abrupt("return", _context3.sent);
|
|
129
|
-
case 3:
|
|
130
|
-
case "end":
|
|
131
|
-
return _context3.stop();
|
|
132
|
-
}
|
|
133
|
-
}, _callee3, this);
|
|
134
|
-
}));
|
|
135
|
-
function release() {
|
|
136
|
-
return _release.apply(this, arguments);
|
|
137
|
-
}
|
|
138
|
-
return release;
|
|
139
|
-
}()
|
|
140
|
-
/**
|
|
141
|
-
* @Title: 断开服务连接
|
|
142
|
-
* @Describe:
|
|
143
|
-
* @Author: Zsj
|
|
144
|
-
*/
|
|
145
|
-
)
|
|
146
|
-
}, {
|
|
147
|
-
key: "disconnectServer",
|
|
148
|
-
value: (function () {
|
|
149
|
-
var _disconnectServer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
150
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
151
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
152
|
-
case 0:
|
|
153
|
-
_context4.next = 2;
|
|
154
|
-
return this.conn.end();
|
|
155
|
-
case 2:
|
|
156
|
-
return _context4.abrupt("return", _context4.sent);
|
|
157
|
-
case 3:
|
|
158
|
-
case "end":
|
|
159
|
-
return _context4.stop();
|
|
160
|
-
}
|
|
161
|
-
}, _callee4, this);
|
|
162
|
-
}));
|
|
163
|
-
function disconnectServer() {
|
|
164
|
-
return _disconnectServer.apply(this, arguments);
|
|
165
|
-
}
|
|
166
|
-
return disconnectServer;
|
|
167
|
-
}())
|
|
168
|
-
}]);
|
|
169
|
-
return Release;
|
|
170
|
-
}();
|
|
171
|
-
export default Release;
|
|
85
|
+
//#endregion
|
|
86
|
+
export { release_default as default };
|