Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ npm test # runs the Node, Python, and Go suites

Prerequisites: Node 24+, a Python >=3.10 (the Python SDK pins 3.12 via `packages/sdk-py/.python-version`), and Go 1.26.6+. The `setup:*` scripts detect each toolchain and print install hints if it is missing. Both are idempotent and machine-local (the Python `.venv` is git-ignored), so re-run them after cloning or switching machines.

> **Nix shortcut:** with [Nix](https://nixos.org/download/) installed, `nix develop` (from the repo root, see [`flake.nix`](flake.nix)) drops you into a shell with Node 24, Python 3.12, Go 1.26.6, `goreleaser`, `git`, and `jq` pre-installed — no manual toolchain setup needed. Note that `nix develop` always starts `bash`; to keep your own shell, run `nix develop -c fish` (or `zsh`, etc. — any shell already installed on your system). Direnv users can `echo "use flake" > .envrc && direnv allow` instead; direnv keeps your current shell.

**Running your work-in-progress CLI**, two channels, one machine-wide at a time:

- `npm run cli:live` links the source tree; rebuilds flow through instantly. For iterating.
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
description = "Leji dev environment — Node 24, Python 3.12, Go 1.26.6";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
nodejs_24
python312
python312Packages.pip
go
goreleaser
git
jq
];

shellHook = ''
if [ -z "$NO_COLOR" ] && [ -t 1 ]; then
_R=$(printf '\033[0m')
_B=$(printf '\033[38;2;0;159;113m')
_D=$(printf '\033[38;2;24;61;59m')
_M=$(printf '\033[38;2;112;216;194m')
_DIM=$(printf '\033[2m')
_BD=$(printf '\033[1m')
else
_R=""; _B=""; _D=""; _M=""; _DIM=""; _BD=""
fi
_node=$(node --version 2>/dev/null || echo "—")
_py=$(python3 --version 2>&1 | awk '{print $2}'); [ -z "$_py" ] && _py="—"
_pip=$(pip --version 2>/dev/null | awk '{print $2}'); [ -z "$_pip" ] && _pip="—"
_go=$(go version 2>/dev/null | awk '{print $3}' | sed 's/go//'); [ -z "$_go" ] && _go="—"
_gr=$(goreleaser --version 2>/dev/null | head -n1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1); [ -z "$_gr" ] && _gr="—"
_git=$(git --version 2>/dev/null | awk '{print $3}'); [ -z "$_git" ] && _git="—"
_jq=$(jq --version 2>/dev/null | sed 's/jq-//'); [ -z "$_jq" ] && _jq="—"
printf "\n"
printf " %s%sleji%s %s•%s %sdevelopment shell%s\n" "$_B" "$_BD" "$_R" "$_M" "$_R" "$_DIM" "$_R"
printf "\n"
printf " %s─ packages ─────────────────────────────────────%s\n" "$_DIM" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s)%s\n" "$_M" "$_R" "node" "$_BD" "$_node" "$_R" "$_DIM" "nodejs_24" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s, pip %s)%s\n" "$_M" "$_R" "python" "$_BD" "$_py" "$_R" "$_DIM" "python312" "$_pip" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s)%s\n" "$_M" "$_R" "go" "$_BD" "$_go" "$_R" "$_DIM" "go 1.26.6" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s)%s\n" "$_M" "$_R" "goreleaser" "$_BD" "$_gr" "$_R" "$_DIM" "goreleaser" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s)%s\n" "$_M" "$_R" "git" "$_BD" "$_git" "$_R" "$_DIM" "git" "$_R"
printf " %s◆%s %-12s %s%s%s %s(%s)%s\n" "$_M" "$_R" "jq" "$_BD" "$_jq" "$_R" "$_DIM" "jq" "$_R"
printf " %s────────────────────────────────────────────────%s\n" "$_DIM" "$_R"
printf "\n"
unset _R _B _D _M _DIM _BD _node _py _pip _go _gr _git _jq
'';

env.PYTHON = "${pkgs.python312}/bin/python3";
};
}
);
}