Files
YANPM/justfile
GW_MC 5668f465bb
All checks were successful
Test / test-frontend (pull_request) Successful in 23s
Test / frontend-build (pull_request) Successful in 26s
Verify / verify-generated-code (pull_request) Successful in 53s
Verify / verify-openapi-spec (pull_request) Successful in 6s
Test / test (pull_request) Successful in 1m15s
Test / lint (pull_request) Successful in 1m13s
Verify / verify-frontend-api-client (pull_request) Successful in 8s
feat: add initial documentation and setup files for YANPM
2025-12-05 21:09:58 +08:00

73 lines
1.8 KiB
Makefile

set dotenv-load := true
# development environment file
set dotenv-filename := "./public/database/.env.generated"
cli *args:
cd apps/cli && \
if [ -n "{{args}}" ]; then \
cargo run -- {{args}}; \
else \
cargo run; \
fi
simulate *args:
cd apps/container && \
if [ -n "{{args}}" ]; then \
cargo run --bin container-simulate -- --db-type={{args}}; \
else \
cargo run --bin container-simulate; \
fi
# Usage: (following SeaORM migration commands)
# init: Initialize migration directory
# generate: Generate a new migration file
# up: Apply all pending migrations
# up -n 10: Apply 10 pending migrations
# down: Rollback last applied migration
# down -n 10: Rollback last 10 applied migrations
# status: Check the status of all migrations
# fresh: Drop all tables from the database, then reapply all migrations
# refresh: Rollback all applied migrations, then reapply all migrations
# reset: Rollback all applied migrations
migrate *args:
cd public/migration && \
if [ -n "{{args}}" ]; then \
cargo run -- {{args}}; \
else \
cargo run; \
fi
generate-entity:
# delegate to cli
just cli db:migrate_and_generate --output-path ../../public/database/src/generated/entities
generate-openapi:
# Generate OpenAPI spec
cd apps/api && \
cargo run -- generate:openapi --output-path ./swagger.json
# Generate API client for frontend
cd apps/frontend && \
pnpm generate:openapi
generate-all: generate-entity generate-openapi
build-frontend:
# build frontend assets
cd apps/frontend && \
pnpm build
build-backend:
# build backend server
cd apps/api && \
cargo build --release
build-apps: build-frontend build-backend
act *args:
if [ -n "{{args}}" ]; then \
act {{args}} --artifact-server-path /tmp/artifacts; \
else \
act; \
fi