bldr_web_plugin_compiler

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = ControllerID

ConfigID is the config identifier.

View Source
const ControllerID = "bldr/web/plugin/compiler"

ControllerID is the controller ID.

Variables

View Source
var (
	QuitPolicy_name = map[int32]string{
		0: "QUIT_POLICY_UNSPECIFIED",
		1: "QUIT_POLICY_RESTART",
		2: "QUIT_POLICY_EXIT",
	}
	QuitPolicy_value = map[string]int32{
		"QUIT_POLICY_UNSPECIFIED": 0,
		"QUIT_POLICY_RESTART":     1,
		"QUIT_POLICY_EXIT":        2,
	}
)

Enum value maps for QuitPolicy.

View Source
var Version = semver.MustParse("0.0.1")

Version is the controller version

Functions

func NewFactory

func NewFactory(b bus.Bus) controller.Factory

NewFactory constructs a new plugin compiler controller factory.

Types

type Config

type Config struct {

	// ProjectId overrides the project id set in the project config.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"projectId,omitempty"`
	// DelveAddr is the address to listen for Delve remote connections.
	// If the build mode is dev and this is set, uses delve to run the plugin.
	// Ignored if build mode is not dev or build platform is not "desktop".
	// Special value: "wait" - waits for plugin entrypoint to be run manually.
	DelveAddr string `protobuf:"bytes,2,opt,name=delve_addr,json=delveAddr,proto3" json:"delveAddr,omitempty"`
	// ElectronPkg is the name and version of the npm package to use for electron.
	// If unset, defaults to the version in package.json.
	// If not found, defaults to electron@latest.
	// Ignored if build platform is not "desktop".
	ElectronPkg string `protobuf:"bytes,3,opt,name=electron_pkg,json=electronPkg,proto3" json:"electronPkg,omitempty"`
	// NativeApp configures branding for native app renderers.
	NativeApp *NativeAppConfig `protobuf:"bytes,4,opt,name=native_app,json=nativeApp,proto3" json:"nativeApp,omitempty"`
	// contains filtered or unexported fields
}

Config configures the web plugin builder.

func NewConfig

func NewConfig() *Config

NewConfig constructs a new config.

func (*Config) CloneMessageVT

func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

func (this *Config) EqualMessageVT(thatMsg any) bool

func (*Config) EqualVT

func (this *Config) EqualVT(that *Config) bool

func (*Config) EqualsConfig

func (c *Config) EqualsConfig(other config.Config) bool

EqualsConfig checks if the config is equal to another.

func (*Config) GetConfigID

func (c *Config) GetConfigID() string

GetConfigID returns the unique string for this configuration type.

func (*Config) GetDelveAddr

func (x *Config) GetDelveAddr() string

func (*Config) GetElectronPkg

func (x *Config) GetElectronPkg() string

func (*Config) GetNativeApp

func (x *Config) GetNativeApp() *NativeAppConfig

func (*Config) GetProjectId

func (x *Config) GetProjectId() string

func (*Config) MarshalJSON

func (x *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

func (x *Config) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Config) MarshalToVT

func (m *Config) MarshalToVT(dAtA []byte) (int, error)

func (*Config) MarshalVT

func (m *Config) MarshalVT() (dAtA []byte, err error)

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

func (m *Config) SizeVT() (n int)

func (*Config) String

func (x *Config) String() string

func (*Config) ToPluginCompilerConf

func (c *Config) ToPluginCompilerConf() (*bldr_plugin_compiler_go.Config, error)

ToPluginCompilerConf converts the Config to a PluginCompilerConf.

func (*Config) UnmarshalJSON

func (x *Config) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

func (m *Config) UnmarshalVT(dAtA []byte) error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration.

type Controller

type Controller struct {
	*bus.BusController[*Config]
}

Controller is the compiler controller.

func (*Controller) BuildManifest

BuildManifest attempts to compile the manifest once.

func (*Controller) BundleElectronHook

func (c *Controller) BundleElectronHook(
	ctx context.Context,
	builderConf *bldr_manifest_builder.BuilderConfig,
	worldEng world.Engine,
) (*plugin_compiler_go.PreBuildHookResult, error)

BundleElectronHook bundles electron.

func (*Controller) BundleSaucerHook

func (c *Controller) BundleSaucerHook(
	ctx context.Context,
	builderConf *bldr_manifest_builder.BuilderConfig,
	worldEng world.Engine,
) (*plugin_compiler_go.PreBuildHookResult, error)

BundleSaucerHook bundles saucer.

func (*Controller) Execute

func (c *Controller) Execute(ctx context.Context) error

Execute executes the controller goroutine.

func (*Controller) GetSupportedPlatforms

func (c *Controller) GetSupportedPlatforms() []string

GetSupportedPlatforms returns the base platform IDs this compiler supports.

func (*Controller) SupportsStartupManifestCache

func (c *Controller) SupportsStartupManifestCache() bool

SupportsStartupManifestCache returns true if startup cache reuse is safe.

type Factory

type Factory = bus.BusFactory[*Config, *Controller]

Factory is the factory for the compiler controller.

type NativeAppConfig

type NativeAppConfig struct {

	// AppName is the display name of the application.
	AppName string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"appName,omitempty"`
	// WindowTitle overrides the default window title.
	WindowTitle string `protobuf:"bytes,2,opt,name=window_title,json=windowTitle,proto3" json:"windowTitle,omitempty"`
	// WindowWidth is the default window width in pixels.
	WindowWidth uint32 `protobuf:"varint,3,opt,name=window_width,json=windowWidth,proto3" json:"windowWidth,omitempty"`
	// WindowHeight is the default window height in pixels.
	WindowHeight uint32 `protobuf:"varint,4,opt,name=window_height,json=windowHeight,proto3" json:"windowHeight,omitempty"`
	// DevTools controls whether DevTools open automatically.
	DevTools bool `protobuf:"varint,5,opt,name=dev_tools,json=devTools,proto3" json:"devTools,omitempty"`
	// ThemeSource overrides the native theme ("dark", "light", "system").
	ThemeSource string `protobuf:"bytes,6,opt,name=theme_source,json=themeSource,proto3" json:"themeSource,omitempty"`
	// IconPath is the path to the application icon PNG (relative to project root).
	// Used for dev-mode branding of the extracted Electron binary.
	IconPath string `protobuf:"bytes,7,opt,name=icon_path,json=iconPath,proto3" json:"iconPath,omitempty"`
	// QuitPolicy configures whether user quit should restart or exit.
	QuitPolicy QuitPolicy `protobuf:"varint,8,opt,name=quit_policy,json=quitPolicy,proto3" json:"quitPolicy,omitempty"`
	// contains filtered or unexported fields
}

NativeAppConfig configures branding for native app renderers.

func (*NativeAppConfig) CloneMessageVT

func (m *NativeAppConfig) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*NativeAppConfig) CloneVT

func (m *NativeAppConfig) CloneVT() *NativeAppConfig

func (*NativeAppConfig) EqualMessageVT

func (this *NativeAppConfig) EqualMessageVT(thatMsg any) bool

func (*NativeAppConfig) EqualVT

func (this *NativeAppConfig) EqualVT(that *NativeAppConfig) bool

func (*NativeAppConfig) GetAppName

func (x *NativeAppConfig) GetAppName() string

func (*NativeAppConfig) GetDevTools

func (x *NativeAppConfig) GetDevTools() bool

func (*NativeAppConfig) GetIconPath

func (x *NativeAppConfig) GetIconPath() string

func (*NativeAppConfig) GetQuitPolicy

func (x *NativeAppConfig) GetQuitPolicy() QuitPolicy

func (*NativeAppConfig) GetThemeSource

func (x *NativeAppConfig) GetThemeSource() string

func (*NativeAppConfig) GetWindowHeight

func (x *NativeAppConfig) GetWindowHeight() uint32

func (*NativeAppConfig) GetWindowTitle

func (x *NativeAppConfig) GetWindowTitle() string

func (*NativeAppConfig) GetWindowWidth

func (x *NativeAppConfig) GetWindowWidth() uint32

func (*NativeAppConfig) MarshalJSON

func (x *NativeAppConfig) MarshalJSON() ([]byte, error)

MarshalJSON marshals the NativeAppConfig to JSON.

func (*NativeAppConfig) MarshalProtoJSON

func (x *NativeAppConfig) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the NativeAppConfig message to JSON.

func (*NativeAppConfig) MarshalProtoText

func (x *NativeAppConfig) MarshalProtoText() string

func (*NativeAppConfig) MarshalToSizedBufferVT

func (m *NativeAppConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*NativeAppConfig) MarshalToVT

func (m *NativeAppConfig) MarshalToVT(dAtA []byte) (int, error)

func (*NativeAppConfig) MarshalVT

func (m *NativeAppConfig) MarshalVT() (dAtA []byte, err error)

func (*NativeAppConfig) ProtoMessage

func (*NativeAppConfig) ProtoMessage()

func (*NativeAppConfig) Reset

func (x *NativeAppConfig) Reset()

func (*NativeAppConfig) SizeVT

func (m *NativeAppConfig) SizeVT() (n int)

func (*NativeAppConfig) String

func (x *NativeAppConfig) String() string

func (*NativeAppConfig) UnmarshalJSON

func (x *NativeAppConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the NativeAppConfig from JSON.

func (*NativeAppConfig) UnmarshalProtoJSON

func (x *NativeAppConfig) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the NativeAppConfig message from JSON.

func (*NativeAppConfig) UnmarshalVT

func (m *NativeAppConfig) UnmarshalVT(dAtA []byte) error

type QuitPolicy

type QuitPolicy int32

QuitPolicy configures how native desktop runtimes should behave on user quit.

const (
	// QUIT_POLICY_UNSPECIFIED lets the compiler pick the default for the build.
	QuitPolicy_QUIT_POLICY_UNSPECIFIED QuitPolicy = 0
	// QUIT_POLICY_RESTART keeps the host restart-friendly after user quit.
	QuitPolicy_QUIT_POLICY_RESTART QuitPolicy = 1
	// QUIT_POLICY_EXIT exits cleanly without restart after user quit.
	QuitPolicy_QUIT_POLICY_EXIT QuitPolicy = 2
)

func (QuitPolicy) Enum

func (x QuitPolicy) Enum() *QuitPolicy

func (QuitPolicy) MarshalJSON

func (x QuitPolicy) MarshalJSON() ([]byte, error)

MarshalJSON marshals the QuitPolicy to JSON.

func (QuitPolicy) MarshalProtoJSON

func (x QuitPolicy) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the QuitPolicy to JSON.

func (QuitPolicy) MarshalProtoText

func (x QuitPolicy) MarshalProtoText() string

func (QuitPolicy) MarshalText

func (x QuitPolicy) MarshalText() ([]byte, error)

MarshalText marshals the QuitPolicy to text.

func (QuitPolicy) String

func (x QuitPolicy) String() string

func (*QuitPolicy) UnmarshalJSON

func (x *QuitPolicy) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the QuitPolicy from JSON.

func (*QuitPolicy) UnmarshalProtoJSON

func (x *QuitPolicy) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the QuitPolicy from JSON.

func (*QuitPolicy) UnmarshalText

func (x *QuitPolicy) UnmarshalText(b []byte) error

UnmarshalText unmarshals the QuitPolicy from text.

Jump to

Keyboard shortcuts

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