atproto Thingiverse but good
2.7 kB
76 lines
1# polymodel development commands
2
3set dotenv-load := false
4
5# Format Rust sources. Run clippy/check separately; clippy --fix can corrupt RSX.
6fix:
7 cargo fmt --all
8# Run clippy without --fix; automatic clippy rewrites can corrupt Dioxus RSX.
9lint:
10 cargo clippy --workspace --all-targets -- -D warnings
11 cargo clippy -p polymodel --all-targets --features server -- -D warnings
12 cargo clippy -p polymodel --target wasm32-unknown-unknown --features web -- -D warnings
13# Compile checks across the whole workspace plus the app's server/wasm targets.
14# migrated SQLite database. Run `just migrate` first (or run `just sqlx-prepare`)
15# so the macros can resolve.
16check:
17 cargo check --workspace
18 cargo check -p polymodel --features server
19 cargo check -p polymodel --target wasm32-unknown-unknown --features web
20
21# Create and migrate the SQLite projection database.
22# Required by the compile-time `query!` macros: run before the first server
23# check, and re-run after editing migrations.
24migrate:
25 mkdir -p ./data
26 -cargo sqlx database create --database-url 'sqlite:./data/polymodel.db'
27 cargo sqlx migrate run --source migrations --database-url 'sqlite:./data/polymodel.db'
28
29# Regenerate the committed `.sqlx` offline query cache after changing SQL.
30sqlx-prepare:
31 cargo sqlx prepare -- -p polymodel --features server
32
33# Run unit tests across the workspace.
34test:
35 cargo nextest run --workspace
36
37# Run server-feature tests (app only; polymodel-api has no server feature).
38test-server:
39 cargo nextest run -p polymodel --features server
40
41# Run all local validation expected before review.
42test-all: fix check lint test test-server
43# Run browser end-to-end tests.
44e2e:
45 cd e2e && npm test
46# Start the Dioxus dev server.
47serve:
48 dx serve
49# Build the Dioxus app for web.
50build-web:
51 dx build --platform web
52# Regenerate crates/polymodel-api from authored lexicons via the local Jacquard checkout.
53generate-api:
54 nix run ../jacquard
55# Create a sibling jj workspace for a Jira ticket or feature slug, then start a fresh change.
56workspace-create name:
57 root="$(jj workspace root)" && workspace_path="$(dirname "$root")/{{ name }}" && jj workspace add "$workspace_path" -r @
58 root="$(jj workspace root)" && workspace_path="$(dirname "$root")/{{ name }}" && cd "$workspace_path" && jj desc -m "{{ name }}"
59
60# List jj workspaces.
61workspace-list:
62 jj workspace list
63
64# Forget a jj workspace after the work is safely landed or intentionally abandoned.
65workspace-forget name:
66 jj workspace forget {{ name }}
67
68# Show current jj state and diff.
69status:
70 jj status
71 jj diff --summary
72
73# Clean build artifacts.
74clean:
75 cargo clean
76 rm -rf target/dx