Move codegen out of mizan-django: protocol/mizan-generate/
The codegen consumes a schema from any backend and emits typed client code for any frontend — it doesn't belong inside a backend adapter. That placement was historical sediment from when there was only a Django backend; it predates the AFI generalization. New top-level slot: `protocol/` for protocol-level tooling. Tree is now: backends/ server protocol adapters frontends/ client kernel + per-framework adapters cores/ shared language-level primitives protocol/ protocol-level tooling workers/ runtime workers / bridges Codegen moves to `protocol/mizan-generate/`. Same file layout under `generator/` (cli.mjs, lib/), preserved via git mv. Package metadata cleaned up: - name: "generate" (placeholder) → "mizan-generate" - description filled in - type: module (cli.mjs is .mjs ESM, was previously declared "commonjs") - bin entry added so `npx mizan-generate --config <config.mjs>` works once the package is published, instead of `node path/to/cli.mjs`. Path-reference fixups: - backends/mizan-django/README.md: `node path/to/...` → `npx mizan-generate` - backends/mizan-fastapi/README.md: same - ISSUES.md: file paths in three issue entries - CLAUDE.md: codegen description + Package Layout section refreshed (added protocol/, mizan-fastapi entry, mizan-python entry) - docs/AFI_ARCHITECTURE.md: Package Layout refreshed identically Verified codegen runs from new location: regenerated the FastAPI example harness's api/ output, identical to pre-move. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -108,9 +108,8 @@ anonymous request. The executor branches on those for `auth=True`,
|
||||
|
||||
## Generate the frontend
|
||||
|
||||
The codegen lives in `backends/mizan-django/generate/` (the codegen package
|
||||
is framework-agnostic; the directory name is historical). Point a config at
|
||||
your FastAPI app and run the CLI:
|
||||
The codegen is `mizan-generate` (in `protocol/mizan-generate/`). Point a
|
||||
config at your FastAPI app and run the CLI:
|
||||
|
||||
```js
|
||||
// frontend/fastapi.config.mjs
|
||||
@@ -133,7 +132,7 @@ export default {
|
||||
```
|
||||
|
||||
```bash
|
||||
node path/to/mizan-django/generate/generator/cli.mjs --config fastapi.config.mjs
|
||||
npx mizan-generate --config fastapi.config.mjs
|
||||
```
|
||||
|
||||
The codegen drives `python -m mizan_fastapi.cli <module>` under the hood,
|
||||
|
||||
Reference in New Issue
Block a user