Documentation
¶
Index ¶
- Constants
- Variables
- func GetElectronApplicable(parsedPlatform bldr_platform.Platform) bool
- func NewFactory(b bus.Bus) controller.Factory
- type Config
- func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Config) CloneVT() *Config
- func (this *Config) EqualMessageVT(thatMsg any) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (c *Config) GetConfigID() string
- func (x *Config) GetConfigSet() map[string]*proto.ControllerConfig
- func (x *Config) GetDelveAddr() string
- func (x *Config) GetHostConfigSet() map[string]*proto.ControllerConfig
- func (x *Config) GetProjectId() string
- func (x *Config) GetWebPkgs() []*bundler.WebPkgRefConfig
- func (x *Config) GetWebPluginId() string
- func (x *Config) MarshalJSON() ([]byte, error)
- func (x *Config) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config) MarshalProtoText() string
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (*Config) ProtoMessage()
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (x *Config) UnmarshalJSON(b []byte) error
- func (x *Config) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Config_ConfigSetEntry
- func (x *Config_ConfigSetEntry) GetKey() string
- func (x *Config_ConfigSetEntry) GetValue() *proto.ControllerConfig
- func (x *Config_ConfigSetEntry) MarshalJSON() ([]byte, error)
- func (x *Config_ConfigSetEntry) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config_ConfigSetEntry) MarshalProtoText() string
- func (*Config_ConfigSetEntry) ProtoMessage()
- func (x *Config_ConfigSetEntry) Reset()
- func (x *Config_ConfigSetEntry) String() string
- func (x *Config_ConfigSetEntry) UnmarshalJSON(b []byte) error
- func (x *Config_ConfigSetEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
- type Config_HostConfigSetEntry
- func (x *Config_HostConfigSetEntry) GetKey() string
- func (x *Config_HostConfigSetEntry) GetValue() *proto.ControllerConfig
- func (x *Config_HostConfigSetEntry) MarshalJSON() ([]byte, error)
- func (x *Config_HostConfigSetEntry) MarshalProtoJSON(s *json.MarshalState)
- func (x *Config_HostConfigSetEntry) MarshalProtoText() string
- func (*Config_HostConfigSetEntry) ProtoMessage()
- func (x *Config_HostConfigSetEntry) Reset()
- func (x *Config_HostConfigSetEntry) String() string
- func (x *Config_HostConfigSetEntry) UnmarshalJSON(b []byte) error
- func (x *Config_HostConfigSetEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
- type Controller
- func (c *Controller) BuildManifest(ctx context.Context, args *bldr_manifest_builder.BuildManifestArgs, ...) (*bldr_manifest_builder.BuilderResult, error)
- func (c *Controller) Execute(ctx context.Context) error
- func (c *Controller) GetSupportedPlatforms() []string
- func (c *Controller) SupportsStartupManifestCache() bool
- type Factory
Constants ¶
const ConfigID = "bldr/web/pkg/compiler"
ConfigID is the config identifier.
const ControllerID = ConfigID
ControllerID is the controller ID.
Variables ¶
var Version = controller.MustParseVersion("0.0.1")
Version is the controller version
Functions ¶
func GetElectronApplicable ¶
func GetElectronApplicable(parsedPlatform bldr_platform.Platform) bool
GetElectronApplicable returns if electron should be bundled for this platform.
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"`
// WebPluginId sets the plugin id for the web plugin.
// If set, the compiler automatically adds this controller to the config set:
// - handle-web-pkgs: handle web pkg lookups for the webPkgIds
WebPluginId string `protobuf:"bytes,11,opt,name=web_plugin_id,json=webPluginId,proto3" json:"webPluginId,omitempty"`
// ConfigSet is a ConfigSet to apply on plugin startup.
// This ConfigSet is applied to the plugin bus.
// This will be included in the plugin binary.
ConfigSet map[string]*proto.ControllerConfig `` /* 175-byte string literal not displayed */
// HostConfigSet is a ConfigSet to apply to the host on plugin startup.
// This ConfigSet is applied to the plugin host bus.
// This will be included in the plugin binary.
// Adds a config to configSet with ID bldr/plugin/host/configset
HostConfigSet map[string]*proto.ControllerConfig `` /* 188-byte string literal not displayed */
// WebPkgs is the list of web packages to externalize and include in the bundle.
//
// Externalized web packages (npm modules) are imported separately from the web bundle.
// They will be deduplicated such that a single version is imported at a time by the app.
// This is useful for packages that require a single instance per WebDocument.
//
// On default only the imports referenced by the plugin will be compiled in.
// Everything else will be tree-shaken away to lower bundle size.
// Additional imports to reference can be specified in the config.
//
// These packages will be available with the LookupWebPkg directive.
// They will also be available at /b/pkg: e.g. /b/pkg/@my/npm-package/foo/bar/index.js
//
// Note: only files & entrypoints imported by at least one js file will be included.
WebPkgs []*bundler.WebPkgRefConfig `protobuf:"bytes,5,rep,name=web_pkgs,json=webPkgs,proto3" json:"webPkgs,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.
// Special value: "wait" - waits for plugin entrypoint to be run manually.
DelveAddr string `protobuf:"bytes,8,opt,name=delve_addr,json=delveAddr,proto3" json:"delveAddr,omitempty"`
// contains filtered or unexported fields
}
Config configures the web package builder.
This is intended to build a plugin which contains a set of WebPkgs.
func (*Config) CloneMessageVT ¶
func (m *Config) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Config) EqualMessageVT ¶
func (*Config) EqualsConfig ¶
EqualsConfig checks if the config is equal to another.
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type.
func (*Config) GetConfigSet ¶
func (x *Config) GetConfigSet() map[string]*proto.ControllerConfig
func (*Config) GetDelveAddr ¶
func (*Config) GetHostConfigSet ¶
func (x *Config) GetHostConfigSet() map[string]*proto.ControllerConfig
func (*Config) GetProjectId ¶
func (*Config) GetWebPkgs ¶
func (x *Config) GetWebPkgs() []*bundler.WebPkgRefConfig
func (*Config) GetWebPluginId ¶
func (*Config) MarshalJSON ¶
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 (*Config) MarshalToSizedBufferVT ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) UnmarshalJSON ¶
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 ¶
type Config_ConfigSetEntry ¶
type Config_ConfigSetEntry struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value *proto.ControllerConfig `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*Config_ConfigSetEntry) GetKey ¶
func (x *Config_ConfigSetEntry) GetKey() string
func (*Config_ConfigSetEntry) GetValue ¶
func (x *Config_ConfigSetEntry) GetValue() *proto.ControllerConfig
func (*Config_ConfigSetEntry) MarshalJSON ¶
func (x *Config_ConfigSetEntry) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Config_ConfigSetEntry to JSON.
func (*Config_ConfigSetEntry) MarshalProtoJSON ¶
func (x *Config_ConfigSetEntry) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config_ConfigSetEntry message to JSON.
func (*Config_ConfigSetEntry) MarshalProtoText ¶
func (x *Config_ConfigSetEntry) MarshalProtoText() string
func (*Config_ConfigSetEntry) ProtoMessage ¶
func (*Config_ConfigSetEntry) ProtoMessage()
func (*Config_ConfigSetEntry) Reset ¶
func (x *Config_ConfigSetEntry) Reset()
func (*Config_ConfigSetEntry) String ¶
func (x *Config_ConfigSetEntry) String() string
func (*Config_ConfigSetEntry) UnmarshalJSON ¶
func (x *Config_ConfigSetEntry) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the Config_ConfigSetEntry from JSON.
func (*Config_ConfigSetEntry) UnmarshalProtoJSON ¶
func (x *Config_ConfigSetEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config_ConfigSetEntry message from JSON.
type Config_HostConfigSetEntry ¶
type Config_HostConfigSetEntry struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value *proto.ControllerConfig `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
func (*Config_HostConfigSetEntry) GetKey ¶
func (x *Config_HostConfigSetEntry) GetKey() string
func (*Config_HostConfigSetEntry) GetValue ¶
func (x *Config_HostConfigSetEntry) GetValue() *proto.ControllerConfig
func (*Config_HostConfigSetEntry) MarshalJSON ¶
func (x *Config_HostConfigSetEntry) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Config_HostConfigSetEntry to JSON.
func (*Config_HostConfigSetEntry) MarshalProtoJSON ¶
func (x *Config_HostConfigSetEntry) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Config_HostConfigSetEntry message to JSON.
func (*Config_HostConfigSetEntry) MarshalProtoText ¶
func (x *Config_HostConfigSetEntry) MarshalProtoText() string
func (*Config_HostConfigSetEntry) ProtoMessage ¶
func (*Config_HostConfigSetEntry) ProtoMessage()
func (*Config_HostConfigSetEntry) Reset ¶
func (x *Config_HostConfigSetEntry) Reset()
func (*Config_HostConfigSetEntry) String ¶
func (x *Config_HostConfigSetEntry) String() string
func (*Config_HostConfigSetEntry) UnmarshalJSON ¶
func (x *Config_HostConfigSetEntry) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the Config_HostConfigSetEntry from JSON.
func (*Config_HostConfigSetEntry) UnmarshalProtoJSON ¶
func (x *Config_HostConfigSetEntry) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Config_HostConfigSetEntry message from JSON.
type Controller ¶
type Controller struct {
*bus.BusController[*Config]
}
Controller is the compiler controller.
func (*Controller) BuildManifest ¶
func (c *Controller) BuildManifest( ctx context.Context, args *bldr_manifest_builder.BuildManifestArgs, host bldr_manifest_builder.BuildManifestHost, ) (*bldr_manifest_builder.BuilderResult, error)
BuildManifest attempts to compile the manifest once.
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.