chore(*): adopt project templates
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
.svelte-kit
|
||||
build
|
||||
.env
|
||||
.env.*
|
||||
@@ -0,0 +1,2 @@
|
||||
PUBLIC_API_BASE_URL=/api
|
||||
ALLOWED_HOSTS=
|
||||
@@ -0,0 +1,6 @@
|
||||
## Checking commands
|
||||
After writing code, always run from `frontend/`:
|
||||
```shell
|
||||
bun fix
|
||||
bun check
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
COMPOSE := cd .. && docker compose
|
||||
changed = ! git diff --quiet $(1) -- $(2) 2>/dev/null
|
||||
stamp = { git update-ref $(1) HEAD 2>/dev/null || true; }
|
||||
|
||||
.PHONY: fmt check build pre-deploy post-deploy dev
|
||||
|
||||
fmt:
|
||||
bun run fix
|
||||
|
||||
check:
|
||||
bun run check
|
||||
bun run lint
|
||||
|
||||
build:
|
||||
$(COMPOSE) run --rm frontend-dev sh -c "bun install && bun run build"
|
||||
|
||||
pre-deploy:
|
||||
@if $(call changed,refs/deploy/frontend,.) || ! test -d build; then \
|
||||
$(MAKE) build && $(call stamp,refs/deploy/frontend); \
|
||||
fi
|
||||
|
||||
post-deploy:
|
||||
@:
|
||||
|
||||
dev:
|
||||
bun run dev
|
||||
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
frontend-dev:
|
||||
networks:
|
||||
default: {}
|
||||
caddy:
|
||||
aliases:
|
||||
- beavergram-frontend
|
||||
|
||||
networks:
|
||||
caddy:
|
||||
external: true
|
||||
@@ -0,0 +1,22 @@
|
||||
services:
|
||||
frontend-dev:
|
||||
image: oven/bun:alpine
|
||||
profiles: [frontend-dev]
|
||||
restart: unless-stopped
|
||||
working_dir: /app
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
- path: frontend/.env
|
||||
required: false
|
||||
environment:
|
||||
API_PROXY_TARGET: http://api:8080
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- frontend_node_modules:/app/node_modules
|
||||
- frontend_svelte_kit:/app/.svelte-kit
|
||||
command: [sh, -c, "bun install && bun run dev --host 0.0.0.0 --port 3000"]
|
||||
|
||||
volumes:
|
||||
frontend_node_modules:
|
||||
frontend_svelte_kit:
|
||||
Reference in New Issue
Block a user