Skip to content

Commit 9c5ea25

Browse files
committed
Add Tailwind Forms and implement LazyInstallCommand
Added @tailwindcss/forms to the project dependencies for enhanced form rendering and aesthetics. Created the LazyInstallCommand class, to streamline the workflow during package installations by suggesting commands and automating the initialization of tailwindcss. Additionally, necessary configurations for postcss and tailwind have been made available. All these changes aim to provide a seamless installation and setup experience for users.
1 parent 47ca89f commit 9c5ea25

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"tailwind"
1414
],
1515
"dependencies": {
16+
"@tailwindcss/forms": "^0.5.6",
1617
"alpinejs": "^3.13.1",
1718
"quill": "^1.3.7",
1819
"theme-change": "^2.5.0"

src/Commands/LazyInstallCommand.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Console\Command;
66

77
use function Laravel\Prompts\confirm;
8+
use function Laravel\Prompts\info;
89

910
class LazyInstallCommand extends Command
1011
{
@@ -22,6 +23,7 @@ public function handle(): int
2223
$packages = [
2324
'-D tailwindcss postcss autoprefixer sass',
2425
'-D daisyui@latest',
26+
'-D @tailwindcss/forms',
2527
'axios',
2628
'quill',
2729
'sanitize-html',
@@ -40,10 +42,20 @@ public function handle(): int
4042
default: true,
4143
hint: 'This will initialize tailwindcss'
4244
)) {
43-
$this->info('Run command "npm i npx tailwindcss init"');
45+
info('Run command "npm i npx tailwindcss init"');
4446
shell_exec('npx tailwindcss init');
4547
}
4648

49+
if (! file_exists(base_path('postcss.config.js'))) {
50+
info('Copy postcss.config.js');
51+
copy(__DIR__.'/../../stubs/postcss.config.js', base_path('postcss.config.js'));
52+
}
53+
54+
if (! file_exists(base_path('tailwind.config.js'))) {
55+
info('Copy tailwind.config.js');
56+
copy(__DIR__.'/../../stubs/tailwind.lazy.config.js', base_path('tailwind.config.js'));
57+
}
58+
4759
return self::SUCCESS;
4860
}
4961
}

stubs/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};
File renamed without changes.

0 commit comments

Comments
 (0)