Skip to content

fix: generate Specta bindings via build script#235

Merged
cooper (czxtm) merged 3 commits into
developfrom
scott/fix-specta-hashing
May 31, 2026
Merged

fix: generate Specta bindings via build script#235
cooper (czxtm) merged 3 commits into
developfrom
scott/fix-specta-hashing

Conversation

@scottmcmaster
Copy link
Copy Markdown
Collaborator

Summary

Somebody moved the location of the specta-generated .ts files and changed the name of one and didn't update the regeneration hashing script, as evidenced by the increased dev build startup time and the diagnostic messages that appear.

Test Plan

Run the dev build, watch the logs.

Docs

  • Docs updated
  • No docs update needed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).

📋 PR Overview

Lines changed 8 (+4 / -4)
Files 0 added, 1 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 17.9% 17.9% 30.9% 54.1%

Generated by 🚫 dangerJS against da512f3

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Tauri dev startup regeneration check so it looks for the current Specta-generated TypeScript files under src/ipc, avoiding unnecessary regeneration on every dev launch.

Changes:

  • Updates the SQLite generated file check from src/types/sqlite.ts to src/ipc/sqlite.ts.
  • Updates the shared generated types check from src/types/shared.ts to src/ipc/types.ts.
  • Aligns diagnostic “missing file” messages with the corrected paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@CasLinden Cas Linden (CasLinden) left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hashed files now just contain re-exports, so re-enabling the optimisation would break generation when needed.

There's also agents manually editing the output files. Breakage, merge conflicts and other issues would be less likely if we just regenerate.

I see two options:

  1. hashing all files
  2. doing away with the optimisation

I'd say 1 just expands the maintenance required, requiring more frequent additions to this script in the future. Is it worth the ~1-2s every run?

@CasLinden
Copy link
Copy Markdown
Contributor

I suppose technically you could hash all files present in the designated /shared dir, but with the agent thing, and maintenance like this PR, which would have caused an issue down the line, I think the case for removal is strong.

@scottmcmaster
Copy link
Copy Markdown
Collaborator Author

The hashed files now just contain re-exports, so re-enabling the optimisation would break generation when needed.

There's also agents manually editing the output files. Breakage, merge conflicts and other issues would be less likely if we just regenerate.

I see two options:

  1. hashing all files
  2. doing away with the optimisation

I'd say 1 just expands the maintenance required, requiring more frequent additions to this script in the future. Is it worth the ~1-2s every run?

Sorry, I don't understand this point. The script is just for dev builds to not waste multiple seconds on every startup. I'm not seeing the issue, but maybe if you clarify I can think of a way to fix it, because technically there always should be a way to make this work in any sane build system.

@CasLinden
Copy link
Copy Markdown
Contributor

The hashed files now just contain re-exports

Look at the contents of shared_types.rs

@CasLinden Cas Linden (CasLinden) removed this pull request from the merge queue due to a manual request May 30, 2026
@CasLinden
Copy link
Copy Markdown
Contributor

Unqueued this.

@CasLinden
Copy link
Copy Markdown
Contributor

I have an explanation ready, let me just prove it / check I am not just wrong.

@CasLinden
Copy link
Copy Markdown
Contributor

Scott McMaster (@scottmcmaster)

This commit changed shared_types.rs from a file that contains the types, to one that re-exports them.

So since then (weeks before the change this PR points to), changing types in nested files in the /shared leads to false negatives as the type files themselves are not what the script hashes and therefore checks for changes.

Here's two scenarios I ran on the branch with screenshots:

Scenario 1: New type is added, requires addition in specta_gen_ts.rs, which is also hashed. So it works.
Scenario 2: An existing type is changed, no hashed files change, script emits false negative.

Screenshot 2026-05-30 at 11 14 53 Screenshot 2026-05-30 at 11 15 30

@CasLinden
Copy link
Copy Markdown
Contributor

Scott McMaster (@scottmcmaster)

please cherry pick: fdff307

Or close this and merge this

@cursor cursor Bot changed the title fix: correct paths for specta-generated ts files fix: generate Specta bindings via build script May 30, 2026
Comment thread apps/native/src/ipc/commands.ts Fixed
@czxtm cooper (czxtm) force-pushed the scott/fix-specta-hashing branch from e519da8 to 5e7ec0a Compare May 30, 2026 08:37
@czxtm cooper (czxtm) force-pushed the scott/fix-specta-hashing branch 2 times, most recently from 91dbb4b to 638151e Compare May 30, 2026 09:13
Merged via the queue into develop with commit 2bd353f May 31, 2026
10 checks passed
@czxtm cooper (czxtm) deleted the scott/fix-specta-hashing branch May 31, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants