Skip to content

Commit

Permalink
v2.5.0
Browse files Browse the repository at this point in the history
- Added the ability to raw-create projects without a single modification
- Added SQlite installation during setup script
- Updated [./README.md]
- Added motion to be installed to front-end packages
- Fixed fonts preloading issue
  • Loading branch information
GoodM4ven committed Oct 18, 2023
1 parent 474c32c commit 3785e0d
Show file tree
Hide file tree
Showing 7 changed files with 173 additions and 14 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the
- [php](https://www.php.net/)
- [apache2](https://httpd.apache.org/)
- [composer](https://getcomposer.org/)
- [sqlite3](https://www.sqlite.org/index.html)
- [libnss3-tools](https://packages.ubuntu.com/focal/libnss3-tools)
- [libgbm-dev](https://packages.debian.org/sid/libgbm-dev)
- [libnotify-dev](https://packages.debian.org/sid/libnotify-dev)
Expand Down Expand Up @@ -122,16 +123,17 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the
- [Graphite](https://graphite.dev/)

- Essentials
- [tippy.js](https://atomiks.github.io/tippyjs/)
- [laravel-wave](https://github.com/qruto/laravel-wave)
- [@formkit/auto-animate](https://github.com/formkit/auto-animate)
- [motion](https://github.com/motiondivision/motionone)
- [@tailwindcss/container-queries](https://github.com/tailwindlabs/tailwindcss-container-queries)
- [tailwindcss](https://tailwindcss.com/) [Dev]
- [postcss](https://github.com/postcss/postcss) [Dev]
- [autoprefixer](https://github.com/postcss/autoprefixer) [Dev]
- [@formkit/auto-animate](https://github.com/formkit/auto-animate) [Dev]
- [@tailwindcss/typography](https://tailwindcss.com/docs/typography-plugin) [Dev]
- [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) [Dev]
- [@tailwindcss/aspect-ratio](https://github.com/tailwindlabs/tailwindcss-aspect-ratio) [Dev]
- [@tailwindcss/container-queries](https://github.com/tailwindlabs/tailwindcss-container-queries) [Dev]
- [tippy.js](https://atomiks.github.io/tippyjs/) [Dev]
- [Option] TALL Stack
- [alpinejs](https://alpinejs.dev/) (Already included in Livewire now!)
- [@alpinejs/mask](https://alpinejs.dev/plugins/mask)
Expand Down
4 changes: 3 additions & 1 deletion files/_stubs/tall/resources/views/components/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class="h-full min-h-screen w-full antialiased"
>
<link
href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"
rel="stylesheet"
rel="preload"
as="style"
onload="this.onload=null; this.rel='stylesheet';"
>
@stack('fonts')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,15 @@ class="h-full min-h-screen w-full antialiased"
>
<link
href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"
rel="stylesheet"
rel="preload"
as="style"
onload="this.onload=null; this.rel='stylesheet';"
>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
rel="preload"
as="style"
onload="this.onload=null; this.rel='stylesheet';"
>
@stack('fonts')

Expand Down
12 changes: 8 additions & 4 deletions lara-stacker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ SCRIPTS=(
"./scripts/setup.sh"
"./scripts/list.sh"
"./scripts/create.sh"
"./scripts/create_raw.sh"
"./scripts/delete.sh"
"./scripts/update.sh"
"./scripts/helpers/permit.sh"
Expand Down Expand Up @@ -120,15 +121,15 @@ while true; do

echo -e "Available Operations:\n"

options=("1. List Projects" "2. Create Project" "3. Delete Project" "4. Exit")
options=("1. List Projects" "2. Create Project" "3. Create Raw Project" "4. Delete Project" "5. Exit")

# Conditional options
if [[ -f "/tmp/updated-lara-stacker.flag" ]]; then
rm /tmp/updated-lara-stacker.flag
update_available=false
fi
if [ "$update_available" == true ]; then
options+=("5. Download Updates")
options+=("6. Download Updates")
fi
if [[ ! -f "$lara_stacker_dir/done-setup.flag" ]]; then
options+=("0. Initial Setup")
Expand Down Expand Up @@ -164,13 +165,16 @@ while true; do
sudo RAN_MAIN_SCRIPT="true" ./scripts/create.sh
;;
3)
sudo RAN_MAIN_SCRIPT="true" ./scripts/delete.sh
sudo RAN_MAIN_SCRIPT="true" ./scripts/create_raw.sh
;;
4)
sudo RAN_MAIN_SCRIPT="true" ./scripts/delete.sh
;;
5)
echo -e "\nExiting Lara-Stacker...\n"
exit 0
;;
5)
6)
if [ "$update_available" == false ]; then
prompt "-=|[ Lara-Stacker [$current_version] ]|=-" "Invalid option! Please type one the of digits in the list..." false false
else
Expand Down
4 changes: 2 additions & 2 deletions scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ fi

# Packages...
if $cancel_suppression; then
$BUN add @tailwindcss/container-queries tippy.js laravel-wave @formkit/auto-animate 2>&1
$BUN add @tailwindcss/container-queries tippy.js laravel-wave @formkit/auto-animate motion 2>&1
else
$BUN add @tailwindcss/container-queries tippy.js laravel-wave @formkit/auto-animate 2>&1 >/dev/null
$BUN add @tailwindcss/container-queries tippy.js laravel-wave @formkit/auto-animate motion 2>&1 >/dev/null
fi

# Enforce permissions
Expand Down
147 changes: 147 additions & 0 deletions scripts/create_raw.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#!/bin/bash

clear

# Status indicator
echo -e "-=|[ Lara-Stacker |> CREATE RAW ]|=-\n"

# * ===========
# * Validation
# * =========

# Check if prompt function exists and source it
function_path="./scripts/functions/prompt.sh"
if [[ ! -f $function_path ]]; then
echo -e "Error: Working directory isn't the script's main.\n"

echo -e "Tip: Maybe run [cd ~/Downloads/lara-stacker/ && sudo ./lara-stacker.sh] commands.\n"

echo -n "Press any key to exit..."
read whatever

clear
exit 1
fi
source $function_path

# Ensure the script isn't ran directly
if [[ -z "$RAN_MAIN_SCRIPT" ]]; then
prompt "Aborted for direct execution flow." "Please use the main [lara-stacker.sh] script." true false
fi

# Confirm if setup script isn't run
if [ ! -e "$PWD/done-setup.flag" ]; then
echo -n "Setup script isn't run yet. Are you sure you want to continue? (y/n) "
read confirmation

case "$confirmation" in
n|N|no|No|NO|nope|Nope|NOPE)
echo -e "\nAborting...\n"

echo -n "Press any key to continue..."
read whatever

clear
exit 1
;;
esac
fi

# * ============
# * Preparation
# * ==========

# Get environment variables and defaults
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
1)
exec 3>&1
exec > /dev/null 2>&1
;;
# Notifications + Errors + Warnings
2)
exec 3>&1
exec > /dev/null
;;
# Everything
*)
exec 3>&1
conditional_quiet=""
cancel_suppression=true
;;
esac

# * =================
# * Collecting Input
# * ===============

# Get the project path from the user
echo -ne "Enter the full project path (e.g., /home/$USERNAME/Code/my_project): " >&3
read full_directory

full_directory="${full_directory%/}"
project_path=$(dirname "$full_directory")
project_name=$(basename "$full_directory")

# Cancel if the project path directory doesn't exists
if [ ! -d "$project_path" ]; then
prompt "\nThe project containing path doesn't exist!" "Raw project creation cancelled."
fi

# Cancel if the project directory already exists
if [ -d "$project_path/$project_name" ]; then
prompt "\nProject folder already exist within the previously given path!" "Raw project creation cancelled."
fi

# * =================
# * Project Creation
# * ===============

# Create the Laravel raw project in the provided path and folder
echo -e "\nInstalling the project via Composer..." >&3

cd $project_path/
composer create-project --prefer-dist laravel/laravel $project_name -n $conditional_quiet

# Enforce permissions
sudo $lara_stacker_dir/scripts/helpers/permit.sh $project_path/$project_name

cd $project_path/$project_name

sed -i "s/APP_NAME=Laravel/APP_NAME=\"$project_name\"/g" ./.env

echo -e "\nCreated and named the raw Laravel application." >&3

# Set up launch.json for debugging (Xdebug)
mkdir $project_path/$project_name/.vscode
cd $project_path/$project_name/.vscode

sudo cp $lara_stacker_dir/files/.vscode/launch.json ./

sed -i "s~\[projectsDirectory\]~$project_path~g" ./launch.json
sed -i "s~\[projectName\]~$project_name~g" ./launch.json

echo -e "\nConfigured VSC debug settings for Xdebug support." >&3

# * ========
# * The End
# * ======

# Enforce permissions
sudo $lara_stacker_dir/scripts/helpers/permit.sh $project_path/$project_name

echo -e "\nUpdated directory and file permissions all around." >&3

# Display a success message
echo -e "\nRaw project created successfully! Run [art serve] from within its directory for launch.\n" >&3

echo -n "Press any key to continue..." >&3
read whatever

clear >&3
4 changes: 2 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ esac
echo -e "Installing system packages..." >&3

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
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 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
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 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
Expand Down

0 comments on commit 3785e0d

Please sign in to comment.