4.2 KiB
@vicen/base
The base application skeleton: a SvelteKit app, prerendered to static files, that consumes UIX
as source from this workspace. It follows docs/consuming.md to
the letter and is the first app that runs the framework's pre-hydration boot for real. It is a
skeleton, not a product — one page, composed from canon components only:
- the
AppShellblock, with aTogglethat writesuix.prefs.setIntent('mode', …)and aSelectthat writesuix.prefs.setIntent('language', …)(es/en/ar); - a
Headingand aDialogopened by its triggerButton.
Where things are
| File | What it is |
|---|---|
svelte.config.js |
the framework's alias table, runes by config, kit.csp with THIS app's boot hash |
vite.config.ts |
sveltekit() + uixBootCheck, which fails the build on a stale boot |
src/prefs-schema.ts |
the preference schema — read by the root layout AND compiled into the boot |
src/generated/boot.js |
the compiled boot (npm run boot), committed |
src/hooks.server.ts |
replaces %uix.boot% in src/app.html with the boot tag |
src/lib/eidos-config.ts |
the eidos config the root registers, and the theme ids the boot is given |
src/lib/reset.css |
the document reset the foundation leaves to the app (docs/consuming.md §5) |
src/lib/strings.ts |
the page's words in es, en and ar, read with langs.ts |
src/routes/+layout.svelte |
the standalone composition root |
scripts/sync-assets.mjs |
copies the framework's static/fonts and static/sounds into static/ |
scripts/smoke.mjs |
loads build/ in Chromium and holds it to the boot contract |
static/fonts/, static/sounds/, build/ and .svelte-kit/ are generated and git-ignored.
Commands
Run them from the repository root with -w apps/base, or from this directory without it.
npm run dev -w apps/base # dev server (copies the assets first)
npm run build -w apps/base # static build into build/ (copies the assets first)
npm run preview -w apps/base # serve the build
npm run check -w apps/base # svelte-kit sync + svelte-check
npm run boot -w apps/base # recompile src/generated/boot.js — after editing the schema or upgrading UIX
npm run assets:sync -w apps/base # copy fonts and sounds; `-- --check` only reports drift (exit 1)
npm run smoke -w apps/base # smoke test of build/ (build first)
npm run apps:check # from the root: check + build + smoke, a member of `npm run gate`
The smoke prints one line of figures and exits non-zero on any failure. It first checks that
build/index.html places the boot tag after the CSP <meta> (unguarded 0) — a <meta> policy
governs only what follows it. Then, in Chromium, two passes for each of three visitors — es-ES,
ar-EG, and es-ES asking for a dark scheme and reduced motion: the boot alone (modules under
/_app/ aborted) must stamp its nine attributes on <html> with the values that visitor asks for
(dir="rtl" lang="ar"; data-mode="dark" data-motion="reduce"), and the full load must show no
page error, no console.error, no CSP violation, and the same nine attributes after hydration.
It counts only what a production build can show. A missing translation is not among them: langs
reports it in dev only, and a path that does not exist prerenders as its raw text, silently. The
page's own words are guarded by npm run check instead — src/lib/strings.ts requires all
three languages, and a misspelt name does not compile. A missing context never reaches the smoke:
it fails the prerender.
The gaps this app found in the framework are flagged to be fixed there, and left visible here rather than patched in the app.