[docs] Domi UI: vendored at a tag, how to upgrade, the Nix hash still to paste

This commit is contained in:
2026-11-23 00:06:10 +01:00
parent b40e2d3b8e
commit f59f8e251d
3 changed files with 24 additions and 23 deletions
+17 -16
View File
@@ -1,13 +1,20 @@
# Ianitor on @domi/ui
The web UI's controls and roles come from **@domi/ui**, the shared Domi design system (Gitea `mnovak/domi-design`,
its `docs/INTEGRATE.md` and `docs/MIGRATION.md`). It is pinned by tag in `apps/web` and `packages/ui`:
its `docs/INTEGRATE.md` §6a and `docs/MIGRATION.md`). It is **vendored** at a tag in `packages/domi-ui` (MPL-2.0,
like Ianitor; `VERSION` names the tag, v1.0.2) and used as a workspace package by `apps/web` and `packages/ui`:
```json
"@domi/ui": "git+https://gitea.marek-novak.cz/mnovak/domi-design.git#v1.0.1"
"@domi/ui": "workspace:*"
```
The lockfile holds the tag's commit (4c7173a). Upgrade by changing the tag after reading its CHANGELOG.md.
Why vendored: domi-design is private on Gitea, and the Nix build (`deploy/nixos/web.nix`) fetches the pnpm
dependencies in a sandbox without credentials. A token there would land in the world-readable Nix store and be needed
on every builder. The vendored copy is offline, reproducible and secret-free; the lockfile names no Gitea repository.
**Do not edit `packages/domi-ui`.** Changes go to domi-design as a PR. To upgrade, read the next tag's CHANGELOG.md,
then from a clone of domi-design run `node tools/vendor.mjs <this repo>/packages/domi-ui vX.Y.Z`, `pnpm install`, and
update `fetchPnpmDeps`'s hash in `deploy/nixos/web.nix` (`lib.fakeHash`, build, paste the hash Nix reports).
## What comes from where
@@ -58,23 +65,17 @@ share dialog still opens with the focus on it.
The host form still checks a field when the focus leaves it, now when it leaves the field and its seal.
## Type checking: a shim until @domi/ui fixes Strike.svelte
## Type checking
@domi/ui 1.0.x's `index.ts` imports `Strike.svelte`, which has no `<script lang="ts">`. Outside the package, a strict
svelte-check refuses that import (implicit any). `apps/web/tsconfig.json` maps `@domi/ui` to
`apps/web/src/domi-ui-types.ts`, which re-exports the components Ianitor uses straight from their files. This is
for types only: Vite, Vitest and the build use the package. Remove both when @domi/ui adds the script tag
(reported to the domi-design session).
@domi/ui's `Strike.svelte` has no `<script lang="ts">`, so TypeScript reads it as JavaScript. `apps/web/tsconfig.json`
sets `allowJs` (with `checkJs` off), as domi-design's own tsconfig does; without it a strict svelte-check refuses the
import (implicit any).
## Risks
- **The Nix build cannot fetch @domi/ui.** `deploy/nixos/web.nix` fetches the pnpm dependencies in a sandbox
without credentials. domi-pki is readable without a login, but domi-design is not (checked 2026-11-22: an
anonymous `git ls-remote` is refused). Until Gitea serves domi-design to anonymous readers, or Ianitor vendors
the tagged files, `nix build .#ianitor` fails, and `fetchPnpmDeps`'s hash in `web.nix` cannot be updated.
**This change must not be merged before that is decided** (Mark).
- Fabrica's runners need a Gitea login for `pnpm install` (the Windows runner on Mark's PC has Git Credential
Manager; INTEGRATE.md §1 has the CI way: a short-lived credential from Custos).
- **The Nix hash is not filled in yet.** `fetchPnpmDeps`'s hash in `deploy/nixos/web.nix` is `lib.fakeHash` because
no machine here has Nix. The first `nix build .#ianitor-web` fails and prints the hash to paste. **Do not merge
before it is pasted and the build passes.**
- A visual change Mark has not seen beyond the asked-for controls: the field labels are @domi/ui's (13 px, 600),
and Ianitor's group labels (Certificate, Visit log, What is it) follow them so a form reads as one; the
segmented controls are as wide as their choices, not the panel.