Skip to content

Rename Rust types to match spec; remove UNION_NAME_OVERRIDES + ENUMERATION_NAME_OVERRIDES#96

Merged
lorisleiva merged 1 commit into
mainfrom
loris/spec-gen-rename-rust-types
Jun 10, 2026
Merged

Rename Rust types to match spec; remove UNION_NAME_OVERRIDES + ENUMERATION_NAME_OVERRIDES#96
lorisleiva merged 1 commit into
mainfrom
loris/spec-gen-rename-rust-types

Conversation

@lorisleiva

Copy link
Copy Markdown
Member

This PR aligns nine hand-written Rust types with the spec's pascalCase defaults so the generator no longer needs name-override tables. Renamed: ConditionNode \u2192 ConditionalValueCondition; EnumVariantData \u2192 EnumValuePayload; InstructionByteDeltaNodeValue \u2192 InstructionByteDeltaValue; InstructionRemainingAccountsNodeValue \u2192 InstructionRemainingAccountsValue; PdaSeedValueValueNode \u2192 PdaSeedValueValue; PdaValue \u2192 PdaValuePda; PdaProgramIdValueNode \u2192 PdaValueProgramId; Endian \u2192 Endianness; InstructionOptionalAccountStrategy \u2192 OptionalAccountStrategy. With every Rust name now matching pascalCase(specName), UNION_NAME_OVERRIDES and ENUMERATION_NAME_OVERRIDES are deleted from spec-generators/src/defaults.ts and all of their consumers (typeExpr.ts, unionPage.ts, index.ts) collapse to plain pascalCase(name). The inline-union file-name path also reverts to following the spec union name directly (e.g. enumValuePayload \u2192 enum_value_payload.rs matching its now-spec-default type EnumValuePayload). Cuts the generator's override surface from seven maps to five.

lorisleiva commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jun 10, 2:13 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 10, 2:21 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 10, 2:21 PM UTC: @lorisleiva merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from loris/spec-gen-value-box-rule to graphite-base/96 June 10, 2026 14:18
@lorisleiva lorisleiva changed the base branch from graphite-base/96 to main June 10, 2026 14:19
…ATION_NAME_OVERRIDES

This PR aligns nine hand-written Rust types with the spec's pascalCase defaults so the generator no longer needs name-override tables. Renamed: `ConditionNode` \u2192 `ConditionalValueCondition`; `EnumVariantData` \u2192 `EnumValuePayload`; `InstructionByteDeltaNodeValue` \u2192 `InstructionByteDeltaValue`; `InstructionRemainingAccountsNodeValue` \u2192 `InstructionRemainingAccountsValue`; `PdaSeedValueValueNode` \u2192 `PdaSeedValueValue`; `PdaValue` \u2192 `PdaValuePda`; `PdaProgramIdValueNode` \u2192 `PdaValueProgramId`; `Endian` \u2192 `Endianness`; `InstructionOptionalAccountStrategy` \u2192 `OptionalAccountStrategy`. With every Rust name now matching `pascalCase(specName)`, `UNION_NAME_OVERRIDES` and `ENUMERATION_NAME_OVERRIDES` are deleted from `spec-generators/src/defaults.ts` and all of their consumers (`typeExpr.ts`, `unionPage.ts`, `index.ts`) collapse to plain `pascalCase(name)`. The inline-union file-name path also reverts to following the spec union name directly (e.g. `enumValuePayload` \u2192 `enum_value_payload.rs` matching its now-spec-default type `EnumValuePayload`). Cuts the generator's override surface from seven maps to five.
@lorisleiva lorisleiva force-pushed the loris/spec-gen-rename-rust-types branch from 9958eea to 0a24115 Compare June 10, 2026 14:20
@lorisleiva lorisleiva merged commit cf8c765 into main Jun 10, 2026
4 checks passed
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