@hchuanz/pocket-core 0.1.0 → 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/README.md +29 -0
- package/package.json +6 -3
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @hchuanz/pocket-core
|
|
2
|
+
|
|
3
|
+
口袋 helper 生态的**核心业务逻辑**(平台无关),从 Electron 桌面应用中抽取,支持 ESM + CJS 双格式。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @hchuanz/pocket-core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 架构
|
|
12
|
+
|
|
13
|
+
采用 ports & adapters(六边形)架构,core 不依赖任何 UI 框架,运行时依赖通过接口注入。
|
|
14
|
+
|
|
15
|
+
## 快速开始
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createPocketCore, ConsoleLogger, NodeJsonFileStorage } from '@hchuanz/pocket-core'
|
|
19
|
+
|
|
20
|
+
const core = createPocketCore({
|
|
21
|
+
logger: new ConsoleLogger(),
|
|
22
|
+
storage: new NodeJsonFileStorage('./data'),
|
|
23
|
+
// ... 其他适配器
|
|
24
|
+
})
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hchuanz/pocket-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "口袋 helper 生态的核心业务逻辑(平台无关,从 Electron 桌面应用抽取)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
18
19
|
],
|
|
19
20
|
"sideEffects": false,
|
|
20
21
|
"publishConfig": {
|
|
@@ -28,9 +29,11 @@
|
|
|
28
29
|
"mirror"
|
|
29
30
|
],
|
|
30
31
|
"license": "MIT",
|
|
32
|
+
"author": "hchuanz",
|
|
33
|
+
"homepage": "https://gitee.com/zhang_hchchc/hchuanz-pocket-platform",
|
|
31
34
|
"repository": {
|
|
32
35
|
"type": "git",
|
|
33
|
-
"url": "https://
|
|
36
|
+
"url": "https://gitee.com/zhang_hchchc/hchuanz-pocket-platform.git"
|
|
34
37
|
},
|
|
35
38
|
"scripts": {
|
|
36
39
|
"build": "tsup",
|