tcdona_unilib 1.0.0 → 1.0.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/README.md +19 -35
- package/dotenvx.ts +13 -0
- package/hono.ts +23 -0
- package/hotkeys-js.ts +2 -0
- package/inquirer.ts +13 -0
- package/package.json +15 -2
- package/pinyin-pro.ts +16 -0
- package/tinypool.ts +27 -0
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# tcdona_unilib - 统一依赖聚合层
|
|
2
2
|
|
|
3
3
|
一个统一的依赖管理库,支持通过子路径导入,保持 tree-shaking 能力。
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
7
|
- ✅ ESM 模块(`type: module`)
|
|
8
|
-
- ✅ 子路径导入支持(如 `import from '
|
|
8
|
+
- ✅ 子路径导入支持(如 `import from 'tcdona_unilib/zod'`)
|
|
9
9
|
- ✅ Tree-shaking 优化
|
|
10
10
|
- ✅ 完整的类型支持
|
|
11
11
|
- ✅ 统一的版本管理
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
## 安装
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm install
|
|
16
|
+
npm install tcdona_unilib
|
|
17
17
|
# or
|
|
18
|
-
yarn add
|
|
18
|
+
yarn add tcdona_unilib
|
|
19
19
|
# or
|
|
20
|
-
pnpm add
|
|
20
|
+
pnpm add tcdona_unilib
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 使用
|
|
@@ -26,45 +26,29 @@ pnpm add tclib
|
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
28
|
// 导入单个库
|
|
29
|
-
import { z } from "
|
|
30
|
-
import { nanoid } from "
|
|
31
|
-
import dayjs from "
|
|
32
|
-
import { defineConfig } from "
|
|
29
|
+
import { z } from "tcdona_unilib/zod"
|
|
30
|
+
import { nanoid } from "tcdona_unilib/nanoid"
|
|
31
|
+
import dayjs from "tcdona_unilib/dayjs"
|
|
32
|
+
import { defineConfig } from "tcdona_unilib/vite"
|
|
33
33
|
|
|
34
34
|
// 导入所有库
|
|
35
|
-
import * as
|
|
35
|
+
import * as tcdona_unilib from "tcdona_unilib"
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## 支持的库
|
|
39
39
|
|
|
40
|
-
| 库名 | 导入方式
|
|
41
|
-
| ------------ |
|
|
42
|
-
| neverthrow | `
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| nanoid | `tclib/nanoid` | ID 生成 |
|
|
48
|
-
| nanostores | `tclib/nanostores` | 状态管理 |
|
|
49
|
-
| effort | `tclib/effort` | 效率工具 |
|
|
50
|
-
| animejs | `tclib/animejs` | 动画库 |
|
|
51
|
-
| clipboardy | `tclib/clipboardy` | 剪贴板 |
|
|
52
|
-
| marked | `tclib/marked` | Markdown 解析 |
|
|
53
|
-
| pathe | `tclib/pathe` | 路径处理 |
|
|
54
|
-
| prettier | `tclib/prettier` | 代码格式化 |
|
|
55
|
-
| turndown | `tclib/turndown` | HTML 转 Markdown |
|
|
56
|
-
| effector | `tclib/effector` | 事件管理 |
|
|
57
|
-
| comctx | `tclib/comctx` | 上下文管理 |
|
|
58
|
-
| es-toolkit | `tclib/estk` | ES 工具集 |
|
|
59
|
-
| magic-regexp | `tclib/magicreg` | 正则表达式 |
|
|
60
|
-
| exome | `tclib/exome` | 状态管理 |
|
|
61
|
-
| vue | `tclib/vue` | Vue 框架 |
|
|
62
|
-
| vite | `tclib/vite` | 构建工具 |
|
|
40
|
+
| 库名 | 导入方式 | 用途 |
|
|
41
|
+
| ------------ | -------------------------- | ---------- |
|
|
42
|
+
| neverthrow | `tcdona_unilib/neverthrow` | 错误处理 |
|
|
43
|
+
| zx | `tcdona_unilib/zx` | Shell 脚本 |
|
|
44
|
+
| dayjs | `tcdona_unilib/dayjs` | 日期时间 |
|
|
45
|
+
| big.js | `tcdona_unilib/big.js` | 精确算术 |
|
|
46
|
+
| es-toolkit | `tcdona_unilib/estk` | ES 工具集 |
|
|
63
47
|
|
|
64
48
|
## 项目结构
|
|
65
49
|
|
|
66
50
|
```
|
|
67
|
-
|
|
51
|
+
tcdona_unilib/
|
|
68
52
|
├── package.json # 统一依赖声明
|
|
69
53
|
├── tsconfig.json # TypeScript 配置
|
|
70
54
|
├── index.ts # 全量导出入口
|
|
@@ -76,7 +60,7 @@ tclib/
|
|
|
76
60
|
|
|
77
61
|
## 配置原理
|
|
78
62
|
|
|
79
|
-
- **exports 字段**: 定义子路径映射关系,支持 `
|
|
63
|
+
- **exports 字段**: 定义子路径映射关系,支持 `tcdona_unilib/zod` 导入方式
|
|
80
64
|
- **type: module**: 启用 ESM 模块系统
|
|
81
65
|
- **Tree-shaking**: 每个模块仅做简单转发,构建工具可自动优化
|
|
82
66
|
|
package/dotenvx.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { config, parse, set, get, ls, genexample } from "@dotenvx/dotenvx"
|
|
2
|
+
export type {
|
|
3
|
+
DotenvConfigOptions,
|
|
4
|
+
DotenvConfigOutput,
|
|
5
|
+
DotenvParseOptions,
|
|
6
|
+
DotenvParseOutput,
|
|
7
|
+
DotenvPopulateInput,
|
|
8
|
+
SetOptions,
|
|
9
|
+
SetProcessedEnv,
|
|
10
|
+
SetOutput,
|
|
11
|
+
GetOptions,
|
|
12
|
+
GenExampleOutput,
|
|
13
|
+
} from "@dotenvx/dotenvx"
|
package/hono.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { Hono } from "hono"
|
|
2
|
+
export type {
|
|
3
|
+
Env,
|
|
4
|
+
ErrorHandler,
|
|
5
|
+
Handler,
|
|
6
|
+
MiddlewareHandler,
|
|
7
|
+
Next,
|
|
8
|
+
NotFoundResponse,
|
|
9
|
+
NotFoundHandler,
|
|
10
|
+
ValidationTargets,
|
|
11
|
+
Input,
|
|
12
|
+
Schema,
|
|
13
|
+
ToSchema,
|
|
14
|
+
TypedResponse,
|
|
15
|
+
Context,
|
|
16
|
+
ContextVariableMap,
|
|
17
|
+
ContextRenderer,
|
|
18
|
+
ExecutionContext,
|
|
19
|
+
HonoRequest,
|
|
20
|
+
InferRequestType,
|
|
21
|
+
InferResponseType,
|
|
22
|
+
ClientRequestOptions,
|
|
23
|
+
} from "hono"
|
package/hotkeys-js.ts
ADDED
package/inquirer.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tcdona_unilib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Unified dependency aggregation layer for shared libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -24,7 +24,13 @@
|
|
|
24
24
|
"./magicreg": "./magic-regexp.ts",
|
|
25
25
|
"./exome": "./exome.ts",
|
|
26
26
|
"./vue": "./vue.ts",
|
|
27
|
-
"./vite": "./vite.ts"
|
|
27
|
+
"./vite": "./vite.ts",
|
|
28
|
+
"./hono": "./hono.ts",
|
|
29
|
+
"./hotkeys": "./hotkeys-js.ts",
|
|
30
|
+
"./pinyinpro": "./pinyin-pro.ts",
|
|
31
|
+
"./tinypool": "./tinypool.ts",
|
|
32
|
+
"./dotenvx": "./dotenvx.ts",
|
|
33
|
+
"./inquirer": "./inquirer.ts"
|
|
28
34
|
},
|
|
29
35
|
"scripts": {
|
|
30
36
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -33,9 +39,12 @@
|
|
|
33
39
|
"author": "",
|
|
34
40
|
"license": "ISC",
|
|
35
41
|
"devDependencies": {
|
|
42
|
+
"@types/bun": "^1.3.5",
|
|
36
43
|
"@types/node": "^20.10.6"
|
|
37
44
|
},
|
|
38
45
|
"dependencies": {
|
|
46
|
+
"@dotenvx/dotenvx": "^1.51.2",
|
|
47
|
+
"@inquirer/prompts": "^8.1.0",
|
|
39
48
|
"@types/big.js": "^6.2.2",
|
|
40
49
|
"@types/turndown": "^5.0.6",
|
|
41
50
|
"animejs": "^4.1.3",
|
|
@@ -46,13 +55,17 @@
|
|
|
46
55
|
"effector": "^23.4.4",
|
|
47
56
|
"es-toolkit": "^1.43.0",
|
|
48
57
|
"exome": "^2.8.0",
|
|
58
|
+
"hono": "^4.11.3",
|
|
59
|
+
"hotkeys-js": "^4.0.0",
|
|
49
60
|
"magic-regexp": "^0.10.0",
|
|
50
61
|
"marked": "^17.0.1",
|
|
51
62
|
"nanoid": "^5.1.6",
|
|
52
63
|
"nanostores": "^1.1.0",
|
|
53
64
|
"neverthrow": "^8.2.0",
|
|
54
65
|
"pathe": "^2.0.3",
|
|
66
|
+
"pinyin-pro": "^3.27.0",
|
|
55
67
|
"prettier": "^3.7.4",
|
|
68
|
+
"tinypool": "^2.0.0",
|
|
56
69
|
"turndown": "^7.2.2",
|
|
57
70
|
"vite": "^7.3.0",
|
|
58
71
|
"vue": "^3.5.26",
|
package/pinyin-pro.ts
ADDED
package/tinypool.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Tinypool,
|
|
3
|
+
isTransferable,
|
|
4
|
+
isMovable,
|
|
5
|
+
markMovable,
|
|
6
|
+
isTaskQueue,
|
|
7
|
+
kTransferable,
|
|
8
|
+
kValue,
|
|
9
|
+
kQueueOptions,
|
|
10
|
+
kRequestCountField,
|
|
11
|
+
kResponseCountField,
|
|
12
|
+
kFieldCount,
|
|
13
|
+
} from "tinypool"
|
|
14
|
+
export type {
|
|
15
|
+
Options,
|
|
16
|
+
Task,
|
|
17
|
+
TaskQueue,
|
|
18
|
+
Transferable,
|
|
19
|
+
TinypoolChannel,
|
|
20
|
+
TinypoolWorker,
|
|
21
|
+
TinypoolData,
|
|
22
|
+
TinypoolPrivateData,
|
|
23
|
+
TinypoolWorkerMessage,
|
|
24
|
+
StartupMessage,
|
|
25
|
+
RequestMessage,
|
|
26
|
+
ResponseMessage,
|
|
27
|
+
} from "tinypool"
|