vinatis/typescript-generator
Generates TypeScript definitions from your Laravel codebase, turning models, form requests, and API resources into typed interfaces so frontend and backend stay in sync. Keep type safety across your stack without writing declarations by hand.
Architecture fit — poor as shipped, salvageable as a reference implementation.
The package is a Symfony bundle (vinatis/typescript-generator-bundle), not a Laravel package. It will register through Symfony's Bundle class and DependencyInjection extension, neither of which Laravel's service container or bootstrap/app.php provider list can consume. Its type-extraction surface is almost certainly coupled to Symfony/Doctrine concepts — entities, FormType classes, serializer metadata, router — none of which exist in a Laravel codebase built on Eloquent, Form Requests, API Resources, and Laravel's router. The underlying idea (derive TypeScript interfaces from PHP type declarations so the frontend contract cannot drift) is sound and directly applicable; the wiring is not.
Integration feasibility — low for drop-in, medium for a port.
There is no composer require path to a working state. Realistic options, in order of preference:
spatie/laravel-typescript-transformer or equivalent) and use this repo only as a design reference for which artifacts to emit. Lowest cost, lowest risk.$fillable and reflection, replace Symfony router introspection with Route::getRoutes(). Effort depends entirely on how much of the generator is reflection-based versus framework-metadata-based; that is the first thing to measure in a spike.Technical risk — high, and concentrated in provenance.
Archived status, 0 stars, 0 dependents, and a repository score of 0 are a coherent signal: no maintainer, no downstream validation, no security response path. For a build-time dev dependency that is survivable — it never runs in production and never sees untrusted input — but it means we own every line we depend on, permanently. Secondary risks: EUPL-1.1 is a weak copyleft with source-disclosure obligations on distribution and on "communication to the public," which is fine for internal tooling but needs a legal read before it ships inside anything we redistribute (SDK, on-prem appliance, white-label build). Finally, hidden coupling: bundles of this kind often assume doctrine/orm, a specific Symfony minor, and PSR-4 layout conventions; any of those can turn a one-day port into a two-week archaeology exercise.
Key questions before committing engineering time:
opportunity: 8.81 score suggests the problem is real and underserved even though the package is not viable.)types/ folder that we would be replacing or duplicating?Stack fit. Laravel and Symfony share PSR interfaces and several components (symfony/console, symfony/finder, symfony/process), so individual classes may be directly reusable even though the bundle wrapper is not. Treat the repo as a library of extractor classes to mine, not as a package to install. Expect the bundle's DependencyInjection extension, configuration tree, and any doctrine/* imports to be discarded wholesale.
Migration path.
php artisan types:generate entrypoint, deterministic output, a configured output directory (e.g. resources/js/types/generated/), and a --check mode that exits non-zero on drift.Compatibility. Pin the fork to a PHP version range we actually run and to our Laravel major. Because the upstream is archived, there is no constraint-conflict risk from future releases — a genuine, if grim, simplification. Snapshot the source commit SHA in the fork's README so provenance is auditable.
Sequencing. Land the CI drift check before broad frontend adoption. A generator without a drift gate produces types that are correct on day one and wrong by month three, and the second state is worse than no types at all because it creates false confidence.
Maintenance. The dominant cost. Archived + 0 dependents means zero upstream fixes, zero CVE triage, zero PHP-version bumps from anyone but us. Budget roughly 10–15% of one engineer's capacity in perpetuity for a small fork, and more if the extraction logic is metadata-bound. Every Laravel major upgrade becomes our migration, not a composer update. This cost is invisible in the build phase and permanent in the run phase — it belongs in the business case, not the footnotes.
Support. None. No issue tracker activity, no maintainer, no SLA. Internal ownership must be explicitly assigned to a named team before adoption; "the platform team" is not an owner. Document the fork's purpose and divergence policy so a future engineer doesn't spend a day wondering why a vendored copy exists.
Scaling. Genuinely low risk — this is a build-time tool that never serves traffic, holds no state, and has no runtime blast radius. Generation time scales linearly with the number of PHP classes in scope, which stays in the low seconds for typical applications. The scaling concern is organizational, not technical: as the number of emitted types grows, frontend and backend must agree on naming, nullability, and date/serialization conventions, or the generated output becomes a source of friction rather than a contract.
Failure modes.
Carbon emitted as string, Eloquent $casts ignored. Mitigation: golden-file tests on a representative sample of models/DTOs.Ramp-up. Small and well-bounded: one engineer, a few days for the spike, one to two weeks for the port plus CI wiring, assuming a reflection-based core. Prerequisite skills are PHP reflection and TypeScript type syntax — both likely already present. The frontend team's ramp-up is near zero if the generated directory is conventional and committed. The real ramp-up risk sits with whoever inherits the fork in eighteen months, which is why the documentation and test-suite requirements should be treated as acceptance criteria rather than nice-to-haves.
Recommendation. Do not adopt the package as a dependency. Run the Phase 0 spike to harvest whatever extraction logic is portable, and default to a Laravel-native transformer if the port estimate exceeds roughly one engineer-week. The high opportunity score reflects a real, recurring pain — PHP/TypeScript contract drift — that this repository identifies clearly but does not solve in a form a Laravel shop can operate.
How can I help you explore Laravel packages today?