Skip to content

Commit

Permalink
Merge ours for CSS and JS files, merge theirs for CHANGELOG.md. Added…
Browse files Browse the repository at this point in the history
… image processing command and dependencies in composer.json. (#15)

* Merge ours for CSS and JS files, merge theirs for CHANGELOG.md. Added image processing command and dependencies in composer.json.

* Fix styling

* Add PHP-CS-Fixer configuration file to the project, which includes rules for code formatting and style. This will ensure consistent code style across the project and improve code readability.

* Fix styling

* Fix styling

* Fix styling

* Fix styling

---------

Co-authored-by: thejmitchener <[email protected]>
  • Loading branch information
thejmitchener and thejmitchener authored Dec 20, 2024
1 parent 3c37adf commit 11d7c46
Show file tree
Hide file tree
Showing 9 changed files with 458 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
/phpstan-baseline.neon export-ignore

# Merge ours
# *.css merge=ours
# *.js merge=ours
# package.json merge=ours
# package-lock.json merge=ours
# composer.json merge=ours
# composer.lock merge=ours
*.css merge=ours
*.js merge=ours

# Merge theirs
CHANGELOG.md merge=theirs
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.3.14","version":"3.65.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces_position":true,"class_definition":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","do","else","elseif","final","for","foreach","function","if","interface","namespace","private","protected","public","static","switch","trait","try","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}},"single_trait_insert_per_statement":true},"hashes":{"src\/AppInitServiceProvider.php":"66c62559d6588bba8ac864307459072d","src\/Facades\/AppInit.php":"679a4aa07ef5dc2f0a3d9ccfe901d455","src\/Commands\/InstallTailwindCssCommand.php":"fac59dc698a1bb6fa268191b83aff2c2","src\/Commands\/InstallCommand.php":"99949ea2172e7078edbf70b674585ee7","src\/Commands\/InstallGitDotFilesCommand.php":"74163d4bec8a5e68f189487eece9b2e8","src\/Commands\/InstallComposerPackagesCommand.php":"e3abc6bcbcc2b04c513758e8061a06a3","src\/Commands\/ProcessImagesCommand.php":"f4b32ec96702e9c111e8078d418fa290","src\/Commands\/ConfigureEnvCommand.php":"bff4a2e5d2a7cb78fce4ef647d175931","src\/Commands\/InstallPrettierCommand.php":"11b614fe35e88ca4ac8daa5e1709f0c8","src\/Commands\/InstallViteCommand.php":"19b748e17c54ece6d5bdd55ef1541344","src\/Commands\/InstallChangeLogCommand.php":"7127ba50ce9fb50f71f2da8375410286","src\/AppInit.php":"520161f0ae6f23aed9cacf0de7396c93","tests\/Pest.php":"5b2122d0e0474fb9f568a8cb9fb479d7","tests\/ArchTest.php":"3ee5b69122c072917aa2cac591256b77","tests\/TestCase.php":"f707c59c644ad648e719c8eb6c3615c7"}}
43 changes: 43 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ You can force initialize the package using the installation command:
php artisan app-init:install --force
```

You can process images in the ```public/images/``` folder using the installation command:

```bash
php artisan app-init:images
```

You can force process images in the ```public/images/``` folder using the installation command:

```bash
php artisan app-init:images --force
```


Optional: Install the image manipulation binaries on MacOS (using Homebrew):

```bash
brew install jpegoptim
brew install optipng
brew install pngquant
npm install -g svgo
brew install gifsicle
brew install webp
brew install libavif
```

## Testing

```bash
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
],
"require": {
"php": "^8.2",
"intervention/image": "^3.9",
"spatie/image-optimizer": "^1.8",
"spatie/laravel-package-tools": "^1.14.0"
},
"require-dev": {
Expand Down Expand Up @@ -70,6 +72,9 @@
"providers": [
"Fuelviews\\AppInit\\AppInitServiceProvider"
]
},
"aliases": {
"RedirectIfNotFound": "Fuelviews\\AppInit\\Facades\\AppInit"
}
},
"minimum-stability": "dev",
Expand Down
205 changes: 202 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/AppInitServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Fuelviews\AppInit\Commands\InstallPrettierCommand;
use Fuelviews\AppInit\Commands\InstallTailwindCssCommand;
use Fuelviews\AppInit\Commands\InstallViteCommand;
use Fuelviews\AppInit\Commands\ProcessImagesCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -28,6 +29,7 @@ public function configurePackage(Package $package): void
InstallViteCommand::class,
InstallComposerPackagesCommand::class,
ConfigureEnvCommand::class,
ProcessImagesCommand::class,
]);

}
Expand Down
Loading

0 comments on commit 11d7c46

Please sign in to comment.