Skip to content

Commit

Permalink
Refactored the package description in composer.json to be more concis…
Browse files Browse the repository at this point in the history
…e and accurate. Renamed the ViteCommand class to InstallCommand for better clarity and consistency. (#8)

* Refactored the package description in composer.json to be more concise and accurate. Renamed the ViteCommand class to InstallCommand for better clarity and consistency.

* Refactored the package description in composer.json to be more concise and accurate. Renamed the ViteCommand class to InstallCommand for better clarity and consistency.
  • Loading branch information
thejmitchener authored Jun 13, 2024
1 parent f8afee0 commit 4918d97
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 46 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/phpstan.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fuelviews/laravel-vite",
"description": "Fuelviews laravel vite package",
"description": "Laravel vite package",
"keywords": [
"fuelviews",
"laravel",
Expand All @@ -13,15 +13,13 @@
{
"name": "Joshua Mitchener",
"email": "[email protected]",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
9 changes: 2 additions & 7 deletions src/ViteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@

namespace Fuelviews\Vite;

use Fuelviews\Vite\Commands\ViteCommand;
use Fuelviews\Vite\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

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);
}
}

0 comments on commit 4918d97

Please sign in to comment.