@pawover/kit 0.0.1 → 0.1.1
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/package.json +42 -45
- package/packages/hooks/dist/alova.d.ts +3 -4
- package/packages/hooks/dist/metadata.json +0 -1
- package/packages/hooks/dist/react.d.ts +4 -13
- package/packages/hooks/dist/react.js +820 -244
- package/packages/utils/dist/index.d.ts +697 -70
- package/packages/utils/dist/index.js +216 -2
- package/packages/utils/dist/math.d.ts +4 -0
- package/packages/utils/dist/math.js +1 -1
- package/packages/utils/dist/{string-DCWqoW4P.js → string-p6hZ1Mjb.js} +174 -7
- package/packages/utils/dist/vite.d.ts +13 -0
- package/packages/utils/dist/vite.js +13 -0
package/package.json
CHANGED
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
"description": "一个基于 TypeScript 的开发工具包",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"type": "module",
|
|
11
|
-
"version": "0.
|
|
12
|
-
"packageManager": "pnpm@10.28.2",
|
|
11
|
+
"version": "0.1.1",
|
|
13
12
|
"engines": {
|
|
14
13
|
"node": ">=22.20.0"
|
|
15
14
|
},
|
|
15
|
+
"devEngines": {
|
|
16
|
+
"runtime": {
|
|
17
|
+
"name": "node",
|
|
18
|
+
"version": "24.14.0"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
16
21
|
"keywords": [
|
|
17
22
|
"pawover",
|
|
18
23
|
"pawover-kit"
|
|
@@ -45,62 +50,36 @@
|
|
|
45
50
|
"./zod": "./packages/zod/dist/index.js",
|
|
46
51
|
"./zod/*": "./packages/zod/dist/*"
|
|
47
52
|
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"test": "vitest",
|
|
50
|
-
"build": "turbo build",
|
|
51
|
-
"build:force": "turbo build --force",
|
|
52
|
-
"build:package": "turbo build:package && pnpm package",
|
|
53
|
-
"build:package:force": "turbo build:package --force && pnpm package",
|
|
54
|
-
"package": "pnpm pack",
|
|
55
|
-
"public": "turbo build && npm publish --access public",
|
|
56
|
-
"check": "pnpm check:types & pnpm check:eslint & pnpm check:format",
|
|
57
|
-
"check:types": "tsc --noEmit",
|
|
58
|
-
"check:eslint": "eslint --fix \"**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx,vue}\" --cache-location=.cache/eslint.cache.json --cache",
|
|
59
|
-
"check:format": "prettier --write \"**/*.{html,json}\" --cache-location=.cache/prettier.cache.json --cache",
|
|
60
|
-
"check:pack": "attw --pack .",
|
|
61
|
-
"clean": "pnpm clean:cache & pnpm clean:lib & pnpm clean:output",
|
|
62
|
-
"clean:turbo": "rimraf -g **/.turbo",
|
|
63
|
-
"clean:cache": "rimraf -g .cache",
|
|
64
|
-
"clean:lib": "rimraf -g node_modules",
|
|
65
|
-
"clean:output": "rimraf -g **/dist **/*.tgz",
|
|
66
|
-
"lib:up": "taze -I -r --exclude pnpm",
|
|
67
|
-
"commit": "git cz",
|
|
68
|
-
"prepare": "husky"
|
|
69
|
-
},
|
|
70
53
|
"devDependencies": {
|
|
71
|
-
"@commitlint/cli": "^21.0.
|
|
72
|
-
"@commitlint/config-conventional": "^21.0.
|
|
73
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
74
|
-
"@pawover/eslint-rules": "^0.
|
|
54
|
+
"@commitlint/cli": "^21.0.2",
|
|
55
|
+
"@commitlint/config-conventional": "^21.0.2",
|
|
56
|
+
"@eslint-react/eslint-plugin": "^5.8.11",
|
|
57
|
+
"@pawover/eslint-rules": "^0.2.0",
|
|
75
58
|
"@playwright/test": "^1.60.0",
|
|
76
59
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
77
60
|
"@types/fs-extra": "^11.0.4",
|
|
78
|
-
"@types/node": "^25.
|
|
79
|
-
"@vitejs/plugin-react": "^6.0.
|
|
80
|
-
"@vitest/browser-playwright": "^4.1.
|
|
61
|
+
"@types/node": "^25.9.1",
|
|
62
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
63
|
+
"@vitest/browser-playwright": "^4.1.8",
|
|
81
64
|
"commitizen": "^4.3.1",
|
|
82
65
|
"cz-customizable": "^7.5.4",
|
|
83
|
-
"eslint": "^10.
|
|
66
|
+
"eslint": "^10.4.1",
|
|
84
67
|
"eslint-plugin-antfu": "^3.2.3",
|
|
85
68
|
"eslint-plugin-import-lite": "^0.6.0",
|
|
86
69
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
87
|
-
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
88
70
|
"fs-extra": "^11.3.5",
|
|
89
71
|
"husky": "^9.1.7",
|
|
90
72
|
"jsdom": "^29.1.1",
|
|
91
|
-
"lint-staged": "^17.0.
|
|
73
|
+
"lint-staged": "^17.0.7",
|
|
92
74
|
"prettier": "^3.8.3",
|
|
93
75
|
"rimraf": "^6.1.3",
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"turbo": "^2.9.12",
|
|
76
|
+
"tsdown": "^0.22.1",
|
|
77
|
+
"turbo": "^2.9.16",
|
|
97
78
|
"typescript": "^6.0.3",
|
|
98
|
-
"typescript-eslint": "^8.
|
|
99
|
-
"vitest": "^4.1.
|
|
100
|
-
"vitest-browser-react": "^2.2.0"
|
|
79
|
+
"typescript-eslint": "^8.60.1",
|
|
80
|
+
"vitest": "^4.1.8"
|
|
101
81
|
},
|
|
102
82
|
"peerDependencies": {
|
|
103
|
-
"@types/react": "^19.2.14",
|
|
104
83
|
"alova": "^3.3.0",
|
|
105
84
|
"mathjs": "^15.0.0",
|
|
106
85
|
"react": "^19.2.0",
|
|
@@ -108,9 +87,6 @@
|
|
|
108
87
|
"zod": "^4.1.0"
|
|
109
88
|
},
|
|
110
89
|
"peerDependenciesMeta": {
|
|
111
|
-
"@types/react": {
|
|
112
|
-
"optional": true
|
|
113
|
-
},
|
|
114
90
|
"alova": {
|
|
115
91
|
"optional": true
|
|
116
92
|
},
|
|
@@ -134,5 +110,26 @@
|
|
|
134
110
|
"cz-customizable": {
|
|
135
111
|
"config": "cz.config.cjs"
|
|
136
112
|
}
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"test": "vitest",
|
|
116
|
+
"build": "turbo build",
|
|
117
|
+
"build:force": "turbo build --force",
|
|
118
|
+
"build:package": "turbo build:package && pnpm package",
|
|
119
|
+
"build:package:force": "turbo build:package --force && pnpm package",
|
|
120
|
+
"package": "pnpm pack",
|
|
121
|
+
"public": "turbo build && pnpm publish --access public",
|
|
122
|
+
"check": "pnpm check:types & pnpm check:eslint & pnpm check:format",
|
|
123
|
+
"check:types": "tsc --noEmit",
|
|
124
|
+
"check:eslint": "eslint --fix \"**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx,vue}\" --cache-location=.cache/eslint.cache.json --cache",
|
|
125
|
+
"check:format": "prettier --write \"**/*.{html,json}\" --cache-location=.cache/prettier.cache.json --cache",
|
|
126
|
+
"check:pack": "attw --pack .",
|
|
127
|
+
"clean": "pnpm clean:cache & pnpm clean:lib & pnpm clean:output",
|
|
128
|
+
"clean:turbo": "rimraf -g **/.turbo",
|
|
129
|
+
"clean:cache": "rimraf -g .cache",
|
|
130
|
+
"clean:lib": "rimraf -g node_modules",
|
|
131
|
+
"clean:output": "rimraf -g **/dist **/*.tgz",
|
|
132
|
+
"lib:up": "taze -I -r --exclude pnpm",
|
|
133
|
+
"commit": "git cz"
|
|
137
134
|
}
|
|
138
|
-
}
|
|
135
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$alova_client0 from "alova/client";
|
|
2
1
|
import { AlovaFrontMiddlewareContext, AlovaMethodHandler, CompleteHandler, ErrorHandler, PaginationHookConfig, RequestHookConfig, SuccessHandler, WatcherHookConfig } from "alova/client";
|
|
3
2
|
import { AlovaGenerics, Method } from "alova";
|
|
4
3
|
|
|
@@ -9,7 +8,7 @@ interface HookOptions$2<AG extends AlovaGenerics, L extends any[], Args extends
|
|
|
9
8
|
onError?: ErrorHandler<AG, Args> | undefined;
|
|
10
9
|
onComplete?: CompleteHandler<AG, Args> | undefined;
|
|
11
10
|
}
|
|
12
|
-
declare function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]>(methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>, hookOptions?: HookOptions$2<AG, L, Args> | undefined):
|
|
11
|
+
declare function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]>(methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>, hookOptions?: HookOptions$2<AG, L, Args> | undefined): import("alova/client").UsePaginationExposure<AG, L, Args>;
|
|
13
12
|
//#endregion
|
|
14
13
|
//#region src/alova/useAlovaRequest.d.ts
|
|
15
14
|
interface HookOptions$1<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {
|
|
@@ -18,7 +17,7 @@ interface HookOptions$1<AG extends AlovaGenerics, Args extends any[]> extends Re
|
|
|
18
17
|
onError?: ErrorHandler<AG, Args> | undefined;
|
|
19
18
|
onComplete?: CompleteHandler<AG, Args> | undefined;
|
|
20
19
|
}
|
|
21
|
-
declare function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]>(methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>, hookOptions?: HookOptions$1<AG, Args> | undefined):
|
|
20
|
+
declare function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]>(methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>, hookOptions?: HookOptions$1<AG, Args> | undefined): import("alova/client").UseHookExposure<AG, Args, unknown>;
|
|
22
21
|
//#endregion
|
|
23
22
|
//#region src/alova/useAlovaWatcher.d.ts
|
|
24
23
|
interface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends WatcherHookConfig<AG, Args> {
|
|
@@ -26,6 +25,6 @@ interface HookOptions<AG extends AlovaGenerics, Args extends any[]> extends Watc
|
|
|
26
25
|
onError?: ErrorHandler<AG, Args> | undefined;
|
|
27
26
|
onComplete?: CompleteHandler<AG, Args> | undefined;
|
|
28
27
|
}
|
|
29
|
-
declare function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]>(methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>, watchingStates: AG["StatesExport"]["Watched"][], hookOptions?: HookOptions<AG, Args>):
|
|
28
|
+
declare function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]>(methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>, watchingStates: AG["StatesExport"]["Watched"][], hookOptions?: HookOptions<AG, Args>): import("alova/client").UseHookExposure<AG, Args, unknown>;
|
|
30
29
|
//#endregion
|
|
31
30
|
export { useAlovaPagination, useAlovaRequest, useAlovaWatcher };
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EffectCallback, RefObject } from "react";
|
|
2
2
|
|
|
3
|
-
//#region src/react/useCreation.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* 确保实例不会被重复创建
|
|
6
|
-
*
|
|
7
|
-
* @param factory
|
|
8
|
-
* @param deps
|
|
9
|
-
*/
|
|
10
|
-
declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
|
|
11
|
-
//#endregion
|
|
12
3
|
//#region src/react/useLatest.d.ts
|
|
13
4
|
/**
|
|
14
5
|
* 返回当前最新值的 Hook
|
|
@@ -17,7 +8,7 @@ declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
|
|
|
17
8
|
*/
|
|
18
9
|
declare function useLatest<T>(value: T): RefObject<T>;
|
|
19
10
|
//#endregion
|
|
20
|
-
//#region ../../node_modules/.pnpm/@pawover+types@0.0.
|
|
11
|
+
//#region ../../node_modules/.pnpm/@pawover+types@0.0.2_@types+react@19.2.15_typescript@6.0.3/node_modules/@pawover/types/dist/index.d.ts
|
|
21
12
|
/** 描述函数类型 */
|
|
22
13
|
type AnyFunction<P extends any[] = any[], R = any> = (...arg: P) => R;
|
|
23
14
|
/** 描述异步函数类型 */
|
|
@@ -45,7 +36,7 @@ type AnyAsyncFunction<P extends any[] = any[], R = any> = (...args: P) => Promis
|
|
|
45
36
|
*/
|
|
46
37
|
declare function useMount(effect: EffectCallback | AnyAsyncFunction): void;
|
|
47
38
|
//#endregion
|
|
48
|
-
//#region ../../node_modules/.pnpm/type-fest@5.
|
|
39
|
+
//#region ../../node_modules/.pnpm/type-fest@5.7.0/node_modules/type-fest/source/tuple-to-union.d.ts
|
|
49
40
|
/**
|
|
50
41
|
Convert a tuple/array into a union type of its elements.
|
|
51
42
|
|
|
@@ -161,4 +152,4 @@ declare function useTitle(title: string, options?: TitleHookOptions | undefined)
|
|
|
161
152
|
*/
|
|
162
153
|
declare function useUnmount(effect: AnyFunction): void;
|
|
163
154
|
//#endregion
|
|
164
|
-
export { BREAK_POINT_TOKEN, BreakPointTokens, ResponsiveHookOptions,
|
|
155
|
+
export { BREAK_POINT_TOKEN, BreakPointTokens, ResponsiveHookOptions, useLatest, useMount, useResponsive, useTitle, useUnmount };
|