Remove stray src-tauri/bindings; make ts-rs export dir cwd-independent #18
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mett/cushion!18
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ts-rs-export-dir"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src-tauri/bindings/*.tswas a tracked duplicate of the ts-rs bindings, committed in91e11d8.Root cause:
TS_RS_EXPORT_DIRwas set insrc-tauri/.cargo/config.toml. Cargo reads config from the cwd upwards, not from the manifest's directory. Socargo test --manifest-path src-tauri/Cargo.tomlfrom the repo root (as CLAUDE.md and CI run it) never saw the setting, and ts-rs wrote to its defaultsrc-tauri/bindings/. Only runs from insidesrc-tauri/wrote tosrc/lib/bindings/. I reproduced this before the fix.Changes
.cargo/config.tomlat the repo root (TS_RS_EXPORT_DIR = { value = "src/lib/bindings", relative = true }). Cargo finds it from both the root andsrc-tauri/.src-tauri/bindings/and add it to.gitignore.Tests
src/lib/bindingsand rancargo test --lib, once from the root and once fromsrc-tauri/. Both runs regeneratedsrc/lib/bindings/and neither createdsrc-tauri/bindings/.pnpm check,pnpm lint,cargo fmt --check,cargo clippy --all-targets -D warnings: clean.cargo testagainst the ABS test server on :13378: all pass.git diff --exit-code -- src/lib/bindings: clean.🤖 Generated with Claude Code