Inside italic/bold code segments every bare word is a variable — including call arguments and method-call receivers — so text literals must be quoted and receivers no longer need backticks. A bare dotted callee `a.b` resolves as a method call when `a` is a local variable, otherwise as a library path (Python-style unified namespace), in both the tree-walk and bytecode backends. Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects to the new idiom; update SKILL.md and the design docs; fix the web/quantum example data model (db/index.mq.md). Unit and gold suites pass; only the 3 network-live tests fail offline. Co-authored-by: Cursor <cursoragent@cursor.com>
82 lines
1.9 KiB
Markdown
82 lines
1.9 KiB
Markdown
---
|
|
title: web assemble smoke
|
|
description: Offline assemble + render markers (no listen).
|
|
import web:ext/web/web.mq.md
|
|
import shell:web-fixtures/styles/shell.mq.md
|
|
import nav:web-fixtures/components/nav.mq.md
|
|
import side:web-fixtures/components/side.mq.md
|
|
import foot:web-fixtures/components/foot.mq.md
|
|
import articles:web-fixtures/db/articles.mq.md
|
|
import fs:lib/fs.mq.md
|
|
import json:lib/json.mq.md
|
|
---
|
|
|
|
# main
|
|
|
|
*store = > web.db url="sqlite:web-fixtures/data/smoke.db"*
|
|
*fields = > articles.schema*
|
|
> `store`.init name=articles fields=`fields`
|
|
*rows = > `store`.select table="articles" limit=1*
|
|
1. `rows`
|
|
*_ = 1*
|
|
2. *
|
|
*seed = > articles.seed*
|
|
> `store`.insert table=articles rows=`seed`
|
|
|
|
`home` =
|
|
|
|
| 组件 | 样式 |
|
|
|------|------|
|
|
| nav.`nav` | shell.`topnav` |
|
|
| side.`side` | shell.`side_panel` |
|
|
| foot.`foot` | |
|
|
|
|
`index` =
|
|
|
|
| 属性 | 值 | 样式 |
|
|
|------|-----|------|
|
|
| title | articles.`articles`.title | shell.`card_title` |
|
|
| body | articles.`articles`.body | shell.`card_body` |
|
|
|
|
*page = > web.page title="smoke" intro="<h1>smoke</h1>"*
|
|
*page = > `page`.compose_components components=`home`*
|
|
*page = > `page`.compose_main main=`index`*
|
|
*html = > `page`.render db=`store`*
|
|
|
|
1. `html`
|
|
> print text=render-ok
|
|
2. *
|
|
> print text=render-fail
|
|
|
|
*nav = > json.get value=`page` key="nav"*
|
|
1. `nav`
|
|
> print text=compose-nav-ok
|
|
2. *
|
|
> print text=compose-nav-fail
|
|
|
|
*side = > json.get value=`page` key="sidebar"*
|
|
1. `side`
|
|
> print text=compose-side-ok
|
|
2. *
|
|
> print text=compose-side-fail
|
|
|
|
*css = > json.get value=`page` key="styles_css"*
|
|
1. `css`
|
|
> print text=styles-ok
|
|
2. *
|
|
> print text=styles-fail
|
|
|
|
*parts = > json.get value=`page` key="parts"*
|
|
*index_part = > json.get value=`parts` key="index"*
|
|
1. `index_part`
|
|
> print text=compose-ok
|
|
2. *
|
|
> print text=compose-fail
|
|
|
|
*got = > `store`.get table="articles" id=1*
|
|
*title = > json.get value=`got` key="title"*
|
|
1. `title` == "Hello Marqdo"
|
|
> print text=db-ok
|
|
2. *
|
|
> print text=db-fail
|