diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml deleted file mode 100644 index da9a739..0000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: PHPStan - -on: - push: - paths: - - '**.php' - - 'phpstan.neon.dist' - - '.github/workflows/phpstan.yml' - -jobs: - phpstan: - name: phpstan - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - coverage: none - - - name: Install composer dependencies - uses: ramsey/composer-install@v3 - - - name: Run PHPStan - run: ./vendor/bin/phpstan tests --error-format=github diff --git a/.gitignore b/.gitignore index a7f372d..0ebf292 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,25 @@ phpstan.neon testbench.yaml vendor node_modules +/.phpunit.cache +/node_modules +/public/hot +/public/storage +/storage/*.key +/vendor +.env +.env.backup +.env.production +.phpunit.result.cache +Homestead.json +Homestead.yaml +auth.json +npm-debug.log +yarn-error.log +/.fleet +/.idea +/.vscode +.user.ini +php.ini +error_log +.DS_Store diff --git a/README.md b/README.md index 95dc8c4..1b8950c 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/fuelviews/laravel-vite.svg?style=flat-square)](https://packagist.org/packages/fuelviews/laravel-vite) [![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/fuelviews/laravel-vite/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/fuelviews/laravel-vite/actions?query=workflow%3Arun-tests+branch%3Amain) -[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/fuelviews/laravel-vite/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/fuelviews/laravel-vite/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain) +[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/fuelviews/laravel-vite/fix-php-code-style-issues.yml?label=code%20style&style=flat-square)](https://github.com/fuelviews/laravel-vite/actions?query=workflow%3A"Fix+PHP+code+style+issues") [![Total Downloads](https://img.shields.io/packagist/dt/fuelviews/laravel-vite.svg?style=flat-square)](https://packagist.org/packages/fuelviews/laravel-vite) -Laravel vite package quickly integrates opinionated vite defaults into laravel projects. +Laravel vite package quickly integrates opinionated vite configuration into laravel projects. ## Installation diff --git a/composer.json b/composer.json index 10c40d5..38ebe79 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fuelviews/laravel-vite", - "description": "Fuelviews laravel vite package", + "description": "Laravel vite package", "keywords": [ "fuelviews", "laravel", @@ -13,15 +13,13 @@ { "name": "Joshua Mitchener", "email": "support@fuelviews.com", + "homepage": "https://fuelviews.com", "role": "Developer" } ], "require": { "php": "^8.2", - "spatie/laravel-package-tools": "^1.16", - "illuminate/contracts": "^10.0||^11.0", - "illuminate/support": "^10.0||^11.0", - "illuminate/console": "^10.0||^11.0" + "spatie/laravel-package-tools": "^1.16" }, "require-dev": { "laravel/pint": "^1.14", diff --git a/src/Commands/ViteCommand.php b/src/Commands/InstallCommand.php similarity index 90% rename from src/Commands/ViteCommand.php rename to src/Commands/InstallCommand.php index 1dc4e1d..349d699 100644 --- a/src/Commands/ViteCommand.php +++ b/src/Commands/InstallCommand.php @@ -10,11 +10,11 @@ use function Laravel\Prompts\confirm; -class ViteCommand extends Command +class InstallCommand extends Command { - public $signature = 'vite:install'; + public $signature = 'vite:install {--force : Overwrite existing files without prompting}'; - public $description = 'Install vite config and supporting dependencies'; + public $description = 'Install vite.config.js and dependencies'; /** * Execute the console command. @@ -51,9 +51,10 @@ protected function publishConfig(string $configFileName): void { $stubPath = __DIR__."/../../resources/$configFileName.stub"; $destinationPath = base_path($configFileName); + $force = $this->option('force'); if (File::exists($destinationPath)) { - if (confirm("$configFileName already exists. Do you want to overwrite it?", false)) { + if ($force || confirm("$configFileName already exists. Do you want to overwrite it?", false)) { File::copy($stubPath, $destinationPath); $this->info("$configFileName has been overwritten successfully."); } else { diff --git a/src/ViteServiceProvider.php b/src/ViteServiceProvider.php index 0e689b6..713c861 100644 --- a/src/ViteServiceProvider.php +++ b/src/ViteServiceProvider.php @@ -2,7 +2,7 @@ namespace Fuelviews\Vite; -use Fuelviews\Vite\Commands\ViteCommand; +use Fuelviews\Vite\Commands\InstallCommand; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; @@ -10,13 +10,8 @@ class ViteServiceProvider extends PackageServiceProvider { public function configurePackage(Package $package): void { - /* - * This class is a Package Service Provider - * - * More info: https://github.com/spatie/laravel-package-tools - */ $package ->name('laravel-vite') - ->hasCommand(ViteCommand::class); + ->hasCommand(InstallCommand::class); } }