-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
157 lines (109 loc) · 3.56 KB
/
justfile
File metadata and controls
157 lines (109 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
set export
APP_VERSION := env_var_or_default("APP_VERSION", "local")
run-backend:
cd backend && bun dev
watch-backend:
cd backend && APP_ENV=development bun watch-dev
watch-frontend:
cd frontend && bun devhost
run-frontend-expose:
cd frontend && bun devhost
dev-deps:
pipx install just.sh
deps:
just deps-frozen-ci
install-deps:
bun install
deps-frozen-ci:
bun install --frozen-lockfile --ignore-scripts --verbose
build-backend-docker:
docker build --build-arg VERSION=$APP_VERSION --target backend -t list-backend .
build-backend-docker-ci:
docker buildx build --progress=plain --target backend -t list-backend --output type=image,push-by-digest=true,oci-mediatypes=true --cache-to type=gha,mode=max --cache-from type=gha --build-arg VERSION=$APP_VERSION .
build-frontend-docker:
docker build --target frontend -t list-frontend .
build-frontend: deps
cd frontend && bun run build
deploy-backend:
flyctl deploy -c backend.fly.toml --local-only
deploy-llm env="prod":
flyctl deploy -c listable-$env-llm.fly.toml
deploy-backend-ci sha:
flyctl deploy -c backend.fly.toml --image registry.fly.io/listable-prod:$sha
deploy-frontend:
cd frontend && bun wrangler pages deploy --branch main --project-name listable-prod dist
push-backend:
docker tag list-backend:latest ghcr.io/getlistable/list-backend:latest && docker push ghcr.io/getlistable/list-backend:latest
test test="":
APP_ENV=test bun test $test
tsc:
bun --bun tsc -b .
svelte-check threshold="warning":
cd frontend && bun --bun check --threshold $threshold
svelte-check-ci:
just svelte-check error
lint:
bun lint
lint-all:
just tsc
just lint
just svelte-check
new-migration name:
cd migrations && bun --bun new-migration $name
migrate direction="up":
cd migrations && bun --bun migrate $direction
analyze-frontend:
cd frontend && bun analyze
init-prettier:
bun prettier --write --plugin-search-dir=. .
fetch-zipcodes:
cd scripts && bun --bun run fetch-zipcodes
test-queries:
cd backend && APP_LOG_QUERIES=true bun --bun run test-queries
sync-mobile:
cd frontend && bunx cap sync
list-deps:
./global_uq_deps.sh
analyze-dep dep:
bunx howfat $dep
connect-postgres env:
cd scripts && APP_ENV=$env bun --bun run src/connectPostgres.ts
connect-postgres-dev:
just connect-postgres development
ensure-field-defaults:
cd scripts && bun --bun run src/ensureFieldDefaults.ts
gen-schema:
cd scripts && bun --bun run src/genSchema.ts
setup-playwright:
bunx playwright install chromium
playwright *args="":
cd frontend && APP_IS_PLAYWRIGHT=true bun playwright test {{args}}
playwright-ci: setup-playwright
#!/usr/bin/env bash
set -e pipefail
# Function to kill the backend and frontend processes on exit
cleanup() {
echo "Killing backend and frontend..."
kill $BACKEND_PID $FRONTEND_PID || echo "nothing"
}
# Trap to catch any exit signals (e.g., Ctrl+C) and run cleanup
trap cleanup EXIT
# Start the backend in the background
# IMPROVE: using ./just.sh instead of just so that this command works in
# both just.sh and just contexts
APP_ENV=test ./just.sh run-backend &
BACKEND_PID=$!
# Start the frontend in the background
APP_ENV=test ./just.sh watch-frontend &
FRONTEND_PID=$!
# IMPROVE: sleeping for 5 to wait for backend and frontend to be available
sleep 5
# Run tests
./just.sh playwright
cleanup
codegen:
just.sh
# just gen-schema
test-codegen:
just codegen
./scripts/bash/check_git_status.sh