-
-
Notifications
You must be signed in to change notification settings - Fork 150
refactor(core)!: decouple discovery #2041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
brendt
wants to merge
43
commits into
3.x
Choose a base branch
from
discovery-improvements
base: 3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+810
−192
Open
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
69a7c7b
Add registry
brendt 086545f
Move things around, decouple things, make Aidan happy.
brendt e1c00bf
QA
brendt ad30d43
QA
brendt e17108b
Moving classes a-round, oh yeah, a-round.
brendt fccc5c0
Aidan's gonna love reading these commit messages
brendt 8162e91
Making my code uglier, to make Aidan's code work.
brendt 1eb5cff
The atrocity is real
brendt 2e1ca4c
Even cleanup can't save us…
brendt c76c35f
The horror…
brendt d50348e
Cleaning up, as far as possible
brendt 57b2c2a
Wip. Yes, it's wip
brendt e5e319b
Moarrr WIP — but actually getting somewhere. Aidan's gonna be so happy
brendt 66c4a77
Forgot to ran QA. Always a good idea
brendt 8ae0a81
Did we actually… make it green?
brendt 6410671
RectOOOOOOOOOOOOOAAAAAArrr
brendt 7852936
We did not make it green :(
brendt dda1183
Ok now it'll be green!
brendt f616bdc
No but now for real
brendt 1d62fc6
Improvement, yes?
brendt 45b46b3
Update docs
brendt 5876ebb
Remove container dependency from support
brendt 029fdf1
Update docs
brendt 00b9ca9
Fix deps
brendt a7ab796
Making it faster, better, stronger
brendt 223fb13
Docs
brendt ba94673
Docs, of course
brendt d991965
QA, of course
brendt a606c0f
Testing
brendt 1b7b3d3
Fixing testing
brendt d1f28b1
Fixing testing
brendt 5ff8c02
QA
brendt 1880b21
QA
brendt c283ecf
Rector wip
brendt d49074c
Rector wip
brendt 47c0b6e
Fix cache path
brendt 317215b
wip
brendt 7a3a7b9
Fix namespace
brendt dd9d8d5
Remove registry
brendt 16ffd0c
WIP
brendt 0bf1bfe
WIP
brendt 87f754f
WIP
brendt 72fe86a
wip
brendt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -9,20 +9,21 @@ | |||
| use Tempest\Console\HasConsole; | ||||
| use Tempest\Container\Container; | ||||
| use Tempest\Container\GenericContainer; | ||||
| use Tempest\Core\DiscoveryCache; | ||||
| use Tempest\Core\DiscoveryCacheStrategy; | ||||
| use Tempest\Core\DiscoveryConfig; | ||||
| use Tempest\Core\FrameworkKernel; | ||||
| use Tempest\Core\Kernel; | ||||
| use Tempest\Core\Kernel\LoadDiscoveryClasses; | ||||
| use Tempest\Discovery\BootDiscovery; | ||||
| use Tempest\Discovery\DiscoveryCache; | ||||
| use Tempest\Discovery\DiscoveryCacheStrategy; | ||||
| use Tempest\Discovery\DiscoveryConfig; | ||||
|
|
||||
| if (class_exists(\Tempest\Console\ConsoleCommand::class)) { | ||||
| final readonly class DiscoveryGenerateCommand | ||||
| { | ||||
| use HasConsole; | ||||
|
|
||||
| public function __construct( | ||||
| private Kernel $kernel, | ||||
| private DiscoveryConfig $discoveryConfig, | ||||
| private FrameworkKernel $kernel, | ||||
| private DiscoveryCache $discoveryCache, | ||||
| ) {} | ||||
|
|
||||
|
|
@@ -58,15 +59,15 @@ public function generateDiscoveryCache(DiscoveryCacheStrategy $strategy, Closure | |||
| { | ||||
| $kernel = $this->resolveKernel(); | ||||
|
|
||||
| $loadDiscoveryClasses = new LoadDiscoveryClasses( | ||||
| $bootDiscovery = new BootDiscovery( | ||||
| container: $kernel->container, | ||||
| discoveryConfig: $kernel->container->get(DiscoveryConfig::class), | ||||
| discoveryCache: $this->discoveryCache, | ||||
| config: $kernel->container->get(DiscoveryConfig::class), | ||||
| cache: $this->discoveryCache, | ||||
| ); | ||||
|
|
||||
| $discoveries = $loadDiscoveryClasses->build(); | ||||
| $discoveries = $bootDiscovery->build(); | ||||
|
|
||||
| foreach ($this->kernel->discoveryLocations as $location) { | ||||
| foreach ($this->discoveryConfig->locations as $location) { | ||||
| $this->discoveryCache->store($location, $discoveries); | ||||
| $log($location->path); | ||||
| } | ||||
|
|
@@ -78,10 +79,11 @@ public function resolveKernel(): Kernel | |||
| { | ||||
| $container = new GenericContainer(); | ||||
| $container->singleton(Container::class, $container); | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| $container->singleton(DiscoveryConfig::class, $this->discoveryConfig); | ||||
|
|
||||
| return new FrameworkKernel( | ||||
| root: $this->kernel->root, | ||||
| discoveryLocations: $this->kernel->discoveryLocations, | ||||
| discoveryLocations: $this->kernel->discoveryConfig->locations, | ||||
| container: $container, | ||||
| ) | ||||
| ->registerKernel() | ||||
|
|
||||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.