From 19ae834c99bdd5c488bad16a4ee35b6721d16ea7 Mon Sep 17 00:00:00 2001 From: despiegk Date: Sun, 11 May 2025 12:21:53 +0300 Subject: [PATCH] ... --- install.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ run.sh | 7 ++++++ 2 files changed, 71 insertions(+) create mode 100755 install.sh create mode 100755 run.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..5fa1c80 --- /dev/null +++ b/install.sh @@ -0,0 +1,64 @@ +#!/bin/bash -ex + +# Change to the directory at the top +cd "$(dirname "$0")" + +# Check if Bun is installed +if ! command -v bun &> /dev/null +then + echo "Bun not found, installing..." + curl -fsSL https://bun.sh/install | bash + # Add bun to PATH for the current session + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" +else + echo "Bun is already installed." +fi + +# Install Svelte with Bun and Vite +echo "Installing Svelte with Bun and Vite..." +bun create vite my-svelte-app --template svelte-ts + +# Change into the new app directory +cd my-svelte-app + +# Install dependencies +bun install + +# Install Tailwind CSS and dependencies +echo "Installing Tailwind CSS and dependencies..." +bun add -D tailwindcss postcss autoprefixer + +# Initialize Tailwind CSS +echo "Initializing Tailwind CSS..." +bunx tailwindcss init -p + +# Configure Tailwind CSS +echo "Configuring Tailwind CSS..." +# Modify tailwind.config.js +cat << EOF > tailwind.config.js +/** @type {import('tailwindcss').Config} */ +export default { + content: [ + './src/**/*.{html,js,svelte,ts}', + ], + theme: { + extend: {}, + }, + plugins: [], +} +EOF + +# Add Tailwind directives to app.css +echo "Adding Tailwind directives to app.css..." +cat << EOF > src/app.css +@tailwind base; +@tailwind components; +@tailwind utilities; + +$(cat src/app.css) +EOF + +# Install Shadcn for Svelte +echo "Installing Shadcn for Svelte..." +bunx shadcn-svelte init --style default --base-color slate --css src/app.css --tailwind-config tailwind.config.js \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..54c03b7 --- /dev/null +++ b/run.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# Change to the Svelte app directory +cd my-svelte-app + +# Run the development server +bun run dev \ No newline at end of file