Skip to content
/ rs-template Public template

rust project template, support monorepo/app/lib etc.

License

Notifications You must be signed in to change notification settings

better-rs/rs-template

Repository files navigation

rs-project-template

rust project template

QuickStart:

Requirements:

  • cookiecutter
# Mac OS X install cookiecutter:
brew install cookiecutter

# Python + pipx:
brew install pipx
pipx ensurepath
pipx install cookiecutter

# Debian/Ubuntu:
sudo apt-get install cookiecutter
  • go-task:
brew install go-task/tap/go-task

Usage:

create monorepo:

# cd:
cd your-workspace/

# create rust monorepo(git repo):
cookiecutter https://github.com/better-rs/rs-template.git --directory="mono-repo/rs"

test run:

task run

# example app:
test cli:run

# example lib:
test core:test

Generate Project Folder Structure:

monorepo:

-> % tree mono/ -L 5 -a
mono/
├── .editorconfig
├── .env.local
├── .github
│   └── workflows
│       ├── rust-clippy.yml
│       └── rust.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .pre-commit-hooks.yaml
├── Cargo.lock
├── Cargo.toml
├── Readme.md
├── Taskfile.yml
├── crates                               // monorepo // rust workspace
│   ├── app                        // your create app
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   ├── Taskfile.yml     // run scripts
│   │   └── src
│   │       └── main.rs
│   ├── cli                        // example app/bin
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   ├── Taskfile.yml     // run scripts
│   │   └── src
│   │       └── bin
│   │           └── main.rs
│   └── core                       // example lib
│       ├── .gitignore
│       ├── Cargo.toml
│       ├── README.md
│       ├── Taskfile.yml           // run scripts
│       └── src
│           └── lib.rs
├── docs
│   └── .gitkeep
├── rustfmt.toml
└── tmp
    └── .gitkeep

12 directories, 27 files