Skip to content

v0.2.0

Choose a tag to compare

@jaspertey jaspertey released this 09 Oct 12:42
· 124 commits to main since this release
003c02d

Modular templates and scaffolds

Put a template in stubs/mod/@module/Tools/, or create one with mod:template, and mod gives you a generator for it, placed wherever your layout keeps the module:

php artisan mod:template tool
php artisan mod:tool Agents:SearchDocuments

Scaffolds generate several related files together, like a CRUD cluster, with one command. They can ask for input, repeat parts over a list, and grow a cluster later through anchored inserts, including its routes. mod:list shows everything your app can generate, and mod:autoload registers missing namespaces in composer.json. The Layout API now reads as verbs, with path() for group folders and extends() for building on another layout. See Upgrading from 0.1 for the renames.

Added

  • Generator templates in stubs/mod/: anchors, value slots, name and sibling placeholders, package template folders and PHP refinements. App templates take precedence over package templates.
  • mod:template creates a template from a class, interface, trait, enum, starter or usable file type, or extracts an existing PHP class with --from and --into without loading it.
  • mod:list shows the active layout, groups, file types, templates, scaffolds and discovery. -v lists discovered classes, --type filters a file type and --json supplies a machine-readable inventory.
  • mod:autoload registers missing Composer PSR-4 mappings for layout roots and moved group folders, with --dry-run, --no-dump and --namespace.
  • ->path(), ->extends() and ->allowsNesting() for group folders, layout inheritance and nesting.
  • Scaffolds generate several file types together: sibling aliases, named stub variants, include(), invokable recipe classes, packages, layout overrides and collision choices.
  • Scaffold trees with asks(), each(), part(), inserts() and mod:<root>.<part> commands to grow a cluster. Anchored inserts can register routes; recursive trees remain finite in the registry and cache.
  • Laravel Prompts for outcomes that one answer resolves, with actionable options for non-interactive runs.

Changed

  • Layout API names are renamed outright: root() → mounts(), kind() → generates(), relation() → relates(), exclude() → excludes(), and typeFolders() → path().
  • placementOption() is removed. The token in path() names the placement option, anchor and placeholder.
  • Public Kind → FileType, UnknownKind → UnknownFileType, inKindRoot() → inFileTypeRoot(), and discovery.kinds → discovery.file_types. Existing layout customizations must update these names.
  • The discovery cache stores template inventory and finite scaffold tree metadata, and checks template fingerprints for stale caches.

Fixed

  • Template body group tokens and name forms follow renamed layout tokens. Explicit path() tokens take precedence over names derived from inherited layouts.
  • mod:list includes factory and policy counts and targets, and identifies package templates overridden by the application.
  • Package template folders accept relative paths containing ... Conflicting template commands explain how to override or rename the templates.
  • mod:autoload distinguishes configured mappings from loaded classes and reports Composer failures while retaining the written entries.
  • Scaffold replays recognize existing migrations by name across timestamps, so refusal, --skip-existing and --force use the original migration file.
  • Generation avoids false autoload warnings for Composer-covered folders and repeated new-group notices for companion files.
  • House factory stubs retain their $model value. Migrations can be scaffold members.

What's Changed

  • Add mod:autoload to register layout roots in composer.json by @jaspertey in #3
  • Verify the Boost resources in fresh Laravel apps by @jaspertey in #4
  • Rename the Layout API to verbs and add path() and extends() by @jaspertey in #5
  • Register moved group folders with mod:autoload by @jaspertey in #6
  • Add scaffolds: generate a cluster of related files with one command by @jaspertey in #7
  • Turn template folders into generators by @jaspertey in #8
  • Fix false autoload warnings and repeated group notices by @jaspertey in #9
  • Add mod:list to show what the active layout can generate by @jaspertey in #10
  • Keep house factory stubs' $model and allow migration scaffold members by @jaspertey in #11
  • Fix a flaky migration comparison test on slow runners by @jaspertey in #13
  • Add mod:template to create generator templates by @jaspertey in #12
  • Grow scaffolds as trees: questions, repeated parts and anchored inserts by @jaspertey in #14
  • Fill remapped template group tokens and clarify list and autoload output by @jaspertey in #15
  • Accept relative package template folders and explain template conflicts by @jaspertey in #16
  • Recognize existing scaffold migrations and let explicit layout paths name the group by @jaspertey in #17
  • Document 0.2 in the README, Boost guidance and changelog by @jaspertey in #18

Full Changelog: v0.1.1...v0.2.0