Skip to content

Releases: vagebnd/runtype

Title: v1.0.0 — Namespace Grouping, Consistent Formatting & Laravel 13 Support

03 Apr 14:20
8e20102

Choose a tag to compare

What's New

Namespace Grouping

Generated TypeScript types are now wrapped in declare namespace blocks based on their PHP namespace, preventing naming collisions and improving organization.

declare namespace App.Http.Resources {
    // App\Http\Resources\UserResource
    export type UserResourceType = {
        id: number;
        name: string;
        created_at: string;
    }
}

Consistent Formatting

  • Properties now use name: type; format with proper indentation
  • Inline object types use { key: type } with spaces
  • Resource type references are fully namespace-qualified

Resource Collection Array Types

Collections returning sequential arrays (e.g., $this->collection->map(...)) now correctly output array types like { id: number }[] instead of broken numeric property keys.

Laravel 13 & PHP 8.5 Support

  • Added support for Laravel 11, 12, and 13
  • Added support for PHP 8.3, 8.4, and 8.5
  • Upgraded to Pest 4 / PHPUnit 12 compatibility

Bug Fixes

  • Fixed instanceof error when type replacement keys are non-string
  • Fixed incorrect Collection type hint casing in PersistTypescriptTypes
  • Synced TypescriptProperty::determineType() with Types::determineType() — was missing BackedEnum support

Breaking Changes

The output format has changed significantly. If you reference generated types in your TypeScript code, you'll need to update your imports to use the namespaced format (e.g., App.Http.Resources.UserResourceType).

Credits

Namespace concept by @rick-bongers (#14).

Added Enum support

16 Jan 09:34

Choose a tag to compare

Added enum support by @rick-bongers.

Ensure optional types are processed correctly

27 May 13:25

Choose a tag to compare

This update ensures that optional types are correctly added to the export i.e. name?: boolean.

Added support for request user resolving in resources

01 Apr 21:15

Choose a tag to compare

This updated binds the user to the request when present, allowing us to do checks based on the user in resources.

Added support for L12

26 Feb 22:46

Choose a tag to compare

0.3.0

refactor: dropped L10 support

Updated PHP-parser to latest version

02 Apr 22:58
d3248e3

Choose a tag to compare

What's Changed

  • Update nikic/php-parser requirement from ^4.15 to ^5.0 by @dependabot in #9

Full Changelog: 0.2.0...0.2.1

Added support for L11

02 Apr 18:54

Choose a tag to compare

Added support for L10

29 Aug 18:05

Choose a tag to compare

0.1.0

feat: run tests on L10