[6.x] Restructure frontend: adopt common/ + modules/ pattern#18964
Merged
Conversation
Reorganizes resources/js/ following the Spatie Laravel/Inertia frontend structure pattern, adapted for Vue 3. - common/ — generic, domain-agnostic code - layouts/ (was layout/) - components/ (generic UI primitives) - form/ (generic form inputs) - composables/ (generic Vue composables) - types/ (shared types) - utils/ (shared utilities) - modules/ — feature-specific domains - admin-table/ - auth/ - entry-types/ - install/ - navigation/ - permissions/ - plugin-manager/ - sections/ - settings/ - sites/ - updater/ - user/ - utilities/ - pages/ — Inertia pages reorganized into subdirs, names deduplicated - auth/, graphql/, install/, settings/, updater/, utilities/ - Domain prefix stripped (SettingsEmailPage → settings/Email) - Page suffix stripped (LoginPage → auth/Login) PHP Inertia::render() and ->inertiaPage() calls updated to use new path-based keys throughout src/Http/Controllers/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
brianjhanson
added a commit
that referenced
this pull request
May 26, 2026
Aligns test assertions with the page restructure from PR #18964. All component() calls now use the subdirectory path form that matches the new pages/ file layout (e.g. 'settings/Email' instead of 'SettingsEmailPage'). 17 test files updated across: - Feature/Integration/PagesTest.php - Feature/Http/Controllers/**/*Test.php - Feature/Http/Middleware/EnsureInstalledTest.php Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Reorganizes
resources/js/following the Spatie Laravel/Inertia frontend structure, adapted for Vue 3.New structure
Key changes
common/vsmodules/: The guiding question — does it relate to a domain or feature of the app? Yes →modules/, No →common/SettingsEmailPage.vue→settings/Email.vue,LoginPage.vue→auth/Login.vue, etc.useEditableTable,useServerPagination, etc. live insidemodules/admin-table/composables/rather than a global flat directorycreateCraftColumnHelpermoved toutils/: It's a helper function, not a component — lives inmodules/admin-table/utils/(note: currentlyhelpers/, see follow-up)Inertia::render()and->inertiaPage()calls insrc/Http/Controllers/updated to use path-based keys (e.g.'settings/Email')Not in scope
packages/craftcms-cp/— Lit-based web component library, untouchedresources/js/legacy.tsand legacy assetsFollow-up items
A few Vue convention adjustments worth a separate pass:
Badge,Modal,Date,Empty,Pane,Text,Select, etc.) violate Vue Style Guide Priority AAuthBase.vue→AuthLayout.vuefor consistency with other layoutshelpers/→utils/(JS/Vue convention)pages/install/Install.vue→pages/install/Index.vuefor consistency withpages/updater/Index.vue🤖 Generated with Claude Code