feat(mise): add template files

This commit is contained in:
Sergio Laín 2024-10-17 17:36:34 +02:00
parent 4cc814caa8
commit 491a5cfff2
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
5 changed files with 170 additions and 0 deletions

View file

@ -0,0 +1,20 @@
# Install Go dependencies
[tasks.install]
alias = "i"
run = "go mod tidy"
# Add a new dependency
[tasks.add]
run = "go get"
# Run the application
[tasks.dev]
run = "go run main.go"
# Run linting
[tasks.lint]
run = "golangci-lint run"
# Run formatting
[tasks.format]
run = "gofumpt -l -w ."

View file

@ -0,0 +1,39 @@
[env]
# Set up the path for node module binaries
BIN_PATH = "{{ cwd }}/node_modules/.bin"
[tools]
# Install Node.js using the specified version
# node = "{{ env['NODE_VERSION'] | default(value='lts') }}" # LTS Version
# node = "{{ get_env(name='NODE_VERSION', default='18.2') }}" # Specific version
node = "latest"
pnpm = "latest"
# Install npm dependencies
[tasks.install]
run = "pnpm install"
# Add a new dependency
[tasks.add]
run = "pnpm add"
# Run the development server
[tasks.dev]
alias = "d"
run = "pnpm run dev"
# Run linting
[tasks.lint]
run = "eslint src/"
# Run formatting
[tasks.format]
run = "prettierd src/"
# Run tests
[tasks.test]
run = "jest"
# Build the project
[tasks.build]
run = "pnpm run build"

View file

@ -0,0 +1,39 @@
[env]
_.python.venv = { path = ".venv", create = true }
[tools]
poetry = { version = "latest", pyproject = "pyproject.toml" }
# Installs the specified Python version
# python = "{{ get_env(name='PYTHON_VERSION', default='3.11') }}" # Specific version
python = "latest"
# Install dependencies
[tasks.install]
alias = "i"
run = "poetry install"
# Add a new dependency
[tasks.add]
alias = "a"
run = "poetry add"
# Update dependencies
[tasks.update]
run = "poetry update"
# Run the application
[tasks.run]
run = "python main.py"
# List dependencies
[tasks.deps]
run = "poetry show --tree"
# Run tests
[tasks.test]
run = "pytest tests/"
# Lint the code
[tasks.lint]
run = "ruff src/"

View file

@ -0,0 +1,39 @@
[env]
# Automatic virtualenv activation
_.python.venv = { path = ".venv", create = true }
[tools]
# Installs the specified Python version
# python = "{{ get_env(name='PYTHON_VERSION', default='3.11') }}" # Specific version
python = "latest"
uv = "latest"
ruff = "latest"
# Install dependencies
[tasks.install]
alias = "i"
run = "uv pip install -r requirements.txt"
# Add a new dependency
[tasks.add]
run = "uv pip install"
# Run the application
[tasks.run]
run = "python main.py"
# List dependencies
[tasks.deps]
run = "uv pip list"
# Run tests
[tasks.test]
run = "pytest tests/"
# Lint the code
[tasks.lint]
run = "ruff src/"
# Format the code
[tasks.format]
run = "ruff format src/"

View file

@ -0,0 +1,33 @@
# Install Rust dependencies
[tasks.install]
alias = "i"
run = "cargo build"
# Add a new dependency
[tasks.add]
run = "cargo add"
# Run the application
[tasks.dev]
run = "cargo run"
# Run linting
[tasks.lint]
run = "cargo clippy"
# Run formatting
[tasks.format]
run = "cargo fmt"
# Run tests
[tasks.test]
run = "cargo test"
# Cleaning the cache
[tasks.clean]
depends = ['cleancache']
run = "cargo clean"
[tasks.cleancache]
run = "rm -rf .cache"
hide = true