@naeemo/capnp 0.1.0 → 0.2.0

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 CHANGED
@@ -41,10 +41,17 @@ console.log(data.getText(0)); // "Hello, Cap'n Proto!"
41
41
 
42
42
  ### Code Generation
43
43
 
44
- Generate TypeScript types from your Cap'n Proto schema:
44
+ Generate TypeScript types from your Cap'n Proto schema using the V3 CLI (requires `capnp` tool installed):
45
45
 
46
46
  ```bash
47
- npx tsx src/cli/codegen.ts schema.capnp -o types.ts
47
+ # Generate single file
48
+ npx capnp-ts-codegen schema.capnp -o types.ts
49
+
50
+ # Generate multiple files to directory
51
+ npx capnp-ts-codegen schema.capnp -d ./generated
52
+
53
+ # With custom runtime import path
54
+ npx capnp-ts-codegen schema.capnp -o types.ts -r ../my-runtime
48
55
  ```
49
56
 
50
57
  Generated code includes:
package/README.zh.md CHANGED
@@ -41,10 +41,17 @@ console.log(data.getText(0)); // "你好,Cap'n Proto!"
41
41
 
42
42
  ### 代码生成
43
43
 
44
- 从 Cap'n Proto 模式生成 TypeScript 类型:
44
+ 使用 V3 CLI 从 Cap'n Proto schema 生成 TypeScript 类型(需要安装 `capnp` 工具):
45
45
 
46
46
  ```bash
47
- npx tsx src/cli/codegen.ts schema.capnp -o types.ts
47
+ # 生成单文件
48
+ npx capnp-ts-codegen schema.capnp -o types.ts
49
+
50
+ # 生成多文件到目录
51
+ npx capnp-ts-codegen schema.capnp -d ./generated
52
+
53
+ # 自定义运行时导入路径
54
+ npx capnp-ts-codegen schema.capnp -o types.ts -r ../my-runtime
48
55
  ```
49
56
 
50
57
  生成的代码包括: