refactor(provider-gen): name the declaration after what it declares - #34
Draft
k08200 wants to merge 1 commit into
Draft
refactor(provider-gen): name the declaration after what it declares#34k08200 wants to merge 1 commit into
k08200 wants to merge 1 commit into
Conversation
"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"`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.providerdeclaration.provider_gen/wire.pestprovider_gen/provider.pesttests/provider_fixtures/instagram.wire…/instagram.providerWireParserProviderParserWireFileProviderFile--app <path>--declaration <path>app_declarationparameterdeclaration--declarationalso removes the odd--app instagram.providerreading, and lines the flag up with the noun the file now uses.Uhura's wire protocol keeps its name.
WireValueand 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
git mvused, rename history preservedTest 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 0cargo clippy --locked --workspace --all-targets -- -D warnings— exit 0cargo test --locked --workspace— exit 0node scripts/check-doc-snippets.mjs— exit 0cargo test --locked -p spock-cli --test provider_gen— 14 passed, 0 failed, 0 ignoredcargo 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, emitsexport const MODULE = "app.instagram@1"spock gen provider --help—Usage: spock gen provider [OPTIONS] --declaration <DECLARATION> --uhura <UHURA> <FILE>