packages

package
v0.3.42 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package packages generates target package-manager manifests from trbconfig.jsonc. The config is the source of truth.

Index

Constants

View Source
const (
	TypeRBLockName = "trb.lock"
)
View Source
const TypeRBManifestName = "trbpackage.json"

Variables

This section is empty.

Functions

func EqualManifest

func EqualManifest(path string, expected []byte) (bool, error)

EqualManifest is used by checks without modifying a project.

func Install

func Install(config *project.Config, stdin io.Reader, stdout, stderr io.Writer) error

func InstallWithDependencies added in v0.2.0

func InstallWithDependencies(config *project.Config, packageDependencies map[string]string, stdin io.Reader, stdout, stderr io.Writer) error

func Sync

func Sync(config *project.Config) (string, error)

func SyncWithDependencies added in v0.2.0

func SyncWithDependencies(config *project.Config, packageDependencies map[string]string) (string, error)

SyncWithDependencies adds target dependencies required by imported TypeRB packages without copying those implementation details into trbconfig.jsonc.

func TypeRBLockPath added in v0.2.3

func TypeRBLockPath(config *project.Config) string

func WriteTypeRBLock added in v0.2.3

func WriteTypeRBLock(path string, lock *TypeRBLock) error

Types

type AdapterTest added in v0.3.16

type AdapterTest struct {
	Config  string   `json:"config"`
	Command []string `json:"command"`
}

AdapterTest declares one explicitly invoked conformance project for a package-owned declaration adapter. Command is an argv vector and is never interpreted by a shell.

type DeclarationAdapter added in v0.3.16

type DeclarationAdapter struct {
	Package      string
	Mode         string
	Path         string
	Dependencies map[string]string
}

type DeclarationProvider added in v0.3.24

type DeclarationProvider struct {
	Package string
	Mode    string
	Module  string
	Path    string
}

type RuntimeAdapter added in v0.3.23

type RuntimeAdapter struct {
	Package      string
	Mode         string
	Path         string
	Dependencies map[string]string
}

type TypeRBLock added in v0.2.3

type TypeRBLock struct {
	FormatVersion  int                            `json:"formatVersion"`
	ConfigChecksum string                         `json:"configChecksum"`
	Imports        map[string]string              `json:"imports"`
	Packages       map[string]TypeRBLockedPackage `json:"packages"`
}

func ReadTypeRBLock added in v0.2.3

func ReadTypeRBLock(path string) (*TypeRBLock, error)

func (*TypeRBLock) Validate added in v0.2.3

func (l *TypeRBLock) Validate() error

type TypeRBLockedPackage added in v0.2.3

type TypeRBLockedPackage struct {
	Version          string            `json:"version"`
	Source           string            `json:"source,omitempty"`
	Revision         string            `json:"revision,omitempty"`
	Checksum         string            `json:"checksum,omitempty"`
	Path             string            `json:"path,omitempty"`
	ManifestChecksum string            `json:"manifestChecksum,omitempty"`
	Dependencies     map[string]string `json:"dependencies,omitempty"`
}

type TypeRBManifest added in v0.2.3

type TypeRBManifest struct {
	FormatVersion             int                                   `json:"formatVersion"`
	Name                      string                                `json:"name"`
	Version                   string                                `json:"version"`
	SourceDir                 string                                `json:"sourceDir,omitempty"`
	Modes                     []string                              `json:"modes,omitempty"`
	Packages                  map[string]project.PackageRequirement `json:"packages,omitempty"`
	NativeDependencies        map[string]map[string]string          `json:"nativeDependencies,omitempty"`
	DeclarationProviders      map[string]string                     `json:"declarationProviders,omitempty"`
	DeclarationAdapters       map[string]string                     `json:"declarationAdapters,omitempty"`
	RuntimeAdapters           map[string]string                     `json:"runtimeAdapters,omitempty"`
	AdapterTests              map[string]AdapterTest                `json:"adapterTests,omitempty"`
	LegacyNativeTypeProviders map[string]string                     `json:"nativeTypeProviders,omitempty"`
	CompilerExtension         json.RawMessage                       `json:"compilerExtension,omitempty"`
}

TypeRBManifest is the portable, repository-owned description of an external TypeRB package. Compiler extensions are recorded at this boundary but are deliberately rejected until the sandboxed extension protocol is available.

func ReadTypeRBManifest added in v0.2.3

func ReadTypeRBManifest(root string) (*TypeRBManifest, error)

func (*TypeRBManifest) DeclarationAdapterFor added in v0.3.16

func (m *TypeRBManifest) DeclarationAdapterFor(mode string) string

func (*TypeRBManifest) DeclarationProviderFor added in v0.3.24

func (m *TypeRBManifest) DeclarationProviderFor(mode string) string

func (*TypeRBManifest) NativeDependenciesFor added in v0.2.3

func (m *TypeRBManifest) NativeDependenciesFor(mode string) map[string]string

func (*TypeRBManifest) RuntimeAdapterFor added in v0.3.23

func (m *TypeRBManifest) RuntimeAdapterFor(mode string) string

func (*TypeRBManifest) Supports added in v0.2.3

func (m *TypeRBManifest) Supports(mode string) bool

func (*TypeRBManifest) Validate added in v0.2.3

func (m *TypeRBManifest) Validate(root string) error

type TypeRBPackages added in v0.2.3

type TypeRBPackages struct {
	Lock                 *TypeRBLock
	Aliases              map[string]string
	Packages             []TypeRBResolvedPackage
	NativeDependencies   map[string]string
	DeclarationProviders []DeclarationProvider
	DeclarationAdapters  []DeclarationAdapter
	RuntimeAdapters      []RuntimeAdapter
}

func LoadTypeRBPackages added in v0.2.3

func LoadTypeRBPackages(config *project.Config) (*TypeRBPackages, error)

LoadTypeRBPackages reads installed packages without changing the lock or contacting a package source. Build, check, run, and REPL use this boundary.

func ResolveTypeRBPackages added in v0.2.3

func ResolveTypeRBPackages(config *project.Config, options TypeRBResolveOptions) (*TypeRBPackages, error)

ResolveTypeRBPackages creates or reuses the deterministic project lock and ensures every remote package is present in the content-addressed cache.

type TypeRBResolveOptions added in v0.2.3

type TypeRBResolveOptions struct {
	Frozen         bool
	Offline        bool
	Update         bool
	UpdatePackages []string
}

type TypeRBResolvedPackage added in v0.2.3

type TypeRBResolvedPackage struct {
	Name     string
	Root     string
	Manifest *TypeRBManifest
}

Jump to

Keyboard shortcuts

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