Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
114 lines (95 loc) · 2.36 KB
/
Copy pathjustfile
File metadata and controls
114 lines (95 loc) · 2.36 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
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
set shell := ["bash", "-cu"]
_default:
@just --list -u
alias test := test-rust
# Test commands
[group('test')]
test-rust:
cargo test
[group('test')]
test-bun crate:
bun test crates/{{crate}}/test_bun
[group('test')]
test-deno crate:
deno test crates/{{crate}}/test_deno --allow-read --parallel
[group('test')]
test-node crate:
node --test "crates/{{crate}}/test_node/*.mjs"
[group('test')]
test-wasm crate: (test-node crate) (test-deno crate) (test-bun crate)
[group('test')]
test-all: test-rust
just test-wasm biome_fmt
just test-wasm graphql_fmt
just test-wasm json_fmt
just test-wasm malva_fmt
just test-wasm markup_fmt
just test-wasm oxc_fmt
just test-wasm web_fmt
# Build commands
[group('build')]
build crate:
wasm-pack build --scope=wasm-fmt crates/{{crate}}
cp -RL crates/{{crate}}/extra/. crates/{{crate}}/pkg/
rm -f crates/{{crate}}/pkg/doc.d.ts
node scripts/patch.mjs crates/{{crate}}
[group('build')]
build-all:
just build biome_fmt
just build graphql_fmt
just build json_fmt
just build malva_fmt
just build markup_fmt
just build oxc_fmt
just build web_fmt
# Format commands
[group('fmt')]
fmt:
cargo fmt --all
taplo fmt .
dprint fmt
# Check commands
[group('check')]
check:
cargo check --all
cargo clippy --all -- -D warnings
cargo fmt --all --check
taplo fmt --check .
dprint check
# Audit command
[group('check')]
audit:
cargo audit
# Ready command - check, build and test all
[group('release')]
ready:
just check
just build-all
just test-all
just pack-dry-run-all
pack-dry-run crate:
cd crates/{{crate}}/pkg && npm pack --dry-run
cd crates/{{crate}}/pkg && npx jsr publish --dry-run
pack-dry-run-all:
just pack-dry-run biome_fmt
just pack-dry-run graphql_fmt
just pack-dry-run json_fmt
just pack-dry-run malva_fmt
just pack-dry-run markup_fmt
just pack-dry-run oxc_fmt
just pack-dry-run web_fmt
# Bump version (major, minor, patch) or set specific version
[group('release')]
version bump_or_version:
#!/usr/bin/env bash
if [[ "{{bump_or_version}}" =~ ^(major|minor|patch)$ ]]; then
cargo set-version --bump "{{bump_or_version}}"
else
cargo set-version "{{bump_or_version}}"
fi
VERSION=$(cd crates/web_fmt && cargo pkgid | sed 's/.*[#@]//')
node scripts/sync_version.mjs "${VERSION}"
git add -A
git commit -m "${VERSION}"
git tag -a "v${VERSION}" -m "${VERSION}"