@mirascript/bindings 0.1.64 → 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.
Files changed (2) hide show
  1. package/README.md +11 -11
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @mirascript/bindings
2
2
 
3
- `@mirascript/bindings` 提供 MiraScript 编译器的统一 JavaScript 绑定层。它会优先在 Node.js 环境加载 `@mirascript/napi` 原生实现,在浏览器或无法加载原生模块时回退到 `@mirascript/wasm`。
3
+ `@mirascript/bindings` 提供统一的编译器加载入口。它在 Node.js 环境优先加载 `@mirascript/napi`,在浏览器或原生模块不可用时回退到 `@mirascript/wasm`。
4
4
 
5
5
  ## 适用场景
6
6
 
7
- - 需要同时支持 Node.js 和浏览器环境
8
- - 希望按统一接口访问底层编译器模块
9
- - 作为上层包的基础依赖,例如 `@mirascript/mirascript`、`@mirascript/cli`、`@mirascript/monaco`
7
+ - 需要同时支持 Node.js 与浏览器
8
+ - 希望用同一套 API 访问编译器模块
9
+ - 作为上层包(如 `@mirascript/mirascript`、`@mirascript/cli`、`@mirascript/monaco`)的底层依赖
10
10
 
11
11
  ## 安装
12
12
 
@@ -14,7 +14,7 @@
14
14
  pnpm add @mirascript/bindings
15
15
  ```
16
16
 
17
- ## 基本用法
17
+ ## 快速开始
18
18
 
19
19
  ```ts
20
20
  import { loadModule, getModule } from '@mirascript/bindings';
@@ -25,12 +25,12 @@ const sameModule = getModule();
25
25
  console.log(mod === sameModule);
26
26
  ```
27
27
 
28
- ## 导出内容
28
+ ## 导出
29
29
 
30
- - `loadModule()`:异步加载底层编译器模块
31
- - `getModule()`:获取已加载模块;若未加载会抛错
32
- - `@mirascript/bindings/wasm`:显式使用 WebAssembly 实现
33
- - `@mirascript/bindings/napi`:显式使用 Node 原生实现
30
+ - `loadModule()`:异步加载底层模块
31
+ - `getModule()`:获取已加载模块(未加载时抛错)
32
+ - `@mirascript/bindings/wasm`:强制使用 WebAssembly 实现
33
+ - `@mirascript/bindings/napi`:强制使用 Node 原生实现
34
34
 
35
35
  ## 开发
36
36
 
@@ -39,4 +39,4 @@ pnpm --filter @mirascript/bindings build
39
39
  pnpm --filter @mirascript/bindings watch
40
40
  ```
41
41
 
42
- 该包本身只负责装配与分发,实际编译能力来自 `@mirascript/napi` `@mirascript/wasm`。
42
+ 该包只负责装配与分发,实际编译能力由 `@mirascript/napi` `@mirascript/wasm` 提供。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirascript/bindings",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "description": "MiraScript compiler bindings",
@@ -32,11 +32,11 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@mirascript/napi": "~0.1.64",
36
- "@mirascript/wasm": "~0.1.64"
35
+ "@mirascript/napi": "~0.1.65",
36
+ "@mirascript/wasm": "~0.1.65"
37
37
  },
38
38
  "devDependencies": {
39
- "@types/node": "^26.0.1"
39
+ "@types/node": "^26.1.1"
40
40
  },
41
41
  "scripts": {
42
42
  "watch": "pnpm build --watch",