Remove stray src-tauri/bindings; make ts-rs export dir cwd-independent #18

Merged
Mett-mit-Zwiebel merged 1 commit from fix/ts-rs-export-dir into main 2026-10-29 01:33:18 +01:00
Mett-mit-Zwiebel commented 2026-10-29 01:28:02 +01:00 (Migrated from github.com)

src-tauri/bindings/*.ts was a tracked duplicate of the ts-rs bindings, committed in 91e11d8.

Root cause: TS_RS_EXPORT_DIR was set in src-tauri/.cargo/config.toml. Cargo reads config from the cwd upwards, not from the manifest's directory. So cargo test --manifest-path src-tauri/Cargo.toml from the repo root (as CLAUDE.md and CI run it) never saw the setting, and ts-rs wrote to its default src-tauri/bindings/. Only runs from inside src-tauri/ wrote to src/lib/bindings/. I reproduced this before the fix.

Changes

  • Move the config to .cargo/config.toml at the repo root (TS_RS_EXPORT_DIR = { value = "src/lib/bindings", relative = true }). Cargo finds it from both the root and src-tauri/.
  • Delete src-tauri/bindings/ and add it to .gitignore.

Tests

  • I reset the files' mtimes in src/lib/bindings and ran cargo test --lib, once from the root and once from src-tauri/. Both runs regenerated src/lib/bindings/ and neither created src-tauri/bindings/.
  • pnpm check, pnpm lint, cargo fmt --check, cargo clippy --all-targets -D warnings: clean.
  • Full cargo test against the ABS test server on :13378: all pass.
  • git diff --exit-code -- src/lib/bindings: clean.

🤖 Generated with Claude Code

`src-tauri/bindings/*.ts` was a tracked duplicate of the ts-rs bindings, committed in 91e11d8. **Root cause:** `TS_RS_EXPORT_DIR` was set in `src-tauri/.cargo/config.toml`. Cargo reads config from the **cwd** upwards, not from the manifest's directory. So `cargo test --manifest-path src-tauri/Cargo.toml` from the repo root (as CLAUDE.md and CI run it) never saw the setting, and ts-rs wrote to its default `src-tauri/bindings/`. Only runs from inside `src-tauri/` wrote to `src/lib/bindings/`. I reproduced this before the fix. **Changes** - Move the config to `.cargo/config.toml` at the repo root (`TS_RS_EXPORT_DIR = { value = "src/lib/bindings", relative = true }`). Cargo finds it from both the root and `src-tauri/`. - Delete `src-tauri/bindings/` and add it to `.gitignore`. **Tests** - I reset the files' mtimes in `src/lib/bindings` and ran `cargo test --lib`, once from the root and once from `src-tauri/`. Both runs regenerated `src/lib/bindings/` and neither created `src-tauri/bindings/`. - `pnpm check`, `pnpm lint`, `cargo fmt --check`, `cargo clippy --all-targets -D warnings`: clean. - Full `cargo test` against the ABS test server on :13378: all pass. - `git diff --exit-code -- src/lib/bindings`: clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.