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

Add a JSON output format option to the route list command #1724

Merged
merged 12 commits into from
Jun 12, 2024

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Jun 12, 2024

Fixes #1715 and opens up for more formats in the future, trying to match how Symfony does it.

Currently only the json format is added.

[
    {
        "page_type": "BladePage",
        "source_file": "_pages/404.blade.php",
        "output_file": "_site/404.html",
        "route_key": "404"
    },
    {
        "page_type": "BladePage",
        "source_file": "_pages/index.blade.php",
        "output_file": "_site/index.html",
        "route_key": "index"
    }
]

Of course, the output of this can also be redirected into a file stream:

$ php hyde route:list --format=json > routes.json

@caendesilva caendesilva linked an issue Jun 12, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.97%. Comparing base (9bf132f) to head (26fa836).
Report is 1 commits behind head on master.

Current head 26fa836 differs from pull request most recent head 5e4caf0

Please upload reports for the commit 5e4caf0 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1724   +/-   ##
=========================================
  Coverage     99.97%   99.97%           
- Complexity     1745     1748    +3     
=========================================
  Files           181      181           
  Lines          4661     4669    +8     
=========================================
+ Hits           4660     4668    +8     
  Misses            1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@caendesilva caendesilva changed the title Support route list command formats Support route list command formats and add JSON output Jun 12, 2024
@caendesilva caendesilva marked this pull request as ready for review June 12, 2024 14:30
@caendesilva caendesilva changed the title Support route list command formats and add JSON output Add a JSON output format option to the route list command Jun 12, 2024
@caendesilva caendesilva merged commit bb34282 into master Jun 12, 2024
21 checks passed
@caendesilva caendesilva deleted the route-list-formats branch June 12, 2024 14:40
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.

Add route list flag to return JSON
1 participant