Repository navigation
3.x - #6
Merged
Merged
3.x#6
Conversation
Version 3 is a rewrite: the component generators and their stubs, the migration commands, the support traits and the 2.x test suite go away.
Require PHP 8.3 and Laravel 13.12, drop composer/composer, and move to Pest, Pint and PHPStan at the max level without a baseline. CI runs PHP 8.3 to 8.5 with the lowest and the latest dependencies, checks coverage and the mutation score, and audits the dependencies.
Modules are found once in the modules directory and described by a manifest: the package, the namespace and every file the package loads. The manifest is cached like the config and built once per process without the cache. The Modules facade lists modules and their seeders.
Config, translations, views, Blade components, migrations and route groups are loaded for every module from the manifest. Commands, factory resolution, Tinker aliases and the Octane watcher are console-only.
Every GeneratorCommand, make:migration and the table migration generators get a --module option. While the generator runs, the application paths and namespace point at the module. A few generators are adjusted: factories, seeders and tests go to their module directories, views are named after the module, and a module provider is registered in the composer.json of the module.
module:make renders a module template, module:sync keeps the composer.json of the application in line with the modules, module:delete uninstalls a module before deleting it, and module:doctor checks the setup. Composer runs through the Process facade with validated package names, and the module vendor is excluded from Packagist.
The provider registers the manifest, the conventions, the generators and the commands, hooks into optimize and about, and publishes the config and the module template.
Every test runs in its own copy of a small application with two modules, from its own working directory, and Composer runs are faked.
Octane workers serve hundreds of requests with stable state and no retained memory compared to the same application without modules.
Rewrite the README for 3.0, add an upgrade guide from 2.x that an agent can follow step by step, a changelog and the license file.
Module providers boot before this package, so config, translations, views and components are registered during register. Cached files of deleted modules are skipped, a relative modules path resolves against the base path and two modules can no longer share a namespace.
A mirror under the packagist.org key replaces Packagist, so it gets the vendor exclusion instead of being overwritten, and the default repository is replaced by one entry. The file mode survives a save, modules may be required for development, installed requirement names compare case-insensitively, and module:doctor prunes vendor directories, skips unreadable ones and only warns about a mirrored install.
Generators called by another one (make:model -a) use the namespaces of the generators config, relative to the root namespace of each generator. Controllers import their form requests from the module, a fully qualified factory name stays in database/factories, component views are named relative to the components namespace and factories find module models outside Models.
Route loading order, the provider register order, config merging, console-only migrations and commands, seeder discovery, the cache in development and production, Packagist mirrors and the upgrade steps that were missing or wrong.
Composer replaces the default repository with whatever is defined under that name, so a non-composer repository there disables Packagist.
…heir source Composer 2.10 writes a mirror as a list entry named packagist and uses it next to the default repository, so both get the exclusion. module:doctor only takes an installed directory for a copy when Composer installed it from the module path.
The --test option passes the test name as a Stringable, and --model and --parent now name classes of the make:model namespace.
A module whose installed directory is missing is an error again, not a copy.
Also correct the README on global Packagist mirrors.
A built manifest lists the files on disk, so development requests without the config and route caches no longer stat every module route and config file.
PHP 8.6 deprecates a class constant called namespace and no longer puts the path in the warning of a failed require.
Windows needs the fileinfo extension and PHP 8.6 is newer than the versions packages declare. Laravel 14 is tested again once Testbench and Octane support it.
Links are absolute like the junctions Composer creates there, paths and line endings are compared independently of the platform, and templates with "|" in file names, which Windows does not allow, are skipped.
Filesystem::delete() can not remove a link to a directory there, which is how Composer links path packages.
Compare it with InterNACHI/modular and nWidart/laravel-modules, document dependencies between modules, the Modules facade and the anonymous Blade components, and fix the broken Commands link and the statements that did not match the code.
…module names An empty namespace in the generators config gave class names with a double backslash: Blade components, the form requests of controllers and component views broke. An empty make:command namespace is refused, since commands are discovered in it. Module names already in kebab case are kept, and acronyms stay one word.
Composer includes a file each time a class is looked up in it, so a file of functions in the commands or seeders directory was included again, and failed, on every check.
Require 2.1 as the starting point, correct the route and exception notes, and list the changes the changelog missed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.