Skip to content

Commit f958a60

Browse files
authored
Merge branch 'main' into update_rector_rules
2 parents 02a74fe + 275cf5e commit f958a60

File tree

6 files changed

+49
-3
lines changed

6 files changed

+49
-3
lines changed

.ai/foundation.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
- Do not change the application's dependencies without approval.
2828

2929
## Frontend Bundling
30-
- 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.
30+
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `{{ $assist->nodePackageManager() }} run build`, `{{ $assist->nodePackageManager() }} run dev`, or `composer run dev`. Ask them.
3131

3232
## Replies
3333
- Be concise in your explanations - focus on what's important rather than explaining obvious details.

.ai/laravel/core.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
- 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.
4040

4141
### Vite Error
42-
- 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`.
42+
- If you receive an "Illuminate\Foundation\ViteException: Unable to locate file in Vite manifest" error, you can run `{{ $assist->nodePackageManager() }} run build` or ask the user to run `{{ $assist->nodePackageManager() }} run dev` or `composer run dev`.

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# Release Notes
22

3-
## [Unreleased](https://github.com/laravel/boost/compare/v1.4.0...main)
3+
## [Unreleased](https://github.com/laravel/boost/compare/v1.5.0...main)
4+
5+
## [v1.5.0](https://github.com/laravel/boost/compare/v1.4.0...v1.5.0) - 2025-10-24
6+
7+
### What's Changed
8+
9+
* Add PhpStorm detection path for Windows by [@GoneTone](https://github.com/GoneTone) in https://github.com/laravel/boost/pull/304
10+
* Dynamic NPM Package Runner by [@imliam](https://github.com/imliam) in https://github.com/laravel/boost/pull/145
11+
12+
### New Contributors
13+
14+
* [@GoneTone](https://github.com/GoneTone) made their first contribution in https://github.com/laravel/boost/pull/304
15+
* [@imliam](https://github.com/imliam) made their first contribution in https://github.com/laravel/boost/pull/145
16+
17+
**Full Changelog**: https://github.com/laravel/boost/compare/v1.4.0...v1.5.0
418

519
## [v1.4.0](https://github.com/laravel/boost/compare/v1.3.3...v1.4.0) - 2025-10-14
620

src/BoostServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function register(): void
3636
$lockFiles = [
3737
base_path('composer.lock'),
3838
base_path('package-lock.json'),
39+
base_path('bun.lock'),
3940
base_path('bun.lockb'),
4041
base_path('pnpm-lock.yaml'),
4142
base_path('yarn.lock'),

src/Install/GuidelineAssist.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Illuminate\Database\Eloquent\Model;
88
use Laravel\Boost\Install\Assists\Inertia;
9+
use Laravel\Roster\Enums\NodePackageManager;
910
use Laravel\Roster\Enums\Packages;
1011
use Laravel\Roster\Roster;
1112
use ReflectionClass;
@@ -168,4 +169,9 @@ public function inertia(): Inertia
168169
{
169170
return new Inertia($this->roster);
170171
}
172+
173+
public function nodePackageManager(): string
174+
{
175+
return ($this->roster->nodePackageManager() ?? NodePackageManager::NPM)->value;
176+
}
171177
}

tests/Feature/Install/GuidelineComposerTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
use Laravel\Boost\Install\GuidelineComposer;
66
use Laravel\Boost\Install\GuidelineConfig;
77
use Laravel\Boost\Install\Herd;
8+
use Laravel\Roster\Enums\NodePackageManager;
89
use Laravel\Roster\Enums\Packages;
910
use Laravel\Roster\Package;
1011
use Laravel\Roster\PackageCollection;
1112
use Laravel\Roster\Roster;
1213

1314
beforeEach(function (): void {
1415
$this->roster = Mockery::mock(Roster::class);
16+
$this->nodePackageManager = NodePackageManager::NPM;
17+
$this->roster->shouldReceive('nodePackageManager')->andReturnUsing(
18+
fn (): NodePackageManager => $this->nodePackageManager
19+
);
20+
1521
$this->herd = Mockery::mock(Herd::class);
1622
$this->herd->shouldReceive('isInstalled')->andReturn(false)->byDefault();
1723

@@ -357,3 +363,22 @@
357363
->toContain('=== phpunit/core rules ===')
358364
->not->toContain('=== pest/core rules ===');
359365
});
366+
367+
test('includes correct package manager commands in guidelines based on lockfile', function (NodePackageManager $packageManager, string $expectedCommand): void {
368+
$packages = new PackageCollection([
369+
new Package(Packages::LARAVEL, 'laravel/framework', '11.0.0'),
370+
]);
371+
$this->nodePackageManager = $packageManager;
372+
$this->roster->shouldReceive('packages')->andReturn($packages);
373+
374+
$guidelines = $this->composer->compose();
375+
376+
expect($guidelines)
377+
->toContain("{$expectedCommand} run build")
378+
->toContain("{$expectedCommand} run dev");
379+
})->with([
380+
'npm' => [NodePackageManager::NPM, 'npm'],
381+
'pnpm' => [NodePackageManager::PNPM, 'pnpm'],
382+
'yarn' => [NodePackageManager::YARN, 'yarn'],
383+
'bun' => [NodePackageManager::BUN, 'bun'],
384+
]);

0 commit comments

Comments
 (0)