feat(web): Document/Endpoint/Resource artifact rewrite (ADR 0007)

Replace the monolithic compose_*/configure author surface with file-level
web|endpoint artifacts, split ext/{web,data,security,net}, and lock
no-degrade rules so the model cannot regress to God-object APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-28 11:06:38 +08:00
1 parent 33f8b94bb0
commit 67bac1bf02
54 files changed
+4642 -2505

No files matched your search

+17 -28
View File
@@ -1,31 +1,20 @@
# ext/web
# ext/web — Document / Endpoint / Resource
Official dynamic website extension: **GFM tables + class methods**.
Design: [`doc/design/ext-web.md`](../../doc/design/ext-web.md).
Official dynamic site extension (**ADR 0007**). Design: [`doc/design/ext-web-artifact.md`](../../doc/design/ext-web-artifact.md).
| Surface | Import | Classes |
|---------|--------|---------|
| English | `> ext/web/web.mq.md` | `page` · `db` · `app` · `form` · `style` |
| Chinese | `> ext/web/网页.mq.md` | `页面` · `数据库` · `应用` · `表单` · `样式` |
```bash
cargo build -p marqdo_plugin_web
# optional install into ~/.marqdo/ext
marqdo ext add web
```
Canonical sample (design §4): [`examples/web-site/`](../../examples/web-site/).
```bash
cargo run -- run examples/web-site/index.mq.md
# http://127.0.0.1:18081/
# /_form/article · /admin · /admin/articles/new
```
Offline smokes: `tests/ext/web-smoke.mq.md`, `web-form-smoke.mq.md`, `web-admin-smoke.mq.md`.
| Feature | Notes |
| Surface | Import |
|---------|--------|
| Form §5.5 | field/rules tables · `validate` · `submit` · `mount_form` → `GET\|POST /_form/{id}` |
| Admin CRUD | `admin=True` · schema → same form path · new/edit/delete under `/admin/{table}` |
| Route | `` `app`.route path=/about page=`about` `` → `GET /about` |
| English | `import web:ext/web/web.mq.md` |
| Chinese | `导入 网页:ext/web/网页.mq.md` |
**Facade:** `page` · `route` · `serve` · `render` · `inspect` · `use`
**Related modules:** `ext/data` (db/cache/storage) · `ext/security` (auth/oidc/rbac) · `ext/net` (http/websocket/url)
```bash
bash scripts/build-web-plugin.sh
marqdo ext add web # optional install
marqdo run examples/marqdo-blog/serve.mq.md
```
Hard rules: no author `ensure_plugin` / `compose_*` / `configure` junk drawer; View schema `|type|slot|value|attrs|style|` only; declared vs system routes via `inspect`.