Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Typescript Generator Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Adopt a Laravel-native equivalent (spatie/laravel-typescript-transformer or equivalent) and use this repo only as a design reference for which artifacts to emit. Lowest cost, lowest risk.
  2. Fork and port the extraction core into an Artisan command — replace Doctrine metadata reads with Eloquent casts/$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.
  3. Run as a sidecar in a throwaway Symfony container in CI, pointed at a generated schema artifact. Almost never worth it — it adds a second runtime, a second dependency graph, and a translation layer for a build-time task.

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:

  • Does the generator read PHP type declarations (portable) or framework metadata (not portable)? This single answer sets the effort estimate.
  • What exactly does it emit — interfaces only, or also enums, route clients, API clients, validators? Scope determines whether a port is worth it versus writing 200 lines ourselves.
  • Is there any test suite in the repo, and does it still run on a current PHP version? A dead repo with green tests is a usable spec; a dead repo with no tests is a liability.
  • Does EUPL-1.1 survive legal review for our distribution model?
  • What is the actual drift problem we are solving — request/response DTOs, Eloquent model shapes, enum parity, or all three? (The opportunity: 8.81 score suggests the problem is real and underserved even though the package is not viable.)
  • Which frontend consumes this, and does it already have a hand-maintained types/ folder that we would be replacing or duplicating?

Integration Approach

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.

  • Phase 0 — Spike (1–3 days, timeboxed, with a hard kill criterion). Clone the repo, run its test suite against our PHP version, and classify each generator as "reflection-based" (portable) or "framework-metadata-based" (rewrite). Deliverable: a one-page go/no-go with an effort range.
  • Phase 1 — Decide build vs. borrow. If the extraction core is reflection-based, fork under our org, strip the bundle plumbing, and wrap in an Artisan command. If it is metadata-bound, stop and adopt the Spatie transformer instead. Do not let the spike bleed into a rewrite by default.
  • Phase 2 — Artisan command. Single 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.
  • Phase 3 — CI contract gate. Run generation in CI, diff against committed output, fail the build on drift. This is the actual product value; the generator is just the mechanism.
  • Phase 4 — Consumption. Frontend imports from the generated directory; the directory is committed (so reviewers see type changes in the diff) or generated in a pre-build step — pick one, don't do both.

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.

Operational Impact

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.

  • Silent drift: generator runs, output is stale because the command wasn't in the build path. Mitigation: blocking CI check.
  • Wrong-but-plausible types: e.g. nullable columns emitted as non-nullable, Carbon emitted as string, Eloquent $casts ignored. Mitigation: golden-file tests on a representative sample of models/DTOs.
  • Build breakage: an unparseable PHP construct in one class fails the whole run and blocks deploys. Mitigation: per-class error isolation, and generation as a non-blocking advisory step for the first two sprints.
  • Orphaned fork: the engineer who ported it leaves. Mitigation: documentation and a test suite are prerequisites for merge, not follow-ups.
  • License exposure: derived code carrying EUPL obligations into a distributed artifact. Mitigation: legal sign-off before Phase 2, and keep the fork in a clearly-labeled internal repo.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource