@changw98ic/core 1.0.0 → 1.0.2
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 +32 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @changw98ic/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
通用网文创作 TypeScript 工具链的核心类型与 Skill 定义。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -10,19 +10,43 @@ npm install @changw98ic/core
|
|
|
10
10
|
|
|
11
11
|
## 使用
|
|
12
12
|
|
|
13
|
+
### 根入口
|
|
14
|
+
|
|
13
15
|
```typescript
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
+
import { ProjectStateSchema, validateProjectState } from '@changw98ic/core';
|
|
17
|
+
import {
|
|
18
|
+
type Skill,
|
|
19
|
+
type ProjectState,
|
|
20
|
+
type Entity,
|
|
21
|
+
type EntityType,
|
|
22
|
+
} from '@changw98ic/core';
|
|
16
23
|
```
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
### 子路径导入
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
```typescript
|
|
28
|
+
import { ProjectStateSchema } from '@changw98ic/core/types';
|
|
29
|
+
import type {
|
|
30
|
+
Skill,
|
|
31
|
+
ProjectState,
|
|
32
|
+
Entity,
|
|
33
|
+
EntityType,
|
|
34
|
+
} from '@changw98ic/core/types';
|
|
35
|
+
```
|
|
21
36
|
|
|
22
|
-
##
|
|
37
|
+
## 说明
|
|
38
|
+
|
|
39
|
+
- 根入口当前主要重导出 `types` 模块。
|
|
40
|
+
- 已发布的导出路径见 `packages/core/package.json`:`.`、`./types`。
|
|
41
|
+
- 上层 CLI、数据层和适配器包都依赖这里的类型定义。
|
|
42
|
+
- `ProjectState`、`Entity`、`EntityType`、`Skill` 是 TypeScript 类型;在 TS 中请用 `import type`。
|
|
43
|
+
- 纯运行时可直接导入的是 `ProjectStateSchema`、`EntitySchema`、`SkillSchema`、`validateProjectState()` 这类 JS 导出。
|
|
44
|
+
|
|
45
|
+
## 文档
|
|
23
46
|
|
|
24
|
-
|
|
47
|
+
- 项目主页:<https://github.com/changw98ic/webnovel-writer-skill#readme>
|
|
48
|
+
- 工作区包总览:`packages/README.md`
|
|
25
49
|
|
|
26
50
|
## License
|
|
27
51
|
|
|
28
|
-
|
|
52
|
+
GPL-3.0-or-later
|