From c25d8b7e54dc4334aed349ea886967e1c6146c07 Mon Sep 17 00:00:00 2001 From: Willem Leuverink Date: Wed, 29 May 2024 15:20:32 +0200 Subject: [PATCH] boyscouting --- src/Commands/Install.php | 13 +++++++------ tests/Feature/Commands/InstallCommandTest.php | 12 ++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Commands/Install.php b/src/Commands/Install.php index bcf988b..01c76d3 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -26,10 +26,8 @@ public function handle(): int $this->printAscii(); $this->printIntro(); - $this->promptToInstallBun(); $this->promptToInstallCssLoading(); - $this->install(); $this->call('bundle:version'); @@ -47,8 +45,9 @@ protected function printAscii() / __ |/ / / // |/ // / / // / / __/ / /_/ // /_/ // /| // /_/ // /___ / /___ /_____/ \____//_/ |_//_____//_____//_____/ - TEXT); + + $this->newLine(); } protected function printIntro() @@ -82,10 +81,12 @@ protected function promptToInstallCssLoading() ); match ($choice) { - 'css' => $this->installCommands[] = 'npm install lightningcss --save-dev', + 'css' => $this->installCommands = array_merge($this->installCommands, [ + 'npm install lightningcss@^1 --save-dev', + ]), 'sass' => $this->installCommands = array_merge($this->installCommands, [ - 'npm install lightningcss --save-dev', - 'npm install sass --save-dev', + 'npm install lightningcss@^1 --save-dev', + 'npm install sass@^1 --save-dev', ]), default => null, }; diff --git a/tests/Feature/Commands/InstallCommandTest.php b/tests/Feature/Commands/InstallCommandTest.php index 1336930..6ffbc71 100644 --- a/tests/Feature/Commands/InstallCommandTest.php +++ b/tests/Feature/Commands/InstallCommandTest.php @@ -37,7 +37,7 @@ ->expectsQuestion('Would you like to use CSS loading?', 'css') ->assertSuccessful(); - Process::assertRan('npm install lightningcss --save-dev'); + Process::assertRan('npm install lightningcss@^1 --save-dev'); }); it('doesnt install LightningCSS when not selected', function () { @@ -46,7 +46,7 @@ ->expectsQuestion('Would you like to use CSS loading?', 'none') ->assertSuccessful(); - Process::assertDidntRun('npm install lightningcss --save-dev'); + Process::assertDidntRun('npm install lightningcss@^1 --save-dev'); }); it('installs Sass when selected', function () { @@ -55,8 +55,8 @@ ->expectsQuestion('Would you like to use CSS loading?', 'sass') ->assertSuccessful(); - Process::assertRan('npm install lightningcss --save-dev'); - Process::assertRan('npm install sass --save-dev'); + Process::assertRan('npm install lightningcss@^1 --save-dev'); + Process::assertRan('npm install sass@^1 --save-dev'); }); it('doesnt install Sass when not selected', function () { @@ -65,8 +65,8 @@ ->expectsQuestion('Would you like to use CSS loading?', 'none') ->assertSuccessful(); - Process::assertDidntRun('npm install lightningcss --save-dev'); - Process::assertDidntRun('npm install sass --save-dev'); + Process::assertDidntRun('npm install lightningcss@^1 --save-dev'); + Process::assertDidntRun('npm install sass@^1 --save-dev'); }); it('doesnt install anything when nothing selected', function () {