-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.nix
54 lines (54 loc) · 1.54 KB
/
tasks.nix
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
{
wrangler.exec = ''
bunx wrangler@latest --config='wrangler.toml' "$@"
'';
fmt.exec = ''
taplo fmt *.toml
nixfmt *.nix --width=100
cargo fmt --all -- --config-path=rustfmt.toml
sqlfluff format --dialect sqlite ./schema.sql
'';
lint.exec = ''
taplo lint *.toml
cargo clippy --all-targets --all-features -- -A clippy::pedantic
sqlfluff lint --dialect sqlite ./schema.sql
deadnix --no-lambda-pattern-names && statix check .
'';
build.exec = ''
cargo build --release --target wasm32-unknown-unknown
'';
# optional: `--remote`
dev.exec = ''
bunx wrangler@latest --config='wrangler.toml' dev "$@"
'';
d1-create-database.exec = ''
bunx wrangler@latest --config='wrangler.toml' d1 create url-short-d1 "$@"
'';
# optional: `--local`, `--remote`
d1-bootstrap.exec = ''
bunx wrangler@latest --config='wrangler.toml' d1 execute url-short-d1 --file='schema.sql'
'';
# optional: `--local`, `--remote`
# required: `--command="SELECT * FROM urls"`
d1-query.exec = ''
bunx wrangler@latest --config='wrangler.toml' d1 execute url-short-d1 "$@"
'';
d1-seed.exec = ''
bash ./scripts/seed.sh
'';
# only works locally in development
d1-viewer.exec = ''
bunx @outerbase/studio@latest $(eval echo $D1_DATABASE_FILEPATH) --port=4000
'';
deploy.exec = ''
bunx wrangler@latest deploy --env='production' --config='wrangler.toml'
'';
rustdoc.exec = ''
cargo rustdoc -- --default-theme='ayu'
'';
clean.exec = ''
rm -rf build
rm -rf target
rm -rf node_modules
'';
}