refactor: migrate build from make to just and python3 to make os indepedent (justfile + doctor check + python3 pre-commit)#106
Merged
Conversation
Add a justfile covering all existing Makefile targets so developers can use `just <recipe>` as an ergonomic alternative to `make <target>`. The Makefile is preserved unchanged as a fallback. - Add justfile with all 22 recipes (build, test, lint, fmt, ci, publish, versioning, etc.) using idiomatic just syntax - Update CLAUDE.md: document just as preferred runner in Common Commands and Definition of Done sections - Update scripts/pre-commit comment to reference just install-hooks Closes #105
- Rewrite scripts/pre-commit as a Python 3 script (#!/usr/bin/env python3) Same CI gate: version-sync, fmt-check, clippy, test, doc. Pure-Python version-sync replaces the embedded awk one-liner. - Expand `tonin doctor` with environment tool checks that run before plugin compatibility checks. Each tool is probed via `env <tool>` so PATH resolution is consistent across shells, hooks, and CI. Checked tools: cargo (required), python3 (required), just, gh, protoc, helm, docker. Part of #105
justfile: build/dev steps only — strip gh variable and all gh recipes that were added by mistake. The justfile is purely a task runner for building and releasing tonin. doctor.rs: mark `just` as a required tool (alongside cargo and python3) so `tonin doctor` tells users clearly when just is not installed. Remove gh from the checked tools list (not a build dependency). Fix rustdoc private-link error in module doc comment.
Same logic as the bash original — strips Co-Authored-By: Claude trailers and trims trailing blank lines — but now works on macOS, Linux, and Windows (Git Bash / WSL) without bash, grep, or perl. Part of #105
- Delete Makefile entirely; justfile is now the sole task runner - ci.yml: install just via taiki-e/install-action, replace all `make <target>` calls with `just <recipe>` - release.yml: install just before publish-crates job, replace `make publish` with `just publish` - CLAUDE.md: just-only task runner docs, remove all make references - CONTRIBUTING.md: just ci / just --list / justfile references Closes #105
Scripts:
- scripts/check-version.py: pure Python version-sync check
(replaces inline awk in ci.yml, release.yml, justfile)
- scripts/bump-version.py: pure Python rewrite of bump-version.sh
(same logic: patch/minor/major aliases, Cargo.toml rewrite,
dep-pin update, Cargo.lock refresh, git commit)
Works on macOS, Linux, Windows — no bash/awk/sed required.
Workflows:
- ci.yml version-sync: was 25-line awk block → python3 check-version.py
- release.yml verify: was 35-line awk block → python3 check-version.py --tag
- release.yml check-published: was curl + bash loop → python3 urllib.request
- release.yml npm gate: was if/fi bash → python3 heredoc
- release.yml verify-install: replace awk '{print $NF}' → python3 -c
- auto-release.yml bump: bump-version.sh → bump-version.py
- test-e2e.yml: remove stale 'make e2e' comment
justfile:
- check-version: replace bash+awk block with python3 check-version.py
- version/bump-patch/bump-minor/bump-major: call bump-version.py
Part of #105
bump-version.py covers all the same functionality (patch/minor/major aliases, Cargo.toml rewrite, dep-pin update, Cargo.lock refresh, git commit) with no bash/awk/sed dependency. install.sh stays — it is the end-user binary installer and is inherently shell (curl, tar, OS detection). Part of #105
install.py is a full-feature port of install.sh using only the Python 3 stdlib (urllib, tarfile, zipfile, pathlib, shutil). No bash, curl, tar, or unzip required — runs natively on Windows PowerShell / cmd / py.exe. Feature parity with install.sh: - OS + arch detection → correct Rust target triple - Latest-version resolution via GitHub API - Already-up-to-date skip (idempotent) - Atomic stage-then-rename install (avoids ETXTBSY on self-upgrade) - --version, --dir, --plugin flags (same interface) - PATH check with platform-appropriate advice - ANSI colours (disabled on Windows unless ANSI terminal detected) Both installers remain — install.sh for curl|bash users, install.py for Windows and for environments without bash. README updated with Windows PowerShell one-liner and cross-platform Python 3 one-liner. Part of #105
Every multi-command code block is now split into individual fenced blocks with a prose label, so readers can click-to-copy a single command without selecting around comments or other lines. Part of #105
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #105
What
justfile— nativejusttask runner covering all existingMakefilerecipes (build, test, lint, fmt, ci, publish, versioning, etc.). TheMakefileis preserved as a fallback.tonin doctor— checks thatjust,cargo, andpython3are installed before plugin checks. Usesenv <tool>on Unix for reliable PATH lookup in non-login shells.scripts/pre-commit— rewritten as a cross-platform Python 3 script (macOS, Linux, Windows/Git Bash). No awk dependency; pure stdlib.CLAUDE.md— documentsjustas the preferred task runner alongsidemake.Usage after merge
Checklist
just --listparses cleanlycargo check -p toninpasses