@mirascript/help 0.1.62-alpha.15 → 0.1.62-alpha.20
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 +36 -0
- package/package.json +6 -1
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @mirascript/help
|
|
2
|
+
|
|
3
|
+
`@mirascript/help` 用于将仓库中的参考文档编译为可直接消费的帮助数据,当前主要生成关键字和运算符说明表,供编辑器集成或网站功能使用。
|
|
4
|
+
|
|
5
|
+
## 数据来源
|
|
6
|
+
|
|
7
|
+
构建脚本会读取仓库中的 `docs/references` 文档目录,并根据 front-matter 中的 `token`、`title` 等字段生成发布内容。
|
|
8
|
+
|
|
9
|
+
## 导出内容
|
|
10
|
+
|
|
11
|
+
- `KEYWORDS`:关键字到 Markdown 文本的映射
|
|
12
|
+
- `OPERATORS`:运算符到 Markdown 文本的映射
|
|
13
|
+
- `Keyword` / `Operator`:由生成结果推导出的字面量类型
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @mirascript/help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 示例
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { KEYWORDS, OPERATORS } from '@mirascript/help';
|
|
25
|
+
|
|
26
|
+
console.log(KEYWORDS['match']);
|
|
27
|
+
console.log(OPERATORS['??']);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 构建
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm --filter @mirascript/help build
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
如果新增或调整 `docs/references` 下的文档,需要重新执行构建以刷新 `dist/` 内容。
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirascript/help",
|
|
3
|
-
"version": "0.1.62-alpha.
|
|
3
|
+
"version": "0.1.62-alpha.20",
|
|
4
4
|
"author": "CloudPSS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Help documentation for Mirascript core language.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/CloudPSS/MiraScript.git",
|
|
10
|
+
"directory": "packages/help"
|
|
11
|
+
},
|
|
7
12
|
"type": "module",
|
|
8
13
|
"main": "./dist/index.js",
|
|
9
14
|
"types": "./dist/index.d.ts",
|