Skip to content

refactor(provider-gen): name the declaration after what it declares - #34

Draft
k08200 wants to merge 1 commit into
spike/gen-provider-generic-runtimefrom
spike/gen-provider-rename
Draft

refactor(provider-gen): name the declaration after what it declares#34
k08200 wants to merge 1 commit into
spike/gen-provider-generic-runtimefrom
spike/gen-provider-rename

Conversation

@k08200

@k08200 k08200 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #33 (which is stacked on #29). Mechanical rename, no behavior change.

#29 already flagged the name: "there is no reason to keep calling this role wire." Measuring what the generator actually replaces (see the coverage comment on gridaco/uhura#29) settled what it should be instead. The declaration names the app's provider tables — which tables to snapshot, which mutation routes to which fn, and which refusal codes a user may see — so it is a .provider declaration.

before after
provider_gen/wire.pest provider_gen/provider.pest
tests/provider_fixtures/instagram.wire …/instagram.provider
WireParser ProviderParser
WireFile ProviderFile
--app <path> --declaration <path>
app_declaration parameter declaration

--declaration also removes the odd --app instagram.provider reading, and lines the flag up with the noun the file now uses.

Uhura's wire protocol keeps its name. WireValue and the "Uhura wire values" the shared runtime type-checks are a different concept; they are untouched. Only the declaration language is renamed.

Both file renames are git mv, so history follows.

Type

refactor

Checklist

Test plan

On the pinned toolchain (1.92.0) and node 24.18.0, after pnpm -C uhura/web build:provider:

  • cargo fmt --all --check — exit 0
  • cargo clippy --locked --workspace --all-targets -- -D warnings — exit 0
  • cargo test --locked --workspace — exit 0
  • node scripts/check-doc-snippets.mjs — exit 0
  • cargo test --locked -p spock-cli --test provider_gen — 14 passed, 0 failed, 0 ignored
  • cargo run -p spock-cli -- gen provider uhura/examples/instagram/backend/app.spock --declaration crates/spock-cli/tests/provider_fixtures/instagram.provider --uhura uhura/examples/instagram/client — exit 0, emits export const MODULE = "app.instagram@1"
  • spock gen provider --helpUsage: spock gen provider [OPTIONS] --declaration <DECLARATION> --uhura <UHURA> <FILE>

"wire" described nothing about this file's role, and the issue that proposed
the spike already said the name should go. Measuring what the generator
actually replaces settled what to call it: the declaration names the app's
provider tables — the snapshot reads, the mutation-to-fn routing, and the
refusals a user may see — so it is a `.provider` declaration.

Renamed with no behavior change: `wire.pest` to `provider.pest`,
`instagram.wire` to `instagram.provider`, `WireParser` to `ProviderParser`,
and `WireFile` to `ProviderFile`. The CLI flag becomes `--declaration`, which
also removes the odd `--app instagram.provider` reading.

Uhura's wire protocol keeps its name. `WireValue` and the "Uhura wire values"
the runtime checks are a different concept and are untouched; only the
declaration language is renamed.

Verified: fmt, clippy -D warnings, `cargo test --locked --workspace`, and the
doc snippets all exit 0; `provider_gen` reports 14 passed, 0 ignored; and
`spock gen provider <program> --declaration instagram.provider --uhura
<client>` still emits `export const MODULE = "app.instagram@1"`.
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spock Ready Ready Preview, Comment Jul 27, 2026 8:58am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 586b6bc0-82a2-447f-8f15-2eb97ffbe756

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spike/gen-provider-rename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant