packages/
mizan-runtime/ Framework-agnostic state engine (~150 lines)
Context registry, batched invalidation, fetch primitives
mizan-django/ Django server adapter (was packages/mizan-rpc/adapters/django/)
Codegen moved to mizan-django/generate/
mizan-react/ React adapter (was packages/mizan-csr/adapters/react/)
Removed premature abstractions: mizan-ast, mizan-schema, mizan-rpc,
mizan-csr, mizan-ssr stub packages. The actual architecture is three
concrete packages, not five abstract layers.
mizan-runtime implements the v1 spec: registerContext with params,
scoped invalidation via microtask batching, server-driven invalidation
from mutation responses, mizanFetch for context bundles, mizanCall for
mutations.
264 Django + 33 React tests pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
2.4 KiB
Makefile
50 lines
2.4 KiB
Makefile
.PHONY: install test test-django test-react test-integration docker-up docker-down clean
|
|
|
|
DJANGO = packages/mizan-django
|
|
REACT = packages/mizan-react
|
|
|
|
# ─── Setup ───────────────────────────────────────────────────────────────────
|
|
|
|
install:
|
|
cd $(DJANGO) && uv pip install -e ".[dev,channels]"
|
|
cd $(REACT) && npm install
|
|
|
|
# ─── Unit Tests ──────────────────────────────────────────────────────────────
|
|
|
|
test: test-django test-react
|
|
|
|
test-django:
|
|
cd $(DJANGO) && uv run pytest
|
|
|
|
test-react:
|
|
cd $(REACT) && npm test
|
|
|
|
# ─── Integration Tests ──────────────────────────────────────────────────────
|
|
|
|
test-integration: docker-up
|
|
@echo "Waiting for backend..."
|
|
@timeout 30 sh -c 'until curl -sf http://localhost:8000/api/mizan/session/ > /dev/null 2>&1; do sleep 1; done'
|
|
cd $(REACT) && npm run test:integration
|
|
@$(MAKE) docker-down
|
|
|
|
# ─── Docker ──────────────────────────────────────────────────────────────────
|
|
|
|
docker-up:
|
|
docker compose -f examples/django-react-site/docker-compose.test.yml up -d --build
|
|
@echo "Backend starting at http://localhost:8000"
|
|
|
|
docker-down:
|
|
docker compose -f examples/django-react-site/docker-compose.test.yml down
|
|
|
|
# ─── All ─────────────────────────────────────────────────────────────────────
|
|
|
|
test-all: test test-integration
|
|
|
|
# ─── Cleanup ─────────────────────────────────────────────────────────────────
|
|
|
|
clean:
|
|
docker compose -f examples/django-react-site/docker-compose.test.yml down -v --remove-orphans 2>/dev/null || true
|
|
rm -rf $(DJANGO)/src/mizan.egg-info $(DJANGO)/dist $(DJANGO)/build
|
|
rm -rf $(REACT)/dist $(REACT)/node_modules
|
|
rm -f examples/django-react-site/backend/db.sqlite3
|