@rustledger/wasm 0.5.2 → 0.7.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
@@ -7,8 +7,10 @@
7
7
  Parse and validate your ledger faster than Python beancount.
8
8
 
9
9
  [![CI](https://github.com/rustledger/rustledger/actions/workflows/ci.yml/badge.svg)](https://github.com/rustledger/rustledger/actions/workflows/ci.yml)
10
+ [![Compatibility](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/rustledger/rustledger/compatibility/.github/badges/compat-badge.json)](https://github.com/rustledger/rustledger/actions/workflows/compat.yml)
10
11
  [![GitHub Release](https://img.shields.io/github/v/release/rustledger/rustledger)](https://github.com/rustledger/rustledger/releases)
11
12
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
13
+ [![Liberapay](https://img.shields.io/liberapay/gives/rustledger.svg?logo=liberapay)](https://liberapay.com/rustledger)
12
14
 
13
15
  </div>
14
16
 
@@ -18,45 +20,50 @@ Parse and validate your ledger faster than Python beancount.
18
20
 
19
21
  | | |
20
22
  |---|---|
21
- | **Much faster** | Parse and validate large ledgers in milliseconds ([see benchmarks](#performance)) |
22
- | **Single binary** | No Python, no dependencies, just download and run |
23
+ | **10-30x faster** | Parse and validate large ledgers in milliseconds ([see benchmarks](#performance)) |
24
+ | **No dependencies** | No Python runtime, no libraries to install |
23
25
  | **Drop-in replacement** | Compatible `bean-*` CLI commands for easy migration |
24
26
  | **Full compatibility** | Parses any valid beancount file |
27
+ | **Editor support** | LSP server for VS Code, Neovim, Helix, and more |
28
+ | **AI-ready** | MCP server for Claude, Cursor, and other AI assistants |
29
+ | **Runs anywhere** | WebAssembly support for browser and Node.js |
30
+ | **Better errors** | Detailed error messages with source locations |
31
+ | **20 built-in plugins** | Plus Python plugin compatibility via WASI sandbox |
25
32
 
26
33
  ## Install
27
34
 
28
35
  | Platform | Command |
29
36
  |----------|---------|
30
- | **Script** | `curl -sSfL rustledger.github.io/i \| sh` |
31
37
  | **macOS** | `brew install rustledger/rustledger/rustledger` |
32
- | **Ubuntu/Debian** | `sudo add-apt-repository ppa:robcohen/rustledger && sudo apt install rustledger` |
33
- | **Fedora/RHEL** | `sudo dnf copr enable rustledger/rustledger && sudo dnf install rustledger` |
34
- | **Arch** | `yay -S rustledger-bin` |
35
38
  | **Windows** | `scoop bucket add rustledger https://github.com/rustledger/scoop-rustledger && scoop install rustledger` |
36
39
  | **Cargo** | `cargo binstall rustledger` or `cargo install rustledger` |
40
+ | **Fedora/RHEL** | `sudo dnf copr enable robcohen/rustledger && sudo dnf install rustledger` |
37
41
  | **Nix** | `nix run github:rustledger/rustledger` |
38
42
  | **Docker** | `docker run --rm -v "$PWD:/data" ghcr.io/rustledger/rustledger /data/ledger.beancount` |
39
43
  | **Binaries** | [GitHub Releases](https://github.com/rustledger/rustledger/releases) |
40
- | **npm** | `npm install @rustledger/wasm` (WebAssembly) |
44
+ | **npm (WASM)** | `npm install @rustledger/wasm` |
45
+ | **npm (MCP)** | `npx @rustledger/mcp-server` ([Model Context Protocol](https://modelcontextprotocol.io) server) |
46
+
47
+ <sub>Missing your platform? [Open an issue](https://github.com/rustledger/rustledger/issues/new) to request it.</sub>
41
48
 
42
49
  ## Quick Start
43
50
 
44
51
  ```bash
45
- rledger-check ledger.beancount
46
- rledger-query ledger.beancount "SELECT account, SUM(position) GROUP BY account"
52
+ rledger check ledger.beancount
53
+ rledger query ledger.beancount "SELECT account, SUM(position) GROUP BY account"
47
54
  ```
48
55
 
49
56
  ## CLI Commands
50
57
 
51
58
  | Command | Description |
52
59
  |---------|-------------|
53
- | `rledger-check` | Validate ledger files with detailed error messages |
54
- | `rledger-query` | Run BQL queries (interactive shell or one-shot) |
55
- | `rledger-format` | Auto-format beancount files |
56
- | `rledger-report` | Generate balance, account, and statistics reports |
57
- | `rledger-doctor` | Debugging tools for ledger issues |
58
- | `rledger-extract` | Import transactions from CSV/OFX bank statements |
59
- | `rledger-price` | Fetch commodity prices from online sources |
60
+ | `rledger check` | Validate ledger files with detailed error messages |
61
+ | `rledger query` | Run BQL queries (interactive shell or one-shot) |
62
+ | `rledger format` | Auto-format beancount files |
63
+ | `rledger report` | Generate balance, account, and statistics reports |
64
+ | `rledger doctor` | Debugging tools for ledger issues |
65
+ | `rledger extract` | Import transactions from CSV/OFX bank statements |
66
+ | `rledger price` | Fetch commodity prices from online sources |
60
67
 
61
68
  Python beancount users can also use `bean-check`, `bean-query`, etc.
62
69
 
@@ -65,20 +72,20 @@ Python beancount users can also use `bean-check`, `bean-query`, etc.
65
72
 
66
73
  ```bash
67
74
  # Validate with plugins
68
- rledger-check --native-plugin auto_accounts ledger.beancount
75
+ rledger check --native-plugin auto_accounts ledger.beancount
69
76
 
70
77
  # Interactive query shell
71
- rledger-query ledger.beancount
78
+ rledger query ledger.beancount
72
79
 
73
80
  # One-shot query
74
- rledger-query ledger.beancount "SELECT date, narration WHERE account ~ 'Expenses:Food'"
81
+ rledger query ledger.beancount "SELECT date, narration WHERE account ~ 'Expenses:Food'"
75
82
 
76
83
  # Reports
77
- rledger-report ledger.beancount balances
78
- rledger-report ledger.beancount stats
84
+ rledger report ledger.beancount balances
85
+ rledger report ledger.beancount stats
79
86
 
80
87
  # Format in place
81
- rledger-format --in-place ledger.beancount
88
+ rledger format --in-place ledger.beancount
82
89
  ```
83
90
 
84
91
  </details>
@@ -87,7 +94,7 @@ rledger-format --in-place ledger.beancount
87
94
 
88
95
  | Crate | Description |
89
96
  |-------|-------------|
90
- | `rustledger` | CLI tools (rledger-check, rledger-query, etc.) |
97
+ | `rustledger` | CLI tool (`rledger check`, `rledger query`, etc.) |
91
98
  | `rustledger-core` | Core types: Amount, Position, Inventory |
92
99
  | `rustledger-parser` | Lexer and parser with error recovery |
93
100
  | `rustledger-loader` | File loading and includes |
@@ -96,6 +103,7 @@ rledger-format --in-place ledger.beancount
96
103
  | `rustledger-query` | BQL query engine |
97
104
  | `rustledger-plugin` | 20 built-in plugins + Python plugin support |
98
105
  | `rustledger-importer` | CSV/OFX import framework |
106
+ | `rustledger-lsp` | Language Server Protocol for editor integration |
99
107
  | `rustledger-wasm` | WebAssembly bindings for JavaScript/TypeScript |
100
108
 
101
109
  <details>
@@ -159,6 +167,31 @@ rledger-format --in-place ledger.beancount
159
167
 
160
168
  <sub>Benchmarks run nightly on 10K transaction ledgers. [View workflow →](https://github.com/rustledger/rustledger/actions/workflows/bench.yml)</sub>
161
169
 
170
+ <details>
171
+ <summary><strong>Benchmark details</strong></summary>
172
+
173
+ **What's measured:**
174
+ - **Validation**: Parse ledger + validate (balance assertions, account opens, etc.)
175
+ - **Balance Report**: Parse + compute all account balances
176
+
177
+ **Memory efficiency:**
178
+ rustledger typically uses 3-5x less memory than Python beancount thanks to Rust's zero-cost abstractions and efficient data structures.
179
+
180
+ **Run locally:**
181
+ ```bash
182
+ # Quick comparison (requires nix)
183
+ nix develop .#bench
184
+ ./scripts/bench.sh
185
+
186
+ # Criterion micro-benchmarks
187
+ cargo bench -p rustledger-core
188
+ cargo bench -p rustledger-parser
189
+ ```
190
+
191
+ See [BENCHMARKING.md](docs/BENCHMARKING.md) for detailed benchmark documentation.
192
+
193
+ </details>
194
+
162
195
  ## Contributing
163
196
 
164
197
  See [CLAUDE.md](CLAUDE.md) for architecture and development setup.
@@ -170,3 +203,9 @@ By submitting a pull request, you agree to the [Contributor License Agreement](C
170
203
  [GPL-3.0](LICENSE)
171
204
 
172
205
  **Commercial licensing available** - [contact us](https://rustledger.github.io/#contact) for proprietary license options.
206
+
207
+ ## Funding
208
+
209
+ rustledger is free and open source. If you find it useful, consider supporting development:
210
+
211
+ [![Support on Liberapay](https://img.shields.io/badge/Support%20on-Liberapay-F6C915?logo=liberapay)](https://liberapay.com/rustledger)
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Rustledger Contributors"
6
6
  ],
7
7
  "description": "Beancount WebAssembly bindings for JavaScript/TypeScript",
8
- "version": "0.5.2",
8
+ "version": "0.7.0",
9
9
  "license": "GPL-3.0-only",
10
10
  "repository": {
11
11
  "type": "git",
@@ -652,6 +652,10 @@ function __wbg_get_imports() {
652
652
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
653
653
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
654
654
  },
655
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
656
+ const ret = typeof(getObject(arg0)) === 'string';
657
+ return ret;
658
+ },
655
659
  __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
656
660
  throw new Error(getStringFromWasm0(arg0, arg1));
657
661
  },
@@ -694,6 +698,14 @@ function __wbg_get_imports() {
694
698
  const ret = new Error();
695
699
  return addHeapObject(ret);
696
700
  },
701
+ __wbg_new_dca287b076112a51: function() {
702
+ const ret = new Map();
703
+ return addHeapObject(ret);
704
+ },
705
+ __wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
706
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
707
+ return addHeapObject(ret);
708
+ },
697
709
  __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
698
710
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
699
711
  },
Binary file