Skip to content
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

Discover filesystem upon booting the framework #426

Merged
merged 57 commits into from
Aug 16, 2022
Merged

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Aug 16, 2022

About

Creates a new foundation class, the FileCollection. Which like the other foundation collections, discovers all the files. Running this part of the autodiscovery will further enrich the Hyde Kernel, and allow greater insight into the application. The end user experience should not be affected by this.

It also adds a new model, File, as an object-oriented way of representing a project file on the disk.

Minor note about testing

Note that having the filesystem pre-discovered means that changing the discovery rules at runtime after the framework has booted, means that you need to reboot the framework. I think this would ever really happen during testing when changing a directory mid-test. If it happens in actual code you are probably doing something wrong (registering in boot method instead of register method for example). See this commit where this problem was encountered and addressed.

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #426 (8247f35) into master (eb8cffe) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #426   +/-   ##
=========================================
  Coverage     99.95%   99.95%           
- Complexity      884      915   +31     
=========================================
  Files            99      102    +3     
  Lines          2191     2259   +68     
=========================================
+ Hits           2190     2258   +68     
  Misses            1        1           
Impacted Files Coverage Δ
packages/framework/src/Hyde.php 100.00% <ø> (ø)
.../framework/src/Foundation/BaseSystemCollection.php 100.00% <100.00%> (ø)
...ckages/framework/src/Foundation/FileCollection.php 100.00% <100.00%> (ø)
...ckages/framework/src/Foundation/PageCollection.php 100.00% <100.00%> (ø)
...kages/framework/src/Foundation/RouteCollection.php 100.00% <100.00%> (ø)
packages/framework/src/HydeKernel.php 100.00% <100.00%> (ø)
packages/framework/src/Models/File.php 100.00% <100.00%> (ø)
...ckages/framework/src/Services/DiscoveryService.php 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva caendesilva marked this pull request as ready for review August 16, 2022 20:16
@caendesilva caendesilva merged commit c3a0465 into master Aug 16, 2022
@caendesilva caendesilva deleted the discover-filesystem branch August 16, 2022 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants