Skip to content

v0.3.0

Choose a tag to compare

@jaspertey jaspertey released this 09 Oct 19:03
· 114 commits to main since this release
db8cbde

Frontend, routes and views inside modules

A module can now hold its whole feature: its Vue or React pages, Blade views and components, and its routes, laid out the way Laravel lays out an app. Wire an Inertia app for module pages once, then generate them:

php artisan mod:install inertia
php artisan mod:page Inventory:Widget/Index

Routes load with one call, Mod::routes(), and views resolve as inventory::…. Scaffolds can now include frontend files, so a page and its controller come from one command, and modules can carry their own templates and scaffolds. Every command that writes files can preview its plan as JSON, and Laravel Boost users get read-only mod tools for their agents. See Upgrading from 0.2: HTTP classes now live under Http/.

Added

  • Frontend files from templates: a .stub whose name ends in another extension becomes a generator (card.blade.php.stub → mod:card, filter.vue.stub → mod:filter). File names follow the stack's casing.
  • mod:page writes a minimal Inertia page for the app's stack (Vue or React, TypeScript when tsconfig.json exists) into the module, following the app's pages/ or Pages/ casing.
  • mod:install inertia previews and wires Vue and React apps for module pages: the page resolver shipped in vendor/, the @modules Vite and TypeScript aliases, and Tailwind sources. Rerunning reports "Already wired."; custom setups get manual instructions.
  • Placeholders that link PHP and frontend files: {{ page }} (Inventory::Widget/Index), {{ view }}, {{ import }} and {{ tag }}. Only known names are replaced, @{{ }} escapes, and an ambiguous bare name in Vue or Blade warns with its file and line.
  • Frontend files as scaffold members, with stack-specific variants, file questions and anchored inserts.
  • mod:template --from copies a Vue or Blade file byte for byte and reports which names to turn into placeholders.
  • ->frontend(pages:, components:, css:, views:) relocates a layout's frontend folders. Folders that differ only by case are refused.
  • Module view namespaces (view('inventory::widgets.show')) and anonymous components (<x-inventory::widget-card />), with mod:view and mod:component. mod:mail --markdown and mod:notification --markdown write their views in the module.
  • Mod::routes() loads each module's routes/web.php, api.php and console.php with Laravel's groups, from bootstrap/app.php or inside your own route group. only:, except: and config('mod.routes.order') control which modules load and when. Works with route:cache.
  • Optional RegistersRoutes classes for routes in PHP, and mod:routes and mod:route-registrar to start either. Scaffolds can insert routes with into: 'routes'.
  • Scaffold members can be ungrouped: true, ask their own group:, or use existing: 'keep' to write a shared file once.
  • Modules can carry their own templates (<module>/stubs/mod/) and scaffolds (<module>/Scaffolds/ or Mod::scaffolds()). The module wins over the app, and the app over packages.
  • --dry-run --json on every command that writes files prints a plan of what it would write, without writing or prompting.
  • mod:list --json adds stack, frontend, views, routes and wiring sections, and where each template and scaffold comes from.
  • With Laravel Boost installed, read-only mod-inventory and mod-plan MCP tools let agents read the inventory and preview generators.

Changed

  • HTTP classes (controllers, requests, middleware, resources) now live under Http/
  • Class discovery skips a module's resources/ and routes/ folders.

What's Changed

  • Add machine-readable plans and a sectioned inventory for agents by @jaspertey in #29
  • Shape modules like Laravel: Http/ classes, resources/ and routes/ folders by @jaspertey in #30
  • Add mod:install inertia to wire module pages into Vue and React apps by @jaspertey in #31
  • Load module routes with Mod::routes(), route files and registrars by @jaspertey in #33
  • Give modules their own Blade views, components and mail views by @jaspertey in #32
  • Generate frontend and plain files: pages, components, scripts and more by @jaspertey in #34
  • Place scaffold members per member, and let modules own generators by @jaspertey in #36
  • Give agents read-only mod tools through Laravel Boost's MCP server by @jaspertey in #35
  • Prepare the README, Boost guidance and changelog for 0.3 by @jaspertey in #37

Full Changelog: v0.2.0...v0.3.0