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

[spiral/prototype] Introducing new prototype:list console command for listing prototype dependencies #1003

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

msmakouz
Copy link
Member

@msmakouz msmakouz commented Oct 17, 2023

Q A
Bugfix?
Breaks BC?
New feature? ✔️
Issues #1001

What is the prototype:list command?

The prototype:list command is a super cool addition to our Spiral Framework. It helps developers by providing an easy way to list all the classes registered in the Spiral\Prototype\PrototypeRegistry. These registered classes are essential for project prototyping.

How to Use It

Using the command is simple. Just run the following line in your terminal:

php app.php prototype:list

Once you do that, you'll get a neat table that displays all the registered prototypes, including their names and target classes. This makes it incredibly easy to see what's available for your project prototyping needs.

+------------------+-------------------------------------------------------+
| Name:            | Target:                                               |
+------------------+-------------------------------------------------------+
| app              | App\Application\Kernel                                |
| classLocator     | Spiral\Tokenizer\ClassesInterface                     |
| console          | Spiral\Console\Console                                |
| broadcast        | Spiral\Broadcasting\BroadcastInterface                |
| container        | Psr\Container\ContainerInterface                      |
| encrypter        | Spiral\Encrypter\EncrypterInterface                   |
| env              | Spiral\Boot\EnvironmentInterface                      |
| files            | Spiral\Files\FilesInterface                           |
| guard            | Spiral\Security\GuardInterface                        |
| http             | Spiral\Http\Http                                      |
| i18n             | Spiral\Translator\TranslatorInterface                 |
| input            | Spiral\Http\Request\InputManager                      |
| session          | Spiral\Session\SessionScope                           |
| cookies          | Spiral\Cookies\CookieManager                          |
| logger           | Psr\Log\LoggerInterface                               |
| logs             | Spiral\Logger\LogsInterface                           |
| memory           | Spiral\Boot\MemoryInterface                           |
| paginators       | Spiral\Pagination\PaginationProviderInterface         |
| queue            | Spiral\Queue\QueueInterface                           |
| queueManager     | Spiral\Queue\QueueConnectionProviderInterface         |
| request          | Spiral\Http\Request\InputManager                      |
| response         | Spiral\Http\ResponseWrapper                           |
| router           | Spiral\Router\RouterInterface                         |
| snapshots        | Spiral\Snapshots\SnapshotterInterface                 |
| storage          | Spiral\Storage\BucketInterface                        |
| serializer       | Spiral\Serializer\SerializerManager                   |
| validator        | Spiral\Validation\ValidationInterface                 |
| views            | Spiral\Views\ViewsInterface                           |
| auth             | Spiral\Auth\AuthScope                                 |
| authTokens       | Spiral\Auth\TokenStorageInterface                     |
| cache            | Psr\SimpleCache\CacheInterface                        |
| cacheManager     | Spiral\Cache\CacheStorageProviderInterface            |
| exceptionHandler | Spiral\Exceptions\ExceptionHandlerInterface           |
| users            | App\Infrastructure\Persistence\CycleORMUserRepository |
+------------------+-------------------------------------------------------+

Why It Matters

This new feature enhances developer productivity and ensures that we're making the most of the Spiral Framework's capabilities. It provides clarity on available prototypes, which can be crucial when building and extending our projects.

Note
You might notice that we've also renamed the old prototype:list command to prototype:usage to better align with its purpose.


I encourage you all to give this new command a try and see how it streamlines our development process. Your feedback is, as always, greatly appreciated.

@msmakouz msmakouz self-assigned this Oct 17, 2023
@msmakouz msmakouz added this to the 3.9 milestone Oct 17, 2023
@msmakouz msmakouz linked an issue Oct 17, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (0936229) 89.41% compared to head (2c70a90) 89.40%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1003      +/-   ##
============================================
- Coverage     89.41%   89.40%   -0.02%     
- Complexity     6119     6122       +3     
============================================
  Files           810      811       +1     
  Lines         17303    17314      +11     
============================================
+ Hits          15471    15479       +8     
- Misses         1832     1835       +3     
Files Coverage Δ
...c/Prototype/src/Bootloader/PrototypeBootloader.php 91.42% <100.00%> (+0.25%) ⬆️
src/Prototype/src/Command/ListCommand.php 80.00% <83.33%> (-1.82%) ⬇️
src/Prototype/src/Command/UsageCommand.php 81.81% <81.81%> (ø)

... and 1 file with indirect coverage changes

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

@butschster butschster changed the title [spiral/prototype] Add console command for listing prototype dependencies [spiral/prototype] Introducing new prototype:list console command for listing prototype dependencies Oct 17, 2023
@butschster butschster merged commit 67363ef into master Oct 18, 2023
9 checks passed
@butschster butschster deleted the feature/prototype-list branch October 18, 2023 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Console Command for Listing All Available Prototypes
2 participants