Skip to content

v0.6.0

Choose a tag to compare

@jaspertey jaspertey released this 11 Oct 20:07
· 72 commits to main since this release
bbcba47

Packages can build on mod

0.6 is about packages that ship code into apps. A package can now ship its own scaffolds under its own name (mod:acme/pages), with mod sorting out clashes between packages and your app. It can register route files, Inertia pages and frontend wiring, and read the app's frontend stack, including Svelte and Livewire. Apps gain a module's own database connection, frontend files in roots that aren't modules, and per-module assets built by Vite.

Mod::vendor('acme')->scaffold('pages', $recipe);   // php artisan mod:acme/pages
Mod::routeFiles('acme', __DIR__.'/../routes');
Mod::pages('acme', __DIR__.'/../resources/js/pages');

Upgrading

  • Package scaffolds must declare a vendor. A package that registers scaffolds with Mod::scaffold() or Mod::scaffolds() is refused with vendor_required. Register them through Mod::vendor('acme')->scaffold(...) instead; the command becomes mod:acme/pages, and include(), layout overrides and mod:rename --scaffold= take the full id. Add command: 'acme:pages' to keep a package-owned command name. An app's own scaffolds are unchanged.

Added

  • Layouts and mounted roots can declare static asset globs and optional executable entries separately. mod:install assets synchronizes Laravel Vite plugin 3 wiring without Inertia; imports, Vite::asset() and @vite retain Laravel ownership of references and loading (#59).
  • Mounted roots can declare root-relative frontend paths, explicit page names, view namespaces and aliases. Pages, views, Vite, TypeScript, Tailwind and the inventory share the compiled ownership record (#57).
  • Packages can declare Inertia page namespaces with Mod::pages() and preview or apply explicit aliases, TypeScript paths and Tailwind sources with Mod::wiring(). Installation includes canonical package globs and preserves custom bootstraps (#93).
  • Mod::stack() exposes the declared Inertia adapter, TypeScript, page path and Livewire status, matching the JSON inventory. Svelte apps can generate .svelte pages (#94).
  • Package scaffolds use required vendor ids, reconcile overrides and conflicts, expose provider pins and inventory notices, and may opt into their own command name (#100, #95).
  • Plan warnings include stable codes and structured data, including missing placement options and choices (#99).
  • Declare module database connections with Mod::connection(), select migrations per connection, generate connection-aware migrations, and opt models/factories and seeders into shared connection defaults (#96).
  • Register package route directories and RegistersRoutes classes with Mod::routeFiles() and Mod::routeRegistrar(); select and order them through Mod::routes() and inspect them in mod:list (#92).

Fixed

  • Scaffold member stubs prefer a registered extension-specific key, then a stack-agnostic key; the app’s stub wins in flat recipes and parts (#90).
  • Missing placement messages name the running command’s option and the group/name short form (#99).

What's Changed

Full Changelog: v0.5.1...v0.6.0