diff --git a/README.md b/README.md index 787a8d0..cc90d05 100755 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the - [Mailpit](https://github.com/axllent/mailpit) (http://localhost:8025) - [MinIO](https://min.io/) (http://localhost:9000) - Active Services - - [Expose](https://expose.dev/docs) (Installed if `EXPOSE_TOKEN` is provided in [.env] file. And use `expose share https://[site-name].test` to work properly) + - [Expose](https://expose.dev/docs) (Installed if `EXPOSE_TOKEN` is provided in [.env] file. Use `expose share https://[site-name].test` to work properly)

@@ -65,13 +65,10 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the - Essentials - [league/flysystem-aws-s3-v3](https://flysystem.thephpleague.com/docs/adapter/aws-s3-v3/) - - [laracasts/cypress](https://github.com/laracasts/cypress) [Dev] - - Use `npx cypress open` to run the tester - - Checkout this [episode](https://laracasts.com/series/jeffreys-larabits/episodes/22) for more details - [predis/predis](https://github.com/predis/predis) - [artesaos/seotools](https://github.com/artesaos/seotools) - [spatie/laravel-data](https://github.com/spatie/laravel-data) - - [laravel/scout](https://laravel.com/docs/10.x/scout) + - [laravel/scout](https://laravel.com/docs/scout) - [qruto/laravel-wave](https://github.com/qruto/laravel-wave) - ["spatie/laravel-medialibrary:^10.0.0"](https://spatie.be/docs/laravel-medialibrary/v10) - [spatie/eloquent-sortable](https://github.com/spatie/eloquent-sortable) @@ -82,8 +79,9 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the - [blade-ui-kit/blade-icons](https://github.com/blade-ui-kit/blade-icons) - [blade-ui-kit/blade-heroicons](https://github.com/blade-ui-kit/blade-heroicons) - [gehrisandro/tailwind-merge-laravel](https://github.com/gehrisandro/tailwind-merge-laravel) - - [laravel/breeze](https://laravel.com/docs/10.x/starter-kits#laravel-breeze) [Dev] - - [laravel/telescope](https://laravel.com/docs/10.x/telescope) (https://project-name.test/telescope) [Dev] + - [laravel/dusk](https://laravel.com/docs/dusk) [Dev] + - [laravel/breeze](https://laravel.com/docs/starter-kits#laravel-breeze) [Dev] + - [laravel/telescope](https://laravel.com/docs/telescope) (https://project-name.test/telescope) [Dev] - [Option] TALL Stack - [livewire/livewire](https://livewire.laravel.com/) - [filament/filament:"^3.0-stable"](https://filamentphp.com/docs/3.x/panels/installation) (https://project-name.test/admin) @@ -124,7 +122,6 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the - [Graphite](https://graphite.dev/) - Essentials - - [cypress](https://www.cypress.io/) - [laravel-wave](https://github.com/qruto/laravel-wave) - [tailwindcss](https://tailwindcss.com/) [Dev] - [postcss](https://github.com/postcss/postcss) [Dev] @@ -219,7 +216,6 @@ There's an option not to remove Breeze views and routes during the creation scri - [Laravel](https://laravel.com) - [FilamentPHP](https://filamentphp.com) - [Pest](https://pestphp.com) -- [Cypress](https://cypress.io) - [Spatie](https://github.com/spatie) - ( [Tech Stack List](#tech-stack-list) ) - ( [VSC Extensions](./files/.opinionated/extensions.md) ) diff --git a/files/.opinionated/extensions.md b/files/.opinionated/extensions.md index 7e887f2..e201021 100755 --- a/files/.opinionated/extensions.md +++ b/files/.opinionated/extensions.md @@ -12,6 +12,7 @@ - [m1guelpf.better-pest](https://github.com/m1guelpf/better-pest) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=m1guelpf.better-pest)] - [calebporzio.better-phpunit](https://github.com/calebporzio/better-phpunit) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=calebporzio.better-phpunit)] - [wmaurer.change-case](https://github.com/wmaurer/vscode-change-case) +- [naumovs.color-highlight](https://github.com/enyancc/vscode-ext-color-highlight) - [Equinusocio.vsc-community-material-theme](https://github.com/material-theme/vsc-community-material-theme) (Darker High Contrast) - [moshfeu.compare-folders](https://github.com/moshfeu/vscode-compare-folders) - [cshum.convert-newline-list-to-array](https://github.com/colinshum/vsc-newline-to-array) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=cshum.convert-newline-list-to-array)] @@ -55,7 +56,7 @@ - [albert.TabOut](https://github.com/albertromkes/tabout) - [bradlc.vscode-tailwindcss](https://github.com/tailwindlabs/tailwindcss-intellisense) - [austenc.tailwind-docs](https://github.com/austenc/vscode-tailwind-docs) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=austenc.tailwind-docs)] -- [bourhaouta.tailwindshades](https://github.com/bourhaouta/vscode-tailwindshades) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=bourhaouta.tailwindshades)] +- [GoodM4ven.vsc-tailwind-shades-generator](https://github.com/GoodM4ven/vsc-tailwind-shades-generator) - [jkjustjoshing.vscode-text-pastry](https://github.com/jkjustjoshing/vscode-text-pastry) [Not on VSX yet | [Market Link](https://marketplace.visualstudio.com/items?itemName=jkjustjoshing.vscode-text-pastry)] - [Gruntfuggly.todo-tree](https://github.com/Gruntfuggly/todo-tree) - [hideoo.trailing](https://github.com/HiDeoo/trailing) \ No newline at end of file diff --git a/files/.opinionated/settings.json b/files/.opinionated/settings.json index a62ff3b..640753b 100755 --- a/files/.opinionated/settings.json +++ b/files/.opinionated/settings.json @@ -124,17 +124,17 @@ ["TailwindMerge::merge\\(\\[?([^\\]]*)\\]?\\)", "'([^']*)'"] ], // [INTEL - Laraphense] - "Laraphense.disableAssetCompletion": true, - "Laraphense.disableBladeCompletion": true, - "Laraphense.disableEloquentCompletion": true, - "Laraphense.disableConfigCompletion": true, - "Laraphense.disableEnvCompletion": true, - "Laraphense.disableMiddlewareCompletion": true, - "Laraphense.disableRouteCompletion": true, - "Laraphense.disableTranslationCompletion": true, - "Laraphense.disableValidationCompletion": true, - "Laraphense.disableViewCompletion": true, - "Laraphense.expandLeadingNamespaceSeparator": false, + "laraphense.disableAssetCompletion": true, + "laraphense.disableBladeCompletion": true, + "laraphense.disableEloquentCompletion": true, + "laraphense.disableConfigCompletion": true, + "laraphense.disableEnvCompletion": true, + "laraphense.disableMiddlewareCompletion": true, + "laraphense.disableRouteCompletion": true, + "laraphense.disableTranslationCompletion": true, + "laraphense.disableValidationCompletion": true, + "laraphense.disableViewCompletion": true, + "laraphense.expandLeadingNamespaceSeparator": false, // // [INTEL - Alpine.js IntelliSense] // "alpine-intellisense.settings.languageScopes": "blade", // TODO uncomment when intel shows within elements only } diff --git a/files/_stubs/tall/vite.config.js b/files/_stubs/tall/vite.config.js index c99e89c..d009ddd 100755 --- a/files/_stubs/tall/vite.config.js +++ b/files/_stubs/tall/vite.config.js @@ -15,20 +15,11 @@ export default defineConfig({ 'resources/css/filament/admin/theme.css', 'resources/js/app.js', ], - refresh: [ - "app/Filament/**/*.php", - "app/Forms/**/*.php", - "app/Infolists/**/*.php", - "app/Livewire/**/*.php", - "app/Providers/Filament/**/*.php", - "app/Tables/**/*.php", - "app/View/Components/**/*.php", - "lang/**", - "resources/lang/**", - "routes/**", - ], + refresh: false, + }), + livewire({ + refresh: ['resources/css/app.css'], }), - livewire(), ], server: { host, diff --git a/files/tailwind.config.js b/files/tailwind.config.js index 2812985..b81c9ce 100755 --- a/files/tailwind.config.js +++ b/files/tailwind.config.js @@ -29,6 +29,7 @@ export default { 'dark-background-1': colors.gray['800'], 'dark-background-2': colors.gray['900'], primary: { + 50: '#e8f7fb', 100: '#cdf0f6', 200: '#9be2ee', 300: '#6ad3e5', @@ -38,8 +39,10 @@ export default { 700: '#046d7f', 800: '#024955', 900: '#01242a', + 950: '#001519', }, 'dark-primary': { + 50: '#fee7e7', 100: '#fcdada', 200: '#f9b4b4', 300: '#f58f8f', @@ -49,6 +52,7 @@ export default { 700: '#8f2929', 800: '#601b1b', 900: '#300e0e', + 950: '#1a0707', }, }, transitionProperty: {}, diff --git a/scripts/create.sh b/scripts/create.sh index ac2fb90..02758a0 100755 --- a/scripts/create.sh +++ b/scripts/create.sh @@ -268,7 +268,7 @@ echo -e "\nInstalling Composer packages..." >&3 cd $PROJECTS_DIRECTORY/$escaped_project_name # Breeze package -composer require --dev laravel/breeze laravel/telescope --with-all-dependencies -n $conditional_quiet +composer require --dev laravel/breeze --with-all-dependencies -n $conditional_quiet if [ "$laravel_stack" = "tall" ]; then stack="blade" @@ -305,7 +305,7 @@ if [ "$is_localized" == true ]; then fi # Dev Packages -composer require laracasts/cypress --dev -n $conditional_quiet +composer require laravel/dusk laravel/telescope --dev -n $conditional_quiet # Non-dev Packages... composer require --with-all-dependencies -n league/flysystem-aws-s3-v3:"^3.0" predis/predis laravel/scout spatie/laravel-medialibrary spatie/laravel-data spatie/eloquent-sortable spatie/laravel-sluggable spatie/laravel-tags spatie/laravel-settings blade-ui-kit/blade-icons spatie/laravel-permission qruto/laravel-wave gehrisandro/tailwind-merge-laravel artesaos/seotools $conditional_quiet @@ -380,19 +380,6 @@ fi # Enforce permissions sudo $lara_stacker_dir/scripts/helpers/permit.sh $PROJECTS_DIRECTORY/$escaped_project_name -# ! Currently vulnerable! -# TODO add to the others when stable -# Cypress - -sudo -i -u $USERNAME bash <&1 -else - $BUN add --force --dev cypress 2>&1 >/dev/null -fi -EOF - # * ======================= # * Package Configurations # * ===================== @@ -404,6 +391,29 @@ php artisan migrate $conditional_quiet echo -e "\nRan the migrations initially." >&3 +# Laravel Dusk +php artisan dusk:install $conditional_quiet + +echo -e "\nInstalled Laravel Dusk and its standalone ChromeDriver." >&3 + +if [ "$use_pest" == true ]; then + sed -i'' -e '/use Tests\\TestCase;/a\ +use Tests\\DuskTestCase;' ./tests/Pest.php + sed -i'' -e '/uses(TestCase::class, RefreshDatabase::class)->in('\''Feature'\'');/a\ +uses(DuskTestCase::class, RefreshDatabase::class)->in('\''Browser'\'');' ./tests/Pest.php + sed -i '/function something()/,/}/c\function booleanHead(array $booleanArray): bool\n{\n return filter_var(head($booleanArray), FILTER_VALIDATE_BOOLEAN);\n}' ./tests/Pest.php + + if [ "$is_localized" == true ]; then + sed -i '/use Illuminate\\Foundation\\Testing\\TestCase as BaseTestCase;/a\use Mcamara\\LaravelLocalization\\LaravelLocalization;' ./tests/TestCase.php + sed -i '/use CreatesApplication;/a\ + \n protected function setUp(): void\n {\n parent::setUp();\n\n $this->withoutVite();\n }\n\n protected function tearDown(): void\n {\n putenv(LaravelLocalization::ENV_ROUTE_KEY);\n\n parent::tearDown();\n }\n\n protected function identifyLocalizedRoutesForLocale(string $locale)\n {\n self::tearDown();\n\n putenv(LaravelLocalization::ENV_ROUTE_KEY . \"=\" . $locale);\n\n self::setUp();\n }' ./tests/TestCase.php + fi + + rm ./tests/Browser/Pages/HomePage.php + + echo -e "\nIntegrated Laravel Dusk with Pest and added a helper method!" >&3 +fi + # TaliwindCSS framework mkdir -p ./resources/css/packages @@ -426,11 +436,6 @@ php artisan vendor:publish --provider="TailwindMerge\Laravel\TailwindMergeServic echo -e "\nConfigured TailwindCSS framework and TailwindMerge package." >&3 -# Cypress framework -php artisan cypress:boilerplate $conditional_quiet - -echo -e "\nConfigured front-end testing with Cypress." >&3 - # Laravel Data package php artisan vendor:publish --provider="Spatie\LaravelData\LaravelDataServiceProvider" --tag="data-config" $conditional_quiet diff --git a/scripts/setup.sh b/scripts/setup.sh index 7f0adc4..e9d891c 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -56,6 +56,7 @@ lara_stacker_dir=$PWD source $lara_stacker_dir/.env # Setting the echoing level +conditional_quiet="--quiet" cancel_suppression=false case $LOGGING_LEVEL in # Notifications Only @@ -71,6 +72,7 @@ case $LOGGING_LEVEL in # Everything *) exec 3>&1 + conditional_quiet="" cancel_suppression=true ;; esac @@ -82,11 +84,17 @@ esac # Installing system packages... echo -e "Installing system packages..." >&3 -sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip redis-server npm -y +if $cancel_suppression; then + sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip redis-server npm -y 2>&1 +else + sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip redis-server npm -y 2>&1 >/dev/null +fi sudo sed -i "s~post_max_size = 8M~post_max_size = 100M~g" /etc/php/8.1/apache2/php.ini sudo sed -i "s~upload_max_filesize = 2M~upload_max_filesize = 100M~g" /etc/php/8.1/apache2/php.ini sudo sed -i "s~variables_order = \"GPCS\"~variables_order = \"EGPCS\"~g" /etc/php/8.1/apache2/php.ini +sudo sed -i'' -e 's/zend\.exception_ignore_args\s*=\s*On/zend.exception_ignore_args = Off/' /etc/php/8.1/apache2/php.ini +sudo sed -i'' -e 's/zend\.exception_ignore_args\s*=\s*On/zend.exception_ignore_args = Off/' /etc/php/8.1/cli/php.ini sudo systemctl start apache2 sudo a2enmod rewrite @@ -109,14 +117,26 @@ echo -e "\nSet up permissions in the projects directly permanently." >&3 # media packages echo -e "\nInstalling media packages..." >&3 -sudo apt install php-imagick php-gd ghostscript ffmpeg -y +if $cancel_suppression; then + sudo apt install php-imagick php-gd ghostscript ffmpeg -y 2>&1 +else + sudo apt install php-imagick php-gd ghostscript ffmpeg -y 2>&1 >/dev/null +fi # Xdebug echo -e "\nInstalling PHP Xdebug..." >&3 -sudo apt install php-xdebug -y +if $cancel_suppression; then + sudo apt install php-xdebug -y 2>&1 +else + sudo apt install php-xdebug -y 2>&1 >/dev/null +fi mkdir -p /home/$USERNAME/.config/xdebug +touch /home/$USERNAME/.config/xdebug/xdebug.log + +sudo chown www-data:www-data /home/$USERNAME/.config/xdebug/xdebug.log +sudo chmod 664 /home/$USERNAME/.config/xdebug/xdebug.log sudo sed -i "s~zend_extension=xdebug.so~zend_extension=xdebug.so\n\nxdebug.log=\"/home/$USERNAME/.config/xdebug/xdebug.log\"\nxdebug.log_level=10\nxdebug.mode=develop,debug,coverage\nxdebug.client_port=9003\nxdebug.start_with_request=yes\nxdebug.discover_client_host=true~g" /etc/php/8.1/mods-available/xdebug.ini @@ -124,16 +144,26 @@ sudo $lara_stacker_dir/scripts/helpers/permit.sh /home/$USERNAME/.config/xdebug sudo systemctl restart apache2 -# Cypress.io -echo -e "\nInstalling Cypress.io dependency packages..." >&3 - -sudo apt install libgbm-dev libnotify-dev libgconf-2-4 xvfb -y +# Google Chrome (for Laravel Dusk) +cd /home/$USERNAME/Downloads/ +if $cancel_suppression; then + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 2>&1 + sudo apt install -y ./google-chrome-stable_current_amd64.deb 2>&1 +else + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 2>&1 >/dev/null + sudo apt install -y ./google-chrome-stable_current_amd64.deb 2>&1 >/dev/null +fi +rm google-chrome-stable_current_amd64.deb # Bun echo -e "\nInstalling Bun front-end package manager..." >&3 sudo -i -u $USERNAME bash <&1 +else + curl -fsSL https://bun.sh/install | bash 2>&1 >/dev/null +fi EOF export BUN="/home/$USERNAME/.bun/bin/bun" @@ -152,28 +182,50 @@ echo -e "\nInstalled Graphite version control CLI..." >&3 # Composer (globally) echo -e "\nInstalling composer globally..." >&3 -sudo apt install composer -y +if $cancel_suppression; then + sudo apt install composer -y 2>&1 +else + sudo apt install composer -y 2>&1 >/dev/null +fi echo -e "\nexport PATH=\"\$PATH:/home/$USERNAME/.config/composer/vendor/bin\"" >> /home/$USERNAME/.bashrc # mkcert echo -e "\nInstalling mkcert for SSL generation..." >&3 -sudo apt install mkcert libnss3-tools -y +if $cancel_suppression; then + sudo apt install mkcert libnss3-tools -y 2>&1 +else + sudo apt install mkcert libnss3-tools -y 2>&1 >/dev/null +fi # MySQL echo -e "\nInstalling MySQL and setting the password to the env-file's..." >&3 -sudo apt install mysql-server -y +if $cancel_suppression; then + sudo apt install mysql-server -y 2>&1 +else + sudo apt install mysql-server -y 2>&1 >/dev/null +fi sudo systemctl start mysql sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$DB_PASSWORD';" -sudo apt install php-mysql -y +if $cancel_suppression; then + sudo apt install php-mysql -y 2>&1 +else + sudo apt install php-mysql -y 2>&1 >/dev/null +fi sudo service apache2 restart +# Pest Database +export MYSQL_PWD=password +mysql -u root -e "CREATE DATABASE pest;" + +echo -e "\nCreated a \"Pest\" MySQL database for testing." >&3 + # Mailpit (service) echo -e "\nInstalling Mailpit and setting up a service for it..." >&3 @@ -181,7 +233,11 @@ mkdir /home/$USERNAME/Downloads/mailpit cd /home/$USERNAME/Downloads/mailpit release_url=$(curl -s https://api.github.com/repos/axllent/mailpit/releases/latest | grep "browser_download_url.*mailpit-linux-amd64.tar.gz" | cut -d : -f 2,3 | tr -d \") -curl -L -o mailpit-linux-amd64.tar.gz $release_url +if $cancel_suppression; then + curl -L -o mailpit-linux-amd64.tar.gz $release_url 2>&1 +else + curl -L -o mailpit-linux-amd64.tar.gz $release_url 2>&1 >/dev/null +fi tar -xzf mailpit-linux-amd64.tar.gz sudo chown $USERNAME:$USERNAME mailpit @@ -207,7 +263,11 @@ RestartSec=10 WantedBy=multi-user.target" | sudo tee /etc/systemd/system/mailpit.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable mailpit.service +if $cancel_suppression; then + sudo systemctl enable mailpit.service 2>&1 +else + sudo systemctl enable mailpit.service 2>&1 >/dev/null +fi sudo systemctl start mailpit.service # MinIO (server, client, and service) @@ -216,8 +276,13 @@ echo -e "\nInstalling MinIO and setting up a service for it..." >&3 mkdir /home/$USERNAME/Downloads/minio cd /home/$USERNAME/Downloads/minio -wget https://dl.min.io/server/minio/release/linux-amd64/minio -wget https://dl.min.io/client/mc/release/linux-amd64/mc +if $cancel_suppression; then + wget https://dl.min.io/server/minio/release/linux-amd64/minio 2>&1 + wget https://dl.min.io/client/mc/release/linux-amd64/mc 2>&1 +else + wget https://dl.min.io/server/minio/release/linux-amd64/minio 2>&1 >/dev/null + wget https://dl.min.io/client/mc/release/linux-amd64/mc 2>&1 >/dev/null +fi sudo chown $USERNAME:$USERNAME minio sudo chmod +x minio @@ -251,7 +316,11 @@ RestartSec=10 WantedBy=multi-user.target" | sudo tee /etc/systemd/system/minio.service > /dev/null sudo systemctl daemon-reload -sudo systemctl enable minio.service +if $cancel_suppression; then + sudo systemctl enable minio.service 2>&1 +else + sudo systemctl enable minio.service 2>&1 >/dev/null +fi sudo systemctl start minio.service sleep 5 @@ -265,7 +334,11 @@ if [ -n "$EXPOSE_TOKEN" ]; then echo -e "\nInstalling Expose and setting up its token to be ready to use..." >&3 cd /home/$USERNAME/Downloads - curl https://github.com/beyondcode/expose/raw/master/builds/expose -L --output expose + if $cancel_suppression; then + curl https://github.com/beyondcode/expose/raw/master/builds/expose -L --output expose 2>&1 + else + curl https://github.com/beyondcode/expose/raw/master/builds/expose -L --output expose 2>&1 >/dev/null + fi sudo chown $USERNAME:$USERNAME expose sudo chmod +x expose @@ -299,7 +372,11 @@ EOF # Install Firacode font (if VSC installed) if [[ $USING_VSC == true ]]; then - sudo apt install fonts-firacode -y + if $cancel_suppression; then + sudo apt install fonts-firacode -y 2>&1 + else + sudo apt install fonts-firacode -y 2>&1 >/dev/null + fi echo -e "\nInstalled Firacode font for VSC." >&3 fi @@ -322,6 +399,7 @@ fi # * ====== touch $lara_stacker_dir/done-setup.flag +sudo $lara_stacker_dir/scripts/helpers/permit.sh $lara_stacker_dir/done-setup.flag echo -e "\nSetup done successfully. The following are required:\n" >&3