yabx/ts-bundle
yabx/ts-bundle is a PHP package for bundling and managing TypeScript assets in your application. It streamlines TypeScript build integration with straightforward configuration, helping keep frontend assets organized, maintainable, and easier to manage within your development workflow.
What the package is. yabx/ts-bundle is a Symfony bundle (not Laravel) that generates TypeScript type definitions from PHP-side contracts — entities, DTOs, enums, and likely controller signatures — so the frontend consumes compiler-checked types rather than hand-maintained .d.ts files. This is a well-understood category (comparable in intent to symfony/ux type generation, typescript-transformer, and OpenAPI→TS pipelines), but this specific implementation is unproven: 2 stars, 0 dependents, and an opportunity score of 0.01 indicate effectively zero ecosystem validation.
Architecture fit — poor as a direct dependency. Three structural mismatches:
Bundle classes, Extension/Configuration DI semantics, and bundle auto-discovery — none of which Laravel's service container consumes. There is no install path short of forking.Integration feasibility. Direct composer require into a Laravel app: not feasible. Fork-and-port into a Laravel service provider: feasible but a genuine engineering project, not a package adoption — you would be reimplementing the introspection layer against Eloquent/Resources while keeping the emitter. Value of the fork depends entirely on the emitter's quality, which is precisely the part we cannot assess from 2 stars and no dependents.
Technical risk — high. Single-vendor, single-maintainer project with no release history to speak of. No test matrix visibility, no security disclosure process, no backward-compatibility track record. Symfony 8 targeting means the maintainer is building forward-looking, which is fine for a hobby project and dangerous for a production contract surface. Critically, this package's failure mode is silent contract drift — emitted types diverge from runtime behavior and the frontend compiles cleanly against a lie.
Key questions before any further spend:
readonly?Stack fit: none. Treat this as a reference implementation for a pattern, not a component to install. The problem it addresses — keeping TypeScript types synchronized with backend contracts — is real and worth solving; the artifact is not the solution for us.
Recommended path: contract-first via OpenAPI. We already have a viable Laravel-native route to the same outcome:
dedoc/scramble or knuckleswtf/scribe → OpenAPI 3.1 spec generated from routes, Form Requests, and API Resources, checked into the repo.openapi-typescript (or orval) → TypeScript types and typed fetch clients in the frontend.This gives deterministic output, an explicit contract artifact, language-agnostic consumers (mobile, partner integrations), and a large maintained ecosystem — all the things this bundle cannot offer at 2 stars.
Migration path (if we deliberately choose to evaluate the bundle's approach):
.d.ts plus a coverage verdict.internal/laravel-ts-types) behind a service provider. Estimate 3–4 weeks of engineering plus ongoing maintenance — weigh against the near-zero cost of the OpenAPI path.Compatibility. If a fork is ever built, pin it to a specific Laravel/Symfony component line, lock PHP minor version in CI, and run generation against the same runtime version as production. Never allow the generator to float across majors independently of the framework.
Sequencing. Contract-generation hygiene (OpenAPI + CI gate) first — it delivers most of the value and de-risks everything downstream. TypeScript client generation second. Only then revisit bespoke PHP introspection.
Maintenance. As a dependency: unquantifiable, which for a contract-bearing tool means unacceptable — a stalled upstream leaves us pinned to a dead framework major. As a fork: we own it outright, roughly 0.25–0.5 FTE ongoing to track Laravel releases, plus a recurring tax every framework upgrade. Neither is attractive relative to a maintained OpenAPI toolchain.
Support. None meaningful. Two stars and zero dependents means no issue-tracker history to mine, no Stack Overflow corpus, no third-party writeups, and no peer to ask. Every problem becomes first-principles debugging against a codebase we did not write.
Scaling. Generation is a build-time batch job; scaling is a non-issue technically. The real scaling concern is organizational: as the number of models and consuming clients grows, an undocumented bespoke type mapper becomes a single point of contract failure across every frontend surface, and its quirks become folklore held by one or two engineers.
Failure modes, ranked:
cast Eloquent applies at runtime but not in metadata). TypeScript compiles; production returns null; runtime error in the browser. Highest severity, lowest detectability.any, quietly disabling type safety exactly where the domain is most complex.Mitigation for all of the above is identical: an explicit, checked-in contract artifact with CI diff enforcement. That is the OpenAPI path.
Ramp-up. Near zero for the OpenAPI route — both tools are widely documented and any mid-level engineer can extend the pipeline. For a fork of this bundle: 2–3 weeks for one engineer to reach competence on the introspection and emission layers, with bus factor 1 unless a second engineer is deliberately trained.
Bottom line. Do not adopt. Log it as a pattern reference, run the 2–3 day spike only if a specific introspection gap in our OpenAPI pipeline is identified, and default to the contract-first route.
How can I help you explore Laravel packages today?