Documentation
¶
Index ¶
- Constants
- func BuildFrameworkVendors(node toolchain.NodePaths, pnpm toolchain.PNPMPaths, projectRoot string, ...) error
- func BuildIdentity(framework string, sourcePath string, mode string, dev bool) string
- func DetectFrameworkWorkspaces(projectRoot string) []string
- func ExtractClientDependencyGraphsFromOutput(assets []Asset, output string) (map[string]ClientDependencyGraph, error)
- func FrameworkImportSpecifiers(framework string) []string
- func FrameworkVendorOutputsExist(projectRoot string, framework string) bool
- func FrameworkVersion(projectRoot string, framework string) (string, error)
- func GenerateViteConfig(asset Asset) ([]byte, error)
- func GenerateViteFrameworkVendorConfig(asset Asset, outputAbsDir string, facades []frameworkModuleFacade, ...) ([]byte, error)
- func GenerateViteGroupConfig(assets []Asset, outputAbsDir string) ([]byte, error)
- func InstallFrameworkWorkspace(node toolchain.NodePaths, pnpm toolchain.PNPMPaths, ...) error
- func IsViteWorkspaceInstalled(asset Asset) bool
- func LoadClientCache(root string)
- func ManagedDependencies(framework string) (dependencies map[string]string, devDependencies map[string]string, ok bool)
- func NormalizeMode(mode string, dev bool) string
- func ProjectManagedDependencies(projectRoot, framework string) (dependencies map[string]string, devDependencies map[string]string, err error)
- func PublicBaseName(name string, framework string, path string, mode string) string
- func PublicComponentDirName(name string, framework string, path string, mode string) string
- func PublicEntryURL(name string, framework string, path string, mode string) string
- func PublicMapURL(name string, framework string, path string, mode string) string
- func StoreCachedViteAsset(built BuiltAsset)
- type Asset
- func (a Asset) BuildIdentity() string
- func (a Asset) BuildProfile() BuildProfile
- func (a Asset) EffectiveRoot() string
- func (a Asset) PublicBaseName() string
- func (a Asset) PublicComponentDirName() string
- func (a Asset) PublicEntryURL() string
- func (a Asset) PublicMapURL() string
- func (a Asset) ViteConfigPath() string
- type BuildProfile
- type BuiltAsset
- type BuiltAssetKind
- type BuiltClientFile
- func FingerprintBuiltClientEntry(asset Asset, entryPath string, files []BuiltClientFile) (string, []BuiltClientFile, error)
- func ScanBuiltClientFiles(asset Asset, entryPath string) ([]BuiltClientFile, error)
- func ScanBuiltClientGroupFiles(asset Asset, groupOutputAbsDir string, entryPath string, outputFiles []string) ([]BuiltClientFile, error)
- type ClientDependencyGraph
- type ClientDependencyGraphNode
- type FrameworkDefinition
- type FrameworkImportMapEntry
- type FrameworkWorkspace
- type RuntimeAsset
- type WrittenConfig
Constants ¶
const ( ModeDev = "dev" ModeProd = "prod" )
const PublicClientPrefix = "/_gox/client"
Variables ¶
This section is empty.
Functions ¶
func BuildFrameworkVendors ¶
func BuildFrameworkVendors(node toolchain.NodePaths, pnpm toolchain.PNPMPaths, projectRoot string, frameworks []string) error
BuildFrameworkVendors builds only the stable production vendor files for the requested frameworks. Existing complete vendor sets are reused. Builds for the same project/framework are serialized so startup, compiler builds, and hot reload cannot write the same vendor output concurrently.
func BuildIdentity ¶
BuildIdentity returns the canonical identity of a client build. Declaration names and .gox module paths are intentionally excluded so equivalent declarations can reuse the same artifact.
func DetectFrameworkWorkspaces ¶
DetectFrameworkWorkspaces returns the managed client frameworks installed in the project's client directory.
func ExtractClientDependencyGraphsFromOutput ¶
func ExtractClientDependencyGraphsFromOutput(assets []Asset, output string) (map[string]ClientDependencyGraph, error)
func FrameworkVendorOutputsExist ¶
FrameworkVendorOutputsExist reports whether every stable production vendor facade for framework already exists in the project client output directory.
func FrameworkVersion ¶
FrameworkVersion returns the effective installed framework version from the framework workspace node_modules package metadata.
func GenerateViteConfig ¶
func GenerateViteGroupConfig ¶
func LoadClientCache ¶
func LoadClientCache(root string)
LoadClientCache loads and reconciles the persisted client bundle cache for a project root. It is intentionally called at server startup, before the server starts accepting requests.
func ManagedDependencies ¶
func NormalizeMode ¶
func PublicBaseName ¶
func PublicComponentDirName ¶
func PublicEntryURL ¶
func PublicMapURL ¶
func StoreCachedViteAsset ¶
func StoreCachedViteAsset(built BuiltAsset)
Types ¶
type Asset ¶
type Asset struct {
Name string
Framework string
Entry string
Path string
AbsPath string
Dev bool
Mode string
OutputDir string
OutputAbsDir string
ProjectRoot string
FrameworkRoot string
WrapperAbsPath string
}
Asset describes one client component build unit. It is intentionally independent from goxcompiler so the client builder can evolve separately.
func InstalledViteAssets ¶
func WriteFrameworkWrappers ¶
func (Asset) BuildIdentity ¶
func (Asset) BuildProfile ¶
func (a Asset) BuildProfile() BuildProfile
func (Asset) EffectiveRoot ¶
func (Asset) PublicBaseName ¶
func (Asset) PublicComponentDirName ¶
func (Asset) PublicEntryURL ¶
func (Asset) PublicMapURL ¶
func (Asset) ViteConfigPath ¶
type BuildProfile ¶
type BuiltAsset ¶
type BuiltAsset struct {
Asset Asset
ConfigPath string
EntryURL string
EntryFile string
Files []BuiltClientFile
Graph ClientDependencyGraph
}
func BuildViteAsset ¶
func BuildViteAssets ¶
func TryLoadCachedViteAsset ¶
func TryLoadCachedViteAsset(asset Asset) (BuiltAsset, bool)
type BuiltAssetKind ¶
type BuiltAssetKind string
const ( BuiltAssetEntry BuiltAssetKind = "entry" BuiltAssetChunk BuiltAssetKind = "chunk" BuiltAssetVendor BuiltAssetKind = "vendor" BuiltAssetCSS BuiltAssetKind = "css" BuiltAssetAsset BuiltAssetKind = "asset" BuiltAssetSourceMap BuiltAssetKind = "sourcemap" )
type BuiltClientFile ¶
func FingerprintBuiltClientEntry ¶
func FingerprintBuiltClientEntry(asset Asset, entryPath string, files []BuiltClientFile) (string, []BuiltClientFile, error)
func ScanBuiltClientFiles ¶
func ScanBuiltClientFiles(asset Asset, entryPath string) ([]BuiltClientFile, error)
type ClientDependencyGraph ¶
type ClientDependencyGraph struct {
Entry string `json:"entry"`
EntryFile string `json:"entryFile"`
Framework string `json:"framework"`
Component string `json:"component"`
OutputFiles []string `json:"outputFiles"`
ModuleFiles []string `json:"moduleFiles"`
Imports []string `json:"imports"`
DynamicImports []string `json:"dynamicImports"`
Nodes []ClientDependencyGraphNode `json:"nodes"`
}
func ExtractClientDependencyGraphFromOutput ¶
func ExtractClientDependencyGraphFromOutput(asset Asset, output string) (ClientDependencyGraph, error)
type FrameworkDefinition ¶
type FrameworkDefinition struct {
Name string
Dependencies map[string]string
DevDependencies map[string]string
PluginSetup string
PluginExprs []string
VendorPackages []string
TypeScriptOptions map[string]any
}
FrameworkDefinition contains the build behavior for a supported framework. Framework names and support states come from clientframework.
func Framework ¶
func Framework(framework string) (FrameworkDefinition, bool)
type FrameworkImportMapEntry ¶
func FrameworkImportMapEntries ¶
func FrameworkImportMapEntries(framework string, version string) []FrameworkImportMapEntry
type FrameworkWorkspace ¶
type FrameworkWorkspace struct {
Framework string
RootDir string
PackageJSONPath string
Changed bool
}
func EnsureFrameworkWorkspace ¶
func EnsureFrameworkWorkspace(projectRoot string, framework string) (FrameworkWorkspace, error)
func EnsureFrameworkWorkspaces ¶
func EnsureFrameworkWorkspaces(projectRoot string, assets []Asset) ([]FrameworkWorkspace, error)
type RuntimeAsset ¶
func EnsureGoxActionsRuntime ¶
func EnsureGoxActionsRuntime(projectRoot string) (RuntimeAsset, error)
func EnsureGoxIsleBaseStyle ¶
func EnsureGoxIsleBaseStyle(projectRoot string) (RuntimeAsset, error)
func EnsureGoxIsleRuntime ¶
func EnsureGoxIsleRuntime(projectRoot string) (RuntimeAsset, error)
type WrittenConfig ¶
func WriteViteConfigs ¶
func WriteViteConfigs(assets []Asset) ([]WrittenConfig, error)