Skip to content
Merged
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
5 changes: 0 additions & 5 deletions .clinerules

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/ci-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
path: |
~/.cache/mise
~/.local/share/mise
key: mise-${{ runner.os }}-${{ inputs.cache_suffix }}-${{ hashFiles('mise.toml', 'template/mise.toml.jinja', 'devbox.json', 'devbox.lock') }}
key: mise-${{ runner.os }}-${{ inputs.cache_suffix }}-${{ hashFiles('mise.toml', 'template/mise.toml.jinja') }}
restore-keys: |
mise-${{ runner.os }}-${{ inputs.cache_suffix }}-
mise-${{ runner.os }}-
Expand All @@ -89,24 +89,24 @@ jobs:
run: |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV

- name: Run dev-setup.sh
run: |
./scripts/dev-setup.sh

- name: Setup mise
uses: jdx/mise-action@v2
with:
install: true
cache: true

- name: Setup Devbox
uses: jetify-com/[email protected]
with:
enable-cache: true

- name: Generate Test Project
run: |
devbox run copier copy . ../test-project --vcs-ref HEAD \
copier copy . ../test-project --vcs-ref HEAD \
--data project_name="Test Project" \
--data project_slug=test-project \
--data project_slug_underscore=test_project \
--data author_name="CI Bot" \
--data github_username="ci-bot" \
--data include_wasm=${{ inputs.wasm }} \
--data include_python=${{ inputs.python }} \
--data include_go=${{ inputs.go }} \
Expand All @@ -116,5 +116,6 @@ jobs:
working-directory: ../test-project
run: |
git init
devbox install
devbox run just setup copyright ci
./scripts/dev-setup.sh
mise install
just setup copyright ci
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.devbox
*.code-workspace
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Python extensions, and Go bindings from a single codebase.

To use this template, you need to install the following tools:

- **[Devbox](https://www.jetify.com/docs/devbox/):** Sets up your development
environment by installing Rust, wasm‑pack, Node, PNPM, and Mise automatically.
- **[Mise](https://mise.jdx.dev/):** Installs and manages Rust, Node, Python, PNPM, and every other tool used by this template.
If you don't have Mise yet, simply run `scripts/dev-setup.sh` and follow the prompts.
- **[Copier](https://copier.readthedocs.io/):** Generates a new project from
this template.

Expand All @@ -50,11 +50,11 @@ git init
jj git init --colocate
```

Enter the Devbox shell:
Install dependencies (Mise will take care of everything):

```bash
devbox install
devbox run direnv allow
./scripts/dev-setup.sh # one-time, installs mise if missing
mise install # installs the toolchain versions specified in mise.toml
```

Set up tools:
Expand All @@ -77,8 +77,8 @@ just ci

## Development Tools & Workflow

The template provides a comprehensive development environment powered by Devbox
and Mise. No manual tool installation required—everything from Rust nightly to
The template provides a comprehensive development environment powered by Mise.
No manual tool installation required—everything from Rust nightly to
WebAssembly toolchains is automatically configured.

**Testing & Quality** Comprehensive test suites run across all platforms, with
Expand Down Expand Up @@ -144,28 +144,28 @@ Your generated project will include:

**Development Environment**

- `devbox.json`: Zero-config development environment
- `mise.toml`: Task runner for common operations
- `mise.toml`: Toolchain configuration and common operations
- `.envrc`: Automatic environment activation
- `.pre-commit-config.yaml`: Git hooks for quality checks

## Testing

```plain
cd ~/workplace && \
rm -rf ~/workplace/ouchie && \
copier copy ~/workplace/copier_rust_template ~/workplace/ouchie \
rm -rf ~/workplace/foobaz && \
copier copy ~/workplace/copier_rust_template ~/workplace/foobaz \
--data include_wasm=true \
--data include_python=true \
--data include_go=true \
--data project_name="Ouchie" \
--data project_slug=ouchie \
--data project_slug_underscore=ouchie \
--data project_name="Foobaz" \
--data project_slug=foobaz \
--data project_slug_underscore=foobaz \
--data author_name="Local Test" \
--force && \
cd ~/workplace/ouchie && \
cd ~/workplace/foobaz && \
git init && \
devbox install && \
./scripts/dev-setup.sh && \
mise install && \
just setup copyright ci ; \
cd go-wasm && \
just setup test test-go && \
Expand Down
5 changes: 5 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ author_name:
help: "Enter the author's name."
default: "Your Name"

github_username:
type: str
help: "Enter your GitHub username."
default: "your-username"

_exclude:
- ".git"
- "__skip_wasm__"
Expand Down
17 changes: 0 additions & 17 deletions devbox.json

This file was deleted.

117 changes: 0 additions & 117 deletions devbox.lock

This file was deleted.

1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[tools]
copier = "latest"
python = "prefix:3.12"
22 changes: 22 additions & 0 deletions scripts/dev-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euo pipefail

# Install mise
if command -v mise >/dev/null 2>&1; then
echo "mise is already installed"
else
echo "mise is not installed"
if command -v brew >/dev/null 2>&1; then
echo "brew is installed"
brew install mise
else
echo "brew is not installed"
curl https://mise.run | sh
fi
fi

mise settings add idiomatic_version_file_enable_tools rust

# Need to install rust first
mise use "rust@prefix:1.87"
34 changes: 34 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

set -euo pipefail

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
ROOT_DIR=$(dirname "$SCRIPT_DIR")
pushd "$ROOT_DIR"
trap 'popd' EXIT

cd ~/workplace

rm -rf ~/workplace/foobaz
copier copy ~/workplace/copier_rust_template ~/workplace/foobaz \
--data include_wasm=true \
--data include_python=true \
--data include_go=true \
--data project_name="Foobaz" \
--data project_slug=foobaz \
--data project_slug_underscore=foobaz \
--data author_name="Local Test" \
--data github_username="local-test" \
--force

cd ~/workplace/foobaz
git init

./scripts/dev-setup.sh
touch mise.lock
mise trust
mise install

just setup copyright ci
cd go-wasm
just setup test test-go
11 changes: 11 additions & 0 deletions template/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[target.'cfg(not(build))'.build]
# Prevents unavoidable warnings from build.rs scripts from failing the build
rustflags = ["-D", "warnings"]

[env]
RUST_BACKTRACE = "1"

# Nextest configuration
[test]
runner = "cargo nextest"

[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
Expand Down
18 changes: 15 additions & 3 deletions template/.clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
cognitive-complexity-threshold = 10
too-many-arguments-threshold = 5
type-complexity-threshold = 200
msrv = "1.87.0"

# ---------- Structural size limits ----------
cognitive-complexity-threshold = 20
enum-variant-size-threshold = 128 # bytes
excessive-nesting-threshold = 6
future-size-threshold = 8192 # bytes; keeps async state small
too-many-arguments-threshold = 6
too-many-lines-threshold = 100 # per-function and per-method
type-complexity-threshold = 200

# ---------- Misc quality-of-life ----------
disallowed-methods = [
"std::mem::transmute",
]
9 changes: 0 additions & 9 deletions template/.envrc

This file was deleted.

Loading