Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Build development environment from makefile #5098

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
50 changes: 50 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Makefile for common development tasks

# Check if uv is installed
check-uv:
@if ! command -v uv &> /dev/null; then \
echo "Warning: 'uv' is not installed. Please install it from https://github.com/astral-sh/uv?tab=readme-ov-file#installation"; \
exit 1; \
fi

# Check if nvm is installed
# Look in NVM_DIR for nvm.sh
check-nvm:
@if [ ! -f "${NVM_DIR}/nvm.sh" ]; then \
echo "Warning: 'nvm' is not installed. Please install it from https://github.com/nvm-sh/nvm#installing-and-updating"; \
exit 1; \
fi

nvm:
. ${NVM_DIR}/nvm.sh && nvm use && $(NVMCMD)

venv:
. .venv/bin/activate && $(VENVCMD)

with-sources:
. .venv/bin/activate && . ${NVM_DIR}/nvm.sh && $(CMD)

# Install dependencies
deps: check-uv check-nvm
uv python install 3.12
. ${NVM_DIR}/nvm.sh && nvm install
make nvm NVMCMD="npm install -g pnpm"
uv tool install pre-commit
uv sync --all-extras

# Run backend development server
dev-backend:
make venv VENVCMD="tox r -e phoenix_main -- --dev serve"

# Run frontend development server
dev-frontend:
make nvm NVMCMD="cd app && pnpm install && pnpm run dev:ui"

# Run both backend and frontend development servers
dev:
make with-sources CMD="cd app && pnpm install && pnpm run dev"

clean:
rm -rf ./app/node_modules
rm -rf .venv
rm -rf .tox
Loading
Loading