An open API service indexing awesome lists of open source software.

https://github.com/asimihsan/copier_rust_template

Copier template for Rust, WebAssembly, and Vite TypeScript
https://github.com/asimihsan/copier_rust_template

copier-template python-template rust rust-template typescript vite vite-template wasm-template web-template webassembly

Last synced: about 2 months ago
JSON representation

Copier template for Rust, WebAssembly, and Vite TypeScript

Awesome Lists containing this project

README

          

๐Ÿฆ€ Rust Multi-Platform Starter



Build Once, Run Everywhere: CLI โ€ข WASM โ€ข Python โ€ข Go



CI Status


License

A unified Rust template for building native CLIs, WebAssembly modules,
Python extensions, and Go bindings from a single codebase.

### ๐ŸŽฏ Key Features

- ๐Ÿฆ€ Cross-platform Rust core
- ๐ŸŒ WASM bindings with web integration _(Optional)_
- ๐Ÿ Python bindings _(Optional)_
- ๐Ÿฆซ Go bindings _(Optional)_
- ๐Ÿš€ GitHub Actions CI pipeline
- ๐Ÿ› ๏ธ Zero-config setup
- ๐Ÿ“Š Comprehensive testing

## Requirements

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

- **[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.

## Quickstart

Generate your project:

```bash
copier copy gh:asimihsan/copier_rust_template my-awesome-project
```

Change into your new project directory:

```bash
cd my-awesome-project
git init
jj git init --colocate
```

Install dependencies (Mise will take care of everything):

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

Set up tools:

```bash
mise run setup
```

Add copyright header:

```bash
mise run copyright
```

Build and test your project:

```bash
mise run ci
```

## Development Tools & Workflow

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
coverage tracking and fuzz testing for core components. Automated CI pipelines
ensure consistent quality on every commit.

**Development Loop** Fast iteration with hot reloading for web development,
watch mode for Rust, and automated rebuilds of Python extensions. Commands are
discovered from `mise-tasks/`, so `mise tasks` shows the generated workflow
surface directly.

๐Ÿ”ง Cargo, bun, and uv for dependency management
๐Ÿ” Clippy and ESLint for static analysis
โœจ rustfmt and Prettier keep code clean
๐Ÿ“Š Code coverage and performance profiling

## Project Configuration

Choose your project components when generating from the template:

```bash
# Full-featured project (default)
copier copy gh:asimihsan/copier_rust_template my-project

# Core + WebAssembly only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_python=false \
--data include_go=false

# Core + Python bindings only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_go=false

# Core + Go bindings only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_python=false

# Core functionality only
copier copy gh:asimihsan/copier_rust_template my-project \
--data include_wasm=false \
--data include_python=false \
--data include_go=false
```

## Project Structure

Your generated project will include:

**Core Components**

- `crates/core/`: Your main Rust library codebase
- `crates/cli/`: Command-line interface implementation
- `Cargo.toml` & `deny.toml`: Rust project configuration
- `.rustfmt.toml`: Code formatting rules
- `mise-tasks/`: Script-backed developer commands

**Optional Components**

- `crates/wasm/`: WebAssembly module (when `include_wasm=true`)
- `web/`: TypeScript frontend (when `include_wasm=true`)
- `crates/python/`: Rust extension crate for Python bindings (when `include_python=true`)
- `python/`: Python packaging and tests (when `include_python=true`)
- `crates/go/`: Rust crate for Go bindings (when `include_go=true`)
- `crates/go-wasm/`: Rust crate for Go/WASI bindings (when `include_go=true`)

**Development Environment**

- `mise.toml`: Toolchain configuration and common operations
- `.envrc`: Automatic environment activation
- `.watchmanconfig`: File-watcher ignore defaults carried over from `sheeptext`

## Testing

Run the full rendered-project validation locally:

```bash
mise run template:ci
```

If you want to inspect the rendered project after the run, set `OUTPUT_DIR`:

```bash
OUTPUT_DIR=/tmp/copier-rust-template-check mise run template:ci
```

## Contributing

If you find issues or have improvements to suggest, please open an issue or
submit a pull request.

## License

This project is licensed under the Mozilla Public License 2.0. See the
[LICENSE](LICENSE) file for details.