@mirascript/constants 0.1.63 → 0.1.65
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 +7 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @mirascript/constants
|
|
2
2
|
|
|
3
|
-
`@mirascript/constants` 导出 MiraScript
|
|
3
|
+
`@mirascript/constants` 导出 MiraScript 编译器常量与辅助类型,包括关键字集合、诊断码、操作码和配置枚举。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 主要导出
|
|
6
6
|
|
|
7
7
|
- `DiagnosticCode`
|
|
8
8
|
- `OpCode`
|
|
9
9
|
- `DIAGNOSTIC_MESSAGES`
|
|
10
|
-
- `KEYWORDS`
|
|
10
|
+
- `KEYWORDS` 与相关关键字分类
|
|
11
11
|
- `Config`、`InputMode`、`DiagnosticPositionEncoding`
|
|
12
|
-
- `isKeyword()`
|
|
12
|
+
- `isKeyword()` 等工具函数
|
|
13
13
|
|
|
14
14
|
## 安装
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
pnpm add @mirascript/constants
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## 快速开始
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { KEYWORDS, isKeyword, DiagnosticCode } from '@mirascript/constants';
|
|
@@ -27,13 +27,11 @@ console.log(isKeyword('match'));
|
|
|
27
27
|
console.log(DiagnosticCode.InvalidKeyword);
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
该包会先从 Rust 常量 crate 生成 WebAssembly 产物,再在 JavaScript 层补充类型与工具方法。
|
|
30
|
+
## 构建
|
|
33
31
|
|
|
34
32
|
```bash
|
|
35
33
|
pnpm --filter @mirascript/constants wasm
|
|
36
34
|
pnpm --filter @mirascript/constants build
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
构建依赖 Rust 工具链与 `wasm-pack`。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirascript/constants",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.65",
|
|
4
4
|
"author": "CloudPSS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "MiraScript constants",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
".": "./dist/index.js"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "^26.
|
|
27
|
+
"@types/node": "^26.1.1",
|
|
28
28
|
"nodemon": "^3.1.14"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|