@vte-js/core 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 +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @vte/core
|
|
1
|
+
# @vte-js/core
|
|
2
2
|
|
|
3
3
|
Vue Token Engine 的核心包,提供 token 解析和类型工具。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @vte/core
|
|
8
|
+
npm install @vte-js/core
|
|
9
9
|
# 或
|
|
10
|
-
pnpm add @vte/core
|
|
10
|
+
pnpm add @vte-js/core
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## API
|
|
@@ -17,7 +17,7 @@ pnpm add @vte/core
|
|
|
17
17
|
定义设计 tokens,返回类型安全的 token 配置。
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import { defineTokens } from "@vte/core";
|
|
20
|
+
import { defineTokens } from "@vte-js/core";
|
|
21
21
|
|
|
22
22
|
const tokens = defineTokens({
|
|
23
23
|
primitive: {
|
|
@@ -39,7 +39,7 @@ const tokens = defineTokens({
|
|
|
39
39
|
解析 token 文件,返回扁平化的 TokenMap。
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
|
-
import { parseTokens } from "@vte/core";
|
|
42
|
+
import { parseTokens } from "@vte-js/core";
|
|
43
43
|
|
|
44
44
|
const tokenMap = await parseTokens("./design-tokens.ts");
|
|
45
45
|
|
|
@@ -53,7 +53,7 @@ const tokenMap = await parseTokens("./design-tokens.ts");
|
|
|
53
53
|
从 token 定义中提取所有合法路径的联合类型,用于 IDE 自动补全。
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
|
-
import { type TokenPath } from "@vte/core";
|
|
56
|
+
import { type TokenPath } from "@vte-js/core";
|
|
57
57
|
|
|
58
58
|
type Paths = TokenPath<typeof tokens>;
|
|
59
59
|
// "primitive" | "primitive.blue" | "primitive.blue.500" | ...
|