Skip to content

Latest commit

 

History

History
169 lines (104 loc) · 4.59 KB

Changelog.md

File metadata and controls

169 lines (104 loc) · 4.59 KB

📦 Changelog

All notable changes to this project will be documented in this file.

[0.7.3]

Fixed

  • A TypeVar bound to a generic class no longer produces an invalid TypeScript constraint. Generic interfaces declare defaults for their type parameters (T = unknown, T extends string = string), so out-of-scope references render as bare references (R extends Resource, data: R) instead of leaking the definition's parameter names or materializing unknown/string fallbacks.
  • References to a generic interface always carry a valid type argument list, including bare references from non-generic classes and materialized pydantic/generic bases.
  • Generic class fields keep their type parameters on Python 3.12.x, where get_type_hints resolves PEP 695 annotation strings to same-named module-level TypeVars. Type parameter scoping matches by name, so fields like data: R are no longer emitted as unknown.

[0.7.2]

Fixed

  • Types in TYPE_CHECKING blocks are now correctly emitted in the generated TypeScript code isntead of raising an ValueError.

[0.7.1]

Fixed

  • Generic references in pydantic models no longer lose their type arguments when the referenced model's type parameter shares a name with a parameter of the enclosing generic class (e.g. ResourceIdentifier[T_I] was emitted as ResourceIdentifier<T>).
  • TSBuilder.save_file opens the target file in write mode, so saving generated TypeScript to disk no longer fails.

[0.7.0]

  • Migrated the development environment and dependency management to uv.
  • Enabled additional Ruff linting rules to improve code quality and consistency.
  • Reformatted the codebase to comply with the updated Ruff configuration.
  • Added support for generic types (TypeVars, bounded type parameters, parametrized references and generic inheritance), including pydantic generic models.

[0.6.0]

  • Added configuration options for indentation style (tabs vs spaces) and size. Use CONFIG.indent_with_tabs and CONFIG.indent_size to customize the output format of the generated TypeScript code.

[0.5.0]

  • Add any_as_unknown config option to use unknown instead of any for the Any type from Python. This is now the default behavior #2.

[0.4.1]

Fixed

  • Support for edge cases in TypeScript interface generation, specifically when an interface has no elements but inherits from another type. This ensures that the generated TypeScript code is valid and does not produce empty interfaces.

[0.4.0]

Added

  • Support for excluding fields from TypeScript types using the exclude method. This only works for TSComplex types, such as TSInterface, TSRecordType, and TSEnum. The builder also now supports excluding fields when adding types.
  • Added changelog :)

[0.3.1]

Fixed

  • Resolved a small issue with wrapped dict types.
  • Fixed import error.

[0.3.0]

Added

  • Support for wrapper types, specifically Mapped from sqlalchemy.

[0.2.1]

Added

  • Support for ABCs in inheritance.

Fixed

  • Minor issue with builder logic when using inherited types.

[0.2.0]

Added

  • Support for class inheritance in type generation.

[0.1.9]

Added

  • datetime type support.

[0.1.6]

Added

  • Ordering support for TypeScript generic types.

Fixed

  • Incorrect ordering logic for record types.

[0.1.4]

Changed

  • TypeScript types are now consistently ordered by name.

[0.1.3]

Changed

  • fullstr() now ensures parent is always listed last.

[0.1.2]

Added

  • Example for Flask/Quart response typing.

[0.1.0]

Added

  • Initial support for Record types.

[Unreleased - Pre 0.1.0]

Added

  • Full support for recursive types.
  • Enum support, including nested dicts.
  • Basic conversion of Python primitives to TypeScript.
  • __hash__ methods for Record and Sequence types.
  • TypeScript export keyword support for cross-file usage.
  • Py.typed marker for PEP 561 compliance.
  • Small builder class to simplify TypeScript generation.
  • Badges, docs, and contribution guides.
  • GitHub workflows, ReadTheDocs integration, and pre-commit hooks.

Changed

  • Refactored base types into 3 categories.
  • Renamed convert to generate.

Fixed

  • Compatibility fixes for Python 3.10.
  • Hashing issue due to non-inherited methods.
  • Inconsistent ordering behavior across Python versions.
  • CI workflow issues with matrix and string casting.

Let me know if you'd like:

  • This output as a CHANGELOG.md file
  • GitHub diff links for each version
  • A GitHub Action to generate this automatically with every tag push