pkg:clod/com.clodhub/web-host 0.12.0 Installable web application shell: manifest, page, service worker, headers, build configuration and the install banner, rendered from typed settings. Turns a web application into an installable one: gives the application's Vite build its configuration, which writes the page head, the web manifest, the response headers and a service worker that makes the page installable without caching, all from the installed settings, and starts the shell in the browser with an add-to-home-screen banner. The application supplies its own `index.html` (the page body and the entry module) and screens. Examples Safari on iPhone shows the Share instructions; Chrome on Android or desktop shows a one-tap Add button; an application already on the home screen or dismissed within three days shows nothing; the desktop wrapper skips the service worker and banner. Package URL: pkg:clod/com.clodhub/web-host@0.12.0 Class: Web host (pkg:clod/com.clodhub/web-host-class@1.1.0): The web client's page, installable manifest, install banner and build. Any component of this class can fill a recipe slot that asks for it. Category devices-and-hosts/web; https://clodhub.com/classes/web-host-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fweb-host-class Provides (1) - web-shell (com.clodhub/web-shell 1.0.0): Installable web application shell (TypeScript modules web/render.ts, web/vite.ts, web/runtime.ts and web/install-banner.ts; web/settings.ts holds the settings clod renders at install). Methods are exported functions called in-process; render and Vite configuration functions run at build time under Node, startShell and browserHost in the browser. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fweb-shell Requires (1) - theme (com.clodhub/theme 1.0.0): Design tokens for colours, spacing, radii, type scale and an animated background, rendered to CSS variables, Swift constants and Kotlin constants. Web: implementation/web/tokens.ts and background.ts. Apple: ThemeTypes.swift, ThemeTokens.swift, BackgroundMath.swift, ThemeBackgroundView.swift. Android: package com.clodhub.theme. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Ftheme Settings (7) The installer collects these settings and renders them into `web/settings.ts` (`webHostSettings`). `applicationId` (required) is a short lower-case name, letters, digits and hyphens, such as `ourpoker`; the web client reads it as `import.meta.env.VITE_APPLICATION_ID`. `applicationName` (required) is the full name shown in the browser tab and the install prompt, such as `OurPoker`. `shortName` (required) is the name under the home-screen icon, at most 12 characters. `themeColour` (required) colours the browser's title bar and `backgroundColour` (required) fills the screen while the installed app starts; each is the name of a theme colour such as `primary` or `background`. `iconPath` (default `icon`) is described below. `webAddress` (required) is the address the web client is served from, such as `https://play.example.com`; it is the installed app's start page. Colours are names of colours in the theme component (the collected setting grammar cannot carry #rrggbb), resolved through the colour table the application passes; the functions also accept #rrggbb when run outside the installer. `iconPath` names the icon files in the web `public/` folder: `.png` is 512 pixels square and `-192.png` is 192 pixels square. - applicationId: string (slug); required, no default - applicationName: string (label); required, no default - shortName: string (label); required, no default - themeColour: string (identifier); required, no default - backgroundColour: string (identifier); required, no default - iconPath: string (slug); optional, default "icon" - webAddress: string (address); required, no default Depends on components: none How to use in a recipe A recipe uses it through a slot of class Web host (pkg:clod/com.clodhub/web-host-class 1.1.0), naming pkg:clod/com.clodhub/web-host as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (web-shell) to the slots that use it. It fills what the component needs (theme) from slots whose components provide it. The recipe sets applicationId, applicationName, shortName, themeColour, backgroundColour, iconPath and webAddress; applicationId, applicationName, shortName, themeColour, backgroundColour and webAddress have no default, so the recipe always sets them. - as a slot in recipe.json components: {"id":"web-host","class":{"name":"pkg:clod/com.clodhub/web-host-class","version":"1.1.0","digest":"339ef2b4aad771ff251d3cc16f2301cb0ee30493488d89a54f31b2e1e6cf13ad"},"preferred":{"name":"pkg:clod/com.clodhub/web-host","version":"0.12.0"}} - in place of another component of the class: clod fetch web-host@0.12.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=web-host@0.12.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot web-host) For developers: how an application uses it The application's `vite.config.ts` returns `webHostConfig({ mode, root, settings: webHostSettings, colours })` from `web/vite.ts`, with `webHostSettings` from the installed `web/settings.ts` and `colours` the colour table of the connected theme; it may add its own fields (for example `resolve.alias`). The build then has the page head, and the web build `manifest.webmanifest`, `sw.js` and `_headers`; the desktop build (`--mode desktop`) has the head without the manifest link and writes `dist-desktop/`. The application's `index.html` holds the page body and `