jsbridge

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 48 Imported by: 0

Documentation

Overview

Package jsbridge discovers, bundles, and runs TypeScript extensions in isolated Sobek runtimes backed by the Go-native extension API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(options DiscoveryOptions) []string

Discover returns extension entry points in upstream load order with the first spelling of an absolute path winning deduplication.

Types

type DiscoveryOptions

type DiscoveryOptions struct {
	CWD                         string
	AgentDir                    string
	ProjectTrusted              bool
	ConfiguredPaths             []string
	ProjectConfiguredPaths      []string
	ResolvedPackagePaths        []string
	ProjectResolvedPackagePaths []string
	ExplicitPaths               []string
}

DiscoveryOptions contains local paths after settings and package resolution. WP-360 supplies resolved package paths; this package does not install packages.

type LoadError

type LoadError struct {
	Path  string `json:"path"`
	Error string `json:"error"`
}

type LoadResult

type LoadResult struct {
	Registry *extensions.Registry
	Paths    []string
	Errors   []LoadError
}

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader owns the build cache and one isolated Sobek VM per loaded extension.

func NewLoader

func NewLoader(options DiscoveryOptions) *Loader

func (*Loader) Close

func (loader *Loader) Close()

func (*Loader) Load

func (loader *Loader) Load(ctx context.Context) LoadResult

func (*Loader) RegisterInto

func (loader *Loader) RegisterInto(ctx context.Context, registry *extensions.Registry) LoadResult

RegisterInto registers one factory per discovered extension into the shared product registry. Each factory run (initial load and every Registry.Fresh on /reload) rebuilds changed bundles and replaces that path's VM, matching upstream reload semantics.

func (*Loader) Reload

func (loader *Loader) Reload(ctx context.Context) LoadResult

Reload rebuilds changed bundles and always replaces every VM and registry.

Jump to

Keyboard shortcuts

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