spadev

package
v0.16.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package spadev exposes one helper, LiveDiskFS, that every Go tool shipping a Vite-built SPA wires into its `init()` so the dev loop (`npm run build:watch`) can serve fresh bundles without recompiling the wick binary.

Convention: every tool keeps its SPA tree at `internal/tools/<tool>/dist/<app>/`. When the env var WICK_DEV_REPO_ROOT points at the wick checkout, each tool's `spa.go` asks for `LiveDiskFS("<tool>")` and swaps its `SPAFS embed.FS` for an `os.DirFS` rooted at the tool dir. Production binaries leave the var unset and stay on the compile-time embed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LiveDiskFS

func LiveDiskFS(toolName string) (fs.FS, bool)

LiveDiskFS returns a live filesystem view of an SPA dist tree for the named Go tool, plus a flag telling the caller whether it should disable any per-process URL caches (live mode → cache off because Vite rebuilds change the hashed bundle name).

Returns (nil, false) when the env var is unset, points at a missing path, or the tool has no dist subdir yet. Callers fall back to their compile-time embed in that case.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL