@le-space/build-journey 0.0.0-stage → 0.12.12

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 CHANGED
@@ -1,3 +1,125 @@
1
- # Temporary Holding Version
1
+ # @le-space/build-journey
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The build of a sealed image ([`@le-space/sealed-image`](../sealed-image)) as a
4
+ journey in stations, for the full-screen view an app shows while it runs: a
5
+ pure model and a Svelte 5 component. Paperless anywhere (its first start) and
6
+ the Belege bridge (its own image) show the same view with their own words.
7
+
8
+ ```
9
+ 1 Builder ── 2 Genuine ── 3 Seal ── 4 Fetch ── 5 Stored ( ── 6 an app's start)
10
+ ```
11
+
12
+ ## Model (`@le-space/build-journey`)
13
+
14
+ Plain ES modules, no DOM, no network; runs in a browser and in Node.
15
+
16
+ - `BUILD_STATIONS`, `buildStations({ fetch: 600, … })`: the five stations of
17
+ the build with their typical seconds (`BUILD_TYPICAL`).
18
+ - `startStation({ key, typical, restoreFrom })`: a station after the build, a
19
+ VM started from the sealed image, with its small steps (`START_STEPS`:
20
+ measure, instance, network, unlock, ready, from `facts.vmStep`) and flows.
21
+ - `stationOfBuildStep(step)`: `onProgress({ step })` → station.
22
+ - `withFacts(facts, step, data, now)`: what was reported so far; keeps only
23
+ values that look like what they claim (hashes, relay, host, counts).
24
+ - `journey({ stations, station, since, now, facts, fetchPct, done })`: index,
25
+ share done, seconds left (the fetch by its bytes and measured speed, the
26
+ rest by typical time, an overrun keeps a minute in hand), when it ends.
27
+ - `substeps({ stations, station, current, facts, done })`: the small steps,
28
+ each `done`, `active` or `next`.
29
+ - `flowNow({ stations, station, facts, fetchPct })`: the path through the
30
+ places, what it carries, and its `kind`: `data` (pieces, drawn as dots),
31
+ `key` (the passphrase that seals, the key that unlocks a VM) or `report`
32
+ (an attestation report), drawn as a key or a shield travelling alone.
33
+ - `marksNow({ stations, station, facts, builder, done })`: what happened
34
+ where, as icons on the places with a note under each: the hardware's
35
+ measurement at the node and the browser's check of it (`ok` false when it
36
+ is not one the app pins), the key that seals the image in the node, the
37
+ fetch's connections each checked, the STORE signed in the browser and
38
+ stored on Aleph, and a start station's VM measured, checked and unlocked.
39
+ Only what a report says happened, or what happens now (`now`, blinking).
40
+ - `fetchPercent`, `fetchRate` (MiB/s).
41
+ - `evidence(facts, builder, links)`: the rows to check, with links: source
42
+ commit, plain image SHA-256 (its STORE), expected measurement (where the
43
+ app pins it), builder V-PROGRAM, node, relay, the measurement the AMD
44
+ processor reported (`ok`: it is one the app pins), content address, the
45
+ STORE, and after a start the INSTANCE and its measurement. `reported(rows)`
46
+ keeps what the build reported (not the pins).
47
+ - `HARDWARE`, `PLACES`, `LINKS`, `pathOf`, `onPath`, `short`, `minutes`.
48
+
49
+ `builder` is the app's pin as `@le-space/sealed-image` takes it:
50
+ `{ plain: { sha256, store, commit }, measurements, crn }`. `links` are bases:
51
+ `{ aleph: 'https://api2.aleph.im/api/v0/messages', repo: 'https://github.com/…', expected: '<url of the pin>' }`.
52
+
53
+ ## View (`@le-space/build-journey/BuildJourney.svelte`)
54
+
55
+ ```svelte
56
+ <script>
57
+ import BuildJourney from '@le-space/build-journey/BuildJourney.svelte';
58
+ import { stationOfBuildStep, withFacts } from '@le-space/build-journey';
59
+
60
+ let view = $state({ station: 'wake', since: Date.now(), done: false, failed: false, minimized: false, facts: {} });
61
+ const onProgress = ({ step, data }) => {
62
+ view.facts = withFacts(view.facts, step, data);
63
+ const station = stationOfBuildStep(step);
64
+ if (station && station !== view.station) Object.assign(view, { station, since: Date.now() });
65
+ };
66
+ </script>
67
+
68
+ <BuildJourney {view} text={(key, vars) => t(`journey.${key}`, vars)} builder={BUILDER} links={LINKS}
69
+ onminimize={() => (view.minimized = true)} onexpand={() => (view.minimized = false)} onclose={close} />
70
+ ```
71
+
72
+ Stations with their LEDs, the small steps of the current one, the animated
73
+ picture of what flows where (with keys, checks and measurements where they
74
+ happen), the evidence with links and the hardware behind
75
+ it, the total bar with the time left and when it ends, a slim bar when
76
+ minimised, the finale, and when it stopped: where, and `reason`. While it
77
+ runs it holds a Wake Lock (`wakeLock={false}` when the app holds one), asks
78
+ before the page is left, notes how long the page was in the background, and
79
+ the tab's title carries the progress.
80
+
81
+ Props: `view` (`{ station, since, done, failed, minimized, facts, fetchPct? }`),
82
+ `text`, `stations`, `locale`, `builder`, `links`, `hardware` (null hides it),
83
+ `places` and `lines` (the picture), `reason`, `hint` (e.g. a phone's),
84
+ `uploadHosts` (tries of the upload), `simple` (no small steps, no evidence), `finaleEvidence` (the build's evidence in the finale, default on),
85
+ `wakeLock`, `miniAt` (`'bottom'` fixed, `'top'` sticky), `openHref` and
86
+ `oncertificate` (the finale's buttons), `cover` (a snippet shown in the
87
+ overlay instead, e.g. a certificate), `testid` (prefix, default
88
+ `build-journey`), `onminimize`, `onexpand`, `onclose`.
89
+
90
+ ### Texts
91
+
92
+ Every word comes from `text(key, vars)`, so each app keeps its own catalogue.
93
+ Keys (`{var}` the values handed in):
94
+
95
+ - `kicker`, `title`, `minimize`, `expand`, `close`, `tab` `{pct}`, `leave`
96
+ - `step` `{n, of}`, `stoppedAt` `{n, station}`, `failedTitle`, `failedText`
97
+ - `stations.<key>.label|duration|title|text|mini` for each station
98
+ - `sub.<key>`: `ask boot answer` · `relay report match` · `send verify luks` ·
99
+ `lanes bytes` · `sign upload confirm` · a start: `measure instance network unlock ready`
100
+ - `attested` `{count}`, `mib` `{got, size}`, `rate` `{rate}`, `attempt` `{n, of}`,
101
+ `retryNote`, `fetched` `{pct}`
102
+ - `flowTitle`, `flow.program|report|passphrase|pieces|image` (a start:
103
+ `instance|vmReport|unlockKey|backup`), `places.<key>` (`browser relay node aleph`, and
104
+ any the app adds)
105
+ - `marks.measuring|measured|attested|mismatch|sealing|sealed|lanes` `{count}`
106
+ `|signing|signed|stored` (a start: `vmMeasuring|vmMeasured|vmAttested|unlocking|unlocked`):
107
+ the notes on the picture; on a narrow screen they stand as a list under it
108
+ - `evidenceTitle`, `evidence.commit|plain|expected|vprogram|node|relay|measured|cid|store|instance|vmMeasured`,
109
+ `matches`, `evidenceNone`, `evidenceNoneStopped`, `hardwareTitle`, `hardware.sev|epyc`
110
+ - `share` `{pct}`, `left` `{minutes}`, `endsAt` `{time}`, `keepOpen`, `cameBack` `{seconds}`
111
+ - `doneTitle`, `doneText`, and with the finale's buttons `open`, `showCertificate`
112
+
113
+ An empty text for `evidenceNone`, `evidenceNoneStopped` or `cameBack` leaves that note out.
114
+
115
+ Nothing a third party sends is rendered as HTML: facts are text, and only
116
+ values that match their pattern become links, under the bases the app hands in.
117
+
118
+ ## Tests
119
+
120
+ `pnpm --filter @le-space/build-journey test`: the model in Node, and the view
121
+ bundled for a browser (esbuild, the Svelte compiler, no Node built-ins) and
122
+ checked in Chromium through Playwright, in each state. Chromium once:
123
+ `pnpm exec playwright install chromium`; without it the view's test is
124
+ skipped, except in CI. `BUILD_JOURNEY_SHOTS=<dir>` leaves screenshots at
125
+ desktop and phone width.
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@le-space/build-journey",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.12.12",
4
+ "description": "The build of a sealed image (@le-space/sealed-image) as a journey in stations: a pure model (stations, facts, time left, small steps, flow, evidence) and a Svelte 5 view of it, with each app's words, stations and pins handed in.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "files": [
8
+ "src",
9
+ "README.md"
10
+ ],
11
+ "main": "./src/index.mjs",
12
+ "exports": {
13
+ ".": "./src/index.mjs",
14
+ "./model": "./src/model.mjs",
15
+ "./BuildJourney.svelte": {
16
+ "svelte": "./src/BuildJourney.svelte",
17
+ "default": "./src/BuildJourney.svelte"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/NiKrause/relay-button"
27
+ },
28
+ "homepage": "https://github.com/NiKrause/relay-button",
29
+ "bugs": {
30
+ "url": "https://github.com/NiKrause/relay-button/issues"
31
+ },
32
+ "peerDependencies": {
33
+ "svelte": "^5.0.0"
34
+ },
35
+ "sideEffects": [
36
+ "*.svelte"
37
+ ]
38
+ }