[repo] Merge: main into feature/domi-ui (CPAL-1.0); @domi/ui v1.0.3 vendored (CPAL-1.0) with <DomiCredit /> and the README line

This commit is contained in:
2026-11-23 00:30:56 +01:00
194 changed files with 969 additions and 1227 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
/** The suite's instant: the demo's answers and the page's Date both read it (a Monday morning in Prague). */
export const CLOCK = "2026-11-16T09:30:00+01:00";
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// What every e2e test gets: the demo started over, the page's clock at the suite's instant, `open`
// for a page of the UI, and afterwards a check that nothing the page showed looks real
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The e2e suite's server (Playwright's global setup): builds the web UI (Vite, production) into a
// fresh temporary folder and serves it on 127.0.0.1 at a free port, with /api/v1 answered by the
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The release's screenshots (docs/release.md): each shot of tests/demo.ts SHOTS, 1440 × 900 at
// scale 1, saved as target/e2e/aula/<name>.png. .fabrica/aula.yaml lists the same files, which
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The main flows of ROADMAP §4 in a real browser, on the built UI and the demo control plane, with
// the clicks counted as in the smoke test (tests/flows.test.ts). Each is recorded: the showcase
+3 -3
View File
@@ -1,7 +1,7 @@
<!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<html lang="en" data-domi-room="ianitor">
<head>
<meta charset="utf-8" />
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "web",
"version": "0.2.0",
"private": true,
"license": "MPL-2.0",
"license": "CPAL-1.0",
"description": "Ianitor Domi web UI (Svelte 5, runes, TypeScript strict). A pure client of the control API.",
"type": "module",
"scripts": {
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The web UI's end-to-end suite (docs/fabrica.md, part 5): the built UI in a real browser against
// the demo control plane (tests/demo.ts, invented data only), served on 127.0.0.1 by e2e/serve.ts.
+12 -4
View File
@@ -1,10 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// The shell (handoff §2.16): sidebar on desktop, top and bottom bars on phone, the routes,
// the banners every screen starts with, toasts and the signed-out dialog (§10).
import { onMount } from "svelte";
import { DomiCredit } from "@domi/ui";
import { Button, Dialog, Icon } from "@ianitor/ui";
import type { IconName } from "@ianitor/ui";
import EngineChip from "./components/EngineChip.svelte";
@@ -104,6 +105,7 @@
<p>{viewer?.via === "authelia" ? `Signed in as ${viewer.name} through Authelia` : viewer ? `Using the API token "${viewer.name}"` : "Signed in through Authelia"}</p>
<p>Control on 127.0.0.1 only</p>
{#if app.overview?.site?.auth_logout_url}<a class="ia-link" href={app.overview.site.auth_logout_url}>Sign out</a>{/if}
<div class="credit"><DomiCredit /></div>
</div>
</nav>
<header class="topbar"><span class="ia-wordmark">IANITOR DOMI</span>{#if app.phone}<EngineChip />{/if}</header>
@@ -120,6 +122,7 @@
{:else if route.view === "settings"}
<Settings tab={route.tab} />
{/if}
<div class="credit phone-credit"><DomiCredit /></div>
</main>
<nav class="bottombar" aria-label="Main">
{#each NAV as n (n.href)}
@@ -160,10 +163,15 @@
.nav[aria-current="page"] :global(svg) { color: var(--domi-accent); }
.foot { margin-top: auto; font-size: 0.82rem; display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
main { padding: var(--main-pad); display: flex; flex-direction: column; gap: 18px; min-width: 0; outline: none; }
.topbar, .bottombar { display: none; }
.topbar, .bottombar, .phone-credit { display: none; }
/* LICENSE Exhibit B, Ianitor's and @domi/ui's (the same words; CPAL §14): on every screen, in the sidebar or, on a
phone, at the foot of the page. <DomiCredit /> renders it exactly. */
.credit { margin-top: 6px; font-size: 0.78rem; }
.sidebar .credit :global(.domi-credit) { justify-content: flex-start; }
@media (max-width: 719.98px) {
.shell { grid-template-columns: minmax(0, 1fr); }
.sidebar { display: none; }
.phone-credit { display: block; margin-top: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: var(--domi-chrome); border-bottom: 1px solid var(--domi-line); padding: 10px 16px; }
.topbar .ia-wordmark { font-size: 12px; letter-spacing: 0.26em; }
main { padding: 18px 16px calc(90px + env(safe-area-inset-bottom)); gap: 14px; }
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §7.1: the apply checklist, its countdown and the queued state.
import { Button, Icon, Progress } from "@ianitor/ui";
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §7.4 and §7.5: the last-change bar with Undo (1 click), and the reverted / not
// applied banner that stands in for its first line.
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §2.4: the engine chip (click 1 of the switch). On the main screen's header on a
// desktop, in the top bar on a phone (§2.16).
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §9: the engine popover. Click 1 is the chip, click 2 "Switch to Caddy" (the popover
// is the confirmation). The switch runs in control; this polls GET /engine until it ends.
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §2.5 and §5.1: the host list, sorted down, degraded, pending, unknown, healthy.
import { Status } from "@ianitor/ui";
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts" module>
import type { IconName } from "@ianitor/ui";
export interface Item {
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §6 and §7: the add/edit panel, its validation on blur, Apply, and the progress and
// outcome of the apply it starts. Every decision comes from control; the form only carries it.
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §13.5: the intermediate banner. Renew is 1 click; the banner then shows the match
// code. Until Custos can sign (docs/custos-ticket.md) the request is signed by hand offline,
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §8.2: mint on open (click 2), Copy link (click 3). Changing an option re-mints with
// `replaces`, so one link from this dialog is valid at a time; closing without copying stops it.
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §2.8 order: paused / needs attention, lost contact, health unavailable, the Caddy
// notice, then (on Hosts) the intermediate banner. First on every screen.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The one typed API client (handoff §0, §10, §11). It owns the base path, the UI header (CSRF),
// redirect: "manual" (sign-out detection), Idempotency-Keys, the error envelope, the server
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// Shared UI state: the overview (polled, handoff §3), the route, contact and sign-in state,
// the server clock offset and toasts. No business logic: everything shown comes from control.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// Following an apply (handoff §2.2 of ui-api, §3 here): GET /applies/{id} every second while it
// runs; quiet retries while edge reloads; the id kept in sessionStorage so a reload resumes it.
+15
View File
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
/**
* The Attribution Information of LICENSE, Exhibit B: Ianitor's credit, word for word the same as @domi/ui's
* (DOMI_ATTRIBUTION; tests/demo.test.ts checks they match). The web UI shows it through <DomiCredit /> on every
* screen (CPAL §14; §15 counts use over a network). Kept here as plain data for the e2e real-data check, which
* runs in Node and leaves out exactly these words.
*/
export const CREDIT = {
phrase: "Built on Domi",
notice: "Copyright (c) 2026 Marek Novák",
url: "https://aula.marek-novak.cz",
} as const;
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// Formatting only (handoff §3): times in the browser's zone, 24-hour clock, counts sentences.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The shapes the UI reads from control (docs/api.md, docs/ui-api.md, GET /api/v1/openapi.json).
// Only the fields the UI uses are typed.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The styles, once: @domi/ui (the Domi faces, the roles with Ianitor's values from data-domi-room="ianitor" on
// <html>, the controls), then Ianitor's own tokens and components on top.
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §13: Certificates → + Device → Issue (3 clicks), approval with the match code, then
// the install (the accepted 4th click). Until Custos can approve, approval is the server
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §8.1: History → pick → Restore this version (3 clicks with the nav click).
import { onMount } from "svelte";
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §5: the main screen.
import { tick } from "svelte";
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §13.6: signing the intermediate by hand on the offline computer (the temporary step
// until Custos can sign, docs/pki.md). The root key never comes to this server.
+7 -5
View File
@@ -1,11 +1,11 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §8.3: Settings with General, API (⚙ → API → New token = 3 clicks, Copy token the
// accepted 4th), Share links and About.
import { onMount } from "svelte";
import { DomiError, TextField } from "@domi/ui";
import { DomiCredit, DomiError, TextField } from "@domi/ui";
import { Banner, Button, Dialog, Segmented } from "@ianitor/ui";
import { ApiError, call, del, get, newKey, patch, post, sentence } from "../lib/api";
import { app, navigate, toast } from "../lib/app.svelte";
@@ -242,7 +242,8 @@
{/if}
{:else}
<p>Ianitor Domi 0.1.0</p>
<p>MPL-2.0</p>
<p>CPAL-1.0 (Common Public Attribution License 1.0). Ianitor 0.2.0 and earlier stay MPL-2.0.</p>
<div class="about-credit"><DomiCredit /></div>
<p>Built, tested and signed by Fabrica Domi</p>
<p><a class="ia-link" href="https://gitea.marek-novak.cz/mnovak/Ianitor" rel="noreferrer">Source on Gitea</a></p>
{/if}
@@ -270,6 +271,7 @@
{/if}
<style>
.about-credit :global(.domi-credit) { justify-content: flex-start; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs [role="tab"] { min-height: 44px; padding: 0 1rem; border-radius: var(--radius-sm); border: 0; background: none; color: var(--domi-fg-2); font-weight: 600; cursor: pointer; }
.tabs [role="tab"][aria-selected="true"] { background: var(--domi-hover); color: var(--domi-fg); }
+3 -3
View File
@@ -1,6 +1,6 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<!-- SPDX-License-Identifier: CPAL-1.0
- Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
- License 1.0: see LICENSE (its Exhibit A is this file's notice). -->
<script lang="ts">
// Handoff §10.2: Authelia sends the sign-in tab back here; it tells the first tab and closes.
import { onMount } from "svelte";
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
+15 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The release's screenshots (docs/release.md): every shot's screen is drawn from the demo control
// plane alone (each click and wait selector found, no call unanswered), and nothing the demo
@@ -10,6 +10,8 @@ import { cleanup, render, waitFor } from "@testing-library/svelte";
import { afterEach, describe, expect, it } from "vitest";
import App from "../src/App.svelte";
import { app } from "../src/lib/app.svelte";
import { DOMI_ATTRIBUTION } from "@domi/ui";
import { CREDIT } from "../src/lib/credit";
import { SHOTS, demoApi, realLooking } from "./demo";
let served: { status: number; path: string; text: string | null }[] = [];
@@ -54,6 +56,16 @@ describe("realLooking", () => {
expect(realLooking("gitea.example.cz and Mark's phone")).toEqual(["gitea.example.cz", "mark"]);
expect(realLooking("flowers.stage")).toEqual(["flowers.stage", "flowers"]);
});
it("is the same credit as @domi/ui's, word for word", () => {
expect([CREDIT.phrase, CREDIT.url, CREDIT.notice]).toEqual([DOMI_ATTRIBUTION.phrase, DOMI_ATTRIBUTION.url, DOMI_ATTRIBUTION.copyright]);
});
it("leaves out only the licence's credit, exactly as written", () => {
expect(realLooking("Built on Domi · Copyright (c) 2026 Marek Novák https://aula.marek-novak.cz")).toEqual([]);
expect(realLooking("Marek's server at https://aula.marek-novak.cz/hosts")).toContain("marek");
expect(realLooking("files.marek-novak.cz")).toEqual(["files.marek-novak.cz", "marek", "novak"]);
});
});
describe("the release's screenshots from the demo control plane", () => {
+8 -5
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The demo control plane for the release's screenshots (docs/release.md): control's answers
// (docs/api.md) for a small invented home server, built on the click smoke test's stand-in
@@ -10,6 +10,7 @@
// on any other name or address.
import { apply, host, mockRoutes, newMock, nowMs, respond, type Route } from "./mockApi";
import { CREDIT } from "../src/lib/credit";
/** One screenshot: the page, the selectors clicked in order, and the selector that means "drawn". */
export interface Shot {
@@ -277,9 +278,11 @@ const ALLOWED_TLDS = new Set(["test", "example", "invalid"]);
const DOC_NETS = ["192.0.2.", "198.51.100.", "203.0.113."];
const FORBIDDEN = ["mark", "marek", "novak", "flowers", "esp32", "hyperv"];
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. */
export function realLooking(text: string): string[] {
/** What in a text could be real: addresses outside the documentation ranges, names outside .test. The licence's
* credit (src/lib/credit.ts, LICENSE Exhibit B) is real on purpose and is the only text left out. */
export function realLooking(shown: string): string[] {
const found: string[] = [];
const text = [CREDIT.url, CREDIT.notice].reduce((t, c) => t.split(c).join(" "), shown);
for (const m of text.matchAll(/(?<![\w.])\d{1,3}(?:\.\d{1,3}){3}(?![\w.])/g)) {
if (m[0] !== "127.0.0.1" && !DOC_NETS.some((n) => m[0].startsWith(n))) found.push(m[0]);
}
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// The smoke test of every ROADMAP §4 flow with its clicks counted (handoff §4, §15): the real
// app against a stand-in for control's API. Typing, focus and waiting are not clicks.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// A stateful stand-in for control's API, shaped like the real answers (docs/api.md), so the
// smoke tests can walk every §4 flow and count its clicks. Its builders and routes are also the
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
// jsdom lacks a few browser features the UI uses.
+3 -3
View File
@@ -1,6 +1,6 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
// SPDX-License-Identifier: CPAL-1.0
// Copyright (c) 2026 Marek Novák. Part of Ianitor, under the Common Public Attribution
// License 1.0: see LICENSE (its Exhibit A is this file's notice).
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { defineConfig } from "vitest/config";