Documentation
¶
Index ¶
- Variables
- type DevtoolArgs
- func (a *DevtoolArgs) BuildBuildCommand() *cli.Command
- func (a *DevtoolArgs) BuildDevtoolCommand() *cli.Command
- func (a *DevtoolArgs) BuildFlags() []cli.Flag
- func (a *DevtoolArgs) BuildProject(ctx context.Context) error
- func (a *DevtoolArgs) BuildPublishCommand() *cli.Command
- func (a *DevtoolArgs) BuildSetupCommand() *cli.Command
- func (a *DevtoolArgs) BuildStartCommand() *cli.Command
- func (a *DevtoolArgs) BuildStartCommands() []*cli.Command
- func (a *DevtoolArgs) BuildStaticHttpCommand() *cli.Command
- func (a *DevtoolArgs) BuildSubCommands() []*cli.Command
- func (a *DevtoolArgs) BuildTargetsCommand() *cli.Command
- func (a *DevtoolArgs) CloseLogFiles()
- func (a *DevtoolArgs) ExecuteCliProject(ctx context.Context, manifestID string, args []string) error
- func (a *DevtoolArgs) ExecuteNativeProject(ctx context.Context) error
- func (a *DevtoolArgs) ExecuteSetup(ctx context.Context) error
- func (a *DevtoolArgs) ExecuteStaticHttpServer(ctx context.Context) error
- func (a *DevtoolArgs) ExecuteWebWasmProject(ctx context.Context) error
- func (a *DevtoolArgs) ExecuteWebWsProject(ctx context.Context) error
- func (a *DevtoolArgs) FillDefaults()
- func (a *DevtoolArgs) FindRepoRoot() (string, error)
- func (a *DevtoolArgs) GetOutputRoot(repoRoot string) string
- func (a *DevtoolArgs) GetStateRoot(repoRoot string) string
- func (a *DevtoolArgs) InitRepoRoot() (repoRoot, stateRoot string, err error)
- func (a *DevtoolArgs) ListTargets() error
- func (a *DevtoolArgs) PublishProject(ctx context.Context) error
- func (a *DevtoolArgs) Validate() error
- type DevtoolBus
- func (d *DevtoolBus) ExecuteWebWasm(ctx context.Context, repoRoot string, minifyEntrypoint, devMode bool, ...) error
- func (d *DevtoolBus) ExecuteWebWs(ctx context.Context, repoRoot string, minifyEntrypoint, devMode bool, ...) error
- func (d *DevtoolBus) GetBus() bus.Bus
- func (d *DevtoolBus) GetContext() context.Context
- func (d *DevtoolBus) GetDistSrcDir() string
- func (d *DevtoolBus) GetLogger() *logrus.Entry
- func (d *DevtoolBus) GetPluginHostObjectKey() string
- func (d *DevtoolBus) GetPluginsDistRoot() string
- func (d *DevtoolBus) GetPluginsStateRoot() string
- func (d *DevtoolBus) GetStateRoot() string
- func (d *DevtoolBus) GetStaticResolver() *static.Resolver
- func (d *DevtoolBus) GetStorageID() string
- func (d *DevtoolBus) GetVolume() volume.Volume
- func (d *DevtoolBus) GetVolumeController() volume.Controller
- func (d *DevtoolBus) GetVolumeInfo() *volume.VolumeInfo
- func (d *DevtoolBus) GetWorldEngine() world.Engine
- func (d *DevtoolBus) GetWorldEngineID() string
- func (d *DevtoolBus) GetWorldState() world.WorldState
- func (d *DevtoolBus) Release()
- func (d *DevtoolBus) StartProjectController(ctx context.Context, b bus.Bus, repoRoot, configPath string, ...) (*bldr_project_watcher.Controller, directive.Reference, error)
- func (d *DevtoolBus) StartProjectControllerWithStartup(ctx context.Context, b bus.Bus, repoRoot, configPath string, ...) (*bldr_project_watcher.Controller, directive.Reference, error)
- func (d *DevtoolBus) StartStorageVolume(ctx context.Context, storageVolumeID string, ...) (volume.Controller, directive.Reference, error)
- func (d *DevtoolBus) SyncDistSources(bldrVersion, bldrSum, bldrSrcPath string) error
Constants ¶
This section is empty.
Variables ¶
var DevtoolWsVersion = semver.MustParse("0.0.1")
DevtoolWsVersion is the version to report for the ws-backed devtool runtime.
Functions ¶
This section is empty.
Types ¶
type DevtoolArgs ¶
type DevtoolArgs struct {
// Logger is the root logger.
Logger *logrus.Entry
// LogLevel is the log level string (debug, info, warn, error).
LogLevel string
// BldrVersion is the version of bldr to require in go.mod
BldrVersion string
// BldrVersionSum is the version sum to require in go.sum
BldrVersionSum string
// BldrSrcPath is the path to bldr to replace in go.mod
// Use for a local path to a development checkout of the bldr sources.
// Must be a path relative to the dist sources.
// Should be unset unless using a dev checkout of bldr.
BldrSrcPath string
// StatePath is the directory to use for working state.
StatePath string
// ConfigPath is the path to the bldr.yaml config file.
ConfigPath string
// OutputPath is the path to use for build output.
OutputPath string
// ServeStaticPath is the path to serve with the static http server.
ServeStaticPath string
// UseGitRoot enables relative paths to the git repo root.
UseGitRoot bool
// Watch indicates we should watch for changes.
Watch bool
// Remote is the remote config to use.
// Controls which world is used to store objects.
Remote string
// BuildType is the type of build to perform
// Usually "dev" or "release"
// If running "dist" this is forced to "release"
BuildType string
// MinifyEntrypoint configures if we will minify the entrypoint files.
MinifyEntrypoint bool
// WebListenAddr is the address to listen for start:web
WebListenAddr string
// WebUseWasm runs the entire runtime in the browser with wasm.
WebUseWasm bool
// BuildCsv is the list of builds to build.
BuildCsv string
// DistCsv is the list of dists to build.
DistCsv string
// PublishCsv is the list of publish IDs.
PublishCsv string
// DisableCleanup disables cleaning up the build files.
DisableCleanup bool
// TargetsCsv is the comma-separated list of deployment targets (e.g., "browser,desktop").
// Overrides platform_ids in build configs when specified.
TargetsCsv string
// WebRenderer is the web renderer to use for native applications.
// Valid values: "electron", "saucer"
WebRenderer string
// StartPlugins is additional plugin IDs to load on startup.
// Appended to the plugins list from bldr.yaml start config.
StartPlugins cli.StringSlice
// LogFiles is the list of log file specs.
LogFiles cli.StringSlice
// contains filtered or unexported fields
}
DevtoolArgs contains common flags for the dev tools.
func NewDevtoolArgs ¶
func NewDevtoolArgs() *DevtoolArgs
NewDevtoolArgs constructs new default arguments.
func (*DevtoolArgs) BuildBuildCommand ¶
func (a *DevtoolArgs) BuildBuildCommand() *cli.Command
BuildBuildCommand builds the bldr build command.
func (*DevtoolArgs) BuildDevtoolCommand ¶
func (a *DevtoolArgs) BuildDevtoolCommand() *cli.Command
BuildDevtoolCommand returns the devtool sub-command set.
func (*DevtoolArgs) BuildFlags ¶
func (a *DevtoolArgs) BuildFlags() []cli.Flag
BuildFlags attaches the flags to a flag set.
func (*DevtoolArgs) BuildProject ¶
func (a *DevtoolArgs) BuildProject(ctx context.Context) error
BuildProject builds one of the targets defined in the project configuration.
func (*DevtoolArgs) BuildPublishCommand ¶
func (a *DevtoolArgs) BuildPublishCommand() *cli.Command
BuildPublishCommand builds the bldr dist command.
func (*DevtoolArgs) BuildSetupCommand ¶
func (a *DevtoolArgs) BuildSetupCommand() *cli.Command
BuildSetupCommand builds the setup sub-command.
func (*DevtoolArgs) BuildStartCommand ¶
func (a *DevtoolArgs) BuildStartCommand() *cli.Command
BuildStartCommand builds the start sub-command.
func (*DevtoolArgs) BuildStartCommands ¶
func (a *DevtoolArgs) BuildStartCommands() []*cli.Command
BuildStartCommands builds the bldr start sub-commands.
func (*DevtoolArgs) BuildStaticHttpCommand ¶
func (a *DevtoolArgs) BuildStaticHttpCommand() *cli.Command
BuildStaticHttpCommand builds the static http server sub-command.
func (*DevtoolArgs) BuildSubCommands ¶
func (a *DevtoolArgs) BuildSubCommands() []*cli.Command
BuildSubCommands builds the sub-command set.
func (*DevtoolArgs) BuildTargetsCommand ¶
func (a *DevtoolArgs) BuildTargetsCommand() *cli.Command
BuildTargetsCommand builds the bldr targets command.
func (*DevtoolArgs) CloseLogFiles ¶
func (a *DevtoolArgs) CloseLogFiles()
CloseLogFiles closes any attached log file hooks.
func (*DevtoolArgs) ExecuteCliProject ¶
func (a *DevtoolArgs) ExecuteCliProject(ctx context.Context, manifestID string, args []string) error
ExecuteCliProject builds and runs a CLI manifest as a subprocess.
Watches for manifest changes and restarts the subprocess automatically. Forwards signals to the child and propagates its exit code.
func (*DevtoolArgs) ExecuteNativeProject ¶
func (a *DevtoolArgs) ExecuteNativeProject(ctx context.Context) error
ExecuteNativeProject starts the project as a native app.
func (*DevtoolArgs) ExecuteSetup ¶
func (a *DevtoolArgs) ExecuteSetup(ctx context.Context) error
ExecuteSetup executes the Setup CLI command.
func (*DevtoolArgs) ExecuteStaticHttpServer ¶
func (a *DevtoolArgs) ExecuteStaticHttpServer(ctx context.Context) error
ExecuteStaticHttpServer runs the static http server command.
func (*DevtoolArgs) ExecuteWebWasmProject ¶
func (a *DevtoolArgs) ExecuteWebWasmProject(ctx context.Context) error
ExecuteWebWasmProject starts the project as a web server in Wasm mode.
func (*DevtoolArgs) ExecuteWebWsProject ¶
func (a *DevtoolArgs) ExecuteWebWsProject(ctx context.Context) error
ExecuteWebWsProject starts the devtool bus and project as a web server with a WebSocket. Plugins run as native binaries under the devtool process.
func (*DevtoolArgs) FillDefaults ¶
func (a *DevtoolArgs) FillDefaults()
FillDefaults fills the args defaults.
func (*DevtoolArgs) FindRepoRoot ¶
func (a *DevtoolArgs) FindRepoRoot() (string, error)
FindRepoRoot returns the absolute path to the root dir to use.
func (*DevtoolArgs) GetOutputRoot ¶
func (a *DevtoolArgs) GetOutputRoot(repoRoot string) string
GetOutputRoot returns the output path root relative to the project root.
func (*DevtoolArgs) GetStateRoot ¶
func (a *DevtoolArgs) GetStateRoot(repoRoot string) string
GetStateRoot returns the state directory according to the config.
func (*DevtoolArgs) InitRepoRoot ¶
func (a *DevtoolArgs) InitRepoRoot() ( repoRoot, stateRoot string, err error, )
InitRepoRoot finds an initializes the repo root.
func (*DevtoolArgs) ListTargets ¶
func (a *DevtoolArgs) ListTargets() error
ListTargets lists available deployment targets.
func (*DevtoolArgs) PublishProject ¶
func (a *DevtoolArgs) PublishProject(ctx context.Context) error
PublishProject publishes a bundle to a repository.
func (*DevtoolArgs) Validate ¶
func (a *DevtoolArgs) Validate() error
Validate validates the arguments.
type DevtoolBus ¶
type DevtoolBus struct {
// contains filtered or unexported fields
}
DevtoolBus contains a built devtool bus.
func BuildDevtoolBus ¶
func BuildDevtoolBus( rctx context.Context, le *logrus.Entry, repoRoot, stateRoot string, watch bool, ) (*DevtoolBus, error)
BuildDevtoolBus builds the storage and bus for the devtool. Returns a set of functions to call to release the controllers.
func (*DevtoolBus) ExecuteWebWasm ¶
func (d *DevtoolBus) ExecuteWebWasm( ctx context.Context, repoRoot string, minifyEntrypoint, devMode bool, listenAddr string, appID string, startPlugins []string, webStartupSrcPath string, forceDedicatedWorkers bool, ) error
ExecuteWebWasm starts the application in the browser with wasm.
func (*DevtoolBus) ExecuteWebWs ¶
func (d *DevtoolBus) ExecuteWebWs( ctx context.Context, repoRoot string, minifyEntrypoint, devMode bool, listenAddr string, webStartupSrcPath string, ) error
ExecuteWebWs starts the application in the browser with a websocket.
func (*DevtoolBus) GetContext ¶
func (d *DevtoolBus) GetContext() context.Context
GetContext returns the context.
func (*DevtoolBus) GetDistSrcDir ¶
func (d *DevtoolBus) GetDistSrcDir() string
GetDistSrcDir returns the path to the redistribute sources checked out under StateRoot.
func (*DevtoolBus) GetLogger ¶
func (d *DevtoolBus) GetLogger() *logrus.Entry
GetLogger returns the root logger
func (*DevtoolBus) GetPluginHostObjectKey ¶
func (d *DevtoolBus) GetPluginHostObjectKey() string
GetPluginHostObjectKey returns the object key for the plugin host.
func (*DevtoolBus) GetPluginsDistRoot ¶
func (d *DevtoolBus) GetPluginsDistRoot() string
GetPluginsDistRoot returns the path to the plugins dist files dir.
func (*DevtoolBus) GetPluginsStateRoot ¶
func (d *DevtoolBus) GetPluginsStateRoot() string
GetPluginsStateRoot returns the path to the plugins state files dir.
func (*DevtoolBus) GetStateRoot ¶
func (d *DevtoolBus) GetStateRoot() string
GetStateRoot returns the root of the state tree.
func (*DevtoolBus) GetStaticResolver ¶
func (d *DevtoolBus) GetStaticResolver() *static.Resolver
GetStaticResolver returns the static controller resolver.
func (*DevtoolBus) GetStorageID ¶
func (d *DevtoolBus) GetStorageID() string
GetStorageID returns the storage controller id.
func (*DevtoolBus) GetVolume ¶
func (d *DevtoolBus) GetVolume() volume.Volume
GetVolume returns the storage volume in use.
func (*DevtoolBus) GetVolumeController ¶
func (d *DevtoolBus) GetVolumeController() volume.Controller
GetVolumeController returns the storage volume controller in use.
func (*DevtoolBus) GetVolumeInfo ¶
func (d *DevtoolBus) GetVolumeInfo() *volume.VolumeInfo
GetVolumeInfo returns the storage volume info.
func (*DevtoolBus) GetWorldEngine ¶
func (d *DevtoolBus) GetWorldEngine() world.Engine
GetWorldEngine returns the world engine instance.
func (*DevtoolBus) GetWorldEngineID ¶
func (d *DevtoolBus) GetWorldEngineID() string
GetWorldEngineID returns the world engine id.
func (*DevtoolBus) GetWorldState ¶
func (d *DevtoolBus) GetWorldState() world.WorldState
GetWorldState returns the world state handle.
func (*DevtoolBus) StartProjectController ¶
func (d *DevtoolBus) StartProjectController( ctx context.Context, b bus.Bus, repoRoot, configPath string, startWithRemote string, extraPlugins []string, ) ( *bldr_project_watcher.Controller, directive.Reference, error, )
StartProjectController reads the config file & starts the project controller. ConfigPath is the path to the project config. ConfigPath can be empty to start with an empty config. extraPlugins are additional plugin IDs appended to the start config. Returns the directive reference & controller.
func (*DevtoolBus) StartProjectControllerWithStartup ¶ added in v0.51.2
func (d *DevtoolBus) StartProjectControllerWithStartup( ctx context.Context, b bus.Bus, repoRoot, configPath string, startWithRemote string, extraPlugins []string, start bool, ) ( *bldr_project_watcher.Controller, directive.Reference, error, )
StartProjectControllerWithStartup reads the config file and starts the project controller.
func (*DevtoolBus) StartStorageVolume ¶
func (d *DevtoolBus) StartStorageVolume( ctx context.Context, storageVolumeID string, ctrlConf *volume_controller.Config, ) (volume.Controller, directive.Reference, error)
StartStorageVolume starts a storage volume. The ID should be unique.
func (*DevtoolBus) SyncDistSources ¶
func (d *DevtoolBus) SyncDistSources(bldrVersion, bldrSum, bldrSrcPath string) error
SyncDistSources syncs the bldr sources and runs npm i and go mod vendor.
bldrSum can be empty bldrSrcPath can be empty