Skip to content

Commit 2388076

Browse files
committed
fix conflicts
2 parents 699cca9 + 58d9e1e commit 2388076

File tree

11 files changed

+114
-53
lines changed

11 files changed

+114
-53
lines changed

.ai/livewire/2/core.blade.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
- `wire:model` is live by default.
2+
- **Namespace**: Components typically exist in `App\Http\Livewire`.
3+
- **Events**: Use `emit()`, `emitTo()`, `emitSelf()` and `dispatchBrowserEvent()` for events.
4+
- Alpine is included separately to Livewire.
5+
- You can listen for `livewire:load` to hook into Livewire initialization, and `Livewire.onPageExpired` for when the page expires:
6+
@verbatim
7+
<code-snippet name="livewire:load example" lang="js">
8+
document.addEventListener('livewire:load', function () {
9+
Livewire.onPageExpired(() => {
10+
alert('Your session expired');
11+
});
12+
13+
Livewire.onError(status => console.error(status));
14+
});
15+
</code-snippet>
16+
@endverbatim

.ai/livewire/3/core.blade.php

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
## Livewire 3
22

33
### Key Changes From Livewire 2
4+
- These things changed in Livewire 2, but may not have been updated in this application. Verify this application's setup to ensure you conform with application conventions.
5+
- Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default.
6+
- Components now use the `App\Livewire` namespace (not `App\Http\Livewire`).
7+
- Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`).
8+
- Use the `components.layouts.app` view as the typical layout path (not `layouts.app`).
49

5-
- **Namespace**: Components now use `App\Livewire` (not `App\Http\Livewire`).
6-
- **Events**: Use `$this->dispatch()` (not `emit` or `dispatchBrowserEvent`).
7-
- **Layout Path**: `components.layouts.app` (not `layouts.app`).
8-
- **Deferred by Default**: Use `wire:model.live` for real-time updates.
9-
- **Alpine Included**: Don't manually include Alpine.js.
10+
### New Directives
11+
- `wire:show`, `wire:transition`, `wire:cloak, `wire:offline`, `wire:target` are available for use. Use the documentation to find usage examples.
1012

11-
### Livewire Best Practices
12-
13-
- Always use a **single root element** in Blade components.
14-
- Always add `wire:key` in loops to prevent DOM merging errors.
13+
### Alpine
14+
- Alpine is now included with Livewire, don't manually include Alpine.js.
15+
- Plugins included with Alpine: persist, intersect, collapse, and focus.
1516

17+
### Lifecycle Hooks
18+
- You can listen for `livewire:init` to hook into Livewire initialization, and `fail.status === 419` for the page expiring:
1619
@verbatim
17-
```blade
18-
@foreach ($items as $item)
19-
<div wire:key="item-{{ $item->id }}">
20-
{{ $item->name }}
21-
</div>
22-
@endforeach
23-
```
20+
<code-snippet name="livewire:load example" lang="js">
21+
document.addEventListener('livewire:init', function () {
22+
Livewire.hook('request', ({ fail }) => {
23+
if (fail && fail.status === 419) {
24+
alert('Your session expired');
25+
}
26+
});
27+
28+
Livewire.hook('message.failed', (message, component) => {
29+
console.error(message);
30+
});
31+
});
32+
</code-snippet>
2433
@endverbatim
25-
26-
- Use attributes to configure Livewire event listeners:
27-
28-
```php
29-
#[On('todo-created')]
30-
public function refreshList()
31-
{
32-
// ...
33-
}
34-
```
35-
36-
- Use `wire:loading` and `wire:dirty` to configure loading states when applicable.
37-
- Use something like `wire:confirm="Are you sure?"` to confirm destructive actions.

.ai/livewire/core.blade.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
11
## Livewire Core
2+
- Use the `search-docs` tool to find exact version specific documentation for how to write Livewire & Livewire tests.
3+
- Use the `php artisan make:livewire [Posts\\CreatePost]` artisan command to create new components
4+
- State should live on the server, with the UI reflecting it.
5+
- All Livewire requests hit the Laravel backend, they're like regular HTTP requests. Always validate form data, and run authorization checks in Livewire actions.
6+
7+
## Livewire Best Practices
8+
- Livewire components require a single root element.
9+
- Use `wire:loading` and `wire:dirty` for delightful loading states.
10+
- Add `wire:key` in loops:
11+
@verbatim
12+
```blade
13+
@foreach ($items as $item)
14+
<div wire:key="item-{{ $item->id }}">
15+
{{ $item->name }}
16+
</div>
17+
@endforeach
18+
```
19+
@endverbatim
20+
- Prefer lifecycle hooks like `mount()`, `updatedFoo()`) for initialization and reactive side effects:
21+
@verbatim
22+
<code-snippet name="Lifecycle hook examples" lang="php">
23+
public function mount(User $user) { $this->user = $user; }
24+
public function updatedSearch() { $this->resetPage(); }
25+
</code-snippet>
26+
@endverbatim
27+
28+
## Testing Livewire
29+
@verbatim
30+
<code-snippet name="Example Livewire component test" lang="php">
31+
Livewire::test(Counter::class)
32+
->assertSet('count', 0)
33+
->call('increment')
34+
->assertSet('count', 1)
35+
->assertSee(1)
36+
->assertStatus(200);
37+
</code-snippet>
38+
@endverbatim
39+
@verbatim
40+
<code-snippet name="Testing a Livewire component exists within a page" lang="php">
41+
$this->get('/posts/create')
42+
->assertSeeLivewire(CreatePost::class);
43+
</code-snippet>
44+
@endverbatim

.ai/tailwindcss/3/core.blade.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
## Tailwind 3
22

33
- Always use Tailwind CSS v3 - verify you're using only classes supported by this version.
4-
- Use the `search-docs` tool to find exactly what's supported in this application's Tailwind setup.

.ai/tailwindcss/4/.gitkeep

Whitespace-only changes.

.ai/tailwindcss/4/core.blade.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
## Tailwind 4
22

33
- Always use Tailwind CSS v4 - do not use the deprecated utilities.
4-
- Use the `search-docs` tool to find exactly what's supported in this application's Tailwind setup.
4+
- `corePlugins` is not supported in Tailwind v4.
55
- In Tailwind v4, you import Tailwind using a regular CSS `@import` statement, not using the `@tailwind` directives used in v3:
66
@verbatim
7-
<code-snippet name="Tailwind v4 import tailwind diff" lang="diff"
7+
<code-snippet name="Tailwind v4 Import Tailwind Diff" lang="diff"
88
- @tailwind base;
99
- @tailwind components;
1010
- @tailwind utilities;
1111
+ @import "tailwindcss";
1212
</code-snippet>
1313
@endverbatim
14-
- `corePlugins` is not supported in Tailwind v4.
1514

1615
### Replaced Utilities
1716
- Tailwind v4 removed deprecated utilities. Do not use the deprecated option - use the replacement.

.ai/tailwindcss/core.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Tailwind Core
22

3-
- Use Tailwind CSS classes to style HTML. Check and use existing Tailwind conventions within the project before writing your own.
4-
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc.).
5-
- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, and group elements logically.
3+
- Use Tailwind CSS classes to style HTML, check and use existing tailwind conventions within the project before writing your own.
4+
- Offer to extract repeated patterns into components that match the project's conventions (i.e. Blade, JSX, Vue, etc..)
5+
- Think through class placement, order, priority, and defaults - remove redundant classes, add classes to parent or child carefully to limit repetition, group elements logically
66

77
### Spacing
88
- When listing items, use gap utilities for spacing, don't use margins.

.ai/volt/core.blade.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Livewire Volt
22

33
- This project uses Livewire Volt for interactivity within its pages. New pages requiring interactivity must also use Livewire Volt. There is documentation available for it.
4-
- Volt is an elegantly crafted **class-based** and **functional** API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to co-exist in the same file
4+
- Make new Volt components using `php artisan make:volt [name] [--test] [--pest]`
5+
- Volt is a **class-based** and **functional** API for Livewire that supports single-file components, allowing a component's PHP logic and Blade templates to co-exist in the same file
56
- Livewire Volt allows PHP logic and Blade templates in one file. Components use the `@volt` directive.
67
- You must check existing Volt components to determine if they're functional or class based. If you can't detect that, ask the user which they prefer before writing a Volt component.
78

@@ -94,7 +95,8 @@ public function increment()
9495

9596
@verbatim
9697
<code-snippet name="CRUD With Volt" lang="php">
97-
@volt
98+
<?php
99+
98100
use App\Models\Product;
99101
use function Livewire\Volt\{state, computed};
100102
@@ -106,15 +108,15 @@ public function increment()
106108
107109
$edit = fn(Product $product) => $this->editing = $product->id;
108110
$delete = fn(Product $product) => $product->delete();
111+
109112
?>
110-
@endvolt
111113

112-
<!-- UI here -->
114+
<!-- HTML / UI Here -->
113115
</code-snippet>
114116
@endverbatim
115117

116118
@verbatim
117-
<code-snippet name="Real-time Search With Volt" lang="php">
119+
<code-snippet name="Real-Time Search With Volt" lang="php">
118120
<flux:input
119121
wire:model.live.debounce.300ms="search"
120122
placeholder="Search..."

src/Mcp/Tools/SearchDocs.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ public function __construct(protected Roster $roster)
2222

2323
public function description(): string
2424
{
25-
return 'Search for up-to-date version-specific documentation related to this project and its packages. This tool will search Laravel hosted documentation based on the packages installed and is perfect for all Laravel related packages. Laravel, inertia, pest, livewire, filament, nova, nightwatch, and more.'.PHP_EOL.'You must use this tool to search for Laravel-ecosystem docs before using other approaches.';
25+
return 'Search for up-to-date version-specific documentation related to this project and its packages. This tool will search Laravel hosted documentation based on the packages installed and is perfect for all Laravel related packages. Laravel, inertia, pest, livewire, filament, nova, nightwatch, and more.'.PHP_EOL.'You must use this tool to search for Laravel-ecosystem docs before using other approaches. The results provided are for this project\'s package version and does not cover all versions of the package.';
2626
}
2727

2828
public function schema(ToolInputSchema $schema): ToolInputSchema
2929
{
3030
return $schema
31-
->string('queries')
32-
->description('### separated list of queries to perform. Useful to pass multiple if you aren\'t sure if it is "toggle" or "switch", or "infinite scroll" or "infinite load", for example.')->required()
33-
31+
->raw('queries', [
32+
'description' => 'List of queries to perform, pass multiple if you aren\'t sure if it is "toggle" or "switch", for example',
33+
'type' => 'array',
34+
'items' => [
35+
'type' => 'string',
36+
'description' => 'Search query',
37+
],
38+
])->required()
3439
->raw('packages', [
3540
'description' => 'Package names to limit searching to from application-info. Useful if you know the package(s) you need. i.e. laravel/framework, inertiajs/inertia-laravel, @inertiajs/react',
3641
'type' => 'array',
@@ -54,7 +59,7 @@ public function handle(array $arguments): ToolResult|Generator
5459
$packagesFilter = array_key_exists('packages', $arguments) ? $arguments['packages'] : null;
5560

5661
$queries = array_filter(
57-
array_map('trim', explode('###', $arguments['queries'])),
62+
array_map('trim', $arguments['queries']),
5863
fn ($query) => $query !== '' && $query !== '*'
5964
);
6065

@@ -90,6 +95,7 @@ public function handle(array $arguments): ToolResult|Generator
9095
'token_limit' => $tokenLimit,
9196
'format' => 'markdown',
9297
];
98+
9399
try {
94100
$response = $this->client()->asJson()->post($apiUrl, $payload);
95101

0 commit comments

Comments
 (0)