mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-12-05 02:52:50 +01:00
Created Makefile and .gitgnore, updated deps
This commit is contained in:
parent
a61f03f412
commit
55fe51fa44
4 changed files with 3835 additions and 4584 deletions
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal 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
43
Makefile
Normal 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 $@
|
|
@ -10,15 +10,15 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/tailwind": "^3.1.1",
|
"@astrojs/tailwind": "^5.1.2",
|
||||||
"@tailwindcss/forms": "^0.5.3",
|
"@tailwindcss/forms": "^0.5.9",
|
||||||
"astro": "^2.3.0",
|
"astro": "^4.16.7",
|
||||||
"astro-critters": "^1.1.31",
|
"astro-critters": "^2.2.0",
|
||||||
"tailwindcss": "^3.0.24"
|
"tailwindcss": "^3.4.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^3.3.3",
|
||||||
"prettier-plugin-astro": "^0.8.0",
|
"prettier-plugin-astro": "^0.14.1",
|
||||||
"prettier-plugin-tailwindcss": "^0.2.7"
|
"prettier-plugin-tailwindcss": "^0.6.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue