Skip to content

Commit 99c22b5

Browse files
committed
chore: tooling update
1 parent 5cce80a commit 99c22b5

7 files changed

Lines changed: 102 additions & 85 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ devid.*
99
.DS_Store
1010
.claude/
1111
docs/superpowers/
12+
13+
justfile.local

Makefile

Lines changed: 0 additions & 64 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ macOS (Apple Silicon) and Linux (arm64/amd64) are supported.
4848
> [!NOTE]
4949
> Keychain access to "Chrome Safe Storage" is only needed if you use the `extra_usage` segment (see below).
5050
51-
Or build from source:
51+
Or build from source (requires [just](https://github.com/casey/just)):
5252

5353
```
54-
make install
54+
just install
5555
```
5656

5757
## Setup
@@ -317,7 +317,7 @@ The defaults are `-f 70` (show 5-hour reset countdown above 70%) and `-s 100` (n
317317
### Basic build
318318

319319
```
320-
make install
320+
just install
321321
```
322322

323323
This builds without codesigning. The Chrome Keychain password is cached locally to `~/.statusline/chrome_key` to avoid repeated Keychain prompts during development.
@@ -331,25 +331,25 @@ Codesigning makes Keychain's "Always Allow" persist across rebuilds. You need an
331331
If you don't have a Developer ID Application certificate yet:
332332

333333
```
334-
make cert-request DEVELOPER_NAME="Your Name"
334+
just cert-request "Your Name"
335335
```
336336

337337
This generates a certificate signing request. Upload `devid.csr` at the URL shown, select **Developer ID Application**, and download the `.cer` file. Then import it:
338338

339339
```
340-
make cert-import CER=~/Downloads/developerID_application.cer
340+
just cert-import ~/Downloads/developerID_application.cer
341341
```
342342

343343
This installs the certificate into your Keychain and prints your signing identity. Clean up afterwards:
344344

345345
```
346-
make cert-clean
346+
just cert-clean
347347
```
348348

349349
#### Building
350350

351351
```
352-
make install-signed DEVELOPER_NAME="Your Name" TEAM_ID="ABC123XYZ"
352+
just install-signed "Your Name" "ABC123XYZ"
353353
```
354354

355355
To find your name and team ID:

deny.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
# Only evaluate the platforms we actually build/ship — keeps windows-only crates
66
# (and their licenses / duplicate versions) out of the graph.
77
targets = [
8-
"aarch64-apple-darwin",
9-
"x86_64-unknown-linux-gnu",
10-
"aarch64-unknown-linux-gnu",
8+
"aarch64-apple-darwin",
9+
"x86_64-unknown-linux-gnu",
10+
"aarch64-unknown-linux-gnu",
1111
]
1212

1313
[advisories]
@@ -20,16 +20,16 @@ version = 2
2020
# Permissive licenses present in the dependency tree. `cargo deny check
2121
# licenses` fails if a new dependency introduces one not listed here.
2222
allow = [
23-
"MIT",
24-
"Apache-2.0",
25-
"BSD-2-Clause",
26-
"BSD-3-Clause",
27-
"ISC",
28-
"Zlib",
29-
"Unicode-3.0",
30-
"MPL-2.0",
31-
# Mozilla CA root bundle shipped via rustls/webpki-roots.
32-
"CDLA-Permissive-2.0",
23+
"MIT",
24+
"Apache-2.0",
25+
"BSD-2-Clause",
26+
"BSD-3-Clause",
27+
"ISC",
28+
"Zlib",
29+
"Unicode-3.0",
30+
"MPL-2.0",
31+
# Mozilla CA root bundle shipped via rustls/webpki-roots.
32+
"CDLA-Permissive-2.0",
3333
]
3434
confidence-threshold = 0.8
3535

justfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
bin := "statusline"
2+
target_bin := "target" / "debug" / bin
3+
release_bin := "target" / "release" / bin
4+
5+
default: build
6+
7+
gate: fmt lint test
8+
cargo build --workspace -q
9+
10+
check:
11+
cargo check --workspace --all-targets
12+
13+
test:
14+
cargo test --workspace
15+
16+
lint:
17+
cargo clippy --workspace --all-targets -- -D warnings
18+
cargo clippy -p statusline --all-targets --features codesigned -- -D warnings
19+
20+
fmt:
21+
cargo fmt --all
22+
taplo fmt
23+
24+
compile:
25+
cargo build --workspace
26+
27+
build:
28+
cargo build --workspace --release
29+
30+
build-signed developer_name team_id:
31+
cargo build --workspace --release --features codesigned
32+
codesign --force --options runtime --sign "Developer ID Application: {{developer_name}} ({{team_id}})" {{release_bin}}
33+
codesign --verify --verbose {{release_bin}}
34+
35+
install: build
36+
cp {{release_bin}} "${CARGO_HOME:-$HOME/.cargo}/bin/"
37+
38+
install-signed developer_name team_id: (build-signed developer_name team_id)
39+
cp {{release_bin}} "${CARGO_HOME:-$HOME/.cargo}/bin/"
40+
41+
dev *ARGS:
42+
cargo build --quiet
43+
{{target_bin}} {{ARGS}}
44+
45+
cert-request developer_name:
46+
openssl req -new -newkey rsa:2048 -nodes \
47+
-keyout devid.key -out devid.csr \
48+
-subj "/CN={{developer_name}}"
49+
@echo ""
50+
@echo "Upload devid.csr at:"
51+
@echo " https://developer.apple.com/account/resources/certificates/add"
52+
@echo "Select 'Developer ID Application', then download the .cer file."
53+
@echo ""
54+
@echo "Then run: just cert-import <path-to-downloaded.cer>"
55+
56+
cert-import cer:
57+
openssl x509 -inform DER -in "{{cer}}" -out devid.crt
58+
openssl pkcs12 -export -out devid.p12 -inkey devid.key -in devid.crt -legacy
59+
security import devid.p12 -k ~/Library/Keychains/login.keychain-db
60+
@echo ""
61+
@echo "Certificate imported. Your signing identity:"
62+
@security find-identity -v -p codesigning | grep "Developer ID Application"
63+
@echo ""
64+
@IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID Application" | head -1 | sed 's/.*"\(.*\)".*/\1/'); \
65+
NAME=$(echo "$IDENTITY" | sed 's/Developer ID Application: \(.*\) (.*/\1/'); \
66+
TEAM=$(echo "$IDENTITY" | sed 's/.*(\(.*\))/\1/'); \
67+
echo "Test with:"; \
68+
echo " just install-signed \"$NAME\" \"$TEAM\""; \
69+
echo ""; \
70+
echo "Clean up: just cert-clean"
71+
72+
cert-clean:
73+
rm -f devid.key devid.csr devid.crt devid.p12

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hard_tabs = true
1+
hard_tabs = true

taplo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# TOML formatting via `taplo fmt` (runs as part of `just fmt`).
2+
exclude = ["target/**", "Cargo.lock"]
3+
4+
[formatting]
5+
# Keep entries in the order they're written (no alphabetical churn).
6+
reorder_keys = false

0 commit comments

Comments
 (0)