From 491a5cfff208134ad2c5c51da58e3462a5534589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 17 Oct 2024 17:36:34 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(mise):=20add=20template=20file?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/mise/templates/go.toml | 20 ++++++++++++ .config/mise/templates/node.toml | 39 +++++++++++++++++++++++ .config/mise/templates/python-poetry.toml | 39 +++++++++++++++++++++++ .config/mise/templates/python-uv.toml | 39 +++++++++++++++++++++++ .config/mise/templates/rust.toml | 33 +++++++++++++++++++ 5 files changed, 170 insertions(+) create mode 100644 .config/mise/templates/go.toml create mode 100644 .config/mise/templates/node.toml create mode 100644 .config/mise/templates/python-poetry.toml create mode 100644 .config/mise/templates/python-uv.toml create mode 100644 .config/mise/templates/rust.toml diff --git a/.config/mise/templates/go.toml b/.config/mise/templates/go.toml new file mode 100644 index 00000000..14ce205d --- /dev/null +++ b/.config/mise/templates/go.toml @@ -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 ." diff --git a/.config/mise/templates/node.toml b/.config/mise/templates/node.toml new file mode 100644 index 00000000..566fd211 --- /dev/null +++ b/.config/mise/templates/node.toml @@ -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" diff --git a/.config/mise/templates/python-poetry.toml b/.config/mise/templates/python-poetry.toml new file mode 100644 index 00000000..37f3bb06 --- /dev/null +++ b/.config/mise/templates/python-poetry.toml @@ -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/" diff --git a/.config/mise/templates/python-uv.toml b/.config/mise/templates/python-uv.toml new file mode 100644 index 00000000..89f60df4 --- /dev/null +++ b/.config/mise/templates/python-uv.toml @@ -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/" diff --git a/.config/mise/templates/rust.toml b/.config/mise/templates/rust.toml new file mode 100644 index 00000000..035d6f79 --- /dev/null +++ b/.config/mise/templates/rust.toml @@ -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