Skip to content

Commit 3785e0d

Browse files
committed
v2.5.0
- 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
1 parent 474c32c commit 3785e0d

File tree

7 files changed

+173
-14
lines changed

7 files changed

+173
-14
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the
2929
- [php](https://www.php.net/)
3030
- [apache2](https://httpd.apache.org/)
3131
- [composer](https://getcomposer.org/)
32+
- [sqlite3](https://www.sqlite.org/index.html)
3233
- [libnss3-tools](https://packages.ubuntu.com/focal/libnss3-tools)
3334
- [libgbm-dev](https://packages.debian.org/sid/libgbm-dev)
3435
- [libnotify-dev](https://packages.debian.org/sid/libnotify-dev)
@@ -122,16 +123,17 @@ This way, I don't have to worry about the things I've mentioned, plus I gain the
122123
- [Graphite](https://graphite.dev/)
123124

124125
- Essentials
126+
- [tippy.js](https://atomiks.github.io/tippyjs/)
125127
- [laravel-wave](https://github.com/qruto/laravel-wave)
128+
- [@formkit/auto-animate](https://github.com/formkit/auto-animate)
129+
- [motion](https://github.com/motiondivision/motionone)
130+
- [@tailwindcss/container-queries](https://github.com/tailwindlabs/tailwindcss-container-queries)
126131
- [tailwindcss](https://tailwindcss.com/) [Dev]
127132
- [postcss](https://github.com/postcss/postcss) [Dev]
128133
- [autoprefixer](https://github.com/postcss/autoprefixer) [Dev]
129-
- [@formkit/auto-animate](https://github.com/formkit/auto-animate) [Dev]
130134
- [@tailwindcss/typography](https://tailwindcss.com/docs/typography-plugin) [Dev]
131135
- [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) [Dev]
132136
- [@tailwindcss/aspect-ratio](https://github.com/tailwindlabs/tailwindcss-aspect-ratio) [Dev]
133-
- [@tailwindcss/container-queries](https://github.com/tailwindlabs/tailwindcss-container-queries) [Dev]
134-
- [tippy.js](https://atomiks.github.io/tippyjs/) [Dev]
135137
- [Option] TALL Stack
136138
- [alpinejs](https://alpinejs.dev/) (Already included in Livewire now!)
137139
- [@alpinejs/mask](https://alpinejs.dev/plugins/mask)

files/_stubs/tall/resources/views/components/app.blade.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ class="h-full min-h-screen w-full antialiased"
7676
>
7777
<link
7878
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"
79-
rel="stylesheet"
79+
rel="preload"
80+
as="style"
81+
onload="this.onload=null; this.rel='stylesheet';"
8082
>
8183
@stack('fonts')
8284

files/_stubs/tall/resources/views/components/localized-app.blade.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ class="h-full min-h-screen w-full antialiased"
7878
>
7979
<link
8080
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"
81-
rel="stylesheet"
81+
rel="preload"
82+
as="style"
83+
onload="this.onload=null; this.rel='stylesheet';"
8284
>
8385
<link
8486
href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap"
85-
rel="stylesheet"
87+
rel="preload"
88+
as="style"
89+
onload="this.onload=null; this.rel='stylesheet';"
8690
>
8791
@stack('fonts')
8892

lara-stacker.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ SCRIPTS=(
5252
"./scripts/setup.sh"
5353
"./scripts/list.sh"
5454
"./scripts/create.sh"
55+
"./scripts/create_raw.sh"
5556
"./scripts/delete.sh"
5657
"./scripts/update.sh"
5758
"./scripts/helpers/permit.sh"
@@ -120,15 +121,15 @@ while true; do
120121

121122
echo -e "Available Operations:\n"
122123

123-
options=("1. List Projects" "2. Create Project" "3. Delete Project" "4. Exit")
124+
options=("1. List Projects" "2. Create Project" "3. Create Raw Project" "4. Delete Project" "5. Exit")
124125

125126
# Conditional options
126127
if [[ -f "/tmp/updated-lara-stacker.flag" ]]; then
127128
rm /tmp/updated-lara-stacker.flag
128129
update_available=false
129130
fi
130131
if [ "$update_available" == true ]; then
131-
options+=("5. Download Updates")
132+
options+=("6. Download Updates")
132133
fi
133134
if [[ ! -f "$lara_stacker_dir/done-setup.flag" ]]; then
134135
options+=("0. Initial Setup")
@@ -164,13 +165,16 @@ while true; do
164165
sudo RAN_MAIN_SCRIPT="true" ./scripts/create.sh
165166
;;
166167
3)
167-
sudo RAN_MAIN_SCRIPT="true" ./scripts/delete.sh
168+
sudo RAN_MAIN_SCRIPT="true" ./scripts/create_raw.sh
168169
;;
169170
4)
171+
sudo RAN_MAIN_SCRIPT="true" ./scripts/delete.sh
172+
;;
173+
5)
170174
echo -e "\nExiting Lara-Stacker...\n"
171175
exit 0
172176
;;
173-
5)
177+
6)
174178
if [ "$update_available" == false ]; then
175179
prompt "-=|[ Lara-Stacker [$current_version] ]|=-" "Invalid option! Please type one the of digits in the list..." false false
176180
else

scripts/create.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,9 @@ fi
372372

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

380380
# Enforce permissions

scripts/create_raw.sh

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#!/bin/bash
2+
3+
clear
4+
5+
# Status indicator
6+
echo -e "-=|[ Lara-Stacker |> CREATE RAW ]|=-\n"
7+
8+
# * ===========
9+
# * Validation
10+
# * =========
11+
12+
# Check if prompt function exists and source it
13+
function_path="./scripts/functions/prompt.sh"
14+
if [[ ! -f $function_path ]]; then
15+
echo -e "Error: Working directory isn't the script's main.\n"
16+
17+
echo -e "Tip: Maybe run [cd ~/Downloads/lara-stacker/ && sudo ./lara-stacker.sh] commands.\n"
18+
19+
echo -n "Press any key to exit..."
20+
read whatever
21+
22+
clear
23+
exit 1
24+
fi
25+
source $function_path
26+
27+
# Ensure the script isn't ran directly
28+
if [[ -z "$RAN_MAIN_SCRIPT" ]]; then
29+
prompt "Aborted for direct execution flow." "Please use the main [lara-stacker.sh] script." true false
30+
fi
31+
32+
# Confirm if setup script isn't run
33+
if [ ! -e "$PWD/done-setup.flag" ]; then
34+
echo -n "Setup script isn't run yet. Are you sure you want to continue? (y/n) "
35+
read confirmation
36+
37+
case "$confirmation" in
38+
n|N|no|No|NO|nope|Nope|NOPE)
39+
echo -e "\nAborting...\n"
40+
41+
echo -n "Press any key to continue..."
42+
read whatever
43+
44+
clear
45+
exit 1
46+
;;
47+
esac
48+
fi
49+
50+
# * ============
51+
# * Preparation
52+
# * ==========
53+
54+
# Get environment variables and defaults
55+
lara_stacker_dir=$PWD
56+
source $lara_stacker_dir/.env
57+
58+
# Setting the echoing level
59+
conditional_quiet="--quiet"
60+
cancel_suppression=false
61+
case $LOGGING_LEVEL in
62+
# Notifications Only
63+
1)
64+
exec 3>&1
65+
exec > /dev/null 2>&1
66+
;;
67+
# Notifications + Errors + Warnings
68+
2)
69+
exec 3>&1
70+
exec > /dev/null
71+
;;
72+
# Everything
73+
*)
74+
exec 3>&1
75+
conditional_quiet=""
76+
cancel_suppression=true
77+
;;
78+
esac
79+
80+
# * =================
81+
# * Collecting Input
82+
# * ===============
83+
84+
# Get the project path from the user
85+
echo -ne "Enter the full project path (e.g., /home/$USERNAME/Code/my_project): " >&3
86+
read full_directory
87+
88+
full_directory="${full_directory%/}"
89+
project_path=$(dirname "$full_directory")
90+
project_name=$(basename "$full_directory")
91+
92+
# Cancel if the project path directory doesn't exists
93+
if [ ! -d "$project_path" ]; then
94+
prompt "\nThe project containing path doesn't exist!" "Raw project creation cancelled."
95+
fi
96+
97+
# Cancel if the project directory already exists
98+
if [ -d "$project_path/$project_name" ]; then
99+
prompt "\nProject folder already exist within the previously given path!" "Raw project creation cancelled."
100+
fi
101+
102+
# * =================
103+
# * Project Creation
104+
# * ===============
105+
106+
# Create the Laravel raw project in the provided path and folder
107+
echo -e "\nInstalling the project via Composer..." >&3
108+
109+
cd $project_path/
110+
composer create-project --prefer-dist laravel/laravel $project_name -n $conditional_quiet
111+
112+
# Enforce permissions
113+
sudo $lara_stacker_dir/scripts/helpers/permit.sh $project_path/$project_name
114+
115+
cd $project_path/$project_name
116+
117+
sed -i "s/APP_NAME=Laravel/APP_NAME=\"$project_name\"/g" ./.env
118+
119+
echo -e "\nCreated and named the raw Laravel application." >&3
120+
121+
# Set up launch.json for debugging (Xdebug)
122+
mkdir $project_path/$project_name/.vscode
123+
cd $project_path/$project_name/.vscode
124+
125+
sudo cp $lara_stacker_dir/files/.vscode/launch.json ./
126+
127+
sed -i "s~\[projectsDirectory\]~$project_path~g" ./launch.json
128+
sed -i "s~\[projectName\]~$project_name~g" ./launch.json
129+
130+
echo -e "\nConfigured VSC debug settings for Xdebug support." >&3
131+
132+
# * ========
133+
# * The End
134+
# * ======
135+
136+
# Enforce permissions
137+
sudo $lara_stacker_dir/scripts/helpers/permit.sh $project_path/$project_name
138+
139+
echo -e "\nUpdated directory and file permissions all around." >&3
140+
141+
# Display a success message
142+
echo -e "\nRaw project created successfully! Run [art serve] from within its directory for launch.\n" >&3
143+
144+
echo -n "Press any key to continue..." >&3
145+
read whatever
146+
147+
clear >&3

scripts/setup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ esac
8585
echo -e "Installing system packages..." >&3
8686

8787
if $cancel_suppression; then
88-
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip redis-server npm -y 2>&1
88+
sudo apt install git curl php apache2 php-curl php-xml php-dom php-bcmath php-zip sqlite3 redis-server npm -y 2>&1
8989
else
90-
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
90+
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
9191
fi
9292

9393
sudo sed -i "s~post_max_size = 8M~post_max_size = 100M~g" /etc/php/8.1/apache2/php.ini

0 commit comments

Comments
 (0)