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

Improve internal page model structure #122

Merged
merged 58 commits into from
Jul 1, 2022
Merged

Conversation

caendesilva
Copy link
Member

This update refactors the internal page models to ensure a more predictable and consistent state. This is in large part done by further defining the page model contract, and abstracting the implementations to the base class, leading to less boilerplate for the actual implementations, while gaining a more defined source of truth. It also adds the scaffolding to customize more output directories, and unifies this with the legacy documentation output paths. Besides that, this PR does not add much in the terms of features, it does make several changes that may be considered breaking to the package developers.

As the returned files are already the just base names, this does nothing
Since this class both acts like the model and the parser (since it does not need parsing) it should implement the contract, so it can be properly recognized by Hyde internals.
Besides that I think it looks nicer, it ensures we use the canonical paths and extensions.
@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #122 (7ea44d3) into master (93b0e9d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #122   +/-   ##
=========================================
  Coverage     99.02%   99.03%           
- Complexity      750      757    +7     
=========================================
  Files            97       97           
  Lines          1956     1971   +15     
=========================================
+ Hits           1937     1952   +15     
  Misses           19       19           
Impacted Files Coverage Δ
packages/framework/src/Models/BladePage.php 100.00% <ø> (ø)
...ackages/framework/src/Models/DocumentationPage.php 100.00% <ø> (ø)
packages/framework/src/Models/MarkdownPost.php 100.00% <ø> (ø)
...framework/src/Actions/CreatesNewPageSourceFile.php 100.00% <100.00%> (ø)
...es/framework/src/Concerns/Internal/FileHelpers.php 91.11% <100.00%> (ø)
...ework/src/Concerns/RegistersDefaultDirectories.php 100.00% <100.00%> (ø)
...ages/framework/src/Concerns/ValidatesExistence.php 100.00% <100.00%> (ø)
packages/framework/src/Contracts/AbstractPage.php 100.00% <100.00%> (ø)
packages/framework/src/HydeServiceProvider.php 94.59% <100.00%> (+0.30%) ⬆️
...kages/framework/src/Services/CollectionService.php 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93b0e9d...7ea44d3. Read the comment docs.

@caendesilva caendesilva marked this pull request as draft July 1, 2022 18:20
@caendesilva caendesilva marked this pull request as ready for review July 1, 2022 19:24
@caendesilva caendesilva merged commit 82f1c89 into master Jul 1, 2022
@caendesilva caendesilva deleted the ModelImprovements branch July 1, 2022 19:24
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