$ show casouri/tree-sitter-module
This repository contains a build toolchain for compiling tree-sitter grammar dynamic libraries (.so/.dylib/.dll) for use with Emacs 29+. The core is a Python CLI (`langman.py`) that wraps shell scripts (`build.sh` and `batch.sh`) to clone, compile, and install tree-sitter grammars from GitHub. It supports versioned builds (via git tags) with caching, cross-platform extended attribute versioning, and parallel builds. The architecture is a simple CLI application with separate commands for building, installing, and querying versions. The codebase is well-structured, includes unit and end-to-end tests, and demonstrates clean separation of concerns between the Python frontend and the shell-based build logic. The tool is practical for Emacs users who need a streamlined way to manage tree-sitter language grammars.
The LLM identified 1 files worth highlighting for reuse:
The main Python CLI tool that orchestrates building and installing tree-sitter grammars. It demonstrates a clean command-line architecture with subparsers, a reusable caching mechanism for versioned builds, and cross-platform extended attribute handling for version metadata (xattr on macOS/Linux, fallback file-based on Windows). The caching logic is isolated and could be extracted into a general-purpose build cache utility. The code is modular, well-documented, and uses only standard library dependencies, making it highly portable and reusable as a template for similar build tools.