Repository navigation
Fix TypeScript declaration emit and strict mypy, and release 0.4.1 - #8
Merged
Merged
Conversation
koehlma
marked this pull request as ready for review
October 14, 2026 05:35
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.
Fixes two problems in generated code and bumps all crates and
@sidexpackages to 0.4.1.declaration: trueandcomposite: true.@sidex/typesexports the brand type asNominalBrand; the brand symbol itself stays private, so brands remain nominal._sidex.pyruntime, passmypy --strict. The runtime's Pydantic hooks andinlineare fully annotated.Rationale
Since 0.4.0, every generated TypeScript type has an exported companion value whose type is inferred and contains the brand. The brand referred to a symbol that consumers could not name, so declaration emit failed with TS4023. Libraries that publish declarations, such as SDKs, could only work around this by post-processing generated code. Composite projects failed as well.
Exporting the brand type fixes this at the root, without regenerating consumer code. The alternative, emitting explicit annotations for every companion value, would make the generated code larger and still require regeneration.
The Python runtime lacked annotations on its Pydantic hooks, which forced consumers to exclude
_sidexfrom strict type checks.Testing
declaration: trueandcomposite: true. The fixture covers nominal wrappers, opaque types, timestamps and dates, generics, and validate-plugin values withtryNew.mypy --strictover generated packages.cargo test, Clippy, the Python integration tests, both TypeScript packages, andpackaging/crates.py packagepass locally.Created on behalf of @koehlma by Claude Code / claude-opus-5-5 · Task