generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove LazyComponentCommand and introduce LazyInstallCommand
LazyComponentCommand was deleted as it was no longer needed. Instead, a new command, LazyInstallCommand, was introduced. This new command prompts the user to install npm dependencies and initialize tailwindcss. The purpose of this change was to implement an improved installation process and provide better user interaction.
- Loading branch information
1 parent
46b7af9
commit b91fe8b
Showing
3 changed files
with
51 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Step2dev\LazyUI\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use function Laravel\Prompts\confirm; | ||
|
||
class LazyInstallCommand extends Command | ||
{ | ||
public $signature = 'lazy-ui:install-package'; | ||
|
||
public $description = 'My command'; | ||
|
||
public function handle(): int | ||
{ | ||
if (confirm( | ||
label: 'Do you want to install npm dependency?', | ||
default: true, | ||
hint: 'This will install all the npm dependencies for lazy-ui' | ||
)) { | ||
$packages = [ | ||
'-D tailwindcss postcss autoprefixer sass', | ||
'-D daisyui@latest', | ||
'axios', | ||
'quill', | ||
'sanitize-html', | ||
'theme-change', | ||
'alpinejs', | ||
]; | ||
|
||
foreach ($packages as $package) { | ||
$this->info('Run command "npm i '.$package.'"'); | ||
shell_exec('npm i '.$package); | ||
} | ||
} | ||
|
||
if (confirm( | ||
label: 'Do you want initialize tailwindcss?', | ||
default: true, | ||
hint: 'This will initialize tailwindcss' | ||
)) { | ||
$this->info('Run command "npm i npx tailwindcss init"'); | ||
shell_exec('npx tailwindcss init'); | ||
} | ||
|
||
return self::SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters