Skip to main content

Module web

Module web 

Source
Expand description

Web-frontend toolchain plumbing.

The [web] manifest section, the package manager it declares, the frontend build that packaging runs, and the pure planning behind water init’s frontend decision tree.

Structs§

InitAnswers
The answers water init needs, each supplied by a flag or a prompt.
WebConfig
The [web] section of Water.toml: web-frontend toolchain declarations.
WebDevServer
A running <pm> run <script> process group whose printed dev-server URL has been captured.
WebFrontend
What web/package.json says about a scaffolded frontend: the framework dependency and whether typescript is a devDependency.
WebOverlayReport
What apply_brand_overlay did, and what it could not.

Enums§

DevTarget
A target water run can hand a dev-server URL to.
ExistingFrontendMode
What to do with a frontend found outside web/.
InitAction
One step of water init. The command executes these in order; the plan is pure so the decision tree is testable without touching disk.
PackageManager
The JavaScript package manager a project declares in [web] package_manager.
WebFramework
The framework a freshly scaffolded Vite project declares.
WebSource
Where the frontend of an initialized project comes from.

Constants§

DEV_URL_ENV
The environment variable that carries the dev-server URL to a debug app.

Functions§

adb_reverse_args
adb -s <device> reverse tcp:<port> tcp:<port> — maps the device’s loopback port onto the host’s so the dev server is reachable from an Android emulator or a USB-connected device alike.
apply_brand_overlay
Apply the WaterUI-branded overlay to a freshly create vite-scaffolded frontend in web_dir.
build_frontend
Build a toolchain-produced mount’s frontend: <pm> run build inside the declared project root with stdio inherited, so the user sees their own bundler’s output and diagnostics verbatim.
decode_web_mount
Decode the web mount — the single mount a project field marks as a toolchain-produced frontend — from an artifact’s symbol table.
detect_web_frontend
Read the framework and language of a scaffolded frontend from its package.json text. None when the manifest cannot be parsed.
dev_script
The script that starts the frontend’s dev server: the first of dev, serve, start declared in the project’s package.json.
dev_url_from_line
Extract the loopback URL a bundler prints once its dev server is listening.
dev_url_port
The port an adb reverse must forward, read from the WATERUI_DEV_URL entry of a launch environment. None when no dev-server handoff is present.
device_facing_url
The URL the target should open, rewritten when the target cannot reach this machine’s loopback.
lockfile_package_manager
The package manager a lockfile implies, used as the prompt’s initial value.
plan_init
The ordered steps water init performs, decided from the CWD’s top-level listing and the already-resolved answers.
web_mount
The include_web! mount declared by the project’s compiled library.