rxtutils 1.1.4-beta.15 → 1.1.4-beta.16
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/cjs/cache/index.cjs +48 -66
- package/cjs/cache/index.d.ts +1 -1
- package/cjs/cache/indexDB.cjs +36 -43
- package/cjs/hooks/useCombineControlValue.cjs +9 -14
- package/cjs/request/defaultHandlers.cjs +3 -3
- package/cjs/request/error.cjs +7 -12
- package/cjs/request/index.cjs +144 -158
- package/cjs/request/index.d.ts +14 -0
- package/cjs/store/createGetter/index.cjs +11 -11
- package/cjs/store/createStateStore/index.cjs +22 -22
- package/cjs/validator/decorators.cjs +44 -55
- package/cjs/validator/validator.cjs +83 -93
- package/es/cache/index.d.ts +1 -1
- package/es/cache/index.mjs +48 -66
- package/es/cache/indexDB.mjs +36 -43
- package/es/hooks/useCombineControlValue.mjs +9 -14
- package/es/request/defaultHandlers.mjs +3 -3
- package/es/request/error.mjs +7 -12
- package/es/request/index.d.ts +14 -0
- package/es/request/index.mjs +144 -158
- package/es/store/createGetter/index.mjs +11 -11
- package/es/store/createStateStore/index.mjs +22 -22
- package/es/validator/decorators.mjs +44 -55
- package/es/validator/validator.mjs +83 -93
- package/package.json +7 -2
|
@@ -9,19 +9,19 @@ function resolveHookState(nextState, currentState) {
|
|
|
9
9
|
return nextState;
|
|
10
10
|
}
|
|
11
11
|
/** 判断当前环境是否为浏览器 */
|
|
12
|
-
|
|
12
|
+
const isBrowser = typeof window !== 'undefined';
|
|
13
13
|
/**
|
|
14
14
|
* 只执行一次的 useEffect hook
|
|
15
15
|
* @param effect 要执行的副作用函数
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
const useEffectOnce = (effect) => {
|
|
18
18
|
useEffect(effect, []);
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* 同构的 useLayoutEffect
|
|
22
22
|
* 在服务端渲染时使用 useEffect,在浏览器环境使用 useLayoutEffect
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
const useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
|
|
25
25
|
/**
|
|
26
26
|
* 创建状态存储
|
|
27
27
|
* 提供一个简单的状态管理解决方案,支持组件间状态共享
|
|
@@ -35,12 +35,12 @@ function createStateStore(initialState) {
|
|
|
35
35
|
* 状态存储对象
|
|
36
36
|
* 包含当前状态、设置状态的方法、状态更新器和监听器列表
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const store = {
|
|
39
39
|
state: initialState instanceof Function ? initialState() : initialState,
|
|
40
|
-
setState
|
|
40
|
+
setState(nextState) {
|
|
41
41
|
store.state = resolveHookState(nextState, store.state);
|
|
42
|
-
store.setters.forEach(
|
|
43
|
-
store.watchers.forEach(
|
|
42
|
+
store.setters.forEach((setter) => setter(store.state));
|
|
43
|
+
store.watchers.forEach((watcher) => watcher(store.state));
|
|
44
44
|
},
|
|
45
45
|
setters: [],
|
|
46
46
|
watchers: [],
|
|
@@ -51,15 +51,15 @@ function createStateStore(initialState) {
|
|
|
51
51
|
*
|
|
52
52
|
* @returns [当前状态, 状态更新函数]
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
const use = () => {
|
|
55
55
|
// 使用 React 的 useState 创建组件本地状态
|
|
56
|
-
|
|
56
|
+
const [globalState, stateSetter] = useState(store.state);
|
|
57
57
|
// 组件卸载时清理状态更新器
|
|
58
|
-
useEffectOnce(
|
|
59
|
-
store.setters = store.setters.filter(
|
|
60
|
-
}
|
|
58
|
+
useEffectOnce(() => () => {
|
|
59
|
+
store.setters = store.setters.filter((setter) => setter !== stateSetter);
|
|
60
|
+
});
|
|
61
61
|
// 在组件挂载和更新时注册状态更新器
|
|
62
|
-
useIsomorphicLayoutEffect(
|
|
62
|
+
useIsomorphicLayoutEffect(() => {
|
|
63
63
|
if (!store.setters.includes(stateSetter)) {
|
|
64
64
|
store.setters.push(stateSetter);
|
|
65
65
|
}
|
|
@@ -67,26 +67,26 @@ function createStateStore(initialState) {
|
|
|
67
67
|
return [globalState, store.setState];
|
|
68
68
|
};
|
|
69
69
|
/** 获取当前状态值 */
|
|
70
|
-
|
|
70
|
+
const get = () => store.state;
|
|
71
71
|
/** 设置状态的函数引用 */
|
|
72
|
-
|
|
72
|
+
const set = store.setState;
|
|
73
73
|
/**
|
|
74
74
|
* 监听状态变化
|
|
75
75
|
* @param callback 状态变化时的回调函数
|
|
76
76
|
* @returns 取消监听的函数
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
const watch = (callback) => {
|
|
79
79
|
store.watchers.push(callback);
|
|
80
|
-
|
|
81
|
-
store.watchers = store.watchers.filter(
|
|
80
|
+
const close = () => {
|
|
81
|
+
store.watchers = store.watchers.filter((watcher) => watcher !== callback);
|
|
82
82
|
};
|
|
83
83
|
return close;
|
|
84
84
|
};
|
|
85
85
|
return {
|
|
86
|
-
use
|
|
87
|
-
get
|
|
88
|
-
set
|
|
89
|
-
watch
|
|
86
|
+
use,
|
|
87
|
+
get,
|
|
88
|
+
set,
|
|
89
|
+
watch,
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -18,9 +18,8 @@ import { BaseValidator } from './validator.mjs';
|
|
|
18
18
|
* username?: string;
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
|
-
function VRequired(noneVals) {
|
|
22
|
-
|
|
23
|
-
return BaseValidator.decoratorCreator(function (val) {
|
|
21
|
+
function VRequired(noneVals = [undefined]) {
|
|
22
|
+
return BaseValidator.decoratorCreator((val) => {
|
|
24
23
|
if (noneVals.includes(val)) {
|
|
25
24
|
return false;
|
|
26
25
|
}
|
|
@@ -39,7 +38,7 @@ function VRequired(noneVals) {
|
|
|
39
38
|
* username?: string;
|
|
40
39
|
* }
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
const VString = BaseValidator.decoratorCreator((val) => {
|
|
43
42
|
if (typeof val !== 'string') {
|
|
44
43
|
return false;
|
|
45
44
|
}
|
|
@@ -57,7 +56,7 @@ var VString = BaseValidator.decoratorCreator(function (val) {
|
|
|
57
56
|
* age?: number;
|
|
58
57
|
* }
|
|
59
58
|
*/
|
|
60
|
-
|
|
59
|
+
const VNumber = BaseValidator.decoratorCreator((val) => {
|
|
61
60
|
if (typeof val !== 'number') {
|
|
62
61
|
return false;
|
|
63
62
|
}
|
|
@@ -75,7 +74,7 @@ var VNumber = BaseValidator.decoratorCreator(function (val) {
|
|
|
75
74
|
* tags?: string[];
|
|
76
75
|
* }
|
|
77
76
|
*/
|
|
78
|
-
|
|
77
|
+
const VArray = BaseValidator.decoratorCreator((val) => {
|
|
79
78
|
if (!Array.isArray(val)) {
|
|
80
79
|
return false;
|
|
81
80
|
}
|
|
@@ -93,7 +92,7 @@ var VArray = BaseValidator.decoratorCreator(function (val) {
|
|
|
93
92
|
* active?: boolean;
|
|
94
93
|
* }
|
|
95
94
|
*/
|
|
96
|
-
|
|
95
|
+
const VBoolean = BaseValidator.decoratorCreator((val) => {
|
|
97
96
|
if (typeof val !== 'boolean') {
|
|
98
97
|
return false;
|
|
99
98
|
}
|
|
@@ -112,14 +111,12 @@ var VBoolean = BaseValidator.decoratorCreator(function (val) {
|
|
|
112
111
|
* age?: number;
|
|
113
112
|
* }
|
|
114
113
|
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
};
|
|
114
|
+
const VMin = (min) => BaseValidator.decoratorCreator((val) => {
|
|
115
|
+
if (typeof val !== 'number' || val < min) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
});
|
|
123
120
|
/**
|
|
124
121
|
* 最大值验证装饰器
|
|
125
122
|
* 验证数字是否小于或等于指定的最大值
|
|
@@ -133,14 +130,12 @@ var VMin = function (min) {
|
|
|
133
130
|
* age?: number;
|
|
134
131
|
* }
|
|
135
132
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
});
|
|
143
|
-
};
|
|
133
|
+
const VMax = (max) => BaseValidator.decoratorCreator((val) => {
|
|
134
|
+
if (typeof val !== 'number' || val > max) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
});
|
|
144
139
|
/**
|
|
145
140
|
* 最小长度验证装饰器
|
|
146
141
|
* 验证字符串或数组的长度是否大于或等于指定的最小长度
|
|
@@ -154,17 +149,15 @@ var VMax = function (max) {
|
|
|
154
149
|
* password?: string;
|
|
155
150
|
* }
|
|
156
151
|
*/
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
167
|
-
};
|
|
152
|
+
const VMinLength = (minLen) => BaseValidator.decoratorCreator((val) => {
|
|
153
|
+
if (typeof val !== 'string' && !Array.isArray(val)) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
if (val.length < minLen) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
});
|
|
168
161
|
/**
|
|
169
162
|
* 最大长度验证装饰器
|
|
170
163
|
* 验证字符串或数组的长度是否小于或等于指定的最大长度
|
|
@@ -178,17 +171,15 @@ var VMinLength = function (minLen) {
|
|
|
178
171
|
* username?: string;
|
|
179
172
|
* }
|
|
180
173
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
});
|
|
191
|
-
};
|
|
174
|
+
const VMaxLength = (maxLen) => BaseValidator.decoratorCreator((val) => {
|
|
175
|
+
if (typeof val !== 'string' && !Array.isArray(val)) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
if (val.length > maxLen) {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
return true;
|
|
182
|
+
});
|
|
192
183
|
/**
|
|
193
184
|
* 邮箱格式验证装饰器
|
|
194
185
|
* 验证字符串是否符合邮箱格式
|
|
@@ -201,12 +192,12 @@ var VMaxLength = function (maxLen) {
|
|
|
201
192
|
* email?: string;
|
|
202
193
|
* }
|
|
203
194
|
*/
|
|
204
|
-
|
|
195
|
+
const VEmail = BaseValidator.decoratorCreator((val) => {
|
|
205
196
|
if (typeof val !== 'string') {
|
|
206
197
|
return false;
|
|
207
198
|
}
|
|
208
199
|
// 简单邮箱正则
|
|
209
|
-
|
|
200
|
+
const emailReg = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
210
201
|
return emailReg.test(val);
|
|
211
202
|
});
|
|
212
203
|
/**
|
|
@@ -222,13 +213,11 @@ var VEmail = BaseValidator.decoratorCreator(function (val) {
|
|
|
222
213
|
* phone?: string;
|
|
223
214
|
* }
|
|
224
215
|
*/
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
});
|
|
232
|
-
};
|
|
216
|
+
const VPattern = (pattern) => BaseValidator.decoratorCreator((val) => {
|
|
217
|
+
if (typeof val !== 'string') {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
return pattern.test(val);
|
|
221
|
+
});
|
|
233
222
|
|
|
234
223
|
export { VArray, VBoolean, VEmail, VMax, VMaxLength, VMin, VMinLength, VNumber, VPattern, VRequired, VString };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var KEY_SYMBOL = Symbol("key-description");
|
|
1
|
+
const KEY_SYMBOL = Symbol("key-description");
|
|
4
2
|
/**
|
|
5
3
|
* 基础验证器类
|
|
6
4
|
* 提供字段验证功能,可通过装饰器为类属性添加验证规则
|
|
7
5
|
*/
|
|
8
|
-
|
|
6
|
+
class BaseValidator {
|
|
9
7
|
/**
|
|
10
8
|
* 构造函数
|
|
11
9
|
* 初始化验证器映射存储
|
|
12
10
|
*/
|
|
13
|
-
|
|
11
|
+
constructor() {
|
|
14
12
|
/** 用于存储验证器映射的私有符号 */
|
|
15
13
|
this.__keySymbol = KEY_SYMBOL;
|
|
16
14
|
this[this.__keySymbol] = {};
|
|
@@ -21,18 +19,16 @@ var BaseValidator = /** @class */ (function () {
|
|
|
21
19
|
* @param itemKey 要验证的字段名
|
|
22
20
|
* @returns 验证错误数组,如果没有错误则返回null
|
|
23
21
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var errors = [];
|
|
22
|
+
validate(itemKey, itemAll = false) {
|
|
23
|
+
const validatorMap = this[this.__keySymbol];
|
|
24
|
+
const errors = [];
|
|
28
25
|
// 校验每个 key
|
|
29
|
-
|
|
26
|
+
const validators = validatorMap[itemKey];
|
|
30
27
|
if (!validators) {
|
|
31
28
|
return null;
|
|
32
29
|
}
|
|
33
|
-
for (
|
|
34
|
-
|
|
35
|
-
var res = validator(this[itemKey]);
|
|
30
|
+
for (const validator of validators) {
|
|
31
|
+
const res = validator(this[itemKey]);
|
|
36
32
|
if (!res.status) {
|
|
37
33
|
errors.push(res.message);
|
|
38
34
|
if (!itemAll)
|
|
@@ -43,7 +39,7 @@ var BaseValidator = /** @class */ (function () {
|
|
|
43
39
|
return errors;
|
|
44
40
|
}
|
|
45
41
|
return null;
|
|
46
|
-
}
|
|
42
|
+
}
|
|
47
43
|
/**
|
|
48
44
|
* 验证多个或所有字段
|
|
49
45
|
* @param order 验证字段的顺序,可以指定验证的字段名数组及其顺序,默认验证所有字段,按对象定义顺序
|
|
@@ -51,21 +47,17 @@ var BaseValidator = /** @class */ (function () {
|
|
|
51
47
|
* @param everyItem 是否验证所有字段,为true时会验证所有字段,为false时遇到第一个失败的字段就停止,默认为 false
|
|
52
48
|
* @returns 验证错误数组,如果没有错误则返回null
|
|
53
49
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var validatorMap = this[this.__keySymbol];
|
|
58
|
-
var errors = {};
|
|
50
|
+
validateAll(order, itemAll = false, everyItem = false) {
|
|
51
|
+
const validatorMap = this[this.__keySymbol];
|
|
52
|
+
const errors = {};
|
|
59
53
|
// 校验每个 key
|
|
60
|
-
|
|
61
|
-
for (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var fns = validatorMap[key];
|
|
54
|
+
const keys = order || Object.keys(validatorMap);
|
|
55
|
+
for (const key of keys) {
|
|
56
|
+
const value = this[key];
|
|
57
|
+
const fns = validatorMap[key];
|
|
65
58
|
// 校验每个校验项目
|
|
66
|
-
for (
|
|
67
|
-
|
|
68
|
-
var res = fn(value);
|
|
59
|
+
for (const fn of fns) {
|
|
60
|
+
const res = fn(value);
|
|
69
61
|
if (!res.status) {
|
|
70
62
|
// 出现错误
|
|
71
63
|
if (Array.isArray(errors[key])) {
|
|
@@ -86,79 +78,77 @@ var BaseValidator = /** @class */ (function () {
|
|
|
86
78
|
return errors;
|
|
87
79
|
}
|
|
88
80
|
return null;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 装饰器创建器
|
|
85
|
+
* 用于创建属性验证装饰器的工厂函数
|
|
86
|
+
*
|
|
87
|
+
* @param func 验证函数,接收属性值并返回布尔值表示验证结果
|
|
88
|
+
* @returns 返回一个接收错误消息的函数,该函数再返回实际的装饰器
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // 创建一个验证字符串的装饰器
|
|
92
|
+
* const VString = BaseValidator.decoratorCreator(
|
|
93
|
+
* (val) => typeof val === 'string' || val === undefined
|
|
94
|
+
* );
|
|
95
|
+
*
|
|
96
|
+
* // 创建一个验证必填项的装饰器
|
|
97
|
+
* const VRequired = BaseValidator.decoratorCreator(
|
|
98
|
+
* (val) => val !== undefined && val !== null && val !== ''
|
|
99
|
+
* );
|
|
100
|
+
*
|
|
101
|
+
* // 在类中使用这些装饰器
|
|
102
|
+
* class User extends BaseValidator {
|
|
103
|
+
* @VString('名称必须为字符串')
|
|
104
|
+
* @(VRequired()('名称必须填写'))
|
|
105
|
+
* name?: string;
|
|
106
|
+
*
|
|
107
|
+
* // 验证使用
|
|
108
|
+
* validateName() {
|
|
109
|
+
* return this.validate('name');
|
|
110
|
+
* }
|
|
111
|
+
* }
|
|
112
|
+
*
|
|
113
|
+
* const user = new User();
|
|
114
|
+
* console.log(user.validateName()); // 显示错误信息:名称必须填写
|
|
115
|
+
*/
|
|
116
|
+
BaseValidator.decoratorCreator = (func) => {
|
|
117
|
+
return (message = (val, value, context) => `${String(context.name)}格式错误`) => {
|
|
118
|
+
return function (value, context) {
|
|
119
|
+
context.addInitializer(function () {
|
|
120
|
+
let validators = this[this.__keySymbol];
|
|
121
|
+
if (!validators) {
|
|
122
|
+
this[this.__keySymbol] = {};
|
|
123
|
+
validators = this[this.__keySymbol];
|
|
124
|
+
}
|
|
125
|
+
const name = context.name;
|
|
126
|
+
const validator = (val) => {
|
|
127
|
+
const validateStatus = func(val, value, context);
|
|
128
|
+
if (validateStatus) {
|
|
129
|
+
return { name, status: true };
|
|
132
130
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return { name: name, status: true };
|
|
131
|
+
else {
|
|
132
|
+
let msg = "";
|
|
133
|
+
if (typeof message === "function") {
|
|
134
|
+
msg = message(val, value, context);
|
|
138
135
|
}
|
|
139
136
|
else {
|
|
140
|
-
|
|
141
|
-
if (typeof message === "function") {
|
|
142
|
-
msg = message(val, value, context);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
msg = message;
|
|
146
|
-
}
|
|
147
|
-
return { name: name, status: false, message: msg };
|
|
137
|
+
msg = message;
|
|
148
138
|
}
|
|
149
|
-
|
|
150
|
-
if (validators[name]) {
|
|
151
|
-
validators[name] = __spreadArray(__spreadArray([], validators[name], true), [validator], false);
|
|
139
|
+
return { name, status: false, message: msg };
|
|
152
140
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
141
|
+
};
|
|
142
|
+
if (validators[name]) {
|
|
143
|
+
validators[name] = [...validators[name], validator];
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
validators[name] = [validator];
|
|
147
|
+
}
|
|
148
|
+
});
|
|
158
149
|
};
|
|
159
150
|
};
|
|
160
|
-
|
|
161
|
-
}());
|
|
151
|
+
};
|
|
162
152
|
// class User extends BaseValidator{
|
|
163
153
|
// @VString('名称必须为字符串')
|
|
164
154
|
// @(VRequired()('名称必须填写'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rxtutils",
|
|
3
|
-
"version": "1.1.4-beta.
|
|
3
|
+
"version": "1.1.4-beta.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "cjs/index.cjs",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"cjs"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
+
"dev": "vite",
|
|
13
14
|
"build": "pnpm clean && rollup -c",
|
|
14
15
|
"clean": "rm -rf es cjs",
|
|
15
16
|
"publishNpm": "npm publish --registry https://registry.npmjs.org",
|
|
@@ -20,13 +21,17 @@
|
|
|
20
21
|
"@types/lodash-es": "^4.17.12",
|
|
21
22
|
"@types/node": "^22.15.29",
|
|
22
23
|
"@types/react": "^19.1.12",
|
|
24
|
+
"@types/react-dom": "^19.2.3",
|
|
25
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
26
|
+
"react-dom": "^19.2.3",
|
|
27
|
+
"react-router": "^7.11.0",
|
|
23
28
|
"rollup": "^4.41.1",
|
|
24
29
|
"rollup-plugin-dts": "^6.2.1",
|
|
25
30
|
"typescript": "^5.8.3",
|
|
26
31
|
"vite": "^5.4.19"
|
|
27
32
|
},
|
|
28
33
|
"peerDependencies": {
|
|
29
|
-
"react": "^19.
|
|
34
|
+
"react": "^19.2.3"
|
|
30
35
|
},
|
|
31
36
|
"dependencies": {
|
|
32
37
|
"axios": "^1.9.0",
|