Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
133 lines (109 loc) · 6.04 KB
/
Copy pathjustfile
File metadata and controls
133 lines (109 loc) · 6.04 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# lector — task runner
# Recipes run in `sh`, which doesn't inherit cargo from an interactive fish/zsh setup.
# Guarantee rustup's bin dir is on PATH so the tauri CLI can find `cargo`.
export PATH := env_var('HOME') + "/.cargo/bin:" + env_var('PATH')
# `default` pipes `just --list` through a small stock-perl filter that clips long recipe
# docs to your terminal width (…) instead of wrapping. Self-contained — no external files;
# falls back to plain `just --list` where perl is absent. Edit the recipes below, not this.
# List available recipes
default:
@if command -v perl >/dev/null 2>&1; then just --color always --list | perl -CS -Mutf8 -lpe 'BEGIN{($w)=`stty size 2>/dev/null </dev/tty`=~/ (\d+)/; $w||=100; $col=(-t STDOUT && !exists $ENV{NO_COLOR})} s/\e\[[0-9;]*m//g unless $col; (my $v=$_)=~s/\e\[[0-9;]*m//g; if(length($v)>$w){my($o,$n)=("",0); while(length && $n<$w-1){ if($col && s/^(\e\[[0-9;]*m)//){$o.=$1}else{s/^(.)//;$o.=$1;$n++} } $_=$o."…".($col?"\e[0m":"")}'; else just --list; fi
# Run the app against the repo's demo config (never touches your real ~/.config/lector config)
[group("dev")]
run:
LECTOR_CONFIG="{{justfile_directory()}}/examples/config.toml" cargo run -p lector
# Validate a config and print the resolved window/tab tree + warnings (defaults to the demo).
[group("dev")]
validate path="examples/config.toml":
cargo run -p lector -- validate "{{path}}"
# Run the workspace tests
[group("check")]
test:
cargo test --workspace
# Type-check the workspace without producing binaries
[group("check")]
check:
cargo check --workspace
# Format all sources
[group("check")]
fmt:
cargo fmt --all
# Lint with clippy (warnings as errors)
[group("check")]
clippy:
cargo clippy --workspace -- -D warnings
# The active-[patch] guard also runs via .githooks/pre-commit (opt-in per clone via core.hooksPath).
# fmt/clippy/tests have no hook or CI — run this manually before committing/merging.
# Full pre-merge gate: fmt-check, clippy, tests, config fmt-check, active-[patch] guard
[group("check")]
gate:
cargo fmt --all --check
cargo clippy --workspace -- -D warnings
@{{ just_executable() }} _core-patch guard # after clippy, whose build.rs generates core-patch.sh on a fresh clone
cargo test --workspace
cargo run -p lector -- fmt --check "{{justfile_directory()}}/examples/config.toml"
# ── shared-core dev loops (require the sibling ../<core> ghq checkout) ──
# Every <core>-dev / <core>-pin wraps shell-core's scripts/core-patch.sh; the cores and the manifest
# each one is pinned in are scripts/tooling.env's CORES.
# core-patch.sh is generated by build.rs from the pinned shell-core rev (git-ignored), so a fresh
# clone has none until its first build.
[private]
_core-patch +args:
@[ -f scripts/core-patch.sh ] || { echo "✗ scripts/core-patch.sh is missing — the build generates it; run 'cargo check' first" >&2; exit 1; }
@bash scripts/core-patch.sh {{args}}
# Re-pin ALL four cores to their pushed HEADs (each in turn, stopping at the first failure). Run before committing.
[group("pin")]
cores-pin: (_core-patch "pin" "all")
# Build lector against local ../chrome-core (uncommitted edits included): activate the [patch], `just run`
[group("chrome")]
chrome-dev: (_core-patch "dev" "chrome")
# Re-pin chrome-core to ../chrome-core's pushed HEAD + deactivate the patch (run after pushing chrome-core)
[group("chrome")]
chrome-pin: (_core-patch "pin" "chrome")
# Serve chrome-core's visual preview with live reload (requires ../chrome-core checked out)
[group("chrome")]
chrome-preview:
@if [ -f ../chrome-core/justfile ]; then just -f ../chrome-core/justfile dev; else echo "✗ ../chrome-core not found — ghq get github.com/Lockyc/chrome-core"; exit 1; fi
# Build lector against local ../config-core (uncommitted edits included): activate the [patch], `just run`
[group("config")]
config-dev: (_core-patch "dev" "config")
# Re-pin config-core to ../config-core's pushed HEAD + deactivate the patch (run after pushing config-core)
[group("config")]
config-pin: (_core-patch "pin" "config")
# Build lector against local ../shell-core (uncommitted edits included): activate the [patch], `just run`
[group("shell")]
shell-dev: (_core-patch "dev" "shell")
# Re-pin shell-core to ../shell-core's pushed HEAD + deactivate the patch (run after pushing shell-core)
[group("shell")]
shell-pin: (_core-patch "pin" "shell")
# Build lector against local ../compositor (uncommitted edits included): activate the [patch], `just run`
[group("compositor")]
compositor-dev: (_core-patch "dev" "compositor")
# Re-pin compositor to ../compositor's pushed HEAD + deactivate the patch (run after pushing compositor)
[group("compositor")]
compositor-pin: (_core-patch "pin" "compositor")
# Build the release .app bundle (needs the Tauri CLI: `cargo install tauri-cli --version ^2`)
[group("dist")]
build:
cd src-tauri && cargo tauri build
# Run on dev with the src-tauri/Cargo.toml version bump committed and pushed (see CLAUDE.md ›
# Release model). `notes` is a notes file; omitted, the notes are the commit subjects since the
# previous tag. Refuses without the Apple signing/notary env AND the updater key; nothing is
# tagged, pushed or published until the notarized build succeeds. DRY_RUN=1 prints the side effects instead.
# Release: gate → notarized build → tag v<version> → fast-forward main → push → GitHub release
[group("dist")]
release notes="": gate
bash scripts/release.sh "{{notes}}"
# Build a release .app and install/replace it in /Applications, then relaunch
[group("dist")]
install: build
#!/usr/bin/env bash
set -euo pipefail
bash scripts/install-app.sh "target/release/bundle/macos/lector.app"
echo "→ launching"
# Launching is its own shell-core script, NOT a bare `open`: `open` forwards the installing
# terminal's whole environment to the app, so an install from a terminal runs lector in an
# environment no real (Dock/Spotlight) launch ever reproduces. launch-app.sh's header carries
# the full footgun.
bash scripts/launch-app.sh
echo "✓ lector updated in /Applications"