Console Improvements in Winter 1.2 Posted in Announcements on Feb 28, 2022.

Luke Towers

Console improvements

The Laravel 9 migration continues to move forward at full steam. There are a number of new features & changes coming to the Console as a part of the pending Winter CMS v1.2 update that we wanted to share with you:

Autocompletion

Symfony v5.4 added the ability for commands to be able to provide tab-autocomplete results to the shell for an improved user experience. Most Winter commands provide support for autocompletion of input values out of the box and it is easy to add support in your own custom commands when extending the Winter\Storm\Console\Command base class.

This feature requires that you run a command in your shell once in order to enable it for all Laravel / Winter console commands:

artisan completion --help

Running just artisan completion will generate the shell script required to be imported into your shell in order to enable support for autocompletion of Winter / Laravel commands; passing the --help flag will provide detailed instructions on how to install the generated script.

Read more on the Symfony blog or the Winter CMS documentation.

Signal Processing

Symfony 5.2 added support for handling signals like SIGTERM, SIGQUIT, etc (usually triggered by the user when pressing CTRL+C in the terminal) in your custom console commands.

This is extremely useful to handle clean up and logging tasks and has already been implemented in the mix:watch command (where the only way the command can end in the first place is via a process signal).

Read more on the Symfony blog.

Various small tweaks

In addition to the major new features available for console commands in Winter v1.2, a number of tweaks have been made to the existing console commands in Winter. Some of them are listed below:

  • Moved the scaffolding commands out of the Storm library and into the relevant modules for each command (i.e. create:theme goes in the CMS module, create:plugin goes in the System module)
  • Updated the scaffolding files to reflect new features (like improvements to console commands, removal of the requirement for config properties for controller behaviors, Laravel Mix & Tailwind support for themes)
  • Added autocompletion support to every core command.
  • Improved reliability of the winter:env, key:generate, and winter:install commands through the new ArrayFile and EnvFile parsers - these commands should no longer interfere with each other.
  • Added aliases for Laravel commands that are replaced by winter commands (i.e. make:model -> create:model, migrate -> winter:up, etc) to make the developer experience of using Winter more familiar to developers with Laravel experience.
  • Revised the list of Laravel-provided commands that are registered by default in Winter to remove commands that don't make sense in Winter projects or otherwise don't work with Winter and add commands that have been added to Laravel in the past couple of years.

Conclusion

These are just a few of the many exciting improvements coming in Winter v1.2! Interested in trying them out now? The Laravel 9 PR is ready and available for testing in your projects today! Follow the instructions at https://github.com/wintercms/winter/pull/148 in order to start testing Winter v1.2 with your projects now!

Keep informed

Sign up to our newsletter to receive updates on Winter CMS releases, new features in the works, and much more.
We'll never spam or give this address away.

Latest blog post

Winter: 16 Months Later

Published July 14, 2022
With the first year of Winter behind us, let's take a look at what we were able to achieve in 2021.

View this post Read all posts

Latest Winter CMS release

v1.2.0

Released July 15, 2022
0 Dependencies, 0 Community Improvements, 0 First Party Plugins, 0 First Party Themes, 0 VSCode Extension, 0 CLI & Console Commands, 0 Autocompletion, 0 Improved Support for Laravel provided commands, 0 New Winter\Storm\Console\Command base class and helpers, 0 Scaffolding Improvements, 0 Bug Fixes, 0 Project Configuration & Helper Files, 0 Testing, 0 Plugin Manager, 0 Backend UI & UX, 0 Media Manager & Image Resizing, 0 Themes, 0 Twig, 0 Events, 0 Database, 0 Filesystem, 2 Modules, 0 Internals, 29 New Contributors

View details View all releases