Restructure repo into five-package AFI architecture
Mizan is an Application Framework Interface (AFI) with five
independent packages:
packages/
mizan-ast/ Language layer (source → KDL schema)
mizan-schema/ IR layer (KDL schema definition)
mizan-rpc/ Protocol layer (client gen + server adapters)
adapters/django/ ← was django/
generator/ ← was react/src/generator/
mizan-csr/ State layer (client state engine)
adapters/react/ ← was react/
mizan-ssr/ Rendering layer (server-side rendering)
Each package is independent. The adapter directories contain the
framework-specific implementations. Stub packages (ast, schema, ssr)
establish the structure for future work.
264 Django tests + 33 React tests pass from new locations.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
17
Makefile
17
Makefile
@@ -1,27 +1,30 @@
|
||||
.PHONY: install test test-django test-react test-integration docker-up docker-down clean
|
||||
|
||||
DJANGO = packages/mizan-rpc/adapters/django
|
||||
REACT = packages/mizan-csr/adapters/react
|
||||
|
||||
# ─── Setup ───────────────────────────────────────────────────────────────────
|
||||
|
||||
install:
|
||||
cd django && pip install -e ".[dev,channels]"
|
||||
cd react && npm install
|
||||
cd $(DJANGO) && uv pip install -e ".[dev,channels]"
|
||||
cd $(REACT) && npm install
|
||||
|
||||
# ─── Unit Tests ──────────────────────────────────────────────────────────────
|
||||
|
||||
test: test-django test-react
|
||||
|
||||
test-django:
|
||||
cd django && pytest
|
||||
cd $(DJANGO) && uv run pytest
|
||||
|
||||
test-react:
|
||||
cd react && npm test
|
||||
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
|
||||
cd $(REACT) && npm run test:integration
|
||||
@$(MAKE) docker-down
|
||||
|
||||
# ─── Docker ──────────────────────────────────────────────────────────────────
|
||||
@@ -41,6 +44,6 @@ test-all: test test-integration
|
||||
|
||||
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 -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
|
||||
|
||||
Reference in New Issue
Block a user