You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
pollora:make:module Crm creates a lean module from the new Pollora/module-default template: classes discovered in app/ (an example hooks class, no service provider), resources/views/blocks, and a Vite build through @pollora/vite-config into public/build/module/<kebab>. Each Laravel layer is one flag away: --provider, --routes (implies --provider), --api (implies --routes), --config, --database, --tests, or --full; --no-assets for a PHP-only module. The module is enabled, composer dump-autoload merges its composer.json, and npm builds it (--no-enable, --no-npm). --repository and --repo-version pick another template; --offline, or a failed download, uses the copy bundled with the framework
module:make writes the same lean module, offline, unless the project's config/modules.php sets paths or stubs (nwidart/laravel-modules' own published file; Pollora's, from --tag=pollora-modules, does not): the framework turns off nwidart/laravel-modules' stock folders, files and classes and writes its bundled template once the module is created
Every enabled module with a vite.config.* gets its module.<kebab> asset container, so Asset::add(...)->container('module.crm') works without a provider of its own; it was set up only for modules with blocks
pollora:make:block recognises a vite.config.js built on @pollora/vite-config, which builds blocks already, instead of warning that it does not match the Pollora pattern
Module activation connectors: whether a Laravel module is enabled comes from a connector, through nwidart/laravel-modules' activator ('activator' => 'pollora'), so module:enable, module:disable and everything reading app('modules') keep working. json (default) reads and writes modules_statuses.json as nwidart does; database keeps a JSON map in the non-autoloaded pollora_modules WordPress option, read with Laravel's connection before WordPress loads (never unserialized) and written with update_option() once it has, falling back on json while the options table does not exist; config reads connectors.config.states or MODULES_ENABLED / MODULES_DISABLED, read-only. A project connector implements ModuleStateConnector and is declared in connectors.<name>.class, or given to ModuleConnectors::extend() in bootstrap/app.php
modules.locked.enabled / modules.locked.disabled (MODULES_LOCKED_ENABLED / MODULES_LOCKED_DISABLED) force a module's state over any connector; switching a locked module throws ModuleLockedException
A switch clears nwidart's provider manifest and the discovery cache, and fires ModuleEnabled / ModuleDisabled (module, source admin or console, WordPress user)
config/modules.php, published with php artisan vendor:publish --tag=pollora-modules: nwidart reads its activator while it registers, before any provider of the application, so the connector is chosen in this file, not from a provider
pollora:module:connector [connector] [--import] shows where module states live and copies them into another connector before the configuration points to it
pollora:doctor and Site Health check module activation (module-activation): the database connector reading its fallback, a module the states list but the disk no longer has, a state file that cannot be written while Plugins › Modules is the way to switch, a configuration or route cache written before the last switch, and MODULES_* settings ignored because config/modules.php is not published
pollora:module:frontend Crm gives an existing module the template's frontend build (package.json and vite.config.js on @pollora/vite-config, resources/assets/app.{js,css}), keeping a .bak of each file it replaces; the builds check recognises the Vite config of nwidart's stock module:make (public/build-<lower>, where Pollora never looks) and points to it
Plugins › Modules (plugins.php?page=pollora-modules, linked as "Modules (n)" among the plugin views): every module with its description, path, state (enabled, disabled, locked) and where the state lives, with Enable / Disable per row and as bulk actions. Switches need activate_plugins (modules.admin.capability), are nonce-protected, go through nwidart's Module::enable() / disable() and say the change applies from the next request. A locked module has no switch; MODULES_ADMIN_TOGGLE=false turns every switch off. With the JSON file, the view warns that the next deployment resets it and each switch asks for confirmation; when the file cannot be written, switches are off and the view explains how to change states
Tools › Pollora's Modules card and pollora:status say where module states are stored, and the card links to the Modules view
Update checks for modules installed by Composer: a module whose path is a Composer package's install path (placed in Modules/ by the skeleton's installer-paths rule, or scanned in vendor/) carries that package's version, whatever its type; a local module has none and is never checked. The latest release comes from the repository the project's composer.json declares for it — a composer repository (Private Packagist, Satis: {url}/p2/{package}.json), a GitHub vcs repository (latest release, else highest tag; MODULES_GITHUB_TOKEN for a private one), or Packagist — is cached per package for 12 hours (1 hour when the source does not answer), and is fetched by a daily WP-Cron task or pollora:module:outdated, never during a front-end request. Plugins › Modules shows "1.3.0 · 1.4.0 available" with the composer update command, Site Health tests "Pollora modules are up to date", and pollora:status (--json too) gives each module's version and latest; a dev-* build is never reported outdated
pollora:make:block --module=<name> creates a block in a module's resources/views/blocks, named after the module in kebab case (blocks-demo/hero), like the seven generators that already took --module
AnsweringTemplate says which template the hierarchy answered a request with: template file, conditional tag, Blade view, whether it fell back to index. It stays empty when Route::wp() or a Laravel route answered, and works without WP_DEBUG, unlike the template marker
Pollora\WordPress\Events\WordPressBooting is dispatched right before wp-settings.php loads: the last moment to set something up before WordPress builds its globals. Listen to it from a provider's register()
DiscoveryCacheManager::scans() says, for each location, whether its structures came from this process, the persistent cache or a scan, with time and count. A cold and a warm persistent cache used to both count as a miss
Pollora\BlockBinding\Domain\Events\BindingResolved is dispatched for each block binding resolved, with its source, field, post, time and whether the cache answered; only when something listens
AssetManager::containers() lists every asset container by name: the theme's, plugins', modules'
Changed
Requires pollora/hook^1.5, for AbstractHook::all() (every registration made through Action and Filter) and the pollora/async/dispatched action, which debugging tools read
Fixed
Tools › Pollora and pollora:status reported 0 modules when one module.json had no priority: nwidart's getPriority() is typed string and threw
Tools › Pollora and pollora:status showed every module as disabled: nwidart keys allEnabled() by lower-case name, which the module's own name never matched
Generators with --module wrote into Modules/<Studly> under the Modules\<Studly> namespace whatever the module declared: they now take the path where nwidart/laravel-modules found the module and the namespace its composer.json maps onto app/ (or src/), so a module under Module\BlocksDemo\ gets classes it can autoload
Removed
The framework's Modules/config/modules.php, merged into modules after nwidart/laravel-modules' own config and so never applied (its module path pointed at the themes directory)