@pisell/common 0.0.8 → 0.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/bin/pisell.js +2 -0
- package/es/components/EditorPreview/index.d.ts +5 -0
- package/es/components/EditorPreview/index.js +14 -0
- package/es/components/EditorPreview/index.less +81 -0
- package/es/components/agreement/Detail/index.d.ts +3 -0
- package/es/components/agreement/Detail/index.js +77 -0
- package/es/components/agreement/Detail/serve.d.ts +1 -0
- package/es/components/agreement/Detail/serve.js +6 -0
- package/es/components/agreement/index.d.ts +11 -0
- package/es/components/agreement/index.js +45 -0
- package/es/components/agreement/index.less +20 -0
- package/es/components/configProvider/index.d.ts +5 -1
- package/es/components/configProvider/index.js +4 -1
- package/es/components/datePicker/index.d.ts +9 -0
- package/es/components/datePicker/index.js +17 -0
- package/es/components/index.d.ts +8 -0
- package/es/components/index.js +4 -0
- package/es/components/inputNumber/index.d.ts +0 -1
- package/es/components/select/index.d.ts +4 -0
- package/es/components/select/index.js +12 -0
- package/es/config/index.d.ts +14 -2
- package/es/config/request.d.ts +7 -0
- package/es/config/request.js +67 -0
- package/es/script/constants/index.js +8 -0
- package/es/script/deploy.js +47 -0
- package/es/script/index.js +37 -0
- package/es/script/release/index.js +161 -0
- package/es/script/release/release.js +163 -0
- package/es/script/uploadCode/index.js +225 -0
- package/es/script/uploadCode/uploadCode.js +401 -0
- package/es/script/utils/index.js +241 -0
- package/lib/bin/pisell.js +4 -0
- package/lib/components/EditorPreview/index.d.ts +5 -0
- package/lib/components/EditorPreview/index.js +37 -0
- package/lib/components/EditorPreview/index.less +81 -0
- package/lib/components/agreement/Detail/index.d.ts +3 -0
- package/lib/components/agreement/Detail/index.js +86 -0
- package/lib/components/agreement/Detail/serve.d.ts +1 -0
- package/lib/components/agreement/Detail/serve.js +30 -0
- package/lib/components/agreement/index.d.ts +11 -0
- package/lib/components/agreement/index.js +82 -0
- package/lib/components/agreement/index.less +20 -0
- package/lib/components/configProvider/index.d.ts +5 -1
- package/lib/components/configProvider/index.js +21 -2
- package/lib/components/datePicker/index.d.ts +9 -0
- package/lib/components/datePicker/index.js +31 -0
- package/lib/components/index.d.ts +8 -0
- package/lib/components/index.js +12 -0
- package/lib/components/inputNumber/index.d.ts +0 -1
- package/lib/components/select/index.d.ts +4 -0
- package/lib/components/select/index.js +31 -0
- package/lib/config/index.d.ts +14 -2
- package/lib/config/request.d.ts +7 -0
- package/lib/config/request.js +76 -0
- package/lib/script/constants/index.js +35 -0
- package/lib/script/deploy.js +61 -0
- package/lib/script/index.js +55 -0
- package/lib/script/release/index.js +116 -0
- package/lib/script/release/release.js +89 -0
- package/lib/script/uploadCode/index.js +149 -0
- package/lib/script/uploadCode/uploadCode.js +208 -0
- package/lib/script/utils/index.js +208 -0
- package/package.json +9 -2
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
|
+
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); } }
|
|
6
|
+
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); }); }; }
|
|
7
|
+
import ssh2 from 'ssh2';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @Title: 项目工作区是否干净
|
|
11
|
+
* @Describe:
|
|
12
|
+
* @Author: Zsj
|
|
13
|
+
* @returns {Promise<boolean>}
|
|
14
|
+
*/
|
|
15
|
+
var isWorkingTreeClean = /*#__PURE__*/function () {
|
|
16
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
17
|
+
var v;
|
|
18
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19
|
+
while (1) switch (_context.prev = _context.next) {
|
|
20
|
+
case 0:
|
|
21
|
+
_context.next = 2;
|
|
22
|
+
return $(_templateObject || (_templateObject = _taggedTemplateLiteral(["git status --porcelain"])));
|
|
23
|
+
case 2:
|
|
24
|
+
v = _context.sent;
|
|
25
|
+
return _context.abrupt("return", v.stdout === '');
|
|
26
|
+
case 4:
|
|
27
|
+
case "end":
|
|
28
|
+
return _context.stop();
|
|
29
|
+
}
|
|
30
|
+
}, _callee);
|
|
31
|
+
}));
|
|
32
|
+
return function isWorkingTreeClean() {
|
|
33
|
+
return _ref.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
}();
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 获取当前分支
|
|
39
|
+
* @returns {Promise<*>}
|
|
40
|
+
*/
|
|
41
|
+
var getGitCurrentBranch = /*#__PURE__*/function () {
|
|
42
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
43
|
+
var v;
|
|
44
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
45
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
_context2.next = 2;
|
|
48
|
+
return $(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["git symbolic-ref --short HEAD"])));
|
|
49
|
+
case 2:
|
|
50
|
+
v = _context2.sent;
|
|
51
|
+
return _context2.abrupt("return", v.stdout);
|
|
52
|
+
case 4:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context2.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee2);
|
|
57
|
+
}));
|
|
58
|
+
return function getGitCurrentBranch() {
|
|
59
|
+
return _ref2.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
}();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @Title: 获取本地lm_config.json配置信息
|
|
65
|
+
* @Describe:
|
|
66
|
+
* @Author: Zsj
|
|
67
|
+
*/
|
|
68
|
+
var getServerConfig = /*#__PURE__*/function () {
|
|
69
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
70
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
71
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
_context3.next = 2;
|
|
74
|
+
return fs.readJson('../lm_config.json');
|
|
75
|
+
case 2:
|
|
76
|
+
return _context3.abrupt("return", _context3.sent);
|
|
77
|
+
case 3:
|
|
78
|
+
case "end":
|
|
79
|
+
return _context3.stop();
|
|
80
|
+
}
|
|
81
|
+
}, _callee3);
|
|
82
|
+
}));
|
|
83
|
+
return function getServerConfig() {
|
|
84
|
+
return _ref3.apply(this, arguments);
|
|
85
|
+
};
|
|
86
|
+
}();
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @Title: 连接服务器
|
|
90
|
+
* @Describe:
|
|
91
|
+
* @Author: Zsj
|
|
92
|
+
*/
|
|
93
|
+
var connectServer = function connectServer(config) {
|
|
94
|
+
var conn = new ssh2.Client();
|
|
95
|
+
return new Promise(function (resolve, reject) {
|
|
96
|
+
conn.on('ready', function () {
|
|
97
|
+
resolve(conn);
|
|
98
|
+
}).on('error', function (err) {
|
|
99
|
+
console.log(err, 'connect error');
|
|
100
|
+
reject();
|
|
101
|
+
}).connect(config);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @Title: 文件上传至服务器
|
|
107
|
+
* @Describe:
|
|
108
|
+
* @Author: Zsj
|
|
109
|
+
*/
|
|
110
|
+
var serverUpload = function serverUpload(conn, _ref4) {
|
|
111
|
+
var localPath = _ref4.localPath,
|
|
112
|
+
remotePath = _ref4.remotePath;
|
|
113
|
+
if (!conn) return Promise.reject('未连接服务器');
|
|
114
|
+
return new Promise(function (resolve, reject) {
|
|
115
|
+
conn.sftp(function (err, sftp) {
|
|
116
|
+
if (err) {
|
|
117
|
+
console.log(err);
|
|
118
|
+
reject(err);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
sftp.fastPut(localPath, remotePath, {
|
|
122
|
+
step: function step(total, nb, fsize) {
|
|
123
|
+
console.table([{
|
|
124
|
+
标题: '当前已上传',
|
|
125
|
+
值: "".concat((total / fsize * 100).toFixed(2), "%")
|
|
126
|
+
}, {
|
|
127
|
+
标题: '每次上传',
|
|
128
|
+
值: "".concat((nb / 1024 / 1024).toFixed(2), "M")
|
|
129
|
+
}, {
|
|
130
|
+
标题: '总大小',
|
|
131
|
+
值: "".concat((fsize / 1024 / 1024).toFixed(2), "M")
|
|
132
|
+
}]);
|
|
133
|
+
}
|
|
134
|
+
}, function (err) {
|
|
135
|
+
if (err) {
|
|
136
|
+
console.log(err);
|
|
137
|
+
reject(err);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
console.log('上传成功');
|
|
141
|
+
resolve(conn);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @Title: 服务器中解压文件
|
|
149
|
+
* @Describe:
|
|
150
|
+
* @Author: Zsj
|
|
151
|
+
*/
|
|
152
|
+
var serverUnpack = function serverUnpack(conn, _ref5) {
|
|
153
|
+
var path = _ref5.path,
|
|
154
|
+
fileName = _ref5.fileName,
|
|
155
|
+
fullFileName = _ref5.fullFileName,
|
|
156
|
+
changelog = _ref5.changelog;
|
|
157
|
+
if (!conn) return Promise.reject('未连接服务器');
|
|
158
|
+
// 文件全名
|
|
159
|
+
return new Promise(function (resolve, reject) {
|
|
160
|
+
conn.shell(function (err, stream) {
|
|
161
|
+
if (err) {
|
|
162
|
+
console.log(err);
|
|
163
|
+
reject(err);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
stream.end("\n cd ".concat(path, "\n unzip ").concat(fullFileName, " -d ").concat(fileName, " && mv ").concat(fileName, "/dist/* ").concat(fileName, "/ && rmdir ").concat(fileName, "/dist\n rm -rf ").concat(fullFileName, "\n echo \"").concat(changelog, "\" > ./").concat(fileName, "/changelog.md\n sh deleteOldVersion.sh\n exit\n ") // 打开到path
|
|
167
|
+
// 解压 1.0.0.zip 文件到 1.0.0 移动dist中内容到 1.0.0内 删除dist
|
|
168
|
+
// 删除1.0.0.zip
|
|
169
|
+
// 写入changelog到changelog.md
|
|
170
|
+
// 执行deleteOldVersion脚本 删除过早版本
|
|
171
|
+
).on('data', function (data) {
|
|
172
|
+
console.log(data.toString());
|
|
173
|
+
}).on('close', function () {
|
|
174
|
+
console.log('✅上传完成');
|
|
175
|
+
resolve();
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @Title: 选择名称进行发布操作
|
|
183
|
+
* @Describe:
|
|
184
|
+
* @Author: Zsj
|
|
185
|
+
*/
|
|
186
|
+
var releaseProject = function releaseProject(conn, _ref6) {
|
|
187
|
+
var path = _ref6.path,
|
|
188
|
+
fileName = _ref6.fileName;
|
|
189
|
+
return new Promise(function (resolve, reject) {
|
|
190
|
+
conn.shell(function (err, stream) {
|
|
191
|
+
if (err) {
|
|
192
|
+
console.log(err);
|
|
193
|
+
reject(err);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
stream.end("\n cd ".concat(path, "\n cp -R -f pre-master next-master\n rm -rf pre-master\n \\cp -R -f ").concat(fileName, "/* next-master\n cp -R -f ").concat(fileName, " pre-master\n rm -rf master\n cp -R next-master master\n rm -rf next-master\n exit\n ") // 打开到path
|
|
197
|
+
// 复制pre-master到next-master
|
|
198
|
+
// 删除pre-master
|
|
199
|
+
// 复制1.0.0到next-master
|
|
200
|
+
// 复制1.0.0到pre-master
|
|
201
|
+
// 删除master
|
|
202
|
+
// 复制next-master到master
|
|
203
|
+
// 删除next-master
|
|
204
|
+
).on('data', function (data) {
|
|
205
|
+
console.log(data.toString());
|
|
206
|
+
}).on('close', function () {
|
|
207
|
+
console.log('✅发布完成');
|
|
208
|
+
resolve();
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @Title: version进行版本号排序
|
|
216
|
+
* @Describe:
|
|
217
|
+
* @Author: Zsj
|
|
218
|
+
*/
|
|
219
|
+
var versionSort = function versionSort(versionList) {
|
|
220
|
+
return versionList.sort(function (a, b) {
|
|
221
|
+
var aParts = a.split('.');
|
|
222
|
+
var bParts = b.split('.');
|
|
223
|
+
for (var i = 0; i < aParts.length && i < bParts.length; i++) {
|
|
224
|
+
var aNum = parseInt(aParts[i]);
|
|
225
|
+
var bNum = parseInt(bParts[i]);
|
|
226
|
+
if (aNum !== bNum) {
|
|
227
|
+
return bNum - aNum;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return bParts.length - aParts.length;
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* 获取当前主项目名称
|
|
236
|
+
* @returns {*}
|
|
237
|
+
*/
|
|
238
|
+
var getCurrentProjectName = function getCurrentProjectName() {
|
|
239
|
+
return require("".concat(process.env.PWD, "/package.json")).name;
|
|
240
|
+
};
|
|
241
|
+
export { isWorkingTreeClean, getServerConfig, connectServer, serverUpload, serverUnpack, versionSort, releaseProject, getGitCurrentBranch, getCurrentProjectName };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/EditorPreview/index.tsx
|
|
20
|
+
var EditorPreview_exports = {};
|
|
21
|
+
__export(EditorPreview_exports, {
|
|
22
|
+
default: () => EditorPreview_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(EditorPreview_exports);
|
|
25
|
+
var import_index = require("./index.less");
|
|
26
|
+
var EditorPreivew = (props) => {
|
|
27
|
+
return /* @__PURE__ */ React.createElement(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
...props,
|
|
31
|
+
className: `pisell-editor-tiny-css ${props.className}`
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
var EditorPreview_default = EditorPreivew;
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.pisell-editor-tiny-css {
|
|
2
|
+
// white-space: pre-wrap;
|
|
3
|
+
word-break: break-word;
|
|
4
|
+
|
|
5
|
+
img {
|
|
6
|
+
vertical-align: baseline;
|
|
7
|
+
object-fit: contain;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
height: auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
div {
|
|
13
|
+
white-space: normal;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
p {
|
|
17
|
+
color: #000;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
margin-bottom: 1em;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
table {
|
|
23
|
+
border-collapse: collapse;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
table:not([cellpadding]) td,
|
|
27
|
+
table:not([cellpadding]) th {
|
|
28
|
+
padding: 0.4rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
table[border]:not([border='0']):not([style*='border-width']) td,
|
|
32
|
+
table[border]:not([border='0']):not([style*='border-width']) th {
|
|
33
|
+
border-width: 1px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
table[border]:not([border='0']):not([style*='border-style']) td,
|
|
37
|
+
table[border]:not([border='0']):not([style*='border-style']) th {
|
|
38
|
+
border-style: solid;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
table[border]:not([border='0']):not([style*='border-color']) td,
|
|
42
|
+
table[border]:not([border='0']):not([style*='border-color']) th {
|
|
43
|
+
border-color: #ccc;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
figure {
|
|
47
|
+
display: table;
|
|
48
|
+
margin: 1rem auto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
figure figcaption {
|
|
52
|
+
color: #999;
|
|
53
|
+
display: block;
|
|
54
|
+
margin-top: 0.25rem;
|
|
55
|
+
text-align: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
hr {
|
|
59
|
+
border-color: #ccc;
|
|
60
|
+
border-style: solid;
|
|
61
|
+
border-width: 1px 0 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
code {
|
|
65
|
+
background-color: #e8e8e8;
|
|
66
|
+
border-radius: 3px;
|
|
67
|
+
padding: 0.1rem 0.2rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
blockquote {
|
|
71
|
+
border-left: 2px solid #ccc;
|
|
72
|
+
margin-left: 1.5rem;
|
|
73
|
+
padding-left: 1rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// blockquote {
|
|
77
|
+
// border-right: 2px solid #ccc;
|
|
78
|
+
// margin-right: 1.5rem;
|
|
79
|
+
// padding-right: 1rem
|
|
80
|
+
// }
|
|
81
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/agreement/Detail/index.tsx
|
|
30
|
+
var Detail_exports = {};
|
|
31
|
+
__export(Detail_exports, {
|
|
32
|
+
default: () => Detail_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Detail_exports);
|
|
35
|
+
var import_ahooks = require("ahooks");
|
|
36
|
+
var import_antd5 = require("antd5");
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
var import_business_hooks = require("../../../business-hooks");
|
|
39
|
+
var import_EditorPreview = __toESM(require("../../EditorPreview"));
|
|
40
|
+
var import_serve = require("./serve");
|
|
41
|
+
var AgreementDetail = ({}, ref) => {
|
|
42
|
+
const [data, setData] = (0, import_react.useState)({});
|
|
43
|
+
const [current, setCurrent] = (0, import_react.useState)(null);
|
|
44
|
+
const _getPolicyDetail = (0, import_ahooks.useRequest)(import_serve.getPolicyDetail, {
|
|
45
|
+
manual: true,
|
|
46
|
+
formatResult: (res) => res.data,
|
|
47
|
+
onSuccess: (res) => {
|
|
48
|
+
setData({
|
|
49
|
+
...data,
|
|
50
|
+
[res.id]: res
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const detail = (0, import_react.useMemo)(() => {
|
|
55
|
+
if (current) {
|
|
56
|
+
return data[current] || {};
|
|
57
|
+
}
|
|
58
|
+
return {};
|
|
59
|
+
}, [data, current]);
|
|
60
|
+
const { showModal, content } = (0, import_business_hooks.useModal)({
|
|
61
|
+
title: detail.title,
|
|
62
|
+
children: /* @__PURE__ */ React.createElement(import_antd5.Spin, { spinning: _getPolicyDetail.loading }, /* @__PURE__ */ React.createElement("div", { style: { minHeight: 400 } }, /* @__PURE__ */ React.createElement(
|
|
63
|
+
import_EditorPreview.default,
|
|
64
|
+
{
|
|
65
|
+
dangerouslySetInnerHTML: {
|
|
66
|
+
__html: detail.content
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
)))
|
|
70
|
+
});
|
|
71
|
+
(0, import_react.useImperativeHandle)(ref, () => {
|
|
72
|
+
return {
|
|
73
|
+
open: (item) => {
|
|
74
|
+
setCurrent(item.id);
|
|
75
|
+
if (!data[item.id]) {
|
|
76
|
+
_getPolicyDetail.run(item.id);
|
|
77
|
+
}
|
|
78
|
+
showModal();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
return content;
|
|
83
|
+
};
|
|
84
|
+
var Detail_default = (0, import_react.forwardRef)(AgreementDetail);
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPolicyDetail: (id: string) => Promise<any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/agreement/Detail/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
getPolicyDetail: () => getPolicyDetail
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(serve_exports);
|
|
25
|
+
var import_request = require("../../../config/request");
|
|
26
|
+
var getPolicyDetail = (id) => (0, import_request.get)(`/shop/policy/` + id);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
getPolicyDetail
|
|
30
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface AgreementProps {
|
|
4
|
+
value?: 1 | 0;
|
|
5
|
+
onChange?: (data: 1 | 0) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
agreements?: any[];
|
|
9
|
+
}
|
|
10
|
+
declare const Agreement: React.FC<AgreementProps>;
|
|
11
|
+
export default Agreement;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/agreement/index.tsx
|
|
30
|
+
var agreement_exports = {};
|
|
31
|
+
__export(agreement_exports, {
|
|
32
|
+
default: () => agreement_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(agreement_exports);
|
|
35
|
+
var import_antd5 = require("antd5");
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_Detail = __toESM(require("./Detail"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var Agreement = ({
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
value,
|
|
44
|
+
onChange,
|
|
45
|
+
agreements
|
|
46
|
+
}) => {
|
|
47
|
+
const detailRef = (0, import_react.useRef)();
|
|
48
|
+
const onRead = (item) => {
|
|
49
|
+
detailRef.current.open(item);
|
|
50
|
+
};
|
|
51
|
+
const _agreements = (0, import_react.useMemo)(() => {
|
|
52
|
+
return agreements == null ? void 0 : agreements.map((item) => {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
"a",
|
|
55
|
+
{
|
|
56
|
+
className: "pisell-agreement",
|
|
57
|
+
key: item.id,
|
|
58
|
+
onClick: (e) => {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
onRead(item);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
item.title
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
}, [agreements]);
|
|
68
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-agreements", className), style }, /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
import_antd5.Checkbox,
|
|
70
|
+
{
|
|
71
|
+
value,
|
|
72
|
+
onChange: (e) => {
|
|
73
|
+
onChange && onChange(e.target.value);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"您已阅读并同意 ",
|
|
77
|
+
_agreements
|
|
78
|
+
), /* @__PURE__ */ import_react.default.createElement(import_Detail.default, { ref: detailRef }));
|
|
79
|
+
};
|
|
80
|
+
var agreement_default = Agreement;
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ConfigProvider } from 'antd5';
|
|
2
|
+
import enUS from 'antd5/locale/en_US';
|
|
3
|
+
import zhCN from 'antd5/locale/zh_CN';
|
|
4
|
+
import zhTW from 'antd5/locale/zh_TW';
|
|
2
5
|
declare const cssVariableMap: {
|
|
3
6
|
/** 白色 - White */
|
|
4
7
|
'--color-white': string;
|
|
@@ -106,4 +109,5 @@ declare const defaultTheme: {
|
|
|
106
109
|
colorTextBase: string;
|
|
107
110
|
};
|
|
108
111
|
};
|
|
109
|
-
export {
|
|
112
|
+
export type { Locale } from 'antd/es/locale';
|
|
113
|
+
export { ConfigProvider, defaultTheme, cssVariableMap, enUS, zhCN, zhTW };
|