Documentation
¶
Index ¶
- Variables
- func CopyFile(src, dst string) error
- func ExecCommand(command string, args []string) (string, error)
- func ExecCommandWithCallback(command string, args []string, callback func(output string)) error
- func ExecStringCommand(cmdString string) (string, error)
- func Hmr(rootHtml string) func(*ContainerPlugin)
- type Cdn
- type ContainerPlugin
- func (pc *ContainerPlugin) Compose() api.Plugin
- func (pc *ContainerPlugin) OnHMR(callback HmrCallback) *ContainerPlugin
- func (pc *ContainerPlugin) OnLoad(name, filter string, callback LoadCallback) *ContainerPlugin
- func (pc *ContainerPlugin) OnResolve(name, filter string, callback ResolveCallback) *ContainerPlugin
- func (pc *ContainerPlugin) Setup(modifier ...func(*ContainerPlugin)) *ContainerPlugin
- func (pc *ContainerPlugin) WithHmr(opts HmrOptions) *ContainerPlugin
- type DependencyConfig
- type FileCallback
- type HmrCallback
- type HmrOptions
- type HmrResult
- type HmrType
- type LoadCallback
- type Manager
- type ManagerOptions
- type Package
- type PackageMeta
- type ResolveCallback
- type RpcError
- type RpcErrorCode
- type RpcMethod
- type RpcRequest
- type RpcResponse
- type RpcServer
- type Server
- type ServerConfig
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var HmrBroadcast = make(chan string)
View Source
var HmrClientBroadcast = make(chan HmrResult)
Functions ¶
func ExecCommand ¶
ExecCommand executes a command with arguments and returns the combined output
func ExecCommandWithCallback ¶
ExecCommandWithCallback executes a command and calls the callback with the output
func ExecStringCommand ¶
ExecStringCommand executes a command from a string with space-separated arguments
func Hmr ¶ added in v0.0.4
func Hmr(rootHtml string) func(*ContainerPlugin)
Types ¶
type ContainerPlugin ¶ added in v0.0.4
type ContainerPlugin struct {
// contains filtered or unexported fields
}
func NewContainerPlugin ¶ added in v0.0.4
func NewContainerPlugin(filter string) *ContainerPlugin
func (*ContainerPlugin) Compose ¶ added in v0.0.4
func (pc *ContainerPlugin) Compose() api.Plugin
func (*ContainerPlugin) OnHMR ¶ added in v0.0.4
func (pc *ContainerPlugin) OnHMR(callback HmrCallback) *ContainerPlugin
func (*ContainerPlugin) OnLoad ¶ added in v0.0.4
func (pc *ContainerPlugin) OnLoad(name, filter string, callback LoadCallback) *ContainerPlugin
func (*ContainerPlugin) OnResolve ¶ added in v0.0.4
func (pc *ContainerPlugin) OnResolve(name, filter string, callback ResolveCallback) *ContainerPlugin
func (*ContainerPlugin) Setup ¶ added in v0.0.4
func (pc *ContainerPlugin) Setup(modifier ...func(*ContainerPlugin)) *ContainerPlugin
func (*ContainerPlugin) WithHmr ¶ added in v0.0.4
func (pc *ContainerPlugin) WithHmr(opts HmrOptions) *ContainerPlugin
type DependencyConfig ¶
type FileCallback ¶ added in v0.0.4
type FileCallback func(path string)
type HmrCallback ¶ added in v0.0.4
type HmrOptions ¶ added in v0.0.4
type LoadCallback ¶ added in v0.0.4
type LoadCallback func(api.OnLoadArgs) (api.OnLoadResult, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(opts ManagerOptions) *Manager
type ManagerOptions ¶ added in v0.0.6
type ManagerOptions struct {
ConfigFile string
}
type PackageMeta ¶
type PackageMeta struct {
Name string `json:"name"`
Version string `json:"version"`
Main string `json:"main"`
Types string `json:"types"`
TypesVersions map[string]map[string][]string `json:"typesVersions"`
Exports map[string]any `json:"exports"`
Dependencies map[string]string `json:"dependencies"`
PeerDependencies map[string]string `json:"peerDependencies"`
TypeScriptVersion string `json:"typeScriptVersion"`
}
type ResolveCallback ¶ added in v0.0.4
type ResolveCallback func(api.OnResolveArgs) (api.OnResolveResult, error)
type RpcError ¶
type RpcError struct {
Code RpcErrorCode `json:"code"`
Message string `json:"message"`
Data any `json:"data"`
}
type RpcErrorCode ¶
type RpcErrorCode int
const ( RpcErrorCodeParseError RpcErrorCode = -32700 RpcErrorCodeInvalidRequest RpcErrorCode = -32600 RpcErrorCodeMethodNotFound RpcErrorCode = -32601 RpcErrorCodeInvalidParams RpcErrorCode = -32602 RpcErrorCodeInternalError RpcErrorCode = -32603 RpcErrorCodeServerError RpcErrorCode = -32000 )
type RpcMethod ¶
type RpcMethod struct {
Name string
Handler func(RpcRequest) RpcResponse
}
type RpcRequest ¶
type RpcResponse ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(cfg ServerConfig) *Server
type ServerConfig ¶
type Watcher ¶ added in v0.0.4
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶ added in v0.0.4
func NewWatcher(rootPath string, ignorePaths []string, cb FileCallback) (*Watcher, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.