diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..04effb7 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,20 @@ +{ + "name": "dev", + "image": "mcr.microsoft.com/devcontainers/base:debian", + "customizations": { + "vscode": { + "extensions": [ + "StarkWare.cairo1", + "tamasfe.even-better-toml", + "rust-lang.rust-analyzer" + ] + } + }, + "features": { + "ghcr.io/devcontainers/features/rust:1": { + "version": "stable" + } + }, + "postCreateCommand": "bash .devcontainer/install-tools.sh", + "remoteUser": "vscode" +} diff --git a/.devcontainer/install-tools.sh b/.devcontainer/install-tools.sh new file mode 100644 index 0000000..e799adc --- /dev/null +++ b/.devcontainer/install-tools.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -e + +echo "🚀 Setting up development environment..." + +# Install dependencies +apt-get update && apt-get install -y curl git build-essential + + +# Install asdf +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0 +echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc +echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc +. ~/.asdf/asdf.sh + +# Add and install plugins +asdf plugin add scarb || true +asdf install scarb 2.10.1 +asdf global scarb 2.10.1 + +asdf plugin add dojo https://github.com/dojoengine/asdf-dojo || true +asdf install dojo 1.5.0 +asdf global dojo 1.5.0 + +asdf plugin add starknet-foundry || true +asdf install starknet-foundry 0.35.0 +asdf global starknet-foundry 0.35.0 + + +echo "✅ Environment ready!" \ No newline at end of file diff --git a/README.md b/README.md index f6ed6b2..d4e07fb 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,28 @@ Once you're ready: - A detailed explanation of your changes. - References to related issues (if applicable). +## 🐳 DevContainer Setup (Docker) + +We provide a **Docker DevContainer** to simplify development and avoid local dependency issues. + +### Prerequisites +- [Docker](https://docs.docker.com/get-docker/) installed and running +- [Visual Studio Code](https://code.visualstudio.com/) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) + +### Setup +1. Open the project in **VS Code**. +2. Press **CTRL + SHIFT + P** → select **“Dev Containers: Reopen in Container”**. +3. The container will build and install all required tools automatically. + +### Verify +Inside the container, run: + +```bash +sozo build +sozo test +scarb fmt --check +``` + ## Maintainers
Josué | Kevin |