Skip to content

Commit

Permalink
boyscouting
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed May 29, 2024
1 parent 6c9d32b commit c25d8b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ public function handle(): int

$this->printAscii();
$this->printIntro();

$this->promptToInstallBun();
$this->promptToInstallCssLoading();

$this->install();

$this->call('bundle:version');
Expand All @@ -47,8 +45,9 @@ protected function printAscii()
/ __ |/ / / // |/ // / / // / / __/
/ /_/ // /_/ // /| // /_/ // /___ / /___
/_____/ \____//_/ |_//_____//_____//_____/
TEXT);

$this->newLine();
}

protected function printIntro()
Expand Down Expand Up @@ -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,
};
Expand Down
12 changes: 6 additions & 6 deletions tests/Feature/Commands/InstallCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand All @@ -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 () {
Expand All @@ -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 () {
Expand Down

0 comments on commit c25d8b7

Please sign in to comment.