diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 4c641e2..b50ec0f 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -43,10 +43,7 @@ The following files in `.machine_readable/` contain structured project metadata: |--------|-------------| | TypeScript | AffineScript | | ReScript | AffineScript | -| Deno | Bun | -| Node.js | Bun | -| npm | Bun | -| pnpm/yarn | Bun | +| Node.js, yarn | Bun (then Deno, pnpm, npm as fallbacks) | | Go | Rust | | Python | Julia/Rust/AffineScript | | Java/Kotlin | Rust/Tauri/Dioxus | diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..71e79a1 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# package.json is JCS-canonical (LANGUAGE-POLICY ยง1.4). +# Prettier must not reformat it. +package.json diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..4a2363f --- /dev/null +++ b/bun.lock @@ -0,0 +1,15 @@ +{ + "lockfileVersion": 2, + "configVersion": 1, + "workspaces": { + "": { + "name": "scripts", + "devDependencies": { + "prettier": "3.10.1", + }, + }, + }, + "packages": { + "prettier": ["prettier@3.10.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg=="], + } +} diff --git a/mise.toml b/mise.toml index 6dd983f..438b264 100644 --- a/mise.toml +++ b/mise.toml @@ -1,34 +1,21 @@ [tools] # Language runtimes -node = "latest" -python = "latest" rust = "latest" -go = "latest" zig = "latest" -java = "latest" bun = "latest" -denojs = "latest" +julia = "latest" # Package managers -npm = "latest" -yarn = "latest" pnpm = "latest" -pip = "latest" cargo = "latest" -go-task = "latest" +just = "latest" # Formatting & Linting -gofmt = "latest" -black = "latest" -isort = "latest" -ruff = "latest" -prettier = "latest" shfmt = "latest" stylua = "latest" # Build tools cmake = "latest" -make = "latest" ninja = "latest" # Shell tools @@ -38,20 +25,15 @@ gnu-tar = "latest" gnu-grep = "latest" # Testing -vitest = "latest" -pytest = "latest" -jest = "latest" [env] # Common environment variables -NODE_ENV = "development" -PYTHONDONTWRITEBYTECODE = "1" -PYTHONUNBUFFERED = "1" - -# Task runner alias -[alias] -task = "go-task" -build = "cargo build --release || npm run build || go build" -test = "cargo test || npm test || go test ./..." -lint = "ruff check . || prettier --check . || black --check ." -fmt = "ruff format . || prettier --write . || black ." + +[tasks.lint] +run = "bun install --frozen-lockfile && bunx --no-install --bun prettier --check ." + +[tasks.fmt] +run = "bun install --frozen-lockfile && bunx --no-install --bun prettier --write ." + +[tasks.test] +run = "bash tests/check-language-compliance.sh" diff --git a/package.json b/package.json new file mode 100644 index 0000000..d9663fa --- /dev/null +++ b/package.json @@ -0,0 +1 @@ +{"devDependencies":{"prettier":"3.10.1"},"license":"MPL-2.0","name":"scripts","private":true} diff --git a/repo_auditor.exs b/repo_auditor.exs index 2bb09fb..4c8ffc6 100644 --- a/repo_auditor.exs +++ b/repo_auditor.exs @@ -81,7 +81,7 @@ defmodule RepoAuditor.RuleEngine do py_files = Path.wildcard(Path.join(repo_path, "**/*.py")) violations = [] - violations = if ts_files != [], do: ["TypeScript found (Migrate to ReScript)" | violations], else: violations + violations = if ts_files != [], do: ["TypeScript found (Migrate to AffineScript)" | violations], else: violations violations = if py_files != [], do: ["Python found (Migrate to Julia)" | violations], else: violations if violations != [] do diff --git a/setup-kinoite-dev.sh b/setup-kinoite-dev.sh index 37aa148..b1e0e9c 100755 --- a/setup-kinoite-dev.sh +++ b/setup-kinoite-dev.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MPL-2.0 # Kinoite Developer Environment Setup # Uses: nerdctl, distrobox, flatpak -# Follows: Hyperpolymath Language Policy (ReScript, Deno, Rust, Gleam) +# Follows: Hyperpolymath Language Policy (AffineScript, Bun, Deno, Rust, Gleam) set -euo pipefail @@ -295,10 +295,10 @@ starship preset pure-preset -o ~/.config/starship.toml echo "Dev toolbox ready!" DEVEOF - # js (ReScript/Deno) box setup + # js (AffineScript/Deno) box setup cat > "$HOME/scripts/toolchains/setup-js.sh" << 'JSEOF' #!/usr/bin/env bash -# ReScript + Deno environment (Hyperpolymath primary stack) +# AffineScript + Deno environment set -euo pipefail # Deno (primary runtime per language policy) @@ -311,19 +311,22 @@ export PATH="$DENO_INSTALL/bin:$PATH" # Verify deno --version -# ReScript via Deno -cat > ~/.local/bin/rescript << 'EOF' -#!/bin/sh -exec deno run --allow-read --allow-write --allow-env --allow-run --allow-net npm:rescript "$@" -EOF -chmod +x ~/.local/bin/rescript +# AffineScript compiler, built from source with opam and dune +sudo dnf install -y opam bubblewrap git +opam init --bare -y +opam switch create affinescript 5.2.0 -y || true +eval "$(opam env --switch=affinescript)" +mkdir -p ~/src +[ -d ~/src/affinescript ] || git clone --depth 1 https://github.com/hyperpolymath/affinescript ~/src/affinescript +(cd ~/src/affinescript && opam install . --deps-only --yes && dune build @install && dune install) +affinescript --version || true # Useful Deno tools deno install --allow-read --allow-write --allow-env --allow-net --allow-run -gf --name=fresh https://deno.land/x/fresh/init.ts deno install --allow-read --allow-write --allow-env --allow-net --allow-run -gf jsr:@anthropic-ai/claude-code -echo "ReScript + Deno environment ready!" -echo "Remember: NO npm/node/bun in production (per language policy)" +echo "AffineScript + Deno environment ready!" +echo "Remember: Bun first; Deno, pnpm, npm as fallbacks; no Node.js or yarn (per language policy)" JSEOF # rust box setup