Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ai/foundation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- Do not change the application's dependencies without approval.

## Frontend Bundling
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them.
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->jsPackageManager() }} run build`, `{{ $assist->jsPackageManager() }} run dev`, or `composer run dev`. Ask them.

## Replies
- Be concise in your explanations - focus on what's important rather than explaining obvious details.
Expand Down
2 changes: 1 addition & 1 deletion .ai/laravel/core.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
- When creating tests, make use of `php artisan make:test [options] <name>` to create a feature test, and pass `--unit` to create a unit test. Most tests should be feature tests.

### Vite Error
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `npm run build` or ask the user to run `npm run dev` or `composer run dev`.
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->jsPackageManager() }} run build` or ask the user to run `{{ $assist->jsPackageManager() }} run dev` or `composer run dev`.
10 changes: 10 additions & 0 deletions src/Install/GuidelineAssist.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,14 @@ public function inertia(): Inertia
{
return new Inertia($this->roster);
}

public function jsPackageManager(): string
{
return match (true) {
file_exists(base_path('bun.lockb')) => 'bun',
file_exists(base_path('pnpm-lock.yaml')) => 'pnpm',
file_exists(base_path('yarn.lock')) => 'yarn',
default => 'npm',
};
}
}