0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-04 19:52:50 +01:00

Created Makefile and .gitgnore, updated deps

This commit is contained in:
Benedikt Wildenhain 2024-10-27 14:15:00 +01:00
parent a61f03f412
commit 55fe51fa44
No known key found for this signature in database
GPG key ID: 78C1F1FE48CA7604
4 changed files with 3835 additions and 4584 deletions

12
.gitignore vendored Normal file
View file

@ -0,0 +1,12 @@
Cargo.lock
Cargo.toml
astro.config.mjs
backend-deps
build
frontend
frontend-deps
package.json
pnpm-lock.yaml
src
tailwind.config.cjs
tsconfig.json

43
Makefile Normal file
View file

@ -0,0 +1,43 @@
TARGET_DIR = ./build
BACKEND_EXECUTABLE = simple-wkd
FRONTEND_DIST = dist
ASSETS_DIR = assets/webpage
BACKEND_FILES=backend/Cargo.toml backend/src/*
WEBSITE_FILES=website/*
# Phony targets to ensure they are always executed
.PHONY: all backend frontend
# Main target to build both backend and frontend
all: backend frontend
# Target to install dependencies for the backend
backend-deps:
if [ ! -f /usr/bin/clang -o ! -f /usr/bin/lld -o ! -f /usr/bin/cargo ]; then sudo apt install -y clang lld cargo; fi
touch $@
# Target to build the backend using Cargo
backend:
@echo "Building backend..."
cp -R backend/* .
cargo build --release --target-dir $(TARGET_DIR)
mv $(TARGET_DIR)/release/$(BACKEND_EXECUTABLE) $(BACKEND_EXECUTABLE)-executable
touch $@
# Target to install dependencies for the frontend
frontend-deps:
sudo apt install -y npm
if [ ! -f /usr/bin/node ]; then sudo apt install -y npm; fi
touch $@
# Target to build the frontend using pnpm
frontend: frontend-deps $(WEBSITE_FILES)
@echo "Building frontend..."
cp -R website/* .
[ ! -f /usr/bin/pnpm -a ! -f /usr/local/bin/pnpm ] && sudo npm install -g pnpm
pnpm install
pnpm astro telemetry disable
pnpm run build
mv $(FRONTEND_DIST) $(ASSETS_DIR)
touch $@

View file

@ -10,15 +10,15 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/tailwind": "^3.1.1",
"@tailwindcss/forms": "^0.5.3",
"astro": "^2.3.0",
"astro-critters": "^1.1.31",
"tailwindcss": "^3.0.24"
"@astrojs/tailwind": "^5.1.2",
"@tailwindcss/forms": "^0.5.9",
"astro": "^4.16.7",
"astro-critters": "^2.2.0",
"tailwindcss": "^3.4.14"
},
"devDependencies": {
"prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0",
"prettier-plugin-tailwindcss": "^0.2.7"
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.8"
}
}

File diff suppressed because it is too large Load diff