@close-by/clay 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/docs/README.md +11 -8
- package/docs/api.md +7 -5
- package/docs/boot.md +1 -1
- package/docs/duckdb.md +1 -3
- package/docs/examples.md +8 -4
- package/docs/getting-started.md +21 -44
- package/docs/kibana.md +2 -0
- package/docs/llms.txt +5 -2
- package/docs/reactive-let.md +7 -5
- package/package.json +5 -5
- package/src/index.ts +3 -0
package/README.md
CHANGED
|
@@ -18,4 +18,6 @@ export default function () {
|
|
|
18
18
|
bunx clay hello.ts
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Live demo: [clay.close-by.org](https://clay.close-by.org/).
|
|
22
|
+
|
|
23
|
+
Docs: shipped with the package at `node_modules/@close-by/clay/docs/`. Agent skill: `node_modules/@close-by/clay/SKILL.md` (or `@close-by/clay/skill`). See [getting-started.md](https://github.com/closeby-corp/clay/blob/main/docs/getting-started.md) after install.
|
package/docs/README.md
CHANGED
|
@@ -6,6 +6,8 @@ You write imperative `ui.*` code on the server. Clay owns a per-client element t
|
|
|
6
6
|
|
|
7
7
|
For coding agents: the repo-root [llms.txt](../llms.txt) is a short map of these guides. The [agent skill](./SKILL.md) ships with `@close-by/clay` at package root (`SKILL.md`).
|
|
8
8
|
|
|
9
|
+
[Live demo](https://clay.close-by.org/) · [Examples catalog](./examples.md)
|
|
10
|
+
|
|
9
11
|
## Guides
|
|
10
12
|
|
|
11
13
|
| Doc | Description |
|
|
@@ -36,20 +38,19 @@ For coding agents: the repo-root [llms.txt](../llms.txt) is a short map of these
|
|
|
36
38
|
|
|
37
39
|
## Quick start
|
|
38
40
|
|
|
41
|
+
The runtime packages are published to npm. The CLI includes prebuilt client assets.
|
|
42
|
+
|
|
39
43
|
```bash
|
|
40
|
-
bun
|
|
41
|
-
|
|
42
|
-
bun run clay hello.ts
|
|
44
|
+
bun add @close-by/clay-cli @close-by/clay
|
|
45
|
+
bunx clay hello.ts
|
|
43
46
|
# → http://localhost:3000
|
|
44
47
|
```
|
|
45
48
|
|
|
46
|
-
Outside the monorepo: `bun run pack:publishable` then install the `dist-pack/*.tgz` set (see [Getting started](./getting-started.md)), or `bun add @close-by/clay-cli @close-by/clay` once published. Maintainers: `bun run publish:dry` / `publish:npm` (order core → … → cli). Shipped CLI includes prebuilt client assets — no separate `build:client` after install.
|
|
47
|
-
|
|
48
49
|
```typescript
|
|
49
50
|
// hello.ts
|
|
50
51
|
import { ui } from '@close-by/clay';
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
export default function () {
|
|
53
54
|
let count = 0;
|
|
54
55
|
const label = ui.label(`Count: ${count}`);
|
|
55
56
|
|
|
@@ -67,15 +68,17 @@ ui.run(() => {
|
|
|
67
68
|
},
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
|
-
}
|
|
71
|
+
}
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
Multi-page with shell:
|
|
74
75
|
|
|
75
76
|
```bash
|
|
76
|
-
|
|
77
|
+
bunx clay ./pages --app --title "My App"
|
|
77
78
|
```
|
|
78
79
|
|
|
80
|
+
`ui.run` is library mode; see [Boot](./boot.md).
|
|
81
|
+
|
|
79
82
|
Or library-style entry (`loadPages` + `ui.run({ app })`) — see [Getting started](./getting-started.md).
|
|
80
83
|
|
|
81
84
|
## Naming
|
package/docs/api.md
CHANGED
|
@@ -1000,7 +1000,7 @@ registerFlowEdgeTypes({ labeled: BaduiLabeledEdge });
|
|
|
1000
1000
|
|
|
1001
1001
|
Then reference those keys from the server: `flow.node({ nodeType: 'fancy', … })` / edge `type: 'labeled'`, and optionally list them on the flow as `customNodeTypes` / `customEdgeTypes`.
|
|
1002
1002
|
|
|
1003
|
-
See Flow
|
|
1003
|
+
See the Flow demos (`/examples/flow` for 1–2, `/examples/flow-editing` for 3–4) for richer patterns:
|
|
1004
1004
|
|
|
1005
1005
|
1. **ETL pipeline** — select/switch/progress/buttons inside nodes; labeled smoothstep edges + dagre auto-layout
|
|
1006
1006
|
2. **Branching approval** — multi-handle triage (`yes` / `no` sources), rating + badges
|
|
@@ -1833,6 +1833,7 @@ onClick: async () => {
|
|
|
1833
1833
|
| `ui.runJavaScript(code)` | `void` | Eval trusted snippet in the browser |
|
|
1834
1834
|
| `ui.scroll.to(opts)` | `void` | Scroll window (`top` / `bottom` / px) |
|
|
1835
1835
|
| `ui.scroll.intoView(selector, opts?)` | `void` | `Element.scrollIntoView` via selector |
|
|
1836
|
+
| `ui.onDispose(callback)` | `void` | Register synchronous cleanup during a page build or event; runs once on disconnect, navigation, or reconnect page replacement. Requires an active session, so call it synchronously during the build or at the start of a handler (not after an `await`); callbacks run in registration order and errors are logged without stopping other cleanup. |
|
|
1836
1837
|
| `ui.timer(interval, callback, options?)` | `TimerHandle` | Session-scoped timer; `interval` in **seconds**; `{ once? }`; `.activate()` / `.deactivate()` / `.cancel()` |
|
|
1837
1838
|
| `ui.upload(props?)` | `Element` | Multipart HTTP upload; see below |
|
|
1838
1839
|
| `ui.storage.tab` | | Per-browser-tab map (sessionStorage mirror) |
|
|
@@ -1894,9 +1895,10 @@ User storage requires a `userId` on the session. The built-in client sends an an
|
|
|
1894
1895
|
const messages = ui.storage.app.create<Message[]>('chatMessages', []);
|
|
1895
1896
|
const online = ui.storage.app.create<string[]>('onlineUsers', [], { persist: false });
|
|
1896
1897
|
|
|
1897
|
-
|
|
1898
|
+
// Inside a page builder, unsubscribe when this page is disposed.
|
|
1899
|
+
ui.onDispose(messages.subscribe((list) => {
|
|
1898
1900
|
// update UI for this session
|
|
1899
|
-
});
|
|
1901
|
+
}));
|
|
1900
1902
|
|
|
1901
1903
|
await messages.set([...(await messages.get()), newMessage]);
|
|
1902
1904
|
await messages.update((prev) => [...prev, newMessage]);
|
|
@@ -1910,12 +1912,12 @@ await messages.update((prev) => [...prev, newMessage]);
|
|
|
1910
1912
|
| `storage.app.create(key, initial, options?)` | Get or create named store; `{ persist?: boolean }` |
|
|
1911
1913
|
| `.get()` | `Promise<T>` — load from adapter when persisted |
|
|
1912
1914
|
| `.set(v)` / `.update(fn)` | `Promise<void>` — save when persisted |
|
|
1913
|
-
| `.subscribe(listener)` | Listen for changes |
|
|
1915
|
+
| `.subscribe(listener)` | Listen for changes; returns an unsubscribe function. Pass it to `ui.onDispose` for page-scoped listeners; subscriptions created outside a session remain process-wide. |
|
|
1914
1916
|
| `storage.app.clearAll()` | Test helper (clears app stores only) |
|
|
1915
1917
|
| `storage.clearAll()` | Test helper (clears app stores + user bags + both adapters) |
|
|
1916
1918
|
| `createMemoryPersistence()` | In-memory adapter for tests (`@close-by/clay-core`) |
|
|
1917
1919
|
| `createFilePersistence({ dir })` | File-backed adapter (`@close-by/clay-persistence-file`) |
|
|
1918
|
-
| `createRedisPersistence({ client, keyPrefix? })` | Redis adapter (`@close-by/clay-persistence-redis
|
|
1920
|
+
| `createRedisPersistence({ client, keyPrefix? })` | Redis adapter (`@close-by/clay-persistence-redis`; monorepo only — not published to npm yet) — multi-process app/user bags; keep WS sticky |
|
|
1919
1921
|
|
|
1920
1922
|
`PersistenceAdapter`:
|
|
1921
1923
|
|
package/docs/boot.md
CHANGED
|
@@ -98,7 +98,7 @@ If you run **`tsc --noEmit`** (or IDE typecheck) on the app repo, exclude reload
|
|
|
98
98
|
|
|
99
99
|
Without that exclude, a leftover stub from a crashed dev session can produce spurious TS errors until you delete `.clay-reload/`. Clay apps that only typecheck `pages/` and `src/` rarely need more; monorepos should exclude `.clay-reload` at the app root `tsconfig.json`.
|
|
100
100
|
|
|
101
|
-
Legacy `_clay-reload-*.ts` files under `pages/` (pre-0.2.5) should be deleted; modern Clay writes
|
|
101
|
+
Legacy `_clay-reload-*.ts` files under `pages/` (pre-0.2.5) should be deleted; modern Clay writes to `<cwd>/.clay-reload/`, inside the project tree but outside `pages/`.
|
|
102
102
|
|
|
103
103
|
## Reactive-let
|
|
104
104
|
|
package/docs/duckdb.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Multi-database DuckDB wrapper: named instances, `ATTACH` for DuckDB/SQLite/Postgres/MySQL, and insert/update/delete helpers.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
bun add @close-by/clay-duckdb # or depend on workspace:* inside this monorepo
|
|
7
|
-
```
|
|
5
|
+
**Monorepo only — not published to npm yet.** Depend on `@close-by/clay-duckdb` with `workspace:*` inside this monorepo.
|
|
8
6
|
|
|
9
7
|
## Connect multiple databases
|
|
10
8
|
|
package/docs/examples.md
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
Demo entry: [`apps/demo/src/main.ts`](../apps/demo/src/main.ts)
|
|
4
4
|
Pages: [`apps/demo/src/examples/`](../apps/demo/src/examples/) (auto-loaded via `ui.loadPages`)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Live: https://clay.close-by.org/ · locally in this repo: `bun run build:client && bun run demo` (or `bun run demo:cli`), then open http://localhost:4000.
|
|
7
|
+
|
|
8
|
+
## Standalone apps
|
|
9
|
+
|
|
10
|
+
- [`examples/tailwind-app/`](../examples/tailwind-app/): Standalone app with Tailwind utilities.
|
|
7
11
|
|
|
8
12
|
## Sidebar groups
|
|
9
13
|
|
|
@@ -16,8 +20,7 @@ Each page sets `group` / `groupIcon` in its `pageMeta`, so the sidebar and the h
|
|
|
16
20
|
| `/` | `Home.ts` | Landing page: hero, live counter + source side by side (`ui.codeBlock`), feature grid, catalog grouped via `ui.navFromPages()` (same as sidebar) |
|
|
17
21
|
| `/examples/counter` | `Counter.ts` | `setText`, `refreshable`, button variants |
|
|
18
22
|
| `/examples/todo` | `Todo.ts` | `reactive`, `bindValue`, list `refreshable`, filters |
|
|
19
|
-
| `/examples/reactive-let-orders` | `ReactiveLetOrders.ts` | Order filters and master–detail views with `ui.state` / `ui.auto` |
|
|
20
|
-
| `/examples/reactive-let-orders-let` | `ReactiveLetOrdersLet.ts` | The same order workflow with reactive `let` variables and the Clay CLI transform |
|
|
23
|
+
| `/examples/reactive-let-orders` | `ReactiveLetOrders.ts` | Order filters and master–detail views with `ui.state` / `ui.auto`, plus the equivalent reactive `let` source (runnable copy: `examples/reactive-let-orders.ts` with the Clay CLI) |
|
|
21
24
|
| `/examples/chat` | `Chat.ts` | `ui.storage.app` (persisted messages + ephemeral presence), async `get`/`set` |
|
|
22
25
|
| `/examples/ai` | `AiDemo.ts` | `ui.ai.*` gallery — chat, prompt bar, loader/thinking, agent cards, diff/insights/fine-tune (static props; no model runtime) |
|
|
23
26
|
| `/examples/upload` | `FileUpload.ts` | `ui.upload` button + dropzone (progress/abort/size), `ui.storage.tab` / `user`, `ui.download`, `ui.clipboard` |
|
|
@@ -39,7 +42,8 @@ Each page sets `group` / `groupIcon` in its `pageMeta`, so the sidebar and the h
|
|
|
39
42
|
| `/examples/kanban` | `KanbanDemo.ts` | `ui.kanban` swimlanes, card detail drawer, element-owned `cardMove`/`cardSelect`, reset via APIs |
|
|
40
43
|
| `/examples/list` | `ListDemo.ts` | Apps: `ui.list` groups, drag to reorder, reset via `setGroups` |
|
|
41
44
|
| `/examples/gantt` | `GanttDemo.ts` | `ui.gantt` owned rows/dates/markers/deps, cross-row drag, header double-click markers, `itemMove` / `markerAdd` settle |
|
|
42
|
-
| `/examples/flow` | `FlowDemo.ts` |
|
|
45
|
+
| `/examples/flow` | `FlowDemo.ts` | `ui.flow` ETL pipeline with in-node controls, labeled edges and dagre auto-layout; multi-handle approval branches |
|
|
46
|
+
| `/examples/flow-editing` | `FlowEditingDemo.ts` | Fan-in/out with `addNode` dynamic stages; group/`parentId` nesting |
|
|
43
47
|
| `/examples/data-clients` | `DataClientsDemo.ts` | DuckDB / Kibana / ClickHouse integration story (mock-friendly) |
|
|
44
48
|
| `/examples/maps` | `MapsGallery.ts` | `ui.map` gallery: markers and popups, routes, arcs, choropleth, clusters, compact analytics map |
|
|
45
49
|
| `/examples/delivery-tracker` | `DeliveryTracker.ts` | `ui.map` route progress and courier marker: `updateRoute` / `upsertMarker` on a timer, `fill` layout |
|
package/docs/getting-started.md
CHANGED
|
@@ -6,13 +6,21 @@
|
|
|
6
6
|
- Node-compatible OS (macOS / Linux / WSL)
|
|
7
7
|
- For local tarball installs: npm (links co-installed `file:` packages; Bun may try the registry for rewritten versions)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Install from npm
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun add @close-by/clay-cli @close-by/clay
|
|
13
|
+
# transitive: core, components, server, persistence-file
|
|
14
|
+
# optional: bun add @close-by/clay-auth
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Use `bun init`’s tsconfig or set `"extends": "@close-by/clay/page-tsconfig"` in your `tsconfig.json`.
|
|
10
18
|
|
|
11
19
|
Consumers import `@close-by/clay` and run apps with the `clay` binary from `@close-by/clay-cli`. The CLI ships prebuilt Vite assets (`client-dist`); you do **not** need `@close-by/clay-client` or a monorepo `build:client`.
|
|
12
20
|
|
|
13
21
|
Walkthrough (tasks list → two pages + `--app`): [Sample app](./tutorial.md).
|
|
14
22
|
|
|
15
|
-
###
|
|
23
|
+
### Contributors: local packs
|
|
16
24
|
|
|
17
25
|
```bash
|
|
18
26
|
# In the Clay checkout:
|
|
@@ -22,38 +30,21 @@ bun run pack:publishable # build:client + bun pm pack → dist-pack/*.tgz
|
|
|
22
30
|
|
|
23
31
|
# In your app directory:
|
|
24
32
|
npm install \
|
|
25
|
-
/path/to/clay/dist-pack/close-by-clay-core
|
|
26
|
-
/path/to/clay/dist-pack/close-by-clay-auth
|
|
27
|
-
/path/to/clay/dist-pack/close-by-clay-compiler
|
|
28
|
-
/path/to/clay/dist-pack/close-by-clay-persistence-file
|
|
29
|
-
/path/to/clay/dist-pack/close-by-clay-components
|
|
30
|
-
/path/to/clay/dist-pack/close-by-clay-server
|
|
31
|
-
/path/to/clay/dist-pack/close-by-clay
|
|
32
|
-
/path/to/clay/dist-pack/close-by-clay-cli
|
|
33
|
+
'/path/to/clay/dist-pack/close-by-clay-core-<version>.tgz' \
|
|
34
|
+
'/path/to/clay/dist-pack/close-by-clay-auth-<version>.tgz' \
|
|
35
|
+
'/path/to/clay/dist-pack/close-by-clay-compiler-<version>.tgz' \
|
|
36
|
+
'/path/to/clay/dist-pack/close-by-clay-persistence-file-<version>.tgz' \
|
|
37
|
+
'/path/to/clay/dist-pack/close-by-clay-components-<version>.tgz' \
|
|
38
|
+
'/path/to/clay/dist-pack/close-by-clay-server-<version>.tgz' \
|
|
39
|
+
'/path/to/clay/dist-pack/close-by-clay-<version>.tgz' \
|
|
40
|
+
'/path/to/clay/dist-pack/close-by-clay-cli-<version>.tgz'
|
|
33
41
|
```
|
|
34
42
|
|
|
35
|
-
Install **all** runtime tarballs together so `@close-by/clay` and `@close-by/clay
|
|
36
|
-
|
|
37
|
-
### When published to npm
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
bun add @close-by/clay-cli @close-by/clay
|
|
41
|
-
# transitive: core, components, server, persistence-file
|
|
42
|
-
# optional: bun add @close-by/clay-auth
|
|
43
|
-
```
|
|
43
|
+
Replace `<version>` with the packed version. Install **all** runtime tarballs together so `@close-by/clay` and `@close-by/clay-*@<version>` resolve from the co-installed packs.
|
|
44
44
|
|
|
45
45
|
### Publishing to npm (maintainers)
|
|
46
46
|
|
|
47
|
-
Runtime packages are scoped
|
|
48
|
-
|
|
49
|
-
1. `@close-by/clay-core`
|
|
50
|
-
2. `@close-by/clay-auth`
|
|
51
|
-
3. `@close-by/clay-compiler`
|
|
52
|
-
4. `@close-by/clay-persistence-file`
|
|
53
|
-
5. `@close-by/clay-components`
|
|
54
|
-
6. `@close-by/clay-server`
|
|
55
|
-
7. `@close-by/clay`
|
|
56
|
-
8. `@close-by/clay-cli`
|
|
47
|
+
Runtime packages are scoped and public. The canonical package list and dependency publish order are in [`scripts/publishable.ts`](../scripts/publishable.ts).
|
|
57
48
|
|
|
58
49
|
```bash
|
|
59
50
|
# In the Clay checkout:
|
|
@@ -65,20 +56,6 @@ bun run publish:npm # pack + validate + real npm publish (same or
|
|
|
65
56
|
# Re-run is safe: versions already on npm are skipped.
|
|
66
57
|
```
|
|
67
58
|
|
|
68
|
-
Equivalent manual flow from packed tarballs:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
bun run pack:publishable
|
|
72
|
-
npm publish ./dist-pack/close-by-clay-core-0.1.0.tgz --access public
|
|
73
|
-
npm publish ./dist-pack/close-by-clay-auth-0.1.0.tgz --access public
|
|
74
|
-
npm publish ./dist-pack/close-by-clay-compiler-0.1.0.tgz --access public
|
|
75
|
-
npm publish ./dist-pack/close-by-clay-persistence-file-0.1.0.tgz --access public
|
|
76
|
-
npm publish ./dist-pack/close-by-clay-components-0.1.0.tgz --access public
|
|
77
|
-
npm publish ./dist-pack/close-by-clay-server-0.1.0.tgz --access public
|
|
78
|
-
npm publish ./dist-pack/close-by-clay-0.1.0.tgz --access public
|
|
79
|
-
npm publish ./dist-pack/close-by-clay-cli-0.1.0.tgz --access public
|
|
80
|
-
```
|
|
81
|
-
|
|
82
59
|
`publish:dry` checks each tarball for rewritten deps (no `workspace:*`), `license` / README / LICENSE, CLI `bin` + `client-dist`, `@close-by/clay` `docs/` (via `prepack` → `scripts/sync-docs.ts`), then runs `npm publish --dry-run`. `publish:npm` looks up each `name@version` on the registry and **skips** if it is already published (resume after a partial failure). Use `--skip-pack` to reuse an existing `dist-pack/`: `bun scripts/publish-from-pack.ts --dry-run --skip-pack`.
|
|
83
60
|
|
|
84
61
|
After install, version-matched docs live at `node_modules/@close-by/clay/docs/` (import paths like `@close-by/clay/docs/api.md` with Bun, or `resolveClayDocsDir` from `@close-by/clay/docs-dir`).
|
|
@@ -202,7 +179,7 @@ Open:
|
|
|
202
179
|
- Source packages keep `workspace:*` for the monorepo; `bun pm pack` / publish rewrites them to the package version.
|
|
203
180
|
- `@close-by/clay-client` is **private**; only its Vite `dist` is copied into `@close-by/clay-cli` (`copy-client` / CLI `prepack`, also invoked by `build:client`).
|
|
204
181
|
- Root stays `private: true`. Each runtime package ships `license`, `README.md`, `LICENSE`, and `publishConfig.access: public`.
|
|
205
|
-
-
|
|
182
|
+
- Publishable packages and dependency order: [`scripts/publishable.ts`](../scripts/publishable.ts).
|
|
206
183
|
|
|
207
184
|
## Library mode (multi-page entrypoint)
|
|
208
185
|
|
package/docs/kibana.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Authenticated (or internal) Kibana REST client: arbitrary API calls, Elasticsearch via console proxy or `/elasticsearch`, and `search_after` pagination for walking every matching log line.
|
|
4
4
|
|
|
5
|
+
**Monorepo only — not published to npm yet.** Depend on `@close-by/clay-kibana` with `workspace:*` inside this monorepo.
|
|
6
|
+
|
|
5
7
|
```typescript
|
|
6
8
|
import { Kibana } from '@close-by/clay-kibana';
|
|
7
9
|
|
package/docs/llms.txt
CHANGED
|
@@ -33,6 +33,8 @@ Notes for agents:
|
|
|
33
33
|
|
|
34
34
|
## Examples
|
|
35
35
|
|
|
36
|
+
- [Live demo](https://clay.close-by.org/): Browse the running examples
|
|
37
|
+
|
|
36
38
|
- [Examples catalog](docs/examples.md): Demo routes and patterns
|
|
37
39
|
- [Demo pages](apps/demo/src/examples/): Runnable `ui.page` modules
|
|
38
40
|
|
|
@@ -43,7 +45,8 @@ Notes for agents:
|
|
|
43
45
|
- [Compatibility](docs/compatibility.md): Public API promise, aliases, and compatibility checks
|
|
44
46
|
- [AI UI](docs/ai.md): `ui.ai.*` visual primitives
|
|
45
47
|
- [Reactive let](docs/reactive-let.md): `ui.state` / `ui.auto` and the compile-time `let` transform
|
|
46
|
-
- [DuckDB](docs/duckdb.md): `@close-by/clay-duckdb`
|
|
48
|
+
- [DuckDB](docs/duckdb.md): `@close-by/clay-duckdb` — monorepo only — not published to npm yet
|
|
49
|
+
- Redis persistence: `@close-by/clay-persistence-redis` — monorepo only — not published to npm yet (see [storage API](docs/api.md))
|
|
47
50
|
- [ClickHouse](docs/clickhouse.md): `@close-by/clay-clickhouse`
|
|
48
|
-
- [Kibana](docs/kibana.md): `@close-by/clay-kibana`
|
|
51
|
+
- [Kibana](docs/kibana.md): `@close-by/clay-kibana` — monorepo only — not published to npm yet
|
|
49
52
|
- [NiceGUI](https://nicegui.io/documentation): Inspiration for the `ui.*` style
|
package/docs/reactive-let.md
CHANGED
|
@@ -66,7 +66,7 @@ Clay lifts `count` into `ui.state`, turns the label into `bindText`, and leaves
|
|
|
66
66
|
| When to use `let` + pragma | When to stay on Phase 1 |
|
|
67
67
|
|-----------------------------|-------------------------|
|
|
68
68
|
| Counters, toggles, filters on demo pages | Async fetch before first paint, heavy CJS imports |
|
|
69
|
-
| Orders-shaped proof pages (`
|
|
69
|
+
| Orders-shaped proof pages (`examples/reactive-let-orders.ts`) | Per-row mutable state without stable row keys |
|
|
70
70
|
| Teaching / prototyping NiceGUI-style UX | You want zero Bun loader / compiler in the path |
|
|
71
71
|
|
|
72
72
|
Phase 1 remains the **escape hatch** — copy patterns from [`ReactiveLetOrders.ts`](../apps/demo/src/examples/ReactiveLetOrders.ts) when Phase 2 limits bite.
|
|
@@ -206,13 +206,15 @@ Tests: `packages/compiler/src/transform.test.ts`, `packages/core/src/auto.test.t
|
|
|
206
206
|
| Page | Syntax | Run |
|
|
207
207
|
|------|--------|-----|
|
|
208
208
|
| [`ReactiveLetOrders.ts`](../apps/demo/src/examples/ReactiveLetOrders.ts) | Phase 1 `state` / `auto` | `bun run cli` |
|
|
209
|
-
| [`
|
|
209
|
+
| [`examples/reactive-let-orders.ts`](../examples/reactive-let-orders.ts) | `let` + `// @clay-reactive` | `bun run clay examples/reactive-let-orders.ts --reactive-let` (from repo root) |
|
|
210
210
|
|
|
211
211
|
```bash
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
bun run demo:cli # Orders at /examples/reactive-let-orders, always interactive
|
|
213
|
+
bun run clay examples/reactive-let-orders.ts --reactive-let # standalone let proof, same route
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
The demo Orders page includes the let source as a code block. The standalone copy stays outside the auto-loaded demo pages.
|
|
217
|
+
|
|
218
|
+
Compiler coverage: `packages/compiler/src/orders-proof.test.ts` transforms the standalone let example and asserts separate list/detail regions (no mega-`auto`).
|
|
217
219
|
|
|
218
220
|
Without `--reactive-let`, `let` assignments are silent no-ops (no error).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@close-by/clay",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "NiceGUI-like ui.* facade for Clay apps",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@close-by/clay-compiler": "0.2.
|
|
41
|
-
"@close-by/clay-core": "0.2.
|
|
42
|
-
"@close-by/clay-components": "0.2.
|
|
43
|
-
"@close-by/clay-server": "0.2.
|
|
40
|
+
"@close-by/clay-compiler": "0.2.26",
|
|
41
|
+
"@close-by/clay-core": "0.2.26",
|
|
42
|
+
"@close-by/clay-components": "0.2.26",
|
|
43
|
+
"@close-by/clay-server": "0.2.26",
|
|
44
44
|
"@tailwindcss/cli": "^4.3.3",
|
|
45
45
|
"tailwindcss": "^4.3.3"
|
|
46
46
|
}
|
package/src/index.ts
CHANGED
|
@@ -501,10 +501,12 @@ import {
|
|
|
501
501
|
} from '@close-by/clay-core';
|
|
502
502
|
import {
|
|
503
503
|
ClayServer,
|
|
504
|
+
onDispose,
|
|
504
505
|
type ClayServerConfig,
|
|
505
506
|
establishAuthSession as establishAuthSessionCore,
|
|
506
507
|
clearAuthSession as clearAuthSessionCore,
|
|
507
508
|
} from '@close-by/clay-server';
|
|
509
|
+
export { onDispose };
|
|
508
510
|
import {
|
|
509
511
|
loadPages,
|
|
510
512
|
navFromPages,
|
|
@@ -2075,6 +2077,7 @@ export const ui = {
|
|
|
2075
2077
|
runJavaScript,
|
|
2076
2078
|
scroll,
|
|
2077
2079
|
timer,
|
|
2080
|
+
onDispose,
|
|
2078
2081
|
storage,
|
|
2079
2082
|
theme,
|
|
2080
2083
|
sound,
|