-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathjustfile
More file actions
140 lines (113 loc) · 2.77 KB
/
justfile
File metadata and controls
140 lines (113 loc) · 2.77 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
set dotenv-load
export RUST_LOG := 'info'
alias a := all
alias d := dev
alias f := fmt
alias i := initialize
alias t := test
default:
just --list
[group: 'check']
all: build clippy e2e fmt-check forbid lint test
[group: 'dev']
build *mode='development':
cargo build && pnpm run build -- --mode {{ mode }}
[group: 'container']
build-container:
docker build -t mcgill.courses:latest .
[group: 'check']
clippy:
./bin/clippy
[group: 'test']
coverage:
./bin/coverage
[group: 'dev']
dev: services typeshare
concurrently \
--kill-others \
--names 'SERVER,CLIENT' \
--prefix-colors 'green.bold,magenta.bold' \
--prefix '[{name}] ' \
--prefix-length 2 \
--success first \
--handle-input \
--timestamp-format 'HH:mm:ss' \
--color \
-- \
'just watch run -- --db-name=mcgill-courses' \
'pnpm run dev'
[group: 'test']
e2e:
pnpm run cy:e2e
[group: 'format']
fmt:
cargo fmt --all
pnpm run format
[group: 'check']
fmt-check:
cargo fmt --all -- --check
pnpm run format-check
[group: 'check']
forbid:
./bin/forbid
[group: 'tools']
[working-directory: 'tools/changelog-genetator']
generate-changelog *args:
cargo run -- --output client/src/assets/changelog.json {{ args }}
[group: 'setup']
initialize *args: restart-services
cargo run -- --source=seed --initialize --db-name=mcgill-courses {{ args }}
[group: 'setup']
install-dev-deps:
cargo install present
cargo install typeshare-cli
brew install --cask chromedriver
curl -LsSf https://astral.sh/uv/install.sh | sh
[group: 'check']
lint *args:
pnpm run lint {{ args }}
[group: 'tools']
[working-directory: 'tools/scraper']
load *args:
cargo run -- \
--batch-size=5 \
--course-delay 1000 \
--source seed \
--user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36" \
{{ args }}
[group: 'tools']
readme:
present --in-place README.md
@prettier --write README.md
[group: 'setup']
restart-services:
docker compose down --volumes && just services
[group: 'dev']
run *args:
cargo run {{ args }}
[group: 'container']
run-container: build-container
docker run -d \
-e MONGODB_URL=$MONGODB_URL \
-e MS_CLIENT_ID=$MS_CLIENT_ID \
-e MS_CLIENT_SECRET=$MS_CLIENT_SECRET \
-e MS_REDIRECT_URI=$MS_REDIRECT_URI \
-e RUST_LOG=info \
-p 8000:8000 \
mcgill.courses:latest
[group: 'dev']
serve:
cargo run -- --db-name=mcgill-courses
[group: 'setup']
services:
docker compose up --no-recreate -d
[group: 'test']
test *filter:
cargo test --all {{ filter }}
[group: 'dev']
typeshare:
RUST_LOG=warn typeshare -l typescript -o client/src/lib/types.ts .
prettier --write client/src/lib/types.ts
[group: 'dev']
watch +COMMAND='test':
cargo watch --clear --exec "{{ COMMAND }}"