Skip to content

refactor: migrate build from make to just and python3 to make os indepedent (justfile + doctor check + python3 pre-commit)#106

Merged
Rushit merged 9 commits into
mainfrom
feat/just-support
Jul 2, 2026
Merged

refactor: migrate build from make to just and python3 to make os indepedent (justfile + doctor check + python3 pre-commit)#106
Rushit merged 9 commits into
mainfrom
feat/just-support

Conversation

@Rushit

@Rushit Rushit commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Closes #105

What

  • justfile — native just task runner covering all existing Makefile recipes (build, test, lint, fmt, ci, publish, versioning, etc.). The Makefile is preserved as a fallback.
  • tonin doctor — checks that just, cargo, and python3 are installed before plugin checks. Uses env <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 — documents just as the preferred task runner alongside make.

Usage after merge

just          # list all recipes
just build    # cargo build --workspace
just ci       # full gate: fmt-check + lint + test + doc + version-sync
just install-hooks  # wire up git hooks

Checklist

  • just --list parses cleanly
  • cargo check -p tonin passes
  • pre-commit hook (Python 3) passes all CI gate steps on every commit in this branch

Rushit added 9 commits July 2, 2026 14:37
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
@Rushit Rushit changed the title feat: add native just support (justfile + doctor check + python3 pre-commit) refactor: migrate build from make to just and python3 to make os indepedent (justfile + doctor check + python3 pre-commit) Jul 2, 2026
@Rushit Rushit merged commit 5f37f09 into main Jul 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: use just support (justfile) for build and dev and CI

1 participant