Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
50 changes: 42 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ make setup # once: the switch solidtype, all dependencies, and
make test # the ppx's lowering, the plugin's rewrite, the
# libraries' tests and the example's
make lint # formatting, the plugin's and the generators' types,
# litany, the release build, and the generated bindings
# litany, the release build, the generated bindings, and
# agents/ against the pages
make fmt # format in place
make example # the board, built by Vite into _build/example-dist, and
# its Astro page, into _build/example-astro
Expand All @@ -34,6 +35,7 @@ make docs # the documentation site, odoc's reference copied into
# as .github/workflows/docs.yml publishes it from main
make docs-serve # the documentation site built, served on DOCS_PORT with
# search
make agents # agents/ written from the documentation's pages
make release VERSION=1.2.3 # tag and release
```

Expand Down Expand Up @@ -65,10 +67,14 @@ headless/ solidtype-headless: the components Kobalte lacks, one
taken and passed on; and Kobalte's own where they need
a fix, each fixed part Kobalte's beneath, the others
Kobalte's as they are
data_grid a data grid's model, whoever dresses it: its columns,
its rows sorted, and reordered by a drop
table a grid of rows and cells: Kobalte's list of rows,
their selection, the keys through their cells, a row
that loads more, columns laid out and resized as
React Stately lays them out, and rows that hold rows,
React Stately lays them out, columns pinned to a side
and a header kept in view, rows reordered by a drag or
the keys, and rows that hold rows,
each row's cells and rows tokens it draws once read
color_picker one colour its parts share, as React Aria's: the colour
components below read it, given no value of their own;
Expand All @@ -81,6 +87,9 @@ headless/ solidtype-headless: the components Kobalte lacks, one
with a wrap, removed by a button or the keys and the
focus moved on
load_more_sentinel what asks a list for more as its end comes into view
top_layer the browser's top layer: an overlay drawn above the
page and every overlay opened before it, and one
kept above those opened after
virtualizer React Aria's Virtualizer: a collection draws the entries
in view, each placed by a layout
color_swatch Kobalte's, a colour less than opaque one a browser
Expand Down Expand Up @@ -131,9 +140,15 @@ heroui/ solidtype-heroui: HeroUI's components ported onto
selection_indicator
what a tab's and a segment's indicator share: drawn in
the selected item, it starts where the last one was
segment trend_chip text_shimmer
segment trend_chip text_shimmer number_stepper
components HeroUI ships no stylesheet for, made as
every port is: their look a stylesheet each
table.css what HeroUI's table stylesheet does not draw: a column
pinned, a header kept in view, where a dragged row
would land
data_grid a grid of rows given as data and columns as
definitions, drawn on the Table port, its look
data-grid.css
extras.css those stylesheets in the components layer, which the
plugin's tarball ships as heroui-extras.css
docs/ the documentation, a Starlight site in Hypha's look,
Expand Down Expand Up @@ -166,13 +181,23 @@ docs/ the documentation, a Starlight site in Hypha's look,
the packages, and a link to each module's odoc page,
which `make docs` copies into public/reference/,
ignored, since Starlight serves public/ as it is
public/llms.txt the site's index for a model, written by hand: what
solidtype is, how it is written, every page; amended
with each page added or changed
agents.md what an agent knows before any page -- the packages
and how solidtype is written -- which the theme puts
at the head of llms.txt; each group's note, and the
skill's description and the parts agents have been
seen writing by hand instead, are in astro.config.mjs
src/pages/demo/ the Astro page's demo, pages of Astro's own outside
Starlight: a route per tea, its islands given props,
under a basket the client router keeps; the page
imports their sources as @demo/<path>?raw
agents/ the documentation for a user's agent, generated by
starlight-theme-hypha from the pages, `make agents`:
llms.txt, the catalogue; pages/, each page as
Markdown, its examples written in; skills/solidtype/,
the skill that sends an agent there; installed by the
root dune into $(opam var solidtype:doc), and llms.txt
alone, its links to solidtype's pages, into every other
package's doc/
prds/ the PRDs of work being decided and built, and which
document owns each kind of fact once it lands
generate/ what writes the generated bindings from Solid's,
Expand Down Expand Up @@ -275,8 +300,8 @@ test/internationalized_date/
test/ppx/ what the ppx writes for each JSX form
test/test_docs.ml every island of docs/islands on some page, or a part of
other islands, every rhp page linked to rhp's, every
page in llms.txt, and the plugin a page installs the
newest release's in CHANGES.md
port's to HeroUI's before its usage, and the plugin a
page installs the newest release's in CHANGES.md
test/does_not_compile.t
each mistake the types refuse, built against the
installed library, with the error a user reads
Expand Down Expand Up @@ -680,6 +705,15 @@ break.
`_ Jsx.component`, never a function type, and an OCaml component is
`Jsx.component make`. Why: Melange wraps an external function used as
a value in a closure, which no JSX tag can name.
- **`agents/` is generated, never edited.** starlight-theme-hypha writes it
from the documentation's pages, `docs/agents.md` and the `agents` options
in `docs/astro.config.mjs`: a page changed is `make agents` run in the
same commit. A module with a page of its own names the page's installed
path, `$(opam var solidtype:doc)/pages/<page>.md`, in its `.mli`'s opening
comment, and `generate/rhp.ts` writes it for rhp's generated components.
Why: a user's agent reads what the release installs, offline, and a page
it reads must be the release's. Test: `make lint` runs `HYPHA_AGENTS=check
astro sync`, which fails on each file that differs from the pages.
- **Tests of what runs in a browser are OCaml, run by vitest.** Alcotest
does not build for Melange; `melange-jest` reaches the globals vitest
shares with Jest. The ppx, native, is tested by its expectations. Why:
Expand Down
96 changes: 96 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,101 @@
# Changes

## 0.12.0 (2026-11-20)

- HeroUI's `Data_grid`: rows given as data, each known by its `row_id`, and
columns as definitions, `Data_grid.column`, drawn on HeroUI's `Table`. A
column sorts exactly when it is given a `sort`, by a row's text in the
page's order or a comparison, the grid keeping its own sort or drawing the
application's; a cell is given its row as an accessor, so a control in it
keeps its focus as the row is given again. Selection checkboxes, columns
resized, pinned and aligned, a header kept in view, rows dragged to a new
place and told with every row, an empty state, a footer, loading more and
virtualization. Its look is `heroui/data-grid.css`, in the plugin's
`heroui-extras.css`. `Solidtype_headless.Data_grid` is its model, for
another design system's grid.
- HeroUI's `Table` takes `pinned` on a `Table.Column` and `sticky_header` on
its `Table.Content`, drawn by the plugin's `heroui-extras.css`; a pinned
cell at a corner of the body fills what lies outside its curve, so nothing
scrolling beneath shows there.
- The headless `Table` reorders its rows, given `on_reorder`: a
`Table.Drag_handle` grabs its row by Enter or Space, the arrows move it
among the rows of its parent and Enter drops it, Escape lets it go, and a
pointer drags it; each step is told to a reader in React Aria's words, a
selected row is dragged with the others selected, and `on_reorder` is
given the rows moved and the row they land beside. A pointer's drag leaves
the row in its place, `data-dragging`, and draws a copy of it that follows
the pointer, `data-drag-preview`. HeroUI's `Table` does so by a `Button` of
`` slot=`drag ``, its dragged row dimmed, its copy lifted, and a line in the
accent where it would land.
- The headless `Table` pins a column to its start or its end, `pinned=`start`
on its `Table.Column`: its header and cells stay in view as the others
scroll beneath them, each beside the columns pinned there before it, the
last of each side `data-pinned-edge`, and the table
`data-pinned-start-detached` and `data-pinned-end-detached` while content
passes beneath them; virtualized too. `sticky_header=true` on its
`Table.Root` keeps the columns' headers at the top of what scrolls it.
- A key pressed in a control inside the headless `Table`'s cell, and so the
HeroUI `Table`'s, is the control's: a field keeps every key, where the
arrows moved focus to another row, a letter could find one, Space selected
it and Tab left the table; a key a control handles is its own; and the
arrows, Home and End from a button move from its cell.
- The headless `Table`, and so the HeroUI `Table`, keeps a resizable
table's layout and its columns' widths beside a `style` given to its
`Table.Root` or a `Table.Column`, which replaced them.
- A resizable table prerendered on the server lays its columns out as they
ask, where every column was 0 pixels wide: the server computes
a memo once, before the columns had registered, and hydration never wrote
the widths again.
- A letter typed on the headless `Table`'s row, and so the HeroUI
`Table`'s, moves to the next row whose text starts with what was typed,
as its interface said; it found none, since each row's text was taken to
be its key.
- HeroUI's `Number_stepper`: a `Number_field` drawn as two round buttons
around its value, whose digits roll to each new number the way it moved,
up as it rises and down as it falls, in sizes; its
value, range, step, format, form and keys are the field's, its input out of
sight in the page's order until text is typed in it. Its look is
`heroui/number-stepper.css`, in the plugin's `heroui-extras.css`. A
component built on a number field draws it in its own classes by
`Number_field.Look`, and reads its value by `Number_field.Shown`.
- A HeroUI `Button` given `` slot=`increment `` or `` slot=`decrement `` steps
the `Number_field` or `Number_stepper` it is in, as React Aria's slots do.
- HeroUI's `Number_field` given `aria_label` and no `Label` names its input
by it, and its buttons "Increase" and "Decrease" followed by it, as React
Aria's; its input was unnamed and its buttons named by a label that was not
there.
- A caller's `on_key_down`, `on_focus` and `on_blur` on the headless
`Number_field`'s and `Color_channel_field`'s input are called beside
Kobalte's own, which they replaced, so the arrows no longer stepped it.
- A component's function child drawn by `Jsx.draw` is drawn where Solid
inserts it, so what it reads draws only it again: a menu opened by a button
in a HeroUI `Table`'s cell stays open, where the cell drew its content anew
and closed it.
- A press that begins on a control in the headless `Table`'s cell leaves the
focus where the control puts it, rather than on the cell.
- Every overlay of HeroUI's ports is drawn in the browser's top layer, by
`Solidtype_headless.Top_layer`: above anything the page stacks, a
virtualized table's sticky header among them, and above every overlay
opened before it, the toasts kept above them all. A popover, a menu, a
select's list and a tooltip were drawn under such a header, since Kobalte
copies its content's `z-index`, which HeroUI's styles leave to React Aria.
- A Kobalte part's `ref` is the function Solid calls with its element, of
the element it declares: every portal's, which the binding left out, is
`?ref:(Dom.element -> unit)`, since a portal draws a `<div>` or a `<g>`.
Breaking: `SegmentedControl`'s root takes `Dom.htmlElement -> unit`, not
an element or a function; the `Types` modules written for a portal's
ref's element, `AlertDialog_Portal_Ref` and the like, are gone.
- `vite-plugin-solidtype` writes a `ref` given by name as a function that
calls it, so a module's function given as an element's `ref`,
`ref=Top_layer.place`, is called with the element, where Solid's compiler
would assign the element to it, an import, and the build failed.
- Each package installs the documentation for a user's agent: `solidtype`
its catalogue, `llms.txt`, every page in Markdown with its examples, and
a skill, `skills/solidtype`, in `$(opam var solidtype:doc)`; every other
package the catalogue, its links reaching those pages. The README's *With
an agent* says how to give an agent the skill, and a module with a page
names the page's installed path in its `.mli`.

## 0.11.1 (2026-11-16)

- The code `ppx_solidtype` writes around a component's tag, the `if false`
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DOCS_PORT ?= 4321
REFERENCE = solidtype solidtype-kobalte solidtype-headless solidtype-heroui solidtype-rhp solidtype-internationalized-date solidtype-gravity-icons ppx_solidtype odoc.support

.DEFAULT_GOAL := help
.PHONY: help setup build test lint fmt example example-serve docs docs-serve generate release
.PHONY: help setup build test lint fmt example example-serve docs docs-serve agents generate release

help: ## list targets
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
Expand All @@ -30,8 +30,10 @@ test: build node_modules ## run the tests
$(OPAM) dune test --force
$(OPAM) bun run test

# Release is the profile opam installs with.
lint: node_modules ## check formatting, types, litany, the release build and bindings
# Release is the profile opam installs with. agents/ is checked from docs/,
# where Astro finds its config, by reading the pages without building the
# site.
lint: node_modules ## check formatting, types, litany, the release build, bindings and agents/
$(OPAM) dune build @all @fmt
$(OPAM) dune build --profile release @all
$(OPAM) litany check
Expand All @@ -43,6 +45,7 @@ lint: node_modules ## check formatting, types, litany, the release build and bin
$(OPAM) bun generate/rhp.ts --check
$(OPAM) bun generate/internationalized_date.ts --check
$(OPAM) bun generate/gravity_icons.ts --check
cd docs && HYPHA_AGENTS=check bunx astro sync

fmt: ## format the code
$(OPAM) dune fmt
Expand Down Expand Up @@ -74,6 +77,11 @@ docs: build node_modules ## build the documentation site
docs-serve: docs ## serve the built documentation site
cd docs && bun --bun astro preview --open --port $(DOCS_PORT)

# Each page as Markdown, llms.txt and the skill, from the documentation's
# pages, for the solidtype package to install.
agents: node_modules ## write agents/ from the documentation's pages
cd docs && HYPHA_AGENTS=write bunx astro sync

generate: node_modules ## write the generated bindings
$(OPAM) bun generate/html.ts
$(OPAM) bun generate/kobalte.ts
Expand Down
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,51 @@ rhp's charts and @internationalized/date's dates included.

```sh
opam repo add open-opam https://github.com/open-opam/opam-repository.git
opam install solidtype
opam install solidtype solidtype-heroui
bun add $(opam show solidtype-heroui --field x-npm-depends)
```

```ocaml
module Jsx = Solidtype.Jsx
module Solid = Solidtype.Solid
module Button = Solidtype_heroui.Button

let make () =
let count, set_count = Solid.create_signal 0 in
<button type_=`button on_click=(fun _ -> Solid.update set_count succ)>
<Button variant=`secondary on_click=(fun _ -> Solid.update set_count succ)>
"Clicked " (Jsx.int (Solid.get count))
</button>
</Button>
```

Setting up dune and Vite to build it:
[Getting Started](https://hyphatech.github.io/solidtype/).

## With an agent

Each release installs its documentation for an agent with it: `llms.txt`,
every page in Markdown, and a skill that sends the agent there before it
writes code with solidtype. With opam alone, copy the skill into your
project, into `.agents/skills/` for Codex, Cursor and most agents or
`.claude/skills/` for Claude Code:

```sh
mkdir -p .agents/skills
cp -r $(opam var solidtype:doc)/skills/solidtype .agents/skills/
```

With Node or Bun:

```sh
npx skills add hyphatech/solidtype
```

An agent that reads no skills is told in your project's `AGENTS.md`:

```md
Before writing code with solidtype, read `$(opam var solidtype:doc)/llms.txt`
and the page of each part the work needs; build from its parts.
```

## Licence

MIT, copyright Hypha Technologies Ltd. See [LICENSE](LICENSE).
Loading