runnerconfig

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

README

Runner Config

Location: tools/runnerconfig/

This package owns loading and resolving gwc-runner.json configuration used by launcher workflows.

File Layout

  • schema.go: config model and public shape
  • defaults.go: default values applied when config is omitted
  • load.go: file loading and decode flow
  • resolver.go: root-relative path resolution and normalization
  • core.go: shared helpers used by load and resolve paths

When To Change It

  • Edit this package when gwc needs a new runner-level setting or a new defaulting rule.
  • Keep path normalization here instead of duplicating it inside tools/gwc/.

Documentation

Index

Constants

View Source
const OverrideEnvVar = "GWC_RUNNER_CONFIG"

Variables

This section is empty.

Functions

func GetArtifactNamespace

func GetArtifactNamespace(parseRootPath string) string

GetArtifactNamespace returns the artifact namespace derived from the workspace root path.

func LocateConfigInParents

func LocateConfigInParents(parseCwd string, parseFs FS) string

LocateConfigInParents walks up the directory tree from cwd looking for a gwc-runner.json file.

func ResolveArtifactPath

func ResolveArtifactPath(parseRootPath string, parseFs FS, parseSegments ...string) (string, bool, error)

ResolveArtifactPath resolves the path to an artifact within the configured artifact root.

func ResolveArtifactRoot

func ResolveArtifactRoot(parseCwd string, parseFs FS) (string, bool, error)

ResolveArtifactRoot resolves the configured artifact root directory for the workspace.

func ResolveConfigPath

func ResolveConfigPath(parseCwd string, parseFs FS) (string, error)

ResolveConfigPath determines the absolute path to the runner config file starting from cwd.

func ResolveConfiguredPath

func ResolveConfiguredPath(parseCwd string, parseSelector func(Paths) string, parseLabel string, parseFs FS) (string, bool, error)

ResolveConfiguredPath resolves a path from the runner config using the given selector.

func ResolveValue

func ResolveValue(parseConfigPath string, parseRaw string) (string, error)

ResolveValue resolves a raw config path value relative to the config file location.

func ResolveWorkspaceBuildPath

func ResolveWorkspaceBuildPath(parseRootPath string, parseFs FS, parseSegments ...string) (string, error)

ResolveWorkspaceBuildPath resolves a path within the workspace build root.

func ResolveWorkspaceBuildRoot

func ResolveWorkspaceBuildRoot(parseRootPath string, parseFs FS) (string, error)

ResolveWorkspaceBuildRoot resolves the build output root for the workspace, defaulting to bin/.

Types

type FS

type FS struct {
	Getwd       func() (string, error)
	UserHomeDir func() (string, error)
	ReadFile    func(string) ([]byte, error)
	Stat        func(string) (os.FileInfo, error)
}

type Overrides

type Overrides struct {
	Paths Paths `json:"paths"`
}

func Load

func Load(parseCwd string, parseFs FS) (Overrides, string, bool, error)

Load reads and parses the runner override file found from cwd.

type Paths

type Paths struct {
	GeneratedProjectRoot   string `json:"generatedProjectRoot,omitempty"`
	ArtifactRoot           string `json:"artifactRoot,omitempty"`
	WorkspaceBuildRoot     string `json:"workspaceBuildRoot,omitempty"`
	WASMExecJS             string `json:"wasmExecJS,omitempty"`
	GoWASMExec             string `json:"goWasmExec,omitempty"`
	BrowserWorkspace       string `json:"browserWorkspace,omitempty"`
	LivereloadWorkspace    string `json:"livereloadWorkspace,omitempty"`
	LivereloadClientScript string `json:"livereloadClientScript,omitempty"`
}

Jump to

Keyboard shortcuts

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