From 5e7547dca88c4b3d77cb1faff21315143a7ba835 Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Sat, 3 Oct 2026 05:28:18 -0400 Subject: [PATCH 1/2] Add a Quick start to the README The docs standard makes a Quick start required: one runnable example that shows what the package does in use, right after Install, pointing on to the full walkthrough. Every symbol in the example was checked against src/, config/ and routes/ before it was written down. --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 356f1fe..0594c95 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,28 @@ php artisan vendor:publish --tag=laranail::console-config php artisan vendor:publish --tag=laranail::console-lang ``` +## Quick start + +```php +use Simtabi\Laranail\Console\Facades\Console; +use Simtabi\Laranail\Console\Tools\Commands\Command; + +final class ReleaseSummaryCommand extends Command +{ + protected $signature = 'release:summary'; + + public function handle(): int + { + $this->output->writeln(Console::status()->success('Build complete')); + echo Console::box(['Version: 2.4.0', 'Env: production'])->title('Release')->render(); + + return self::SUCCESS; + } +} +``` + +The full walkthrough is in [Getting started](docs/getting-started.md); everything else is in the [documentation index](#documentation). + ## Documentation Full documentation is at **[opensource.simtabi.com/documentation/laranail/console](https://opensource.simtabi.com/documentation/laranail/console/)** — installation, getting started, the design system, architecture, configuration, and per-subsystem reference (theming, colours, typography, Markdown, charts, widgets, banners, panels, menus, the full-screen TUI, prompts & forms, and more). From 012ecee6b2aa594cf8067f723ad2d60eedbbe76d Mon Sep 17 00:00:00 2001 From: Imani Manyara Date: Sat, 3 Oct 2026 05:35:21 -0400 Subject: [PATCH 2/2] Assert the emoji fallback agrees with Symfony, not with a fixed width symfony/console 8.1.8 widened its width table, so U+1FAEA now measures 2 columns, and every test job failed on main. Two tests hardcoded the old answer (1) while their own names promise only that the fallback keeps Symfony's measurement. They now assert exactly that, via Helper::width(), so they hold on 8.1.5 and 8.1.8 alike. --- tests/Tools/Support/EmojisBridgeCatalogueTest.php | 5 ++++- tests/Tools/Support/EmojisBridgeFallbackTest.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Tools/Support/EmojisBridgeCatalogueTest.php b/tests/Tools/Support/EmojisBridgeCatalogueTest.php index 1872f33..1e4d86a 100644 --- a/tests/Tools/Support/EmojisBridgeCatalogueTest.php +++ b/tests/Tools/Support/EmojisBridgeCatalogueTest.php @@ -5,6 +5,7 @@ namespace Simtabi\Laranail\Console\Tools\Tests\Support; use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Helper\Helper; use Simtabi\Laranail\Console\Tools\Support\Emoji; use Simtabi\Laranail\Console\Tools\Support\DisplayWidth; use Simtabi\Laranail\Console\Tools\Support\EmojisBridge; @@ -77,7 +78,9 @@ public function test_a_failing_catalogue_degrades_to_the_built_in_behaviour(): v self::assertSame('❌', Emoji::make()->unicode()->get('cross')); self::assertSame('', Emoji::make()->get('unicorn')); self::assertSame('ship 🚀', Emoji::make()->ascii()->render('ship 🚀')); - self::assertSame(1, DisplayWidth::of("\u{1FAEA}")); + // Whatever Symfony itself measures: its width table learns new emoji over time + // (8.1.8 widened U+1FAEA to 2), and the fallback promises to agree with it, not with 1. + self::assertSame(Helper::width("\u{1FAEA}"), DisplayWidth::of("\u{1FAEA}")); } public function test_discovery_finds_the_adapter_exactly_when_it_is_autoloadable(): void diff --git a/tests/Tools/Support/EmojisBridgeFallbackTest.php b/tests/Tools/Support/EmojisBridgeFallbackTest.php index 09cb8d0..66ecbad 100644 --- a/tests/Tools/Support/EmojisBridgeFallbackTest.php +++ b/tests/Tools/Support/EmojisBridgeFallbackTest.php @@ -5,6 +5,7 @@ namespace Simtabi\Laranail\Console\Tools\Tests\Support; use PHPUnit\Framework\TestCase; +use Symfony\Component\Console\Helper\Helper; use Simtabi\Laranail\Console\Tools\Support\Emoji; use Simtabi\Laranail\Console\Tools\Support\DisplayWidth; use Simtabi\Laranail\Console\Tools\Support\EmojisBridge; @@ -60,6 +61,8 @@ public function test_emoji_sequences_measure_two_columns_without_the_catalogue() public function test_an_emoji_newer_than_the_width_table_keeps_the_symfony_measurement(): void { // The documented limit of the fallback: without a catalogue, nothing says U+1FAEA is an emoji. - self::assertSame(1, DisplayWidth::of("\u{1FAEA}")); + // Whatever Symfony itself measures: its width table learns new emoji over time + // (8.1.8 widened U+1FAEA to 2), and the fallback promises to agree with it, not with 1. + self::assertSame(Helper::width("\u{1FAEA}"), DisplayWidth::of("\u{1FAEA}")); } }