-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathjustfile
More file actions
86 lines (68 loc) · 2.36 KB
/
Copy pathjustfile
File metadata and controls
86 lines (68 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
# build all crates
build:
cargo build
# show coverage with codecov percentage at the end
coverage:
cargo llvm-cov --all-features --workspace 2>&1 | awk '{print} /^TOTAL/ {pct=$4} END {print "\ncodecov: " pct}'
# generate the kittynode-core docs
docs-rs:
cargo doc -p kittynode-core
# install dev tools
install-dev-tools:
cargo install cargo-edit cargo-llvm-cov cargo-nextest just
# run the kittynode cli with the given args
kittynode *args='':
@if [ -z "{{ args }}" ]; then target/debug/kittynode help; else target/debug/kittynode {{ args }}; fi
# start the dot-com site
kittynode-com:
bun --cwd kittynode-com dev --open
# start the docs dev server
kittynode-docs:
bun --cwd kittynode-docs dev --open
# lint the javascript code
lint-js:
bun -F kittynode-docs -F kittynode-com format-lint && bun -F kittynode-com check
# lint and fix the javascript code
lint-js-fix:
bun -F kittynode-docs -F kittynode-com format-lint:fix && bun -F kittynode-com check
# lint the rust code
lint-rs:
cargo clippy --all-targets --all-features -- -D warnings && cargo fmt --all -- --check
# lint the rust code with pedantic rules
lint-rs-pedantic:
cargo clippy --all-targets --all-features -- -D warnings -W clippy::pedantic -A clippy::missing_errors_doc -A clippy::too_many_lines && cargo fmt --all -- --check
# release cli
release:
#!/usr/bin/env bash
set -euxo pipefail
git pull --rebase origin main
cargo set-version --bump minor -p kittynode-cli
git add $(git ls-files "*/Cargo.toml") Cargo.toml Cargo.lock
verCli="$(cargo pkgid -p kittynode-cli | cut -d@ -f2)"
git commit -m "Release kittynode-cli-${verCli}"
git tag "kittynode-cli-${verCli}" -m "Release kittynode-cli-${verCli}"
git push origin HEAD "kittynode-cli-${verCli}"
# set up the project
setup:
bun install && just install-dev-tools
# run the unit tests
test:
cargo nextest run
# run the unit and integration tests
test-all:
cargo nextest run -- --include-ignored
# run the unit tests with coverage
test-coverage:
cargo llvm-cov nextest
# run the unit and integration tests with coverage
test-coverage-all:
cargo llvm-cov nextest -- --include-ignored
# update dependencies
update:
nix flake update
cargo upgrade
cd kittynode-com && bun update
cd kittynode-docs && bun update
# start the server
server:
cargo run -p kittynode-server