2026-05-08 10:08:53 +00:00
|
|
|
set shell := ["bash", "-cu"]
|
|
|
|
|
|
|
|
|
|
database_url := "postgres://xtablo:xtablo@localhost:5432/xtablo?sslmode=disable"
|
|
|
|
|
compose_config_dir := ".podman-compose"
|
2026-05-09 18:18:24 +00:00
|
|
|
tailwind_input := "tailwind.input.css"
|
|
|
|
|
tailwind_output := "static/tailwind.css"
|
2026-05-08 10:08:53 +00:00
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
@just --list
|
|
|
|
|
|
2026-05-10 09:23:48 +00:00
|
|
|
build-styles:
|
|
|
|
|
go run ./cmd/buildstyles
|
|
|
|
|
|
2026-05-08 10:08:53 +00:00
|
|
|
compose-config:
|
|
|
|
|
mkdir -p {{compose_config_dir}}
|
|
|
|
|
printf '%s\n' '{"auths":{}}' > {{compose_config_dir}}/config.json
|
|
|
|
|
|
|
|
|
|
machine-up:
|
|
|
|
|
@if command -v podman >/dev/null 2>&1; then \
|
|
|
|
|
if ! podman machine inspect podman-machine-default 2>/dev/null | grep -q '"State": "running"'; then \
|
|
|
|
|
podman machine start podman-machine-default; \
|
|
|
|
|
fi; \
|
|
|
|
|
else \
|
|
|
|
|
echo "podman is required" >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
db-up: machine-up compose-config
|
|
|
|
|
DOCKER_CONFIG="$PWD/{{compose_config_dir}}" podman compose up -d postgres
|
|
|
|
|
|
|
|
|
|
db-down:
|
|
|
|
|
@if command -v podman >/dev/null 2>&1; then \
|
|
|
|
|
DOCKER_CONFIG="$PWD/{{compose_config_dir}}" podman compose down; \
|
|
|
|
|
else \
|
|
|
|
|
echo "podman is required" >&2; \
|
|
|
|
|
exit 1; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
db-reset: compose-config
|
|
|
|
|
just machine-up
|
|
|
|
|
DOCKER_CONFIG="$PWD/{{compose_config_dir}}" podman compose down -v
|
|
|
|
|
DOCKER_CONFIG="$PWD/{{compose_config_dir}}" podman compose up -d postgres
|
|
|
|
|
|
|
|
|
|
db-logs: machine-up compose-config
|
|
|
|
|
DOCKER_CONFIG="$PWD/{{compose_config_dir}}" podman compose logs -f postgres
|
|
|
|
|
|
|
|
|
|
generate:
|
2026-05-10 09:23:48 +00:00
|
|
|
just build-styles
|
2026-05-09 18:18:24 +00:00
|
|
|
pnpm exec tailwindcss -i {{tailwind_input}} -o {{tailwind_output}} --cwd .
|
2026-05-10 09:23:48 +00:00
|
|
|
go run github.com/a-h/templ/cmd/templ@v0.3.1020 generate
|
2026-05-08 10:08:53 +00:00
|
|
|
go run github.com/sqlc-dev/sqlc/cmd/sqlc@v1.31.1 generate
|
|
|
|
|
|
2026-05-09 18:18:24 +00:00
|
|
|
design-system:
|
|
|
|
|
just generate
|
|
|
|
|
go run ./cmd/designsystem
|
|
|
|
|
|
|
|
|
|
css-watch:
|
|
|
|
|
pnpm exec tailwindcss -i {{tailwind_input}} -o {{tailwind_output}} --cwd . --watch
|
|
|
|
|
|
2026-05-08 10:08:53 +00:00
|
|
|
fmt:
|
|
|
|
|
gofmt -w .
|
|
|
|
|
|
|
|
|
|
test:
|
2026-05-10 09:23:48 +00:00
|
|
|
just build-styles
|
2026-05-08 10:08:53 +00:00
|
|
|
go test ./...
|
|
|
|
|
|
|
|
|
|
build:
|
2026-05-10 09:23:48 +00:00
|
|
|
just build-styles
|
2026-05-09 18:18:24 +00:00
|
|
|
pnpm exec tailwindcss -i {{tailwind_input}} -o {{tailwind_output}} --cwd .
|
2026-05-08 10:08:53 +00:00
|
|
|
go build ./...
|
|
|
|
|
|
|
|
|
|
check: generate test build
|
|
|
|
|
|
|
|
|
|
dev: db-up
|
2026-05-10 09:23:48 +00:00
|
|
|
just build-styles
|
2026-05-09 18:18:24 +00:00
|
|
|
pnpm exec tailwindcss -i {{tailwind_input}} -o {{tailwind_output}} --cwd .
|
2026-05-08 10:08:53 +00:00
|
|
|
DATABASE_URL='{{database_url}}' air -c .air.toml
|
|
|
|
|
|
|
|
|
|
run: db-up
|
2026-05-10 09:23:48 +00:00
|
|
|
just build-styles
|
2026-05-09 18:18:24 +00:00
|
|
|
pnpm exec tailwindcss -i {{tailwind_input}} -o {{tailwind_output}} --cwd .
|
2026-05-08 10:08:53 +00:00
|
|
|
DATABASE_URL='{{database_url}}' go run .
|