Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR optimizes path handling across the framework by centralizing path configuration, extracting the Paths implementation into a dedicated subpackage, and standardizing stub generation patterns across all setup files.
- Centralized path configuration with new
Views,Routes, andMigrationspath helpers - Refactored
packages.Pathsimplementation intopackages/pathssubpackage for better organization - Standardized stub generation to use
facadesImportandfacadesPackageparameters consistently across all modules
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
view/console/view_make_command.go |
Simplified view creation by removing custom path flag and using centralized config |
view/console/view_make_command_test.go |
Updated tests to match new populateStub signature (issues found) |
view/console/stubs.go |
Simplified stub template to use single DummyDefinition placeholder |
support/variable.go |
Added Views field to Paths struct for centralized view path configuration |
support/path/path.go |
Added Migration(), Route(), and View() path helper functions |
support/console/console.go |
Refactored GetFilePath() to use path/internals utilities |
support/stubs/stub.go |
Standardized DatabaseConfig parameters to use facades import/package pattern |
packages/paths/paths.go |
New file extracting Paths implementation from packages package |
packages/paths.go |
Emptied - content moved to packages/paths subpackage |
packages/setup.go |
Added public Paths() helper function and env.PackageName() usage |
packages/modify/stubs.go |
Updated bootstrap stub generation to use dynamic package resolution |
foundation/console/test_make_command.go |
Enhanced test generation with conditional imports based on subdirectory structure |
foundation/console/stubs.go |
Updated test stub template to use DummyTestImport and DummyTestCase |
foundation/console/package_make_command.go |
Changed config file location from setup/config/ to setup/stubs.go |
foundation/console/package_make_command_stubs.go |
Refactored to generate setup stubs with proper config function |
foundation/configuration/paths.go |
Added Routes() and Views() methods to Paths interface implementation |
contracts/foundation/configuration/paths.go |
Added Routes() and Views() to Paths interface |
contracts/packages/setup.go |
Added Migrations() method to Paths interface |
database/migration/stubs.go |
Updated migration stubs to use facades import/package placeholders |
database/migration/migrator.go |
Enhanced StubData to include FacadesPackage and FacadesImport |
database/migration/creator.go |
Restructured StubData fields for better organization |
database/setup/setup.go |
Updated to use facades import instead of main package |
testing/setup/stubs.go |
Standardized parameter names to use Import/Package suffix pattern |
testing/setup/setup.go |
Added bootstrapPackage parameter to stubs |
telemetry/setup/stubs.go |
Removed unused time import and standardized parameters |
telemetry/setup/setup.go |
Added facadesPackage variable for cleaner code |
session/setup/stubs.go |
Standardized stub parameters to use facades import/package |
session/setup/setup.go |
Refactored to use facades package instead of main package |
route/setup/stubs.go |
Updated routes stub to use standardized facade parameters |
route/setup/setup.go |
Simplified by using path helpers and removing hardcoded paths |
queue/setup/stubs.go |
Standardized stub parameters across Config and JobMigration |
queue/setup/setup.go |
Refactored to use path.Migration() helper |
mail/setup/stubs.go |
Standardized stub parameters to use facades import/package |
mail/setup/setup.go |
Updated to use facades package pattern |
log/setup/stubs.go |
Standardized stub parameters to use facades import/package |
log/setup/setup.go |
Updated to use facades package pattern |
http/setup/stubs.go |
Standardized all config stub parameters |
http/setup/setup.go |
Updated to use facades import in addition to package |
hash/setup/stubs.go |
Standardized stub parameters to use facades import/package |
hash/setup/setup.go |
Added facadesPackage variable |
grpc/setup/stubs.go |
Standardized stub parameters to use facades import/package |
grpc/setup/setup.go |
Simplified by using path.Route() helper |
filesystem/setup/stubs.go |
Standardized stub parameters and reordered imports |
filesystem/setup/setup.go |
Added facadesPackage variable |
cache/setup/stubs.go |
Standardized stub parameters to use facades import/package |
cache/setup/setup.go |
Added facadesPackage variable |
auth/setup/stubs.go |
Standardized stub parameters to use facades import/package |
auth/setup/setup.go |
Updated to use facades import/package pattern |
mocks/packages/Paths.go |
Added mock implementation for Migrations() method |
mocks/foundation/configuration/Paths.go |
Added mock implementations for Routes() and Views() methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1297 +/- ##
==========================================
+ Coverage 68.82% 69.01% +0.18%
==========================================
Files 278 277 -1
Lines 16114 16164 +50
==========================================
+ Hits 11091 11156 +65
+ Misses 4549 4534 -15
Partials 474 474 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
📑 Description
Closes goravel/goravel#423
This pull request refactors how configuration files and migration stubs reference and import the
facadespackage across multiple modules. Instead of hardcoding thefacadesimport path and package name, these values are now dynamically injected, making the codebase more modular and adaptable to different project structures. Additionally, there are new methods and interface changes to support more flexible path management for various components.The most important changes are:
Dynamic Facades Import and Package Injection:
Configstub generators inauth,cache, andfilesystemsetup modules to acceptfacadesImportandfacadesPackageas arguments, replacing hardcoded references with dynamic values. This change also updates the corresponding calls in their respectivesetup.gofiles. [1] [2] [3] [4] [5] [6] [7] [8] [9]database/migration/stubs.goand related logic now use injectedfacadesImportandfacadesPackagevariables, removing direct references to the globalfacadespackage and supporting more flexible project layouts. [1] [2] [3] [4] [5] [6] [7] [8]Path and Interface Enhancements:
RoutesandViewsmethods to thePathsinterface and their implementations, allowing for more granular and explicit path management in the framework. [1] [2] [3] [4]Package Generator Improvements:
foundation/console/package_make_command_stubs.goto use the new dynamic config stub and updated the generatedsetup.goto use the new config and provider registration pattern. [1] [2] [3]Minor Cleanups:
appServiceProvidertest stub fromconsole/console/make_command_test.go.✅ Checks