@pisell/common 0.0.21 → 0.0.23
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/components/DragSort/index.d.ts +2 -0
- package/es/components/EditorPreview/index.d.ts +5 -0
- package/es/components/agreement/Detail/index.d.ts +3 -0
- package/es/components/button/index.d.ts +17 -0
- package/es/components/card/index.d.ts +5 -0
- package/es/components/checkbox/index.d.ts +20 -0
- package/es/components/datePicker/index.d.ts +9 -0
- package/es/components/index.d.ts +30 -0
- package/es/components/input/index.d.ts +35 -0
- package/es/components/inputNumber/index.d.ts +9 -0
- package/es/components/radio/index.d.ts +13 -0
- package/es/components/select/index.d.ts +9 -0
- package/es/config/index.d.ts +30 -0
- package/es/script/constants/index.js +2 -1
- package/es/script/uploadCode/uploadCode.js +21 -8
- package/es/script/utils/index.js +34 -1
- package/lib/components/DragSort/index.d.ts +2 -0
- package/lib/components/EditorPreview/index.d.ts +5 -0
- package/lib/components/agreement/Detail/index.d.ts +3 -0
- package/lib/components/button/index.d.ts +17 -0
- package/lib/components/card/index.d.ts +5 -0
- package/lib/components/checkbox/index.d.ts +20 -0
- package/lib/components/datePicker/index.d.ts +9 -0
- package/lib/components/index.d.ts +30 -0
- package/lib/components/input/index.d.ts +35 -0
- package/lib/components/inputNumber/index.d.ts +9 -0
- package/lib/components/radio/index.d.ts +13 -0
- package/lib/components/select/index.d.ts +9 -0
- package/lib/config/index.d.ts +30 -0
- package/lib/script/constants/index.js +8 -0
- package/lib/script/uploadCode/uploadCode.js +5 -0
- package/lib/script/utils/index.js +20 -0
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ButtonProps as AntButtonProps } from 'antd5';
|
|
2
|
+
import type { ButtonGroupProps as AntButtonGroupProps } from 'antd5/es/button';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
export declare type ButtonProps = AntButtonProps;
|
|
7
|
+
export declare type ButtonGroupProps = AntButtonGroupProps;
|
|
8
|
+
/**
|
|
9
|
+
* 按钮组件
|
|
10
|
+
* @param props
|
|
11
|
+
* @constructor
|
|
12
|
+
*/
|
|
13
|
+
declare const Button: {
|
|
14
|
+
(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Group: (props: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export default Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CheckboxGroupProps as AntCheckboxGroupProps } from 'antd/es/checkbox';
|
|
2
|
+
import type { CheckboxProps as AntCheckboxProps } from 'antd5';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 后续可添加属性
|
|
8
|
+
*/
|
|
9
|
+
export declare type CheckboxProps = AntCheckboxProps;
|
|
10
|
+
export declare type CheckboxGroupProps = AntCheckboxGroupProps;
|
|
11
|
+
/**
|
|
12
|
+
* 多选框
|
|
13
|
+
* @param props
|
|
14
|
+
* @constructor
|
|
15
|
+
*/
|
|
16
|
+
declare const Checkbox: {
|
|
17
|
+
(props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
Group: (props: AntCheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export default Checkbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DatePickerProps as AntDatePickerProps } from 'antd5';
|
|
2
|
+
export declare type DatePickerProps = AntDatePickerProps;
|
|
3
|
+
/**
|
|
4
|
+
* 日期选择框
|
|
5
|
+
* @param props
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare const DatePicker: (props: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default DatePicker;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { default as Agreement } from './agreement';
|
|
2
|
+
export type { AgreementProps } from './agreement';
|
|
3
|
+
export { default as Avatar } from './avatar';
|
|
4
|
+
export type { AvatarProps } from './avatar';
|
|
5
|
+
export { default as Button } from './button';
|
|
6
|
+
export type { ButtonGroupProps, ButtonProps } from './button';
|
|
7
|
+
export { default as Card } from './card';
|
|
8
|
+
export type { CardProps } from './card';
|
|
9
|
+
export { default as Checkbox } from './checkbox';
|
|
10
|
+
export type { CheckboxGroupProps, CheckboxProps } from './checkbox';
|
|
11
|
+
export { default as ColorPicker } from './ColorPicker';
|
|
12
|
+
export type { ColorPickerProps } from './ColorPicker';
|
|
13
|
+
export * from './configProvider';
|
|
14
|
+
export { default as DatePicker } from './datePicker';
|
|
15
|
+
export type { DatePickerProps } from './datePicker';
|
|
16
|
+
export { default as DragSort } from './DragSort';
|
|
17
|
+
export { default as IconFont } from './Iconfont';
|
|
18
|
+
export type { IconFontProps } from './Iconfont';
|
|
19
|
+
export { default as Input } from './input';
|
|
20
|
+
export type { GroupProps, InputProps, PasswordProps, SearchProps, TextAreaProps, } from './input';
|
|
21
|
+
export { default as InputNumber } from './inputNumber';
|
|
22
|
+
export type { InputNumberProps } from './inputNumber';
|
|
23
|
+
export { default as Pagination } from './pagination';
|
|
24
|
+
export type { PaginationProps } from './pagination';
|
|
25
|
+
export { default as Radio } from './radio';
|
|
26
|
+
export type { RadioGroupProps, RadioProps } from './radio';
|
|
27
|
+
export { default as Select } from './select';
|
|
28
|
+
export type { SelectOptionProps, SelectProps } from './select';
|
|
29
|
+
export { default as Switch } from './switch';
|
|
30
|
+
export type { SwitchProps } from './switch';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { InputProps as AntInputProps } from 'antd5';
|
|
2
|
+
import { GroupProps as AntGroupProps, PasswordProps as AntPasswordProps, SearchProps as AntSearchProps, TextAreaProps as AntTextAreaProps } from 'antd5/es/input';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 后续可添加属性
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 后续可添加属性
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 后续可添加属性
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* 后续可添加属性
|
|
17
|
+
*/
|
|
18
|
+
export declare type InputProps = AntInputProps;
|
|
19
|
+
export declare type TextAreaProps = AntTextAreaProps;
|
|
20
|
+
export declare type SearchProps = AntSearchProps;
|
|
21
|
+
export declare type PasswordProps = AntPasswordProps;
|
|
22
|
+
export declare type GroupProps = AntGroupProps;
|
|
23
|
+
/**
|
|
24
|
+
* input输入框
|
|
25
|
+
* @param props
|
|
26
|
+
* @constructor
|
|
27
|
+
*/
|
|
28
|
+
declare const Input: {
|
|
29
|
+
(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
TextArea: (props: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Search: (props: SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
Password: (props: PasswordProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
Group: (props: GroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
};
|
|
35
|
+
export default Input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InputNumberProps as AntInputNumberProps } from 'antd5';
|
|
2
|
+
export declare type InputNumberProps = AntInputNumberProps;
|
|
3
|
+
/**
|
|
4
|
+
* 数字输入框
|
|
5
|
+
* @param props
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare const InputNumber: (props: InputNumberProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default InputNumber;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RadioGroupProps as AntRadioGroupProps, RadioProps as AntRadioProps } from 'antd5';
|
|
2
|
+
export declare type RadioGroupProps = AntRadioGroupProps;
|
|
3
|
+
export declare type RadioProps = AntRadioProps;
|
|
4
|
+
/**
|
|
5
|
+
* 单选框
|
|
6
|
+
* @param props
|
|
7
|
+
* @constructor
|
|
8
|
+
*/
|
|
9
|
+
declare const Radio: {
|
|
10
|
+
(props: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Group: (props: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
export default Radio;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SelectProps as AntSelectProps } from 'antd5';
|
|
2
|
+
import { OptionProps as AntOptionProps } from 'rc-select/es/Option';
|
|
3
|
+
export declare type SelectProps = AntSelectProps;
|
|
4
|
+
export declare type SelectOptionProps = AntOptionProps;
|
|
5
|
+
declare const Select: {
|
|
6
|
+
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Option: (props: AntOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default Select;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type PisellConfigType = {
|
|
2
|
+
ENV: {
|
|
3
|
+
host: string;
|
|
4
|
+
socket: string;
|
|
5
|
+
helpHost: string;
|
|
6
|
+
boxlocal_h5: string;
|
|
7
|
+
accounts: string;
|
|
8
|
+
domain: string;
|
|
9
|
+
googleMap: string;
|
|
10
|
+
appCenter: string;
|
|
11
|
+
static: string;
|
|
12
|
+
};
|
|
13
|
+
/** 当前主项目类型 */
|
|
14
|
+
platform: 'shop' | string;
|
|
15
|
+
/** 包内请求 由主项目注入 */
|
|
16
|
+
request: {
|
|
17
|
+
get: RequestMethod;
|
|
18
|
+
post: RequestMethod;
|
|
19
|
+
put: RequestMethod;
|
|
20
|
+
remove: RequestMethod;
|
|
21
|
+
request: RequestMethod;
|
|
22
|
+
};
|
|
23
|
+
/** 消息通知url */
|
|
24
|
+
webhookUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface RequestMethod {
|
|
27
|
+
<T = any>(url: string, data?: Record<string, any>, config?: any): Promise<T>;
|
|
28
|
+
}
|
|
29
|
+
export declare const initConfig: (options: PisellConfigType) => void;
|
|
30
|
+
export declare const getConfig: () => PisellConfigType;
|
|
@@ -26,4 +26,5 @@ var isSsrMap = {
|
|
|
26
26
|
my_pisel_pc_v2: true,
|
|
27
27
|
my_pisel_h5_v2: true
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
var checkPackages = ['@pisell/date-picker', '@pisell/lowcode-renderer', '@pisell/common', '@pisell/utils'];
|
|
30
|
+
export { outPathMap, isSsrMap, checkPackages };
|
|
@@ -11,8 +11,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
11
11
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
12
|
import archiver from 'archiver';
|
|
13
13
|
import path from 'path';
|
|
14
|
-
import { isSsrMap, outPathMap } from "../constants/index.js";
|
|
15
|
-
import { connectServer as _connectServer, getGitCurrentBranch, getServerConfig, isWorkingTreeClean, serverUnpack as _serverUnpack, serverUpload as _serverUpload } from "../utils/index.js";
|
|
14
|
+
import { checkPackages, isSsrMap, outPathMap } from "../constants/index.js";
|
|
15
|
+
import { checkPkgVersion, connectServer as _connectServer, getGitCurrentBranch, getServerConfig, isWorkingTreeClean, serverUnpack as _serverUnpack, serverUpload as _serverUpload } from "../utils/index.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @Title: 上传代码至服务器类
|
|
@@ -63,7 +63,7 @@ var UploadCode = /*#__PURE__*/function () {
|
|
|
63
63
|
key: "check",
|
|
64
64
|
value: function () {
|
|
65
65
|
var _check = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
66
|
-
var serverConfigMap, serverConfig;
|
|
66
|
+
var serverConfigMap, _yield$checkPkgVersio, success, message, serverConfig;
|
|
67
67
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
68
68
|
while (1) switch (_context.prev = _context.next) {
|
|
69
69
|
case 0:
|
|
@@ -96,6 +96,19 @@ var UploadCode = /*#__PURE__*/function () {
|
|
|
96
96
|
console.log('工作区不干净, 请先提交代码');
|
|
97
97
|
return _context.abrupt("return", false);
|
|
98
98
|
case 13:
|
|
99
|
+
_context.next = 15;
|
|
100
|
+
return checkPkgVersion(checkPackages);
|
|
101
|
+
case 15:
|
|
102
|
+
_yield$checkPkgVersio = _context.sent;
|
|
103
|
+
success = _yield$checkPkgVersio.success;
|
|
104
|
+
message = _yield$checkPkgVersio.message;
|
|
105
|
+
if (success) {
|
|
106
|
+
_context.next = 21;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
console.log(message);
|
|
110
|
+
return _context.abrupt("return", false);
|
|
111
|
+
case 21:
|
|
99
112
|
serverConfig = this.setConfig(serverConfigMap[this.env]);
|
|
100
113
|
if (this.env === 'prod') {
|
|
101
114
|
serverConfig.privateKey = fs.readFileSync(path.join(process.env.HOME, '.ssh', 'id_rsa'));
|
|
@@ -106,20 +119,20 @@ var UploadCode = /*#__PURE__*/function () {
|
|
|
106
119
|
serverConfig = this.setConfig(serverConfigMap.cn[this.env]);
|
|
107
120
|
}
|
|
108
121
|
if (serverConfig) {
|
|
109
|
-
_context.next =
|
|
122
|
+
_context.next = 27;
|
|
110
123
|
break;
|
|
111
124
|
}
|
|
112
125
|
console.log('您当前没有权限!');
|
|
113
126
|
return _context.abrupt("return", false);
|
|
114
|
-
case
|
|
127
|
+
case 27:
|
|
115
128
|
_context.t0 = console;
|
|
116
|
-
_context.next =
|
|
129
|
+
_context.next = 30;
|
|
117
130
|
return getGitCurrentBranch();
|
|
118
|
-
case
|
|
131
|
+
case 30:
|
|
119
132
|
_context.t1 = _context.sent;
|
|
120
133
|
_context.t0.log.call(_context.t0, '当前主项目分支', _context.t1);
|
|
121
134
|
return _context.abrupt("return", true);
|
|
122
|
-
case
|
|
135
|
+
case 33:
|
|
123
136
|
case "end":
|
|
124
137
|
return _context.stop();
|
|
125
138
|
}
|
package/es/script/utils/index.js
CHANGED
|
@@ -5,6 +5,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
5
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
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
7
|
import * as dotenv from 'dotenv';
|
|
8
|
+
import npmCheck from 'npm-check';
|
|
8
9
|
import path from 'path';
|
|
9
10
|
import ssh2 from 'ssh2';
|
|
10
11
|
|
|
@@ -319,4 +320,36 @@ var sendWebhook = /*#__PURE__*/function () {
|
|
|
319
320
|
return _ref9.apply(this, arguments);
|
|
320
321
|
};
|
|
321
322
|
}();
|
|
322
|
-
|
|
323
|
+
var checkPkgVersion = /*#__PURE__*/function () {
|
|
324
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(checkPackages) {
|
|
325
|
+
var currentState, pkgs, wrongPkg, errorMessage, isWrongVersion;
|
|
326
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
327
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
328
|
+
case 0:
|
|
329
|
+
_context6.next = 2;
|
|
330
|
+
return npmCheck();
|
|
331
|
+
case 2:
|
|
332
|
+
currentState = _context6.sent;
|
|
333
|
+
pkgs = currentState.get('packages');
|
|
334
|
+
wrongPkg = pkgs.filter(function (item) {
|
|
335
|
+
return checkPackages.includes(item.moduleName) && item.mismatch;
|
|
336
|
+
});
|
|
337
|
+
errorMessage = wrongPkg.reduce(function (p, c) {
|
|
338
|
+
return "".concat(p, "\n ").concat(c.moduleName, "\u672C\u5730\u7248\u672C").concat(c.installed, "\u9700\u5347\u7EA7\u81F3").concat(c.packageJson, "\n ");
|
|
339
|
+
}, '');
|
|
340
|
+
isWrongVersion = wrongPkg.length;
|
|
341
|
+
return _context6.abrupt("return", {
|
|
342
|
+
success: !isWrongVersion,
|
|
343
|
+
message: errorMessage
|
|
344
|
+
});
|
|
345
|
+
case 8:
|
|
346
|
+
case "end":
|
|
347
|
+
return _context6.stop();
|
|
348
|
+
}
|
|
349
|
+
}, _callee6);
|
|
350
|
+
}));
|
|
351
|
+
return function checkPkgVersion(_x2) {
|
|
352
|
+
return _ref10.apply(this, arguments);
|
|
353
|
+
};
|
|
354
|
+
}();
|
|
355
|
+
export { isWorkingTreeClean, getServerConfig, connectServer, serverUpload, serverUnpack, versionSort, releaseProject, getGitCurrentBranch, getCurrentProjectName, loadJSON, getCurrentUserName, sendWebhook, checkPkgVersion };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ButtonProps as AntButtonProps } from 'antd5';
|
|
2
|
+
import type { ButtonGroupProps as AntButtonGroupProps } from 'antd5/es/button';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
export declare type ButtonProps = AntButtonProps;
|
|
7
|
+
export declare type ButtonGroupProps = AntButtonGroupProps;
|
|
8
|
+
/**
|
|
9
|
+
* 按钮组件
|
|
10
|
+
* @param props
|
|
11
|
+
* @constructor
|
|
12
|
+
*/
|
|
13
|
+
declare const Button: {
|
|
14
|
+
(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
Group: (props: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export default Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CheckboxGroupProps as AntCheckboxGroupProps } from 'antd/es/checkbox';
|
|
2
|
+
import type { CheckboxProps as AntCheckboxProps } from 'antd5';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 后续可添加属性
|
|
8
|
+
*/
|
|
9
|
+
export declare type CheckboxProps = AntCheckboxProps;
|
|
10
|
+
export declare type CheckboxGroupProps = AntCheckboxGroupProps;
|
|
11
|
+
/**
|
|
12
|
+
* 多选框
|
|
13
|
+
* @param props
|
|
14
|
+
* @constructor
|
|
15
|
+
*/
|
|
16
|
+
declare const Checkbox: {
|
|
17
|
+
(props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
Group: (props: AntCheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export default Checkbox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DatePickerProps as AntDatePickerProps } from 'antd5';
|
|
2
|
+
export declare type DatePickerProps = AntDatePickerProps;
|
|
3
|
+
/**
|
|
4
|
+
* 日期选择框
|
|
5
|
+
* @param props
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare const DatePicker: (props: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default DatePicker;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { default as Agreement } from './agreement';
|
|
2
|
+
export type { AgreementProps } from './agreement';
|
|
3
|
+
export { default as Avatar } from './avatar';
|
|
4
|
+
export type { AvatarProps } from './avatar';
|
|
5
|
+
export { default as Button } from './button';
|
|
6
|
+
export type { ButtonGroupProps, ButtonProps } from './button';
|
|
7
|
+
export { default as Card } from './card';
|
|
8
|
+
export type { CardProps } from './card';
|
|
9
|
+
export { default as Checkbox } from './checkbox';
|
|
10
|
+
export type { CheckboxGroupProps, CheckboxProps } from './checkbox';
|
|
11
|
+
export { default as ColorPicker } from './ColorPicker';
|
|
12
|
+
export type { ColorPickerProps } from './ColorPicker';
|
|
13
|
+
export * from './configProvider';
|
|
14
|
+
export { default as DatePicker } from './datePicker';
|
|
15
|
+
export type { DatePickerProps } from './datePicker';
|
|
16
|
+
export { default as DragSort } from './DragSort';
|
|
17
|
+
export { default as IconFont } from './Iconfont';
|
|
18
|
+
export type { IconFontProps } from './Iconfont';
|
|
19
|
+
export { default as Input } from './input';
|
|
20
|
+
export type { GroupProps, InputProps, PasswordProps, SearchProps, TextAreaProps, } from './input';
|
|
21
|
+
export { default as InputNumber } from './inputNumber';
|
|
22
|
+
export type { InputNumberProps } from './inputNumber';
|
|
23
|
+
export { default as Pagination } from './pagination';
|
|
24
|
+
export type { PaginationProps } from './pagination';
|
|
25
|
+
export { default as Radio } from './radio';
|
|
26
|
+
export type { RadioGroupProps, RadioProps } from './radio';
|
|
27
|
+
export { default as Select } from './select';
|
|
28
|
+
export type { SelectOptionProps, SelectProps } from './select';
|
|
29
|
+
export { default as Switch } from './switch';
|
|
30
|
+
export type { SwitchProps } from './switch';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { InputProps as AntInputProps } from 'antd5';
|
|
2
|
+
import { GroupProps as AntGroupProps, PasswordProps as AntPasswordProps, SearchProps as AntSearchProps, TextAreaProps as AntTextAreaProps } from 'antd5/es/input';
|
|
3
|
+
/**
|
|
4
|
+
* 后续可添加属性
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 后续可添加属性
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 后续可添加属性
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 后续可添加属性
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* 后续可添加属性
|
|
17
|
+
*/
|
|
18
|
+
export declare type InputProps = AntInputProps;
|
|
19
|
+
export declare type TextAreaProps = AntTextAreaProps;
|
|
20
|
+
export declare type SearchProps = AntSearchProps;
|
|
21
|
+
export declare type PasswordProps = AntPasswordProps;
|
|
22
|
+
export declare type GroupProps = AntGroupProps;
|
|
23
|
+
/**
|
|
24
|
+
* input输入框
|
|
25
|
+
* @param props
|
|
26
|
+
* @constructor
|
|
27
|
+
*/
|
|
28
|
+
declare const Input: {
|
|
29
|
+
(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
TextArea: (props: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Search: (props: SearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
Password: (props: PasswordProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
Group: (props: GroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
};
|
|
35
|
+
export default Input;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InputNumberProps as AntInputNumberProps } from 'antd5';
|
|
2
|
+
export declare type InputNumberProps = AntInputNumberProps;
|
|
3
|
+
/**
|
|
4
|
+
* 数字输入框
|
|
5
|
+
* @param props
|
|
6
|
+
* @constructor
|
|
7
|
+
*/
|
|
8
|
+
declare const InputNumber: (props: InputNumberProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default InputNumber;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RadioGroupProps as AntRadioGroupProps, RadioProps as AntRadioProps } from 'antd5';
|
|
2
|
+
export declare type RadioGroupProps = AntRadioGroupProps;
|
|
3
|
+
export declare type RadioProps = AntRadioProps;
|
|
4
|
+
/**
|
|
5
|
+
* 单选框
|
|
6
|
+
* @param props
|
|
7
|
+
* @constructor
|
|
8
|
+
*/
|
|
9
|
+
declare const Radio: {
|
|
10
|
+
(props: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Group: (props: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
export default Radio;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SelectProps as AntSelectProps } from 'antd5';
|
|
2
|
+
import { OptionProps as AntOptionProps } from 'rc-select/es/Option';
|
|
3
|
+
export declare type SelectProps = AntSelectProps;
|
|
4
|
+
export declare type SelectOptionProps = AntOptionProps;
|
|
5
|
+
declare const Select: {
|
|
6
|
+
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Option: (props: AntOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default Select;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type PisellConfigType = {
|
|
2
|
+
ENV: {
|
|
3
|
+
host: string;
|
|
4
|
+
socket: string;
|
|
5
|
+
helpHost: string;
|
|
6
|
+
boxlocal_h5: string;
|
|
7
|
+
accounts: string;
|
|
8
|
+
domain: string;
|
|
9
|
+
googleMap: string;
|
|
10
|
+
appCenter: string;
|
|
11
|
+
static: string;
|
|
12
|
+
};
|
|
13
|
+
/** 当前主项目类型 */
|
|
14
|
+
platform: 'shop' | string;
|
|
15
|
+
/** 包内请求 由主项目注入 */
|
|
16
|
+
request: {
|
|
17
|
+
get: RequestMethod;
|
|
18
|
+
post: RequestMethod;
|
|
19
|
+
put: RequestMethod;
|
|
20
|
+
remove: RequestMethod;
|
|
21
|
+
request: RequestMethod;
|
|
22
|
+
};
|
|
23
|
+
/** 消息通知url */
|
|
24
|
+
webhookUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
export interface RequestMethod {
|
|
27
|
+
<T = any>(url: string, data?: Record<string, any>, config?: any): Promise<T>;
|
|
28
|
+
}
|
|
29
|
+
export declare const initConfig: (options: PisellConfigType) => void;
|
|
30
|
+
export declare const getConfig: () => PisellConfigType;
|
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/script/constants/index.js
|
|
20
20
|
var constants_exports = {};
|
|
21
21
|
__export(constants_exports, {
|
|
22
|
+
checkPackages: () => checkPackages,
|
|
22
23
|
isSsrMap: () => isSsrMap,
|
|
23
24
|
outPathMap: () => outPathMap
|
|
24
25
|
});
|
|
@@ -51,8 +52,15 @@ var isSsrMap = {
|
|
|
51
52
|
my_pisel_pc_v2: true,
|
|
52
53
|
my_pisel_h5_v2: true
|
|
53
54
|
};
|
|
55
|
+
var checkPackages = [
|
|
56
|
+
"@pisell/date-picker",
|
|
57
|
+
"@pisell/lowcode-renderer",
|
|
58
|
+
"@pisell/common",
|
|
59
|
+
"@pisell/utils"
|
|
60
|
+
];
|
|
54
61
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
62
|
0 && (module.exports = {
|
|
63
|
+
checkPackages,
|
|
56
64
|
isSsrMap,
|
|
57
65
|
outPathMap
|
|
58
66
|
});
|
|
@@ -78,6 +78,11 @@ var UploadCode = class {
|
|
|
78
78
|
console.log("工作区不干净, 请先提交代码");
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
|
+
const { success, message } = await (0, import_utils.checkPkgVersion)(import_constants.checkPackages);
|
|
82
|
+
if (!success) {
|
|
83
|
+
console.log(message);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
81
86
|
let serverConfig = this.setConfig(serverConfigMap[this.env]);
|
|
82
87
|
if (this.env === "prod") {
|
|
83
88
|
serverConfig.privateKey = fs.readFileSync(
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/script/utils/index.js
|
|
30
30
|
var utils_exports = {};
|
|
31
31
|
__export(utils_exports, {
|
|
32
|
+
checkPkgVersion: () => checkPkgVersion,
|
|
32
33
|
connectServer: () => connectServer,
|
|
33
34
|
getCurrentProjectName: () => getCurrentProjectName,
|
|
34
35
|
getCurrentUserName: () => getCurrentUserName,
|
|
@@ -44,6 +45,7 @@ __export(utils_exports, {
|
|
|
44
45
|
});
|
|
45
46
|
module.exports = __toCommonJS(utils_exports);
|
|
46
47
|
var dotenv = __toESM(require("dotenv"));
|
|
48
|
+
var import_npm_check = __toESM(require("npm-check"));
|
|
47
49
|
var import_path = __toESM(require("path"));
|
|
48
50
|
var import_ssh2 = __toESM(require("ssh2"));
|
|
49
51
|
var isWorkingTreeClean = async () => {
|
|
@@ -232,8 +234,26 @@ var sendWebhook = async ({ title, content }) => {
|
|
|
232
234
|
});
|
|
233
235
|
return await response.json();
|
|
234
236
|
};
|
|
237
|
+
var checkPkgVersion = async (checkPackages) => {
|
|
238
|
+
const currentState = await (0, import_npm_check.default)();
|
|
239
|
+
const pkgs = currentState.get("packages");
|
|
240
|
+
const wrongPkg = pkgs.filter((item) => {
|
|
241
|
+
return checkPackages.includes(item.moduleName) && item.mismatch;
|
|
242
|
+
});
|
|
243
|
+
const errorMessage = wrongPkg.reduce((p, c) => {
|
|
244
|
+
return `${p}
|
|
245
|
+
${c.moduleName}本地版本${c.installed}需升级至${c.packageJson}
|
|
246
|
+
`;
|
|
247
|
+
}, "");
|
|
248
|
+
const isWrongVersion = wrongPkg.length;
|
|
249
|
+
return {
|
|
250
|
+
success: !isWrongVersion,
|
|
251
|
+
message: errorMessage
|
|
252
|
+
};
|
|
253
|
+
};
|
|
235
254
|
// Annotate the CommonJS export names for ESM import in node:
|
|
236
255
|
0 && (module.exports = {
|
|
256
|
+
checkPkgVersion,
|
|
237
257
|
connectServer,
|
|
238
258
|
getCurrentProjectName,
|
|
239
259
|
getCurrentUserName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "A collection of reusable UI components for web development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"array-move": "^3.0.1",
|
|
64
64
|
"dotenv": "^16.0.3",
|
|
65
65
|
"inquirer": "^9.2.6",
|
|
66
|
+
"npm-check": "^6.0.1",
|
|
66
67
|
"react-beautiful-dnd": "^13.1.0",
|
|
67
68
|
"react-color": "^2.19.3",
|
|
68
69
|
"ssh2": "^1.13.0",
|