ui work phase 1

This commit is contained in:
2026-09-22 04:57:45 -03:00
parent 2ef6139957
commit 0ce36b98e4
23 changed files with 2332 additions and 1 deletions

View File

@@ -112,6 +112,38 @@ build it first: cd soleprint/common/ui && pnpm build
Each publish leaves a `.spr` stamp in the destination recording name, version,
type, source and mode, so a copy can say where it came from.
### Slices: only what a consumer uses
`publish` hands over the whole component. A **slice** hands over the part one
consumer actually uses, as readable source, computed rather than picked:
```bash
make ui # list: every export and part, and what it pulls in
make ui scan ../mpr/ui/detection-app # what an app uses; its framework copy against spr
./ctrl/ui.sh slice path/to/ui.toml # write the slices a run file lists
./ctrl/ui.sh check path/to/ui.toml # the same, writing nothing — exit 1 if stale
```
A run file names the consumer, where the slice goes, and whether it is read from
the consumer's own imports (`scan`) or named (`use`). `target = "vue"` takes files
from `common/ui/src` — `Panel` alone is one file and `vue`; `TimeSeriesRenderer`
brings uplot and nothing else does. `target = "plain"` takes parts from
`common/theme/parts` as one `ui.css` and one `ui.js`. See
`soleprint/common/slice/ui.example.toml`.
Two deliveries:
| `delivery` | for | what changes |
| --- | --- | --- |
| `dependency` | your own projects | nothing: spr's names stay, and a `.spr` stamp says where the copy came from |
| `vendored` | a repository that is not spr's | names go through a mapping profile, headers are stripped, no stamp is written, a scrub fails on any spr word, and `notice` must be stated |
Every run writes a manifest beside its run file recording the hash of each file
it wrote. That is what makes drift visible both ways: when spr moves on, `check`
says the slice is stale; when someone edits the copy, the next run names the file
and refuses to overwrite it without `--force` — so an improvement made in a
consumer can be brought back instead of lost.
## Deploying
```bash