-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-shadcn.sh
59 lines (49 loc) · 2.35 KB
/
install-shadcn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
DEFAULT_URL=https://raw.githubusercontent.com/marcio4ugusto/laravel-starter-kit/main/stubs/default
SHAD_URL=https://raw.githubusercontent.com/marcio4ugusto/laravel-starter-kit/main/stubs/shadcn
echo "Starting copy files for the starter kit..."
# installing inertia and ziggy
composer require inertiajs/inertia-laravel
composer require tightenco/ziggy
# create the main template
rm resources/views/welcome.blade.php
curl -o ./resources/views/app.blade.php $DEFAULT_URL/resources/views/app.blade.php
# publishing inertia middleware:
php artisan inertia:middleware
# activate the middleware stubs/bootstrap/app.php
curl $DEFAULT_URL/bootstrap/app.php > ./bootstrap/app.php
# copy stubs
curl $DEFAULT_URL/vite.config.js > ./vite.config.js
curl -o ./tsconfig.json $DEFAULT_URL/tsconfig.json
curl -o ./tailwind.config.js $DEFAULT_URL/tailwind.config.js
curl -o ./postcss.config.js $DEFAULT_URL/postcss.config.js
curl $DEFAULT_URL/package.json > ./package.json
curl $DEFAULT_URL/.gitignore > ./.gitignore
curl -o ./.eslintrc.json $DEFAULT_URL/.eslintrc.json
curl $DEFAULT_URL/editorconfig > ./editorconfig
curl $DEFAULT_URL/routes/web.php > ./routes/web.php
rm ./resources/js/app.js
rm ./resources/js/bootstrap.js
curl -o ./resources/js/app.tsx $DEFAULT_URL/resources/js/app.tsx
mkdir -p ./resources/js/types
curl -o ./resources/js/types/global.d.ts $DEFAULT_URL/resources/js/types/global.d.ts
curl -o ./resources/js/types/index.d.ts $DEFAULT_URL/resources/js/types/index.d.ts
curl -o ./resources/js/types/vite-env.d.ts $DEFAULT_URL/resources/js/types/vite-env.d.ts
mkdir -p ./resources/js/pages
curl -o ./resources/js/pages/Welcome.tsx $DEFAULT_URL/resources/js/pages/Welcome.tsx
mkdir -p ./resources/js/components
curl $DEFAULT_URL/resources/css/app.css > ./resources/css/app.css
curl $DEFAULT_URL/app/Http/Middleware/HandleInertiaRequests.php > ./app/Http/Middleware/HandleInertiaRequests.php
# copy stubs
curl $SHAD_URL/tailwind.config.js > ./tailwind.config.js
curl $SHAD_URL/package.json > ./package.json
curl -o components.json $SHAD_URL/components.json
curl $SHAD_URL/resources/js/pages/Welcome.tsx > ./resources/js/pages/Welcome.tsx
mkdir -p ./resources/js/lib
curl -o ./resources/js/lib/utils.ts $SHAD_URL/resources/js/lib/utils.ts
# install npm dependencies
npm install
echo "DONE!"
echo " "
echo "run \`php artisan serve\` and \`npm run dev\`"
echo "access \`localhost:8000\`"