bldr_web_pkg_compiler

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = "bldr/web/pkg/compiler"

ConfigID is the config identifier.

View Source
const ControllerID = ConfigID

ControllerID is the controller ID.

Variables

View Source
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 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) GetConfigSet

func (x *Config) GetConfigSet() map[string]*proto.ControllerConfig

func (*Config) GetDelveAddr

func (x *Config) GetDelveAddr() string

func (*Config) GetHostConfigSet

func (x *Config) GetHostConfigSet() map[string]*proto.ControllerConfig

func (*Config) GetProjectId

func (x *Config) GetProjectId() string

func (*Config) GetWebPkgs

func (x *Config) GetWebPkgs() []*bundler.WebPkgRefConfig

func (*Config) GetWebPluginId

func (x *Config) GetWebPluginId() 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) 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 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 (*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 (*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

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.

Jump to

Keyboard shortcuts

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