From 7684b947ddc7c95cf557853fb233fe5a70f78aeb Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Mon, 3 Nov 2025 14:50:56 +0530 Subject: [PATCH 1/3] Handle @volt directives in GuidelineComposer Signed-off-by: Pushpak Chhajed --- src/Install/GuidelineComposer.php | 2 ++ tests/Feature/Install/GuidelineComposerTest.php | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Install/GuidelineComposer.php b/src/Install/GuidelineComposer.php index f18f02ed..2a957af1 100644 --- a/src/Install/GuidelineComposer.php +++ b/src/Install/GuidelineComposer.php @@ -256,6 +256,8 @@ protected function renderContent(string $content, string $path): string $placeholders = [ '`' => '___SINGLE_BACKTICK___', ' '___OPEN_PHP_TAG___', + '@volt' => '___VOLT_DIRECTIVE___', + '@endvolt' => '___ENDVOLT_DIRECTIVE___', ]; $content = str_replace(array_keys($placeholders), array_values($placeholders), $content); diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index f381d930..15202fe3 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -424,5 +424,13 @@ // Processes blade variables correctly ->toContain('=== .ai/test-blade-with-assist rules ===') ->toContain('Run `npm install` to install dependencies') - ->toContain('Package manager: npm'); + ->toContain('Package manager: npm') + // Preserves @volt directives in blade templates + ->toContain('=== .ai/test-blade-with-volt-directives rules ===') + ->toContain('`@volt`') + ->toContain('`@endvolt`') + ->toContain('@volt') + ->toContain('@endvolt') + ->not->toContain('volt-anonymous-fragment') + ->not->toContain('@livewire'); }); From 679fd6efe6265dd6ee316168ec6680aeaac2a3c9 Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Mon, 3 Nov 2025 14:52:44 +0530 Subject: [PATCH 2/3] remove redundant @volt directives checks Signed-off-by: Pushpak Chhajed --- tests/Feature/Install/GuidelineComposerTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index 15202fe3..1618a204 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -429,8 +429,6 @@ ->toContain('=== .ai/test-blade-with-volt-directives rules ===') ->toContain('`@volt`') ->toContain('`@endvolt`') - ->toContain('@volt') - ->toContain('@endvolt') ->not->toContain('volt-anonymous-fragment') ->not->toContain('@livewire'); }); From fde8c61046b0adf328e58e9608f8b5b9f416cbe3 Mon Sep 17 00:00:00 2001 From: Pushpak Chhajed Date: Mon, 3 Nov 2025 15:28:14 +0530 Subject: [PATCH 3/3] Fix test Signed-off-by: Pushpak Chhajed --- tests/Feature/Install/GuidelineComposerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Feature/Install/GuidelineComposerTest.php b/tests/Feature/Install/GuidelineComposerTest.php index 1618a204..5051d874 100644 --- a/tests/Feature/Install/GuidelineComposerTest.php +++ b/tests/Feature/Install/GuidelineComposerTest.php @@ -388,6 +388,7 @@ test('renderContent handles blade and markdown files correctly', function (): void { $packages = new PackageCollection([ new Package(Packages::LARAVEL, 'laravel/framework', '11.0.0'), + new Package(Packages::VOLT, 'laravel/volt', '1.0.0'), ]); $this->roster->shouldReceive('packages')->andReturn($packages); @@ -426,9 +427,8 @@ ->toContain('Run `npm install` to install dependencies') ->toContain('Package manager: npm') // Preserves @volt directives in blade templates - ->toContain('=== .ai/test-blade-with-volt-directives rules ===') ->toContain('`@volt`') - ->toContain('`@endvolt`') + ->toContain('@endvolt') ->not->toContain('volt-anonymous-fragment') ->not->toContain('@livewire'); });