@pawover/kit 0.5.1 → 0.7.0
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/README.en.md +123 -0
- package/README.md +123 -1
- package/entry/eslint-rules.cjs +1 -0
- package/entry/eslint-rules.d.cts +1 -0
- package/entry/eslint-rules.d.ts +2 -0
- package/entry/eslint-rules.js +2 -0
- package/entry/hooks-alova.cjs +1 -0
- package/entry/hooks-alova.d.cts +1 -0
- package/entry/hooks-alova.d.ts +1 -0
- package/entry/hooks-alova.js +1 -0
- package/entry/hooks-react.cjs +1 -0
- package/entry/hooks-react.d.cts +1 -0
- package/entry/hooks-react.d.ts +1 -0
- package/entry/hooks-react.js +1 -0
- package/entry/index.cjs +1 -0
- package/entry/index.d.cts +1 -0
- package/entry/index.d.ts +1 -0
- package/entry/index.js +1 -0
- package/entry/math.cjs +1 -0
- package/entry/math.d.cts +1 -0
- package/entry/math.d.ts +1 -0
- package/entry/math.js +1 -0
- package/entry/types-react.cjs +1 -0
- package/entry/types-react.d.cts +1 -0
- package/entry/types-react.d.ts +1 -0
- package/entry/types-react.js +1 -0
- package/entry/types.cjs +1 -0
- package/entry/types.d.cts +1 -0
- package/entry/types.d.ts +1 -0
- package/entry/types.js +1 -0
- package/entry/vite.cjs +1 -0
- package/entry/vite.d.cts +1 -0
- package/entry/vite.d.ts +1 -0
- package/entry/vite.js +1 -0
- package/entry/zod.cjs +1 -0
- package/entry/zod.d.cts +1 -0
- package/entry/zod.d.ts +1 -0
- package/entry/zod.js +1 -0
- package/package.json +78 -63
- package/packages/hooks/dist/alova.cjs +0 -53
- package/packages/hooks/dist/alova.d.cts +0 -1
- package/packages/hooks/dist/alova.d.ts +0 -33
- package/packages/hooks/dist/alova.js +0 -50
- package/packages/hooks/dist/index.cjs +0 -0
- package/packages/hooks/dist/index.d.cts +0 -1
- package/packages/hooks/dist/index.d.ts +0 -1
- package/packages/hooks/dist/index.js +0 -0
- package/packages/hooks/dist/react.cjs +0 -169
- package/packages/hooks/dist/react.d.cts +0 -1
- package/packages/hooks/dist/react.d.ts +0 -95
- package/packages/hooks/dist/react.js +0 -163
- package/packages/utils/dist/index.cjs +0 -2300
- package/packages/utils/dist/index.d.cts +0 -1
- package/packages/utils/dist/index.d.ts +0 -2739
- package/packages/utils/dist/index.js +0 -2287
- package/packages/utils/dist/math-BznvO4qI.cjs +0 -1029
- package/packages/utils/dist/math-DRbCtLQH.js +0 -1012
- package/packages/utils/dist/math.cjs +0 -3
- package/packages/utils/dist/math.d.cts +0 -1
- package/packages/utils/dist/math.d.ts +0 -60
- package/packages/utils/dist/math.js +0 -2
- package/packages/utils/dist/vite.cjs +0 -44
- package/packages/utils/dist/vite.d.cts +0 -1
- package/packages/utils/dist/vite.d.ts +0 -28
- package/packages/utils/dist/vite.js +0 -43
- package/packages/zod/dist/index.cjs +0 -91
- package/packages/zod/dist/index.d.cts +0 -1
- package/packages/zod/dist/index.d.ts +0 -57
- package/packages/zod/dist/index.js +0 -61
- /package/{packages/hooks/dist/metadata.json → entry/hooks-metadata.json} +0 -0
- /package/{packages/utils/dist → entry}/metadata.json +0 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# pawover-kit
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@pawover/kit)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
> An open-source TypeScript toolkit: type utilities, static utility classes, React / Alova hooks, ESLint rulesets and Zod schemas, ready to use with complete type definitions.
|
|
8
|
+
|
|
9
|
+
pawover-kit is a pnpm monorepo made of 5 independently publishable packages. The root package `@pawover/kit` re-exports every subpackage, while each subpackage can also be installed and used on its own.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Type-only utilities** `@pawover/kit-types`: no runtime code, providing `AnyObject`, `TreeLike`, the `AnyFunction` family, `AdvancedRecord`, `ApiNameCheck` and more
|
|
14
|
+
- **Static utility classes** `@pawover/kit-utils`: 14+ utility classes covering arrays, strings, objects, trees, currency, dates, math and more
|
|
15
|
+
- **React / Alova hooks** `@pawover/kit-hooks`: `useMount`, `useUnmount`, `useLatest`, `useResponsive`, `useTitle` and Alova request hooks
|
|
16
|
+
- **ESLint rulesets** `@pawover/kit-eslint-rules`: 9 rule groups (javascript / typescript / react / reactHooks / vue / stylistic / antfu / imports / importsSort) plus `GLOB_EXCLUDE` and `createRules`
|
|
17
|
+
- **Zod v4 schemas** `@pawover/kit-zod`: common validators for id, string, number, boolean, bigint and more
|
|
18
|
+
- Dual ESM / CJS builds with full type declarations
|
|
19
|
+
- `development` export condition so bundlers can use the source directly in development
|
|
20
|
+
|
|
21
|
+
## Packages
|
|
22
|
+
|
|
23
|
+
| Package | Description | Import path |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| `@pawover/kit-types` | Type-only utilities (no runtime code) | `@pawover/kit/types`, React types via `@pawover/kit/types/react` |
|
|
26
|
+
| `@pawover/kit-utils` | Static utility classes | `@pawover/kit/utils` (also `./math` and `./vite` subpaths) |
|
|
27
|
+
| `@pawover/kit-hooks` | React + Alova hooks | `@pawover/kit/hooks/react`, `@pawover/kit/hooks/alova` |
|
|
28
|
+
| `@pawover/kit-eslint-rules` | ESLint rulesets | `@pawover/kit/eslint-rules` |
|
|
29
|
+
| `@pawover/kit-zod` | Zod v4 schemas | `@pawover/kit/zod` |
|
|
30
|
+
|
|
31
|
+
> [!NOTE]
|
|
32
|
+
> The root export of `@pawover/kit-hooks` is empty. Always import from the `@pawover/kit/hooks/react` or `@pawover/kit/hooks/alova` subpaths.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
Install the umbrella package:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @pawover/kit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or install individual subpackages:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @pawover/kit-types
|
|
46
|
+
npm install @pawover/kit-utils
|
|
47
|
+
npm install @pawover/kit-hooks
|
|
48
|
+
npm install @pawover/kit-eslint-rules
|
|
49
|
+
npm install @pawover/kit-zod
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> [!WARNING]
|
|
53
|
+
> `alova`, `mathjs`, `react`, `vite` and `zod` are optional peer dependencies: install them yourself when using the related features (for example `alova` and `react` are required for `@pawover/kit/hooks/alova`).
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { TypeUtil } from "@pawover/kit/utils";
|
|
59
|
+
import { useMount } from "@pawover/kit/hooks/react";
|
|
60
|
+
import { useAlovaRequest } from "@pawover/kit/hooks/alova";
|
|
61
|
+
import type { AnyObject } from "@pawover/kit/types";
|
|
62
|
+
import eslintRules from "@pawover/kit/eslint-rules";
|
|
63
|
+
import { id } from "@pawover/kit/zod";
|
|
64
|
+
|
|
65
|
+
// Type utilities
|
|
66
|
+
const obj: AnyObject = { a: 1, b: "2" };
|
|
67
|
+
|
|
68
|
+
// Static utility classes
|
|
69
|
+
TypeUtil.isString("hello"); // true
|
|
70
|
+
|
|
71
|
+
// React hooks
|
|
72
|
+
useMount(() => {
|
|
73
|
+
console.log("mounted");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ESLint rulesets (flat config)
|
|
77
|
+
export default [
|
|
78
|
+
{ ignores: eslintRules.GLOB_EXCLUDE },
|
|
79
|
+
{ files: ["**/*.ts"], rules: { ...eslintRules.javascript, ...eslintRules.typescript } },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
// Zod schemas
|
|
83
|
+
id.parse("abc"); // "abc"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
|
|
88
|
+
- Node.js >= 22.20.0
|
|
89
|
+
- pnpm >= 11
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/pawover/pawover-kit.git
|
|
95
|
+
cd pawover-kit
|
|
96
|
+
pnpm install
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Common commands:
|
|
100
|
+
|
|
101
|
+
| Command | Description |
|
|
102
|
+
| :--- | :--- |
|
|
103
|
+
| `pnpm test` | Run all vitest suites (801 tests / 31 files, node + jsdom environments) |
|
|
104
|
+
| `pnpm test:types` | Type-check the test files |
|
|
105
|
+
| `pnpm test:ci` | Full CI pipeline: type check → tests → build → smoke → pack check |
|
|
106
|
+
| `pnpm build` | Build every subpackage with turbo (tsdown emits ESM/CJS builds and type declarations) |
|
|
107
|
+
| `pnpm check` | Run types / eslint / format checks in parallel |
|
|
108
|
+
|
|
109
|
+
## Testing
|
|
110
|
+
|
|
111
|
+
- **Unit tests**: vitest with two projects (node environment for utils / zod / eslint-rules, jsdom environment for hooks)
|
|
112
|
+
- **Type tests**: type-level API tests ending with `.test.type.ts` under `test/types/`, fully checked by `test:types`
|
|
113
|
+
- **Smoke tests**: verify every dist entry is importable after the build
|
|
114
|
+
|
|
115
|
+
## Build pipeline
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
tsdown (build:source) → metadata extraction (build:metadata) → turbo build
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- **tsdown** produces the bundles and type declarations
|
|
122
|
+
- **metadata.ts** extracts the runtime exports of utils / hooks into `dist/metadata.json`
|
|
123
|
+
- Every subpath export ships a `"development": "./src/index.ts"` alias so dev toolchains can consume the source directly
|
package/README.md
CHANGED
|
@@ -1 +1,123 @@
|
|
|
1
|
-
# pawover-kit
|
|
1
|
+
# pawover-kit
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@pawover/kit)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
> 一个基于 TypeScript 的开源工具包合集:类型工具、静态工具类、React / Alova Hooks、ESLint 规则集与 Zod Schema,开箱即用、类型完备。
|
|
8
|
+
|
|
9
|
+
pawover-kit 是一个 pnpm 单体仓库(monorepo),由 5 个独立可发布的子包组成。根包 `@pawover/kit` 聚合重新导出所有子包,也可以按需单独安装使用。
|
|
10
|
+
|
|
11
|
+
## 特性
|
|
12
|
+
|
|
13
|
+
- **纯类型工具** `@pawover/kit-types`:无运行时代码,提供 `AnyObject`、`TreeLike`、`AnyFunction` 族、`AdvancedRecord`、`ApiNameCheck` 等常用类型
|
|
14
|
+
- **静态工具类** `@pawover/kit-utils`:数组、字符串、对象、树、货币、日期、数学等 14+ 个工具类
|
|
15
|
+
- **React / Alova Hooks** `@pawover/kit-hooks`:`useMount`、`useUnmount`、`useLatest`、`useResponsive`、`useTitle` 与 Alova 请求系列 Hooks
|
|
16
|
+
- **ESLint 规则集** `@pawover/kit-eslint-rules`:9 大规则组(javascript / typescript / react / reactHooks / vue / stylistic / antfu / imports / importsSort)+ `GLOB_EXCLUDE` + `createRules`
|
|
17
|
+
- **Zod v4 Schema** `@pawover/kit-zod`:id、string、number、boolean、bigint 等常用校验器
|
|
18
|
+
- ESM / CJS 双格式产物,附带完整类型声明
|
|
19
|
+
- `development` 导出条件,开发环境可直接使用源码,方便调试
|
|
20
|
+
|
|
21
|
+
## 包结构
|
|
22
|
+
|
|
23
|
+
| 包 | 说明 | 导入路径 |
|
|
24
|
+
| :--- | :--- | :--- |
|
|
25
|
+
| `@pawover/kit-types` | 纯类型工具包(无运行时代码) | `@pawover/kit/types`,react 相关类型见 `@pawover/kit/types/react` |
|
|
26
|
+
| `@pawover/kit-utils` | 静态工具类 | `@pawover/kit/utils`(另有 `./math`、`./vite` 子路径) |
|
|
27
|
+
| `@pawover/kit-hooks` | React + Alova Hooks | `@pawover/kit/hooks/react`、`@pawover/kit/hooks/alova` |
|
|
28
|
+
| `@pawover/kit-eslint-rules` | ESLint 规则集 | `@pawover/kit/eslint-rules` |
|
|
29
|
+
| `@pawover/kit-zod` | Zod v4 Schema | `@pawover/kit/zod` |
|
|
30
|
+
|
|
31
|
+
> [!NOTE]
|
|
32
|
+
> `@pawover/kit-hooks` 的根导出为空,请始终从 `@pawover/kit/hooks/react` 或 `@pawover/kit/hooks/alova` 子路径导入。
|
|
33
|
+
|
|
34
|
+
## 安装
|
|
35
|
+
|
|
36
|
+
使用根包聚合导入:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @pawover/kit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
或按需安装单个子包:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @pawover/kit-types
|
|
46
|
+
npm install @pawover/kit-utils
|
|
47
|
+
npm install @pawover/kit-hooks
|
|
48
|
+
npm install @pawover/kit-eslint-rules
|
|
49
|
+
npm install @pawover/kit-zod
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> [!WARNING]
|
|
53
|
+
> `alova`、`mathjs`、`react`、`vite`、`zod` 为可选 peer 依赖:使用对应功能前需自行安装(如使用 `@pawover/kit/hooks/alova` 需要 `alova` 与 `react`)。
|
|
54
|
+
|
|
55
|
+
## 快速开始
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { TypeUtil } from "@pawover/kit/utils";
|
|
59
|
+
import { useMount } from "@pawover/kit/hooks/react";
|
|
60
|
+
import { useAlovaRequest } from "@pawover/kit/hooks/alova";
|
|
61
|
+
import type { AnyObject } from "@pawover/kit/types";
|
|
62
|
+
import eslintRules from "@pawover/kit/eslint-rules";
|
|
63
|
+
import { id } from "@pawover/kit/zod";
|
|
64
|
+
|
|
65
|
+
// 类型工具
|
|
66
|
+
const obj: AnyObject = { a: 1, b: "2" };
|
|
67
|
+
|
|
68
|
+
// 静态工具类
|
|
69
|
+
TypeUtil.isString("hello"); // true
|
|
70
|
+
|
|
71
|
+
// React Hook
|
|
72
|
+
useMount(() => {
|
|
73
|
+
console.log("mounted");
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// ESLint 规则集(flat config)
|
|
77
|
+
export default [
|
|
78
|
+
{ ignores: eslintRules.GLOB_EXCLUDE },
|
|
79
|
+
{ files: ["**/*.ts"], rules: { ...eslintRules.javascript, ...eslintRules.typescript } },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
// Zod Schema
|
|
83
|
+
id.parse("abc"); // "abc"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 环境要求
|
|
87
|
+
|
|
88
|
+
- Node.js >= 22.20.0
|
|
89
|
+
- pnpm >= 11
|
|
90
|
+
|
|
91
|
+
## 开发
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
git clone https://github.com/pawover/pawover-kit.git
|
|
95
|
+
cd pawover-kit
|
|
96
|
+
pnpm install
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
常用命令:
|
|
100
|
+
|
|
101
|
+
| 命令 | 说明 |
|
|
102
|
+
| :--- | :--- |
|
|
103
|
+
| `pnpm test` | vitest 全量运行(801 条测试 / 31 个文件,node + jsdom 双环境) |
|
|
104
|
+
| `pnpm test:types` | 测试文件的类型检查 |
|
|
105
|
+
| `pnpm test:ci` | 完整 CI 流程:类型检查 → 测试 → 构建 → 冒烟 → pack 检查 |
|
|
106
|
+
| `pnpm build` | turbo 构建全部子包(tsdown 生成 ESM/CJS 双格式与类型声明) |
|
|
107
|
+
| `pnpm check` | 并行运行 types / eslint / format 检查 |
|
|
108
|
+
|
|
109
|
+
## 测试
|
|
110
|
+
|
|
111
|
+
- **单元测试**:vitest 双项目(node 环境覆盖 utils / zod / eslint-rules,jsdom 环境覆盖 hooks)
|
|
112
|
+
- **类型测试**:`test/types/` 下以 `.test.type.ts` 结尾的类型级 API 测试,由 `test:types` 全量检查
|
|
113
|
+
- **冒烟测试**:构建后验证所有 dist 产物可正常导入
|
|
114
|
+
|
|
115
|
+
## 构建流水线
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
tsdown (build:source) → metadata 提取 (build:metadata) → turbo build
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
- **tsdown** 负责打包与类型声明生成
|
|
122
|
+
- **metadata.ts** 提取 utils / hooks 的运行时导出名,写入 `dist/metadata.json`
|
|
123
|
+
- 所有子路径导出均带 `"development": "./src/index.ts"` 别名,开发工具链可直接使用源码
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-eslint-rules");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './eslint-rules.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-hooks/alova");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './hooks-alova.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-hooks/alova";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-hooks/alova";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-hooks/react");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './hooks-react.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-hooks/react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-hooks/react";
|
package/entry/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-utils");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './index.d.ts';
|
package/entry/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils";
|
package/entry/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils";
|
package/entry/math.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-utils/math");
|
package/entry/math.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './math.d.ts';
|
package/entry/math.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils/math";
|
package/entry/math.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils/math";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-types/react");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types-react.d.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-types/react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-types/react";
|
package/entry/types.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-types");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types.d.ts';
|
package/entry/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-types";
|
package/entry/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-types";
|
package/entry/vite.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-utils/vite");
|
package/entry/vite.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './vite.d.ts';
|
package/entry/vite.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils/vite";
|
package/entry/vite.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-utils/vite";
|
package/entry/zod.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("@pawover/kit-zod");
|
package/entry/zod.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './zod.d.ts';
|
package/entry/zod.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-zod";
|
package/entry/zod.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@pawover/kit-zod";
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/pawover"
|
|
7
7
|
},
|
|
8
8
|
"description": "一个基于 TypeScript 的开发工具包",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.7.0",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=22.20.0"
|
|
@@ -27,133 +27,147 @@
|
|
|
27
27
|
"url": "git+https://github.com/pawover/pawover-kit.git"
|
|
28
28
|
},
|
|
29
29
|
"license": "MIT",
|
|
30
|
-
"main": "./
|
|
31
|
-
"module": "./
|
|
32
|
-
"types": "./
|
|
30
|
+
"main": "./entry/index.cjs",
|
|
31
|
+
"module": "./entry/index.js",
|
|
32
|
+
"types": "./entry/index.d.ts",
|
|
33
33
|
"files": [
|
|
34
|
-
"
|
|
35
|
-
"packages/hooks/dist",
|
|
36
|
-
"packages/zod/dist"
|
|
34
|
+
"entry"
|
|
37
35
|
],
|
|
38
36
|
"exports": {
|
|
39
37
|
".": {
|
|
40
38
|
"import": {
|
|
41
|
-
"types": "./
|
|
42
|
-
"default": "./
|
|
39
|
+
"types": "./entry/index.d.ts",
|
|
40
|
+
"default": "./entry/index.js"
|
|
43
41
|
},
|
|
44
42
|
"require": {
|
|
45
|
-
"types": "./
|
|
46
|
-
"default": "./
|
|
43
|
+
"types": "./entry/index.d.cts",
|
|
44
|
+
"default": "./entry/index.cjs"
|
|
47
45
|
}
|
|
48
46
|
},
|
|
49
|
-
"./
|
|
47
|
+
"./utils": {
|
|
50
48
|
"import": {
|
|
51
|
-
"types": "./
|
|
52
|
-
"default": "./
|
|
49
|
+
"types": "./entry/index.d.ts",
|
|
50
|
+
"default": "./entry/index.js"
|
|
53
51
|
},
|
|
54
52
|
"require": {
|
|
55
|
-
"types": "./
|
|
56
|
-
"default": "./
|
|
53
|
+
"types": "./entry/index.d.cts",
|
|
54
|
+
"default": "./entry/index.cjs"
|
|
57
55
|
}
|
|
58
56
|
},
|
|
59
|
-
"./
|
|
57
|
+
"./math": {
|
|
60
58
|
"import": {
|
|
61
|
-
"types": "./
|
|
62
|
-
"default": "./
|
|
59
|
+
"types": "./entry/math.d.ts",
|
|
60
|
+
"default": "./entry/math.js"
|
|
63
61
|
},
|
|
64
62
|
"require": {
|
|
65
|
-
"types": "./
|
|
66
|
-
"default": "./
|
|
63
|
+
"types": "./entry/math.d.cts",
|
|
64
|
+
"default": "./entry/math.cjs"
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
|
-
"./
|
|
70
|
-
"./utils": {
|
|
67
|
+
"./vite": {
|
|
71
68
|
"import": {
|
|
72
|
-
"types": "./
|
|
73
|
-
"default": "./
|
|
69
|
+
"types": "./entry/vite.d.ts",
|
|
70
|
+
"default": "./entry/vite.js"
|
|
74
71
|
},
|
|
75
72
|
"require": {
|
|
76
|
-
"types": "./
|
|
77
|
-
"default": "./
|
|
73
|
+
"types": "./entry/vite.d.cts",
|
|
74
|
+
"default": "./entry/vite.cjs"
|
|
78
75
|
}
|
|
79
76
|
},
|
|
80
77
|
"./utils/math": {
|
|
81
78
|
"import": {
|
|
82
|
-
"types": "./
|
|
83
|
-
"default": "./
|
|
79
|
+
"types": "./entry/math.d.ts",
|
|
80
|
+
"default": "./entry/math.js"
|
|
84
81
|
},
|
|
85
82
|
"require": {
|
|
86
|
-
"types": "./
|
|
87
|
-
"default": "./
|
|
83
|
+
"types": "./entry/math.d.cts",
|
|
84
|
+
"default": "./entry/math.cjs"
|
|
88
85
|
}
|
|
89
86
|
},
|
|
90
87
|
"./utils/vite": {
|
|
91
88
|
"import": {
|
|
92
|
-
"types": "./
|
|
93
|
-
"default": "./
|
|
89
|
+
"types": "./entry/vite.d.ts",
|
|
90
|
+
"default": "./entry/vite.js"
|
|
94
91
|
},
|
|
95
92
|
"require": {
|
|
96
|
-
"types": "./
|
|
97
|
-
"default": "./
|
|
93
|
+
"types": "./entry/vite.d.cts",
|
|
94
|
+
"default": "./entry/vite.cjs"
|
|
98
95
|
}
|
|
99
96
|
},
|
|
100
|
-
"./
|
|
97
|
+
"./hooks/react": {
|
|
101
98
|
"import": {
|
|
102
|
-
"types": "./
|
|
103
|
-
"default": "./
|
|
99
|
+
"types": "./entry/hooks-react.d.ts",
|
|
100
|
+
"default": "./entry/hooks-react.js"
|
|
104
101
|
},
|
|
105
|
-
"require":
|
|
102
|
+
"require": {
|
|
103
|
+
"types": "./entry/hooks-react.d.cts",
|
|
104
|
+
"default": "./entry/hooks-react.cjs"
|
|
105
|
+
}
|
|
106
106
|
},
|
|
107
107
|
"./hooks/alova": {
|
|
108
108
|
"import": {
|
|
109
|
-
"types": "./
|
|
110
|
-
"default": "./
|
|
109
|
+
"types": "./entry/hooks-alova.d.ts",
|
|
110
|
+
"default": "./entry/hooks-alova.js"
|
|
111
111
|
},
|
|
112
112
|
"require": {
|
|
113
|
-
"types": "./
|
|
114
|
-
"default": "./
|
|
113
|
+
"types": "./entry/hooks-alova.d.cts",
|
|
114
|
+
"default": "./entry/hooks-alova.cjs"
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
"./hooks/
|
|
117
|
+
"./hooks/metadata.json": "./entry/hooks-metadata.json",
|
|
118
|
+
"./zod": {
|
|
118
119
|
"import": {
|
|
119
|
-
"types": "./
|
|
120
|
-
"default": "./
|
|
120
|
+
"types": "./entry/zod.d.ts",
|
|
121
|
+
"default": "./entry/zod.js"
|
|
121
122
|
},
|
|
122
123
|
"require": {
|
|
123
|
-
"types": "./
|
|
124
|
-
"default": "./
|
|
124
|
+
"types": "./entry/zod.d.cts",
|
|
125
|
+
"default": "./entry/zod.cjs"
|
|
125
126
|
}
|
|
126
127
|
},
|
|
127
|
-
"./
|
|
128
|
+
"./types": {
|
|
128
129
|
"import": {
|
|
129
|
-
"types": "./
|
|
130
|
-
"default": "./
|
|
130
|
+
"types": "./entry/types.d.ts",
|
|
131
|
+
"default": "./entry/types.js"
|
|
131
132
|
},
|
|
132
|
-
"require":
|
|
133
|
+
"require": {
|
|
134
|
+
"types": "./entry/types.d.cts",
|
|
135
|
+
"default": "./entry/types.cjs"
|
|
136
|
+
}
|
|
133
137
|
},
|
|
134
|
-
"./
|
|
138
|
+
"./types/react": {
|
|
135
139
|
"import": {
|
|
136
|
-
"types": "./
|
|
137
|
-
"default": "./
|
|
140
|
+
"types": "./entry/types-react.d.ts",
|
|
141
|
+
"default": "./entry/types-react.js"
|
|
138
142
|
},
|
|
139
143
|
"require": {
|
|
140
|
-
"types": "./
|
|
141
|
-
"default": "./
|
|
144
|
+
"types": "./entry/types-react.d.cts",
|
|
145
|
+
"default": "./entry/types-react.cjs"
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
|
-
"./
|
|
148
|
+
"./eslint-rules": {
|
|
145
149
|
"import": {
|
|
146
|
-
"types": "./
|
|
147
|
-
"default": "./
|
|
150
|
+
"types": "./entry/eslint-rules.d.ts",
|
|
151
|
+
"default": "./entry/eslint-rules.js"
|
|
148
152
|
},
|
|
149
|
-
"require":
|
|
150
|
-
|
|
153
|
+
"require": {
|
|
154
|
+
"types": "./entry/eslint-rules.d.cts",
|
|
155
|
+
"default": "./entry/eslint-rules.cjs"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"./metadata.json": "./entry/metadata.json"
|
|
159
|
+
},
|
|
160
|
+
"dependencies": {
|
|
161
|
+
"@pawover/kit-eslint-rules": "0.0.0-alpha.3",
|
|
162
|
+
"@pawover/kit-hooks": "0.0.0-alpha.3",
|
|
163
|
+
"@pawover/kit-utils": "0.0.0-alpha.3",
|
|
164
|
+
"@pawover/kit-types": "0.0.0-alpha.3",
|
|
165
|
+
"@pawover/kit-zod": "0.0.0-alpha.3"
|
|
151
166
|
},
|
|
152
167
|
"devDependencies": {
|
|
153
168
|
"@commitlint/cli": "^21.2.1",
|
|
154
169
|
"@commitlint/config-conventional": "^21.2.0",
|
|
155
170
|
"@eslint-react/eslint-plugin": "^5.18.2",
|
|
156
|
-
"@pawover/eslint-rules": "^0.2.3",
|
|
157
171
|
"@playwright/test": "^1.62.1",
|
|
158
172
|
"@stylistic/eslint-plugin": "^6.0.0-beta.5",
|
|
159
173
|
"@testing-library/react": "^16.3.2",
|
|
@@ -225,6 +239,7 @@
|
|
|
225
239
|
"test:types": "tsc -p test/tsconfig.json --noEmit",
|
|
226
240
|
"test:smoke": "node test/scripts/smoke.mjs",
|
|
227
241
|
"test:ci": "pnpm test:types && pnpm test && pnpm build && pnpm test:smoke && pnpm check:pack",
|
|
242
|
+
"postbuild": "node scripts/sync-entry.ts",
|
|
228
243
|
"build": "turbo build",
|
|
229
244
|
"build:force": "turbo build --force",
|
|
230
245
|
"build:package": "turbo build:package && pnpm package",
|