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). 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}")); } }