Documentation
¶
Overview ¶
Package wave is the end-user runtime API for Wave applications.
Application code should only need this package to construct runtime behavior and attach middleware/templating helpers.
Index ¶
- func GetIsDev() bool
- func MustGetPort() int
- func SetModeToDev()
- type Config
- type Wave
- func (w *Wave) ConfigFile() string
- func (w *Wave) CriticalCSS() template.CSS
- func (w *Wave) CriticalCSSStyleElement() template.HTML
- func (w *Wave) DistDir() string
- func (w *Wave) IsDev() bool
- func (w *Wave) Logger() *slog.Logger
- func (w *Wave) MustGetPort() int
- func (w *Wave) MustPrivateFS() fs.FS
- func (w *Wave) MustStaticMiddleware(immutable bool) func(http.Handler) http.Handler
- func (w *Wave) PrivateFS() (fs.FS, error)
- func (w *Wave) PrivateStaticDir() string
- func (w *Wave) PublicPathPrefix() string
- func (w *Wave) PublicURL(original string) string
- func (w *Wave) RawConfigJSON() []byte
- func (w *Wave) RefreshScript() template.HTML
- func (w *Wave) SetModeToDev()
- func (w *Wave) StaticPrivateOutDir() string
- func (w *Wave) StaticPublicOutDir() string
- func (w *Wave) StyleSheetLinkElement() template.HTML
- func (w *Wave) ViteManifestLocation() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustGetPort ¶
func MustGetPort() int
MustGetPort returns the application runtime port. In dev mode it resolves and caches a framework-controlled free port. It panics in dev mode if a free port cannot be resolved. It panics in non-dev mode when PORT is missing or invalid.
Types ¶
type Config ¶
type Config struct {
// Required -- Raw Wave configuration JSON.
WaveConfigJSON []byte
// Required -- this must root at <distDir>/static for production.
DistStaticFS fs.FS
// Optional logger.
Logger *slog.Logger
}
Config configures Wave initialization.
type Wave ¶
type Wave struct {
// contains filtered or unexported fields
}
Wave provides the app-facing runtime API surface.
func New ¶
New constructs a Wave runtime instance from raw config JSON and a dist/static file system root.
func (*Wave) ConfigFile ¶
ConfigFile returns the original configuration file location if known.
func (*Wave) CriticalCSS ¶
CriticalCSS returns critical CSS content when available.
func (*Wave) CriticalCSSStyleElement ¶
CriticalCSSStyleElement returns one rendered critical-css <style> element.
func (*Wave) MustGetPort ¶
MustGetPort returns the application runtime port.
func (*Wave) MustPrivateFS ¶
MustPrivateFS returns the private filesystem or panics if unavailable.
func (*Wave) MustStaticMiddleware ¶
MustStaticMiddleware returns middleware that serves static public assets and delegates all other requests to next.
func (*Wave) PrivateStaticDir ¶
PrivateStaticDir returns the source directory for private static assets.
func (*Wave) PublicPathPrefix ¶
PublicPathPrefix returns the normalized configured public path prefix.
func (*Wave) RawConfigJSON ¶
RawConfigJSON returns the raw bytes of the configuration file.
func (*Wave) RefreshScript ¶
RefreshScript returns one rendered dev refresh script.
func (*Wave) SetModeToDev ¶
func (w *Wave) SetModeToDev()
SetModeToDev sets the environment to development mode.
func (*Wave) StaticPrivateOutDir ¶
StaticPrivateOutDir returns the private static output directory.
func (*Wave) StaticPublicOutDir ¶
StaticPublicOutDir returns the public static output directory.
func (*Wave) StyleSheetLinkElement ¶
StyleSheetLinkElement returns one rendered non-critical stylesheet <link>.
func (*Wave) ViteManifestLocation ¶
ViteManifestLocation returns the expected path of the Vite manifest in build output.
Directories
¶
| Path | Synopsis |
|---|---|
|
buildtime
|
|
|
buildentry
Package buildentry owns wavebuild command parsing and execution orchestration.
|
Package buildentry owns wavebuild command parsing and execution orchestration. |
|
builder
Package builder orchestrates Wave build execution across schema, CSS, and static artifact phases.
|
Package builder orchestrates Wave build execution across schema, CSS, and static artifact phases. |
|
builder/internal/css
Package css implements the Wave CSS build and manifest generation pipeline.
|
Package css implements the Wave CSS build and manifest generation pipeline. |
|
builder/internal/fileops
Package fileops provides deterministic file hashing and atomic write helpers for Wave build artifacts.
|
Package fileops provides deterministic file hashing and atomic write helpers for Wave build artifacts. |
|
builder/internal/schema
Package schema parses and validates Wave configuration documents for build and runtime consumers.
|
Package schema parses and validates Wave configuration documents for build and runtime consumers. |
|
builder/internal/static
Package static owns Wave static-asset planning, hashing, and public map generation.
|
Package static owns Wave static-asset planning, hashing, and public map generation. |
|
devserver
Package devserver provides the top-level Wave development server orchestration API.
|
Package devserver provides the top-level Wave development server orchestration API. |
|
internal/broadcast
Package broadcast provides websocket fan-out for Wave dev-server browser updates.
|
Package broadcast provides websocket fan-out for Wave dev-server browser updates. |
|
internal/devserver/appsupervisor
Package appsupervisor manages dev-server process lifecycle and readiness probing.
|
Package appsupervisor manages dev-server process lifecycle and readiness probing. |
|
internal/devserver/eventpipeline
Package eventpipeline classifies and plans filesystem watcher events for the Wave dev server.
|
Package eventpipeline classifies and plans filesystem watcher events for the Wave dev server. |
|
internal/devserver/hooks
Package hooks normalizes and executes configured dev-server on-change hooks.
|
Package hooks normalizes and executes configured dev-server on-change hooks. |
|
internal/devserver/reloadwait
Package reloadwait isolates browser runtime orchestration for devserver.
|
Package reloadwait isolates browser runtime orchestration for devserver. |
|
internal/devserver/restartengine
Package restartengine decides and executes dev-server restart/build behavior.
|
Package restartengine decides and executes dev-server restart/build behavior. |
|
internal/devserver/runloop
Package runloop executes the dev-server watcher event loop.
|
Package runloop executes the dev-server watcher event loop. |
|
internal/outputledger
Package outputledger provides a Wave-owned on-disk build-output ledger and final reconciliation sweep helpers.
|
Package outputledger provides a Wave-owned on-disk build-output ledger and final reconciliation sweep helpers. |
|
internal/watch
Package watch owns fsnotify watcher wiring and normalized event emission for Wave dev tooling.
|
Package watch owns fsnotify watcher wiring and normalized event emission for Wave dev tooling. |
|
internal/watch/classification
Package classification maps changed filesystem paths to semantic watcher file types.
|
Package classification maps changed filesystem paths to semantic watcher file types. |
|
internal/watch/dedup
Package dedup performs deterministic watcher event and path deduplication.
|
Package dedup performs deterministic watcher event and path deduplication. |
|
internal
|
|
|
wavecache
Package wavecache provides low-level runtime cache primitives shared by Wave runtime services.
|
Package wavecache provides low-level runtime cache primitives shared by Wave runtime services. |
|
wavefilemap
Package wavefilemap models mappings from source public assets to built output artifacts.
|
Package wavefilemap models mappings from source public assets to built output artifacts. |
|
wavefs
Package wavefs owns small filesystem helpers shared by Wave build/dev internals.
|
Package wavefs owns small filesystem helpers shared by Wave build/dev internals. |
|
waveglob
Package waveglob owns path normalization and glob matching semantics used by Wave build/dev watchers.
|
Package waveglob owns path normalization and glob matching semantics used by Wave build/dev watchers. |
|
wavelock
Package wavelock owns Wave's project-level lock lifecycle for build and dev orchestration.
|
Package wavelock owns Wave's project-level lock lifecycle for build and dev orchestration. |
|
waveruntime
Package waveruntime holds Wave runtime-specific rendering and config helpers.
|
Package waveruntime holds Wave runtime-specific rendering and config helpers. |
|
waveruntimecore
Package waveruntimecore hosts low-level Wave runtime mechanics.
|
Package waveruntimecore hosts low-level Wave runtime mechanics. |
|
Package waveartifacts defines build artifact naming and directory conventions.
|
Package waveartifacts defines build artifact naming and directory conventions. |
|
Package waveconfig provides JSON parsing with filesystem-path invariants that can be applied to typed configuration structs.
|
Package waveconfig provides JSON parsing with filesystem-path invariants that can be applied to typed configuration structs. |
|
Package waveenv provides runtime-safe environment and path primitives used by Wave runtime and config parsing.
|
Package waveenv provides runtime-safe environment and path primitives used by Wave runtime and config parsing. |
|
Package waveframework provides framework/tooling-facing helpers that operate on Wave runtime instances without expanding the end-user `wave` API surface.
|
Package waveframework provides framework/tooling-facing helpers that operate on Wave runtime instances without expanding the end-user `wave` API surface. |
|
Package wavewatch defines Wave's file-watch and hook execution contract used by framework tooling, devservers, and build pipelines.
|
Package wavewatch defines Wave's file-watch and hook execution contract used by framework tooling, devservers, and build pipelines. |