Skip to content

Commit 77c8b99

Browse files
committed
chore: add just development shortcuts
1 parent eac87ce commit 77c8b99

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ npm run dev --prefix config-generator
1717

1818
打开 `http://127.0.0.1:8080/`。无需启动 Python 或 Zensical。支持配对生成、服务端或客户端单独生成、多用户、三种证书模式、SOCKS5 认证、重连、0-RTT 和 TCP/UDP 转发;“配置详解”可按枚举分支浏览 YAML,并通过悬浮或键盘聚焦查看逐项说明。
1919

20+
安装了 [just](https://just.systems/) 时,可用仓库根目录的快捷命令:
21+
22+
```sh
23+
just setup # 首次安装锁定依赖
24+
just dev # 编译 WASM 并启动生成器
25+
just dev-ui # 仅修改 Svelte/CSS 时跳过 WASM 编译
26+
just wasm # Vite 运行期间重编译 Rust/XML
27+
just check # Rust、WASM 与 Svelte 检查
28+
```
29+
30+
运行 `just` 可查看构建、预览和浏览器回归等全部命令。
31+
2032
独立构建:
2133

2234
```sh

‎justfile‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Use the native shell on Windows; Unix keeps just's default `sh` shell.
2+
3+
set windows-shell := ["powershell.exe", "-NoLogo", "-NoProfile", "-Command"]
4+
5+
# Show the available repository tasks.
6+
default:
7+
@just --list
8+
9+
# Install locked Python and Node.js dependencies.
10+
setup:
11+
uv sync --locked
12+
npm ci --prefix config-generator
13+
npm ci --prefix tests/config-generator
14+
15+
# Compile WASM, then start the config generator at http://127.0.0.1:8080/.
16+
dev:
17+
npm run dev --prefix config-generator
18+
19+
# Start Vite without rebuilding WASM (for Svelte/CSS-only changes).
20+
dev-ui:
21+
npm exec --prefix config-generator -- vite --host 127.0.0.1 --port 8080
22+
23+
# Rebuild WASM after Rust or XML changes while Vite is running.
24+
wasm:
25+
npm run wasm --prefix config-generator
26+
27+
# Start the documentation development server.
28+
docs:
29+
uv run --locked zensical serve
30+
31+
# Run formatting, native/WASM Rust checks, tests, and Svelte checks.
32+
check:
33+
cargo +nightly fmt --all --check
34+
cargo test --workspace --locked
35+
cargo clippy --workspace --all-targets --locked -- -D warnings
36+
cargo clippy --target wasm32-unknown-unknown --lib --locked -- -D warnings
37+
npm run check --prefix config-generator
38+
39+
# Build the documentation and standalone generator under site/.
40+
build:
41+
uv run --locked python scripts/build-site.py
42+
43+
# Build and validate the combined site.
44+
site-check: build
45+
uv run --locked python tests/config-generator/check-site.py
46+
47+
# Run browser regression tests against a temporary server for config-generator/dist/.
48+
browser:
49+
uv run --locked python tests/config-generator/run-browser.py
50+
51+
# Run browser regression tests against the combined deployment-prefix build.
52+
browser-site: build
53+
uv run --locked python tests/config-generator/run-browser.py --directory site/config-generator --prefix /tuic/config-generator/
54+
55+
# Build, validate, and serve the combined site preview.
56+
preview: site-check
57+
uv run --locked python tests/config-generator/preview-server.py

0 commit comments

Comments
 (0)